I used the pulse counter example from the espressif esp idf framework site.
Arduino energy meter pulse counter.
I have also tested out code for all the external switches.
I have been trying to count pulses from a 12 500 hz square wave to trigger an output.
The timing of this function has been determined empirically and will.
Single phase 3 phase import export.
When the arduino is reset it prints 315 to the serial over a 25 ms sample.
Ok so i am having some trouble getting the counter to count or the way i am looking at the count total in the serial monitor is wrong.
Imagine if the ground reference for the meter was floating at a high voltage with respect to earth ground but your arduino power supply s negative line was referenced to earth ground a good way to get electrical isolation is with an opto coupler also called an opto isolator which is essentially an led and a photo transistor inside the same package.
You can find the example on the espressif github.
Here s the code i have so far.
There are only two interrupt pins on the arduino if you wish to count pulses from more than two sources then please read on.
Play video i belong to a village of odisha india where frequent power cut is very common.
Reads a pulse either high or low on a pin.
This is an article to show how to count pulses generated by a flow sensor.
During my childhood days continuing studies after dusk was a real challenge.
For example if value is high pulsein waits for the pin to go from low to high starts timing then waits for the pin to go low and stops timing.
Returns the length of the pulse in microseconds or gives up and returns 0 if no complete pulse was received within the timeout.
It hampers the life of every one.
W hello guys i want to do a system for my home where i can monitor energy either from energy meter pulse output sdm72dr or using current transformer arduino sensor and displaying the cost of kwh used in a serial monitor which one would be reliable and provide accurate information i had about 17000 rs last months bill due.
There are a few parameters that need to be tuned for each power meter s pulses kwh usually says xxx imp kwh somewhere on your meter.
Locate the little led on your meeter and mount the light sensor over it to register the power consumption rate blinks.
However i did write a sketch earlier to test that that i am able to read pulses in basically using a pulse generator and whenever a pulse is high an led is on.
This sensor counts led pulses from your house meter and converts it into watts and accumulated kwh.
Now if i move that same code down into void loop it counts.
315 x 40 12600.
Due to this problem i designed a solar syste.
Which seems to me it s working perfectly.
So i know the arduino is seeing an input.
My only problem is it only returns this number once upon reset of the board.
Gas meters water flow.
Contest my 12 input high precision pulse counter kwh x2f.