I am trying to power an atmega328p, and the esp8266 for one of my projects. I am trying to drive a relay to switch lights on and off. The problem is that the relay runs on 12v, the atmega runs on 5v and the esp8266 runs on 3.3. I was thinking of using a board mount power supply to use 120v ac, to get 12v for the relay, then use a 7805 regulator to get 5v for the atmega, and finally use a LM3940IT to get 3.3v for the esp8266. I do know that the esp8266 can not be run off of the atmega's 3.3v pin :(
What I am wondering is am I totally off on what I am hoping to do. Is there a better way? I have found a couple articles about switch power but, not as much as I would like. I am also concerned about the amount of amperage needed for everything. I will use a Darlington transistor to drive the relay from the atmega, I am not sure how much power that will consume.
Here is the board PSU http://www.mouser.com/ProductDetail/RECOM/RAC04-12DC-230/?qs=F5OEftmZcCAbIVZkvUf1yw%3d%3d I would really appreciate any help. Thank you very much.