View Single Post
  #30   Report Post  
Posted to uk.d-i-y
The Natural Philosopher[_2_] The Natural Philosopher[_2_] is offline
external usenet poster
 
Posts: 39,563
Default Logging mains voltage: Arduino or Raspberry Pi?

On 13/04/18 17:24, newshound wrote:
On 13/04/2018 15:44, The Natural Philosopher wrote:
On 13/04/18 15:02, newshound wrote:



My point is, do the low pass filtering in software, though.

A bridge rectifier and smoothing cap is a peak voltage reading
abortion for this: you want to do an RMS average especially for kettle
elements.

My solution is less components, but more code.

Code is cheap!

Only issue is doing a square root in binary integers...arduinos don't
have native floating point ****!


Let's park that for the moment




As you say, small mains transformer, a few resistors and of course a
5 volt Zener on the ADC input.


Well i'd just clamp that to the 5V rails.


Clamp what? I'm confused.


The input.

resistor and reverse biased diode to +5V. If it goes above 5V the diode
clamps it to the suplly rail plus half a volt or so. Standsard technique.


https://i.stack.imgur.com/LfzyT.png

is a perfect example

from a similar app.

https://electronics.stackexchange.co...erence-voltage




--
€œA leader is best When people barely know he exists. Of a good leader,
who talks little,When his work is done, his aim fulfilled,They will say,
€œWe did this ourselves.€

ۥ Lao Tzu, Tao Te Ching