following your useful guides I made my electricity monitoring system with an Arduino, which has been working well for over a year
Now, if I find some time, I would like to improve the system a bit, by remaking the interface board, for example by implementing the “Buffered Voltage Bias” circuit.
In addition to this I have seen that someone add two 1n4148 protection diodes to the analog inputs, as in this example: Sharing the 2.5V reference, however according to some opinions they should be useless because Vf of the external diodes is likely to be higher than the internal Arduino diodes, which therefore would begin to conduct anyway sooner.
What could happen in my case is that the Arduino is switched off (temporarily) with connected measuring probes: what can I put as protection? I read on some forums to insert a resistance of 10k in series with the signal that applies to the analog pin, but does this not distort the measurement?
What you need to do depends on where you look. The ATMega 328P data sheet clearly states that the maximum input current per pin that the protection diodes can handle is 40 mA.
But if you check the Atmel Knowledge Base, there is an item there “I/O protection in XMEGA devices” which equally clearly states that:
“The protection mechanism is snapback diodes at each pad. The safe maximum current through this is 1mA.
The application note AVR182 shows an application example, which uses the I/O protection in Mega/Tiny devices.
For the source/sink capability of I/O pins, please refer the’ I/O Pin Characteristics’ section in the device datasheet.”
If you look at the App.Note AVR182, that recommends a 1 mA maximum current.
My reading of that 40mA is that’s the current the pin can source (or sink) when it’s operating normally. In that case the 40mA won’t be flowing through protection diodes, but rather though the pin’s gate.
The injection current (1mA) is the relevant number in that table, and that’s consistent with the other references you listed - although it is a little more generous at 5mA when the device is not powered.
I’ve never managed to find “Injection current” on the Atmel 328P data sheet (Rev. 8161D–AVR–10/09 is the one I use, neither is it on Atmel-8271J-AVR- ATmega-Datasheet_11/2015). I did find the per port limit on a different (still Atmel) device, I can’t remember which now.
This circuit could therefore be inserted in the guides, since with three miserable components the analog input is protected not only from the analog values out of range, but also from the Arduino off condition.
For the c.t. input, the c.t. itself behaves as a current source with near-infinite impedance, so the source impedance of the current signal is effectively the burden.
For the voltage input, in theory adding a bigger load will reduce the flux in the core and reduce the distortion, so there might be a benefit to reducing the resistors’ values, though it’s hard to see that as being realistic with a transformer that’s got a full-load current of ½ A or more; it would require resistors dissipating several watts.
ok
this would be the reference scheme for designing the pcb, is that correct?
did I connect port B of the LM358 like this, or is it better that I do not connect it at all?
What you have drawn there is asking for problems. Connect the unused half exactly like you have the used half, i.e. connect pins 6 - 7, pin 5 is OK as it is. If you do not connect it at all, there’s a risk it will oscillate and consume excessive current.
Otherwise I can’t immediately see anything else that might cause a problem.