Drawing power for arduino from AC


I am working on a project that requires an Arduino to control 4 dimmer circuits that regulate ceramic heat sources. The Dimmers are for AC power and I plan to use a Triac / optocoupler to connect these to the Arduino. The dimming process will control the heat sources based on set temp guidelines, so I will be using temp sensors to monitor the temps and dim accordingly.

The idea (and that is all it is at the moment) is to have a single unit that is powered by AC that has four outputs that control ceramic heat bulbs that can range between 50w to 250w each. So there is one AC input and four independently controlled AC outputs

Each output is independent of each other because they will be controlling different environments in my setup and the Arduino will control these based on temperature readings coming from individual sensors (2 per output).

I have looked at a single temp control unit that I currently have for this purpose and it controls only one heat source. This is powered by 240V AC and it seems to power the PIC15F684 it uses as a microprocessor using the AC supply. It is 'converted to DC' if that is the right term using what looks like a capacitor connected to a resistor and then a zener diode before connecting to the VDD of the microprocessor.

It also must have some protection for the VSS return as this connects back to the Neutral AC circuit.

Is this a common circuit is there anyone that can explain how this works to me so I can replicate it for the Arduino, or is there a easier / better way of powering my DC circuit in the project from the AC supply.


The device is controlling temperatures in reptile vivariums and will require dimming rather than switching on and off. This is standard for commercial purchased control equipment for this purpose.

It is interesting that you say this minimal parts solution is extremely dangerous and not recommended for any project given that I have 5 different commercial products for doing this process (single units controlling one heat source each) and all of these use the same process surely if this is a dangerous circuit they would not use it either.

I can power the DC circuit separately but this means then two plugs in the wall for the same device, surely this is avoidable ?

The heat source has to be dimmed and not just switched on and off there are several reasons for this.

  1. Unlike humans reptiles cannot move away from the vivarium if it gets too hot or cold. Accurate and maintained temperature control of the environment is key to the health of the reptile. Heat loss from vivariums especially glass ones is a problem.

  2. Unlike humans reptiles thermoregulate in order to digest food and this requires them to have a constant temperature which varies depending on the animal.

  3. Some of the hot spots in vivariums are achieved using bulbs and not ceramics, how annoying for the reptile and the human inhabitants would a light switching on and off be.

  4. These vivariums are heated 24 hours a day 7 days a week with temperature differences between day and night and also between normal and breeding seasons. It is more efficient to control the heat source using a dimming technique that it is switching them on and off. after all there is a recession on.

I agree that any circuit that uses AC power is lethal and I also accept that I don't know an lot about this subject, but I wasn't born a computer programmer or reptile keeper either I had to start and learn somewhere.

The idea of asking for help and understanding in this area was to ensure I understood what I was trying to achieve before attempting it in a controlled manor. It would be foolish of me to just plug some components together and see what happened. I was asking for help in understanding how this circuit was working.

I accept that a transformer type circuit is maybe a better way to go to provide DC power, but it still will not negate the need for me to use dimming circuits to control the outputs.

I am not going to close my mind to your suggestion of using an SSR after all I did ask for some help and it would be equally as foolish to ignore what is being offered. I understand how dimming the heat source to maintain a constant temperature works I don't see how using an SSR to switch on and off the heat source will maintain a constant temp of lets say 110 degrees.

Do you have any good examples of how this works that I can read up on etc.

I think I will incorporate a transformer / rectifier / capacitor option for providing the DC power as I understand the concept behind this and can find plenty of examples to learn from.

I currently only am only using two types of heat source that need to be controlled by this unit. The first is a ceramic heat bulb these range from 50 - 250w depending on the vivarium size the animal is housed in. The second is a halogen heat bulb ranging from 50 - 100w

I guess they would not react that quickly. So if my initial understanding is correct. Then option 2 is what I should recreate using SSR's is this correct. I base this on option 3 is how a dimmer circuit works and 4 is a DC version of 3.

My understanding is that an SSR is used to turn on or off the power to the ac load , it can be connected to the Arduino to control the switching as they are protected using optical isolation right ?

But just switching on and off when the temperature falls below or above 110 degrees would work for the ceramic as there would be no visible affect, how does this work for the Halogen heat source. surely switch on and off would be like switch a light switch on and off or am i missing something here.

No the vivarium will not go dark as the bulb being use for heat does not give off the UVB levels that some reptiles need and so this is provided by special florescent tubes that mimic sunlight. In most vivariums there is a light source and a separate heat source.

I found the following on the playground.


I think this is what you mean by using an SSR without zero-crossing switching.

Thanks Ke7GKP

You have given me a number of helpful things to think about on this project. Going to do some more research on this and see what really best fits the needs of the project.