UsernameD:
Tom, sorry to cause any confusion when I said "First pic is without a resistor from A0 to ground, fully rectifies ac" as rectifies should just say rectified circuit. I was just making reference to the fact that I started with an AC signal and rectified it before going to the Arduino. I can provide a schematic, but here... this is what I did:
Start with 12vac
Then goes into a voltage divider circuit which split the signal to about 10.5v on one side and 1.5v on the other.
The 1.5v side of the divided circuit goes through a 4 diode, rectifier circuit to give me a half sine that does not cross 0v (all positive voltage now). This 0 to 1.5 volt sine goes into my A0 pin.
I (as well) connected a 1k resistor from A0 to ground, as well as a 50uF cap from A0 to ground and now get a nice steady 1.5v (approximately). I can get an even smoother output with a larger cap, however I noticed that if I change voltages slightly (via messing around with the voltage divider), larger caps can make the output slow to change (which I don't want). 50Uf seems to be what I'm looking for.
Have a drink, eat a pie, all is good
- I can draw out my schematic if anyone wants to see it.
Your rectifier needs to be after the 12Vac and before the voltage divider.
So you feed the voltage divider with DC.
Put capacitor across DC output of the rectifier.
YES, a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Please make sure you show all your gnd connections.
Thanks.. Tom... ![]()