ATtiny85 Clamp on Ammeter
I needed a simple clamp on ammeter, particularly one that would be able to read lower currents. A salvaged ac split ferrite (most computers have one around the ac line cord, and some are removable) was used for the current transformer. One hundred turns of 36 a.w.g. enamel wire was wrapped around one ferrite half forming a secondary winding, and the wire ends brought out to a burden resistor of 47 ohms. An ATtiny85 was used to measure the peak voltage, and the voltage is related to the current through the primary of the ferrite (single wire inserted through the remaining space of the ferrite core). The ATtiny85 blinks an led once a second for greater than zero but less than one amp of current, and blinks faster for greater currents- at 13 amps, I have it flash 8 times a second. I could have calibrated it at one flash per amp, but will leave that to others to do.
I used a Hammond 1551K plastic enclosure, and epoxied the split ferrite to one end in a manner that allowed the unit to open easily from the top (fine wires in the fixed part closest the case, so no bending stress on the wires). The ATtiny85 was put in a DIP socket on perfboard so the ATtiny could be removed for programming. I should have made the perfboard longer, 2 small perfboards had to be used. The unit is powered by 2ea. CR2032 watch batteries in series, the battery holder has an on/off switch built in. It draws 16 mA in operation. I am relying on the battery's internal resistance to not blow up the ATtiny.
The idea for this was http://www.kerrywong.com/2011/07/16/simple-curren...
The circuit diagram is found here http://electronics.stackexchange.com/questions/973...
On the ATtiny85, I use A1 for analog input (physical pin 7) and output via a 330 ohm resistor to a red led on 1 (physical pin 6). The Arduino code is attached (AnalogInput_Simple.ino).
The video shows the operation, it works well for my needs. The pot below the red led adjusts the zero current value (not fixed 10K resistors as in the circuit diagram reference). In my version, I have 2 fixed value 3.3K resistors with a 4700 ohm pot in the middle, the wiper feeding one end of the burden resistor, thus I can adjust zero more accurately than using 10K fixed resistors.