@DJPhil: Your drawing is exactly what I was envisioning. Did not realize that Fairchild had the LM2591HV. That looks like the perfect component to fix the issue. Guess I should have checked out their website before posting.
No worries. There's almost always a part for what you need, especially if it's likely to solve a common problem, it's just a matter of finding it!
Could you give me some more details on a transformer circuit? Easier and safer sounds like the way to go.
The whole thing hinges on the transformer, but it's fairly simple otherwise. I changed the previous picture to show the difference. I probably shouldn't have mentioned it, as it's not a very good idea unless you're just tinkering for fun. I think you'll find that it's more trouble than it's worth if you just want a power supply that works so you can get on to the microcontroller programming.
Now you could skip the extra transformer, but a linear regulator is more efficient when it's input and output voltages are close. Dropping from 45VDC (too high for a 7805, but I'm sure there's a HV version) down to 5VDC means that for every watt (5V @ 200mA) you draw through the regulator it must dissipate about eight watts (40V @ 200mA) in heat! This is a bit oversimplified, but you get the idea. This is one of the reasons SMPS are so useful. The extra transformer is used to step the voltage down to something that's closer to the regulator's output.
The standard linear regulators to use for 5VDC output are based on the 7805. National (just to keep it consistent) has both a full 7805 (LM7805) and a low power version with less output capacity in a smaller package (LM78L05). Take a spin through the datasheets and work out your power needs. When you know how much power you'll need (16mA per SSR plus the micro and support circuitry, plus any display, etc.) you can work out which is better to use and how much heatsinking you need (most likely a small clip on heatsink or copper plane will do).
There's lots of info out there on linear three terminal regulator circuits. A datasheet search website like
datasheetcatalog.com will have dozens of hits for 7805, and you can learn a good deal looking at the application circuitry from different manufacturers.
As for the transformer, you'll probably have a hard time finding something that's intended for 30VAC to 8VAC at say 200mA. You can search for something similar that's designed for 50-60Hz and has a turns ratio of about 3.75:1, or try and wind your own. That can get somewhat involved, but it may be your only option to get what you need. There's a few good resources out there if you want to try, I'd just hit google and jump right in. Small, low power transformers don't regulate well, meaning that their output voltage changes a great deal depending on load.
Finally, it may not be necessary to reinvent the wheel. If you have access to one or a few older thermostats that have micros in them (or lcd displays, it's a giveaway that there's a micro inside) see what they used to get their power. It's entirely possible that they were designed for low power use and run entirely off batteries, or perhaps they have a nice charging system to keep the batteries topped off. They might even have a small transformer in them that you can pillage. You can also simply recreate the exact circuit they use for power and save yourself the design headaches, assuming you don't need more power than it's designed for.
I hope I'm being more helpful than confusing. There's a lot of background info in some of these concepts and I'm too often long winded.
Hope that helps.
