AC Light Dimming via Arduino

Hello All,

I am asking for guidance on whether this personal home project is feasible.

I want to dim my room light via arduino, also using a solenoid to control the physical switch itself.
Would this be a feasible home project, and if so, could someone point me to which specific arduino board to buy?

Thanks,


tofu

"Dimming" AC power electronically is quite a tricky task.

Manual dimmers are effectively a large potentiometer (actually called a Rheostat). To do it electronically is somewhat harder.

The accepted method of doing it is kind of like PWM, but with special timing. The AC waveform is chopped off at certain percentages through its cycle to reduce the power. This takes special hardware, and interfacing it is not a task I would enjoy.

Your best bet would be to get an infra-red dimmer plate to replace your existing wall switch, and program the Arduino to send the right remote codes through an infra-red LED. That way you have the remote control as well :wink:

Any arduino would work, try an uno
why do you want to control the physical switch?
You can use a triac and with detecting when it crosses zero, dim the lights
I have a lutron dimmer with remote in my room, so btw I couldn't get the infrared to work, its its own protocol and wasn't able to it with ken sheriffs ir library,

I have a lutron dimmer with remote in my room, so btw I couldn't get the infrared to work, its its own protocol and wasn't able to it with ken sheriffs ir library,

You'd want to "record" the IR signal using an IR receiver connected to the Arduino, then you can replay it back again. That way you don't care what the protocol is.

Yeah, I tried with that and it didn't work, and I know the hardware worked It did with a normal protocol
I think its a little too complex for that library, it sends like 4-5 different codes in succesion thta aren't always the same

Thanks for all the replies!

Also, would the task be made simpler if I use an inverter to turn the AC supply into a DC supply? Forgive me if that is a stupid idea, I'm not the best at circuit design

Ideally, I would like to have the WHOLE light mechanism under my command, switch and dimming.

The eventual plan is to have it voice controlled via a windows app integrating the dragon naturally speaking SDK.

Once again, thanks for the help!


tofu

Mechanical dimmer and small servo to turn it?

An inverter makes ac out of dc, but anyway probably the easiest would be to get a 12v power supply and use 12v leds strips that you can easily dim with a mosfet and pwm from the arduino

Tell me if this would work guys.

I would hook up the line to a rectifier, converting the current to direct. I can ground the neutral line, and use an arduino controlled autotransformer/rheostat to achieve the dimming. Does this sound good?

Ehh, close
do you have to control the 120v incandescent bulbs? I suppose if you got a mosfet with a high enough vds you could do that, but that wouldn't be the best way, there's no need to make it dc unless you want to power something that needs it

Well for one im going to switch out my CFL for an LED driven bulb.
Secondly, I would think that the software and hardware involved for dimming a DC LED bulb would be less sophisticated, correct?

Depends if its dimmable, some are some aren't, and some need special way of dimming(which idk about)
I think if you get a dimmable led the easiest way would be with a triac,
You could even make your own switch on the wall with your own ir setup for remote control, just pick a protocol you like or have a remote for and house a little circuit board in the switch box, use those unbreakable plastic plates and drill an ir reciever in it

Be careful when playing with mains powered lights.
You could rectify the mains but YOU CAN NOT GROUND any rectified DC mains voltage.
This will set any equipment connected to the arduino to mains voltage ( e.g. touching metal parts of the computer/USB connector .... you use to program the arduino will be live) VERY DANGEROUS !!!!

first experiment with low voltage projects, mains voltage is dangerous to life

Out of interest I just came across this circuit: Voltage Controlled AC Light Dimmer

It transforms the voltage down to 9V with a transformer, full wave rectifies it, then does some jiggery-pokery with a 555 to drive a triac at just the right moments.

Looks an interesting circuit. I may have to investigate testing it out some time.

tofuman64:
I can ground the neutral line

NO!

Don't do it. Don't even think about doing it.

Neutral is not ground. Depending how your supply is connected and what your neighbours are doing, it could be a significantly different voltage. If you connect that to your local ground you make your local ground absorb the current imbalance between the three phases in your neighbourhood. That can easily be more current than your local ground is designed to handle. It might manage it (without damaging anything) but on the other hand you might find that your local ground now has a voltage on it. If you manage that, it could be extremely dangerous.

I strongly advise you abandon any thought of directly manipulating or wiring into mains voltage circuits. Given the level of understanding implied by your proposals, I don't believe you're in a position to do it safely. More worrying, I don't think you appreciate how much you would have to learn to do this safely.

If you haven't been taught to deal with mains voltage electricity, stay well away from it. You only need one mistake to kill you, or somebody else. Either buy a professionally designed device to do what you want, or convert the problem to low voltage.

Yeah if you ground the "neutral" of the dc you will essentially be shorting every half cycle to ground, which is kinda bad

Thanks for all the responses guys. It seems this project will have to wait another day when i enroll in an electrical engineering course. Thanks for all the safety tips!

One last hypothetical question though. Since the arduino boards need electricity to function and do things, would I be able to "siphon off" some of the mains electricity? If so, what would be the methodology and hardware involved? this is PURELY hypothetical.

Simplest way is a 120v to 7-9v transformer, a rectifier and smoothing caps to feed the vin
or buy a power supply with all that built in

If your not drawing much with the arduinos power you could take apart those small usb wallwarts and use that on the 5v pin

Are we forgetting that most Arduinos have a standard DC power plug?