Energy pulse meter + outside temperature

  • This is a prototype for an energy pulse meter type sensor plus a Dallas temp sensor. Works after some problems with the radio communication so it is time to do a "real installation". A nano and radio is in the bigger white box, the DS18b20 in the small box and the pulse sensor is hooked up to the meter. The boxes and the IR sensor holder are made with a 3D printer.Energy.jpg

  • Hero Member

    @mbj nice... I really need to look into getting a 3D printer. ..

  • Nice work. What printer do you have? I 'invested' in the MOD-t from NewMatter, an Indiegogo campaign product. I have a Makerbot at work that I 'practice' with. My father uses a service at his local library that will do 3D prints for him; check around your local area.

  • The printer is "home made". Based on the Ord Bot Hadron mechanical parts and the rest are pieces from here and there. Very nice to have to make parts like this. (the sensor box and the IR sensor holder)Em2.JPG Em1.JPG

  • By the way - here is a typical output from Openhab where data comes in via the mqtt-gateway to a RPi controller with Razberry z-wave board. (the house is electrically heated so heaters go on and off together with all other electrical equipment so curves look a bit rough, upper curve is Kwh and the lower is W ).Em3.JPG

  • @mbj Would you mind sharing your sketch? 🙂 Right now I'm using two separate arduinos for measuring energy and temperature (hot/cold side) on my heat pump. Would be nice to combine this into one arduino, one sketch.


  • I'm looking for code to read the IR pulses from my hydro meter.

  • Please post your sketch. Thank you.

  • Hardware Contributor

    Hi @ANZ14778!

    To start you can look here:

  • Hi!

    Would it be possible to use both of the interrupts for two LED sensors or will the interrupts then collide and effect the precision? Of course it would be better if I could use S0-outputs and then perhaps the 12-channel meter described here but in this case I only have the blinking LEDs available.

    If multiple interrupts are ok, would it then also be ok to go for even more interrupts, 5 or 6 interrupt pins are available for the Mega if I'm not mistaken. Whats the limit? I guess it depends on the clock frequency and the number of tasks in the loop()?!


  • @NickBuilder
    I made this one so long ago that I do not remember the program well but (from a bad memory as well 🙂 ) I think that the interrupt is there for the sleep mode only which is optional and meant for a battery powered sensor.
    Mine is on USB power all the time so I do not use the sleep mode at all and besides I want to follow the watt numbers which will not be available during a sleep mode operation.

    In principle there should be no problem using two interrupts but the program need a rewrite for that setup of course. Also it might be questionable if using sleep mode together with two power sensor leds will save anything at all (often they blink 1000 times per kW consumed).

  • I assumed you were using the example mentioned by sundberg84 and in that code it's clear that the interruption is used to increment the pulse count.

    If you use a different approach I would very much like to take part of your code. Are you still monitoring your energy and power this way?


  • @NickBuilder
    I now have looked at the code and (of course) you are right, the interrupt is used for the pulse count which I think is the best way of programming this function.

    My sensor is based on an old version of this code but modified for use with Openhab (which does not give any start value back, this function has to be own programmed). Another modification is that same unit monitors a number of temperature sensors.

    The "thing" has been in operation since my first post above and works well but I guess I should make an effort to modernize the code. Maybe a task for the long and dull autumn/winter days here.

Log in to reply

Suggested Topics