Yes, this is the goal :-)
I use for my watt meter a nodemcu. I simply count the time every 2 pulse and calculate the power.
Now I have to check my sketch because I don't remember well but the "state" variable is to check if the state of the pin is changed in order to "listen" the pulse.
I added an other variable to check if arduino was restarted (arduino riavviato = arduino restarted)... why?
Simple, arduino count every pulse (one pulse is one Wh). Every pulse, arduino send to HS the total pulse. If I restart arduino, or if arduino reset/restart I lose the count of pulse (power consumption). So, if "arduino_riavviato" var is 1 (arduino restarted), arduino read the "old" number of pulses from HS, in this way, arduino can sum other pulse to the previous... (It is hard for me to explain... :-) )
Well thought!
I do not need something so elaborate.
For me the important thing is to continuously measure the instantaneous power, to have an event that allows me to warn of excessive consumption ... or / and a recurring event that informs me of the power consumption
If you disconnect the HS3, or the server, for some reason you will also lose energy readings ... For me the energy consumed, in relation to power is an additional gift: a "good to have", but "not a "must to have"
I do not need something so elaborate.
For me the important thing is to continuously measure the instantaneous power, to have an event that allows me to warn of excessive consumption ... or / and a recurring event that informs me of the power consumption
If you disconnect the HS3, or the server, for some reason you will also lose energy readings ... For me the energy consumed, in relation to power is an additional gift: a "good to have", but "not a "must to have"
If you want, I can share with you my sketch.
If you can share your sketch it will be great; thanks!
(…) Sorry, I don't understand... If is a pulse, why you want to check as analogue signal? (…)
The analogue inputs are digital inputs with the added functionality of analogue.
sensor = digitalRead(14); // reads a digital signal on pin A0 …
The idea came from here:
http://www.smartofthehome.com/2013/0...eters-arduino/
but as I said I'm thinking ..
Comment