My compressor sits in a noise reduction enclosure outside the shed and I often forget to turn it off so it stays on sometimes for few days or even weeks, but during that time I have no idea how often it recharges ie turns itself on/off. Some folks turn their whole shed off when the leave but I invariably have something or other cooking that requires power, like battery charging, electrolysis etc so I am not always able to do this. The only time I usually turn the shed off completely is if we go away for more than a couple of days.

Anyway I though I would have a futz around to see if I could make a electronics gismo that detects when an electrical machine turns on/of and the time period over which this happens.
This will also serve to tell me if I have a slow leak or not and if so how slow the leak is.

The key to this is a small copper wire coil - these can wound by hand if you have a source of lacquered Cu wire - even easier of you have a slow speed lathe
These coils also come with most (even cheap) 250V Volt/Amp panel meters and as the LCD displays eventually cark it I have a few spares coils.

C2 is the coil in question and it has to have the mains carrying cable that goes from the GPO to the machine going the that coil.
C2 is the coil for the Volt/Amp meter I have rigged up to detect the compressor current.
IMG_5439.jpg

The leads from C2 are (eventually) connected to an Arduino board
The output from these small coils is AC but the Arduino "Analog to Digital" ports expects a positive DC voltage between 0 and 5V max.

The voltage generated by a current going through these coils is also about 1V per Amp, so with a current of 15A drawn by the compressor this means the coil generates about 15V AC so ideally it has to be converted to DC and then also stepped down.

Stepping down is easy I just set up a small resistor pair (R2=17k and R1=100K) in series and tapped off across the smaller resistor, ie ground and Analog port A1 on the Arduino
This drops the voltage to about 10% of the voltage generated by the coil or about 1.5V which the arduino happily accepts.

I did play around with a small rectifier to convert the coils AC to DC but I just found it easier to do the rectification from AC to DC in software. All the negative values of the AC wave automatically become zero and can be rejected while the positive values can be summed and averaged and if needed a fudge factor can be applied to approximate the actual current being draw.
However, I didn't worry about a fudge factor because I don't really need to know the actual current, but just whether how often the compressor is switched on/off.


IMG_5438.jpg

The display shows I(A) or nominal current - actually its the output of the DAC averaged over 100, 10ms reads
When the compressor switches on, I(A) jumps around a fair bit but it stays well over 100.
I could get more stable result by taking more readings and averaging them but it doesn't really matter.

Tr is the number of times the I(A) has gone over a nominal programmed value (I use 50) and then comes back below that value.
So it triggers TR to increment by one every time it does this.

ET is the elapsed time since recording started, in hours.

Arduino board $13, screen $6, resistors a few cents so <$20 in parts.

I was going to 3D print up a box for it but I think I', just going to use it prototype form for a while.
There are lots of programs tweaks I could do for it but lets see how it goes for now.