A-240VAC TO 5VDC POWER SUPPLY

This is simple way to power some 5v logic from a 240vac source.  If a 120vac power adapter is used, the circuit will also work for 120vac power lines.