Currently I use three current clamps to measure the three phases of our mains lines with one Fluksometer, and an additional Fluksometer to measure the output of our PV installation with another current clamp. This is due to the fact that all our meters do provide no pulse output and I do not want to add an additional meter with an S0-output. So my idea was (and still is) to use the schematics of the Fluksometer collector board as a hint-provider to set up an analog-to-pulse converter.
For that it will be convenient to use an ATtiny13 that offers a 10bit-ADC and corresponding pulse-out ports equivalent to those used on the ATmega168 in the Fluksometer. The pulse-former's setup thus is pretty easy: Input current-clamp to ADC-port with 1uF and 1k91 to ground (as in the original) and output one port to an opto-coupler TIL111 (or something like that) forming an S0-port; adding a 5V-power supply and you are done with the electronics part.
Now the software part - pretty easy as well due to the availability of the AVR part of the Fluksometer's software - but wait, that is where I get stuck:
* Why is the software setting the ADC-Vref to Vbg that is 1.1V? The actual clamp output is 0-5V? How to avoid the overflow?
* Maybe already the answer: Why is there the 1k91-1% pull down resistor in the clamp's path? The 1uF capacitor I understand as voltage buffer...
May someone raise my smartness on this point? If so, I guess such a pulse-former would be a pretty nice and inexpensive enhancement to the Fluksometer enabling it to use up to two additional current clamps to measure "all you need".
Kind regards
Markus
Hi Markus,
That would indeed be a nice hack. You might even multiplex three analog (clamp) inputs to a single pulse output. That would allow you to hook up to 9 clamps on a single FLM.
As for the ADC Vref being Vbg: The current clamp output impedance will form a voltage divider in conjunction with the 1k91 pull-down. The latter will also force the input to 0V when no clamp is attached.
Cheers,
-Bart.
Hi Bart,
but as the current clamp and the 1k91 resistor are in parallel, it would be a current divider (thus the voltage still be 0 to 5V)?! I am a bit puzzled... But as long as it works, I am fine; on the weekend I will start the software part on my small converter...
Kindly, Markus
Addendum: As there are also current clamps that transform "just" the current to measure (say to 0 to 20mA) I would have understood the schematics as then the 1k91 resistors "makes" the voltage to measure through Ohm's law... In the case of the Fluksometer clamps I thought (maybe wrongly) this current to voltage conversion happens already in the clamp (thus 0 to 50A are mapped to 0 to 5V). Questions over questions on basic physics ;-)
O.K., now I understood it :-) The clamps' measured impedance is around 6k9 Ohms - by the parallel 1k91 Ohm resistor this actually brings down the maximum voltage provided by the clamp to around 1,1V which is the Vbg. (5V/6k9 = 7,25E-4 A max current by clamp; 6k9 parallel to 1k91 is around 1k5 Ohms clamp resistance towards the ADC: R*I equals approx. 1,08V) and the world is right again...
It's good to know that the world is right again. :-)
After some testing, please find in the following the hack's corresponding code for "own convenience"...
Hi Markus,
1/ Does this mean you have a working prototype?
2/ Might be more appropriate to upload your code to Github (or some other repo) and link to it from here.
Cheers,
Bart.
Hi Bart,
at 1) yes, I have a working prototyp (but yet didn't have time to actually plug it into my fluksometer, will do so this evening or during the weekend and by that also provide compare measures between the S0 and the clamp variant)
at 2) yes, sounds appropriate and I will try to do so; doing so, I will also add the corresponding eagle files and a picture of the prototype.
Time, o time, where are thou?
Best regards
Markus
Here you go - taking first experiences with Github... (therefore the weird branch setup...)
See https://github.com/gebhardm/energyhacks/tree/energyhacks/Impulsformer for code and schematics; the impulses are a bit behind the analog readings but within expected error tolerance.
Have fun.
Regards, Markus
Getting used to github - now the "correct" link to my repository (above link now is invlaid): https://github.com/gebhardm/energyhacks
I will add also a little hack for a temperature control that switches a circular pump for warm water, sometime...
Have fun, Markus
Hi Markus,
Feel free to join us for EC1205 in Offenburg next week.
Cheers,
Bart.
I just wish I understood what you have done :(
I assume from what I have seen on the GTI hub page you have written a software program to go into the FLM?
If I copy that into mine will my CC ports now be Digital ports?
Im sure alot of users have no idea what you have done but would like to be able to convert a port over simply.
Maybe the easiest way is to wait for a 'new' Flukso with more digital ports or purchase a new 2nd Flukso to use for gas and water etc?
Bazzle
@Bazzle: No, no, no - this is a little hardware hack that uses another microcontroller to convert clamp data (as the FLM) to pulses that then can be input to the FLM's pulse ports; so there is no hack on the FLM yet. (see the Impulsformer.jpg that has a clamp, power and an FLM pulse port attached to the wires...)
With respect to the 'new' FLM I at least did not have the time yet to start the software change... Meanwhile anyone a little bit firm with microcontrollers may be able to copy my little hack...
Best regards
Markus