💬 Power Meter Pulse Sensor
-
The guide specifies LM393 Light Sensor or the tsl250r-lf so I thought it was the same since the same name.
Since the node will be powered with it's power supply, I don't have any battery drain problem in this case. But why did you use a transistor? Can't you just check for a threshold value in the analog input to count as a pulse? -
The guide specifies LM393 Light Sensor or the tsl250r-lf so I thought it was the same since the same name.
Since the node will be powered with it's power supply, I don't have any battery drain problem in this case. But why did you use a transistor? Can't you just check for a threshold value in the analog input to count as a pulse?Ok, all I can see is that it doesnt look the same at all.
@gohan - I tried, and I thought that should work - but for some reason I could not get it to trigger the interupt on the atmega :(
Looking the the voltage thresholds it was supposed to work but it didnt. I was thinking it was to low uA but i dont know really. -
This is what I use togeheter with LM393
https://www.kjell.com/se/sortiment/el-verktyg/elektronik/optokomponenter/ir-dioder-fototransistorer/fototransistor-p90042 -
Ok, all I can see is that it doesnt look the same at all.
@gohan - I tried, and I thought that should work - but for some reason I could not get it to trigger the interupt on the atmega :(
Looking the the voltage thresholds it was supposed to work but it didnt. I was thinking it was to low uA but i dont know really.Instead of the 10k resistor, do you think I could use a potentiometer to "adjust" sensitivity? I would like to avoid messing up the readings with lights entering when opening the cabinet door where the meter is located
@flopp
Do you mind sharing your wiring? 940nm, isn't it infrared? -
Instead of the 10k resistor, do you think I could use a potentiometer to "adjust" sensitivity? I would like to avoid messing up the readings with lights entering when opening the cabinet door where the meter is located
@flopp
Do you mind sharing your wiring? 940nm, isn't it infrared?@gohan - a potentiometer is just a variable resistor so why not? Good idea if you have one laying around.
As i said before though, the try with the transistor is just a try - im not that good with transistors yet and dont know how they work exactly. After this i read somewhere that the base resistor should be bigger to protect the transistor... dont know how to calculate that. -
Instead of the 10k resistor, do you think I could use a potentiometer to "adjust" sensitivity? I would like to avoid messing up the readings with lights entering when opening the cabinet door where the meter is located
@flopp
Do you mind sharing your wiring? 940nm, isn't it infrared?@gohan said in 💬 Power Meter Pulse Sensor:
@flopp
Do you mind sharing your wiring? 940nm, isn't it infrared?I connected the photo resistor directly to the LM393.
I don't know if that is IR. -
Hello,
First, thanks for this tutorial !
I used the code defined in tutorial but I have the following message for "void receive(const MyMessage &message)" :'MyMessage' does not name a typeDo you know what can be the cause of this error please ?
Thanks in advance for your help
-
Hello,
First, thanks for this tutorial !
I used the code defined in tutorial but I have the following message for "void receive(const MyMessage &message)" :'MyMessage' does not name a typeDo you know what can be the cause of this error please ?
Thanks in advance for your help
-
@moumout31 do you have void receive(const MyMessage &message) somewhere in your code or where does it come from?
Could you post the full error message?Have you installed the MySensors library?
@mfalkvidd void receive(const MyMessage &message) is in the code.
MySensors library is installed, I already use it in other nodes.
It's strange because it works in another computer...The full error messages, in french beacause I'm french are :
Arduino : 1.8.0 (Windows 7), Carte : "Arduino Pro or Pro Mini, ATmega328 (3.3V, 8 MHz)" _02_Main_loop:271: error: 'MyMessage' does not name a type In file included from C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/MySensors.h:257:0, from C:\Users\Anne-Laure\Dropbox\Maison\A récupérer sur OneDrive\my_teleinfo_light\_02_Main_loop.ino:118: C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/core/MyTransport.cpp: In function 'void transportProcessMessage()': C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/core/MyTransport.cpp:745:14: error: cannot resolve overloaded function 'receive' based on conversion to type 'bool' if (receive) { ^ C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/core/MyTransport.cpp:811:15: error: cannot resolve overloaded function 'receive' based on conversion to type 'bool' if (receive) { ^ exit status 1 'MyMessage' does not name a type Bibliothèque non valide trouvée dans C:\Users\Anne-Laure\Documents\Arduino\libraries\MySensors : C:\Users\Anne-Laure\Documents\Arduino\libraries\MySensors Ce rapport pourrait être plus détaillé avec l'option "Afficher les résultats détaillés de la compilation" activée dans Fichier -> Préférences.Thanks for your help
-
@mfalkvidd void receive(const MyMessage &message) is in the code.
MySensors library is installed, I already use it in other nodes.
It's strange because it works in another computer...The full error messages, in french beacause I'm french are :
Arduino : 1.8.0 (Windows 7), Carte : "Arduino Pro or Pro Mini, ATmega328 (3.3V, 8 MHz)" _02_Main_loop:271: error: 'MyMessage' does not name a type In file included from C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/MySensors.h:257:0, from C:\Users\Anne-Laure\Dropbox\Maison\A récupérer sur OneDrive\my_teleinfo_light\_02_Main_loop.ino:118: C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/core/MyTransport.cpp: In function 'void transportProcessMessage()': C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/core/MyTransport.cpp:745:14: error: cannot resolve overloaded function 'receive' based on conversion to type 'bool' if (receive) { ^ C:\Users\Anne-Laure\Documents\Arduino\libraries\arduino_759467/core/MyTransport.cpp:811:15: error: cannot resolve overloaded function 'receive' based on conversion to type 'bool' if (receive) { ^ exit status 1 'MyMessage' does not name a type Bibliothèque non valide trouvée dans C:\Users\Anne-Laure\Documents\Arduino\libraries\MySensors : C:\Users\Anne-Laure\Documents\Arduino\libraries\MySensors Ce rapport pourrait être plus détaillé avec l'option "Afficher les résultats détaillés de la compilation" activée dans Fichier -> Préférences.Thanks for your help
-
@moumout31 My guess is that MyMessage is defined in your sketch, overriding the definition in the MySensors library. Could you post your sketch?
@mfalkvidd It's strange... It works with an older version of Arduino software... Thus, the problem is solved ! Thanks
-
Hello,
I don't understand why, but my power meter sensor gives a higher index than the real power meter index after 2 days.
I think that it counts more pulses than pulses provided by the power meter...
Does anybody encounter this problem ?
Can it be cause to bounce for example ?Thank you
-
Hello,
I don't understand why, but my power meter sensor gives a higher index than the real power meter index after 2 days.
I think that it counts more pulses than pulses provided by the power meter...
Does anybody encounter this problem ?
Can it be cause to bounce for example ?Thank you
-
Hello,
I don't understand why, but my power meter sensor gives a higher index than the real power meter index after 2 days.
I think that it counts more pulses than pulses provided by the power meter...
Does anybody encounter this problem ?
Can it be cause to bounce for example ?Thank you
@moumout31
I had same issue, check here for my solution
https://forum.mysensors.org/topic/4716/two-energy-meter/4 -
@moumout31
could it be getting some light from another source?@gohan No, the light is always switched off in this room and I tried, when I switch on the light, there is no pulse from the sensor.
@flopp Thanks for your help. What I see in your topic is that you increase from 10000µs to 40000µs the interval to avoid corrupted interrupts, is that correct ?
Thank you
-
@gohan No, the light is always switched off in this room and I tried, when I switch on the light, there is no pulse from the sensor.
@flopp Thanks for your help. What I see in your topic is that you increase from 10000µs to 40000µs the interval to avoid corrupted interrupts, is that correct ?
Thank you
@moumout31
Yes correct.
When I checked with Serial Monitor and some serial.print in different places I could see that arduino registered double interrupts -
@moumout31
Yes correct.
When I checked with Serial Monitor and some serial.print in different places I could see that arduino registered double interrupts -
@moumout31
Yes correct.
When I checked with Serial Monitor and some serial.print in different places I could see that arduino registered double interrupts -
@moumout31
Yes correct.
When I checked with Serial Monitor and some serial.print in different places I could see that arduino registered double interrupts@flopp After a few days, I confirm you that the index is consistent with power meter index.
However, instant power in watt is not correcly calculated.
For example, when power meter indicates 550W, about 1500W is calculated by the sketch. Do you know how I can resolve this problem please ?Thanks a lot !