I'm working on a lighting controller that does a waterfall effect on the 12 v stair lights by saturating a mosfet for each stair in ascending or descending order. I need to read 120 VAC in the switch leg and travelers so I can run the waterfall in different directions depending on which switch is controlling the lights.
Two questions:
-
Can I use a rectifier and a voltage divider to read the voltage directly (no transformer or cell phone wall adapter)? Since the voltage source isn't floating, can I have the Arduino plugged in to my computer while reading the signal or will my Arduino's ground short out one side of the rectifier and blow stuff up?
Also, do I need the capacitor on the rectifier or can I just read the rectified wave with analogRead()?
-
I also want to read the waveform out of the dimmer so I can do a reverse waterfall at the same dimming level after the switch is turned off. Does anyone know if this is possible ?
- Can I use a rectifier and a voltage divider to read the voltage directly (no transformer or cell phone wall adapter)?
No!
Since the voltage source isn't floating, can I have the Arduino plugged in to my computer while reading the signal or will my Arduino's ground short out one side of the rectifier and blow stuff up?
Yes! You can potentially blow something up or electrocute yourself or someone else. The low-voltage electronics, and anything you connect to, or anything you can touch has to be electrically isolated from the power line. A transformer (sometimes built into a power adapter), optical isolation, or a relay can be used, depending on the application.
The simplest way to safely "detect" AC is to use a relay with a 120VAC coil.
- I also want to read the waveform out of the dimmer so I can do a reverse waterfall at the same dimming level after the switch is turned off. Does anyone know if this is possible ?
It's not practical to read the waveform, but you can rectify & filter the output from a transformer and measure the DC.
I'm working on a lighting controller that does a waterfall effect on the 12 v stair lights by saturating a mosfet for each stair in ascending or descending order.
If the Arduino is controlling the 12V lights, the Arduino "knows" the state/status of the lights already.