Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Announcements
  3. 💬 Battery Powered Sensors

💬 Battery Powered Sensors

Scheduled Pinned Locked Moved Announcements
battery
347 Posts 55 Posters 68.0k Views 53 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aclertant
    wrote on last edited by
    #74

    Do you think that the use of a piezo electric switch is possible ?
    I found one that deliver 24v and 0,2A... The goal would be to create wireless switch...

    AWIA gohanG 2 Replies Last reply
    0
    • A aclertant

      Do you think that the use of a piezo electric switch is possible ?
      I found one that deliver 24v and 0,2A... The goal would be to create wireless switch...

      AWIA Offline
      AWIA Offline
      AWI
      Hero Member
      wrote on last edited by
      #75

      @aclertant Interesting idea... Energy harvesting with piezo-electric components is certainly possible. From MySensors point of view the energy (very very little) has to be stored and boosted to power the radio and mcu for message processing. There are a few examples of "harvesting" remotes (i.e. Philips HUE) but I am not sure if these use a piezo element.

      1 Reply Last reply
      0
      • H Offline
        H Offline
        hiddenuser
        wrote on last edited by
        #76

        I removed the both the LED and the Voltage Regulator of an Arduino pro min 3.3v . The simple sketch on it's own works fine. However when I connect an NRF24L01 it does not communicate back to the gateway.. :(

        1 Reply Last reply
        0
        • A aclertant

          Do you think that the use of a piezo electric switch is possible ?
          I found one that deliver 24v and 0,2A... The goal would be to create wireless switch...

          gohanG Offline
          gohanG Offline
          gohan
          Mod
          wrote on last edited by
          #77

          @aclertant
          If you look at enocean products there are already commercial energy harversting switches in case you don't find a way to make it.

          1 Reply Last reply
          0
          • A Offline
            A Offline
            aclertant
            wrote on last edited by
            #78

            @gohan yes it's exactly what I'd like to do ;)

            I should forget to use an arduino in fact... just send one command using... a pic ? or something else...

            The enocean switch is really cool, but quiet expensive :(

            1 Reply Last reply
            0
            • gohanG Offline
              gohanG Offline
              gohan
              Mod
              wrote on last edited by
              #79

              Like all commercial products they cost because they have been developed, tested and produced. So it's up to you if you want to spend time tinkering or go with an already working solution :-)

              A 1 Reply Last reply
              0
              • gohanG gohan

                Like all commercial products they cost because they have been developed, tested and produced. So it's up to you if you want to spend time tinkering or go with an already working solution :-)

                A Offline
                A Offline
                aclertant
                wrote on last edited by
                #80

                @gohan @AWI
                we need something like this but for NRF24L01 module.
                https://github.com/SmingHub/Sming
                Do you think that possibly exist or there is a huge problem ? Like no eeprom or something like that ?

                1 Reply Last reply
                0
                • gohanG Offline
                  gohanG Offline
                  gohan
                  Mod
                  wrote on last edited by
                  #81

                  You see, enocean protocol has been developed from the start to be used with devices that use energy harvesting, so you can't think to use general purpose HW (like esp8266, FRF24, Arduino boards) that is not optimized very low power consumption (look at all the mods required to make a mini pro last months on battery with a reed switch and a nrf24 module); with piezo-electric components the amount of energy is really really tiny so you need super optimized HW to work with that.
                  The link you posted is about something that works on a ESP8266 but that works over wifi, that is for sure not the best energy efficient system.

                  1 Reply Last reply
                  0
                  • N Offline
                    N Offline
                    napo7
                    Hardware Contributor
                    wrote on last edited by
                    #82

                    There is a much more efficient way (and cost-less) to measure VBATT :
                    https://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
                    It doesn't need any external resistor, so there will be no current flowing even when the Atmega is asleep.

                    AWIA 1 Reply Last reply
                    0
                    • N napo7

                      There is a much more efficient way (and cost-less) to measure VBATT :
                      https://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/
                      It doesn't need any external resistor, so there will be no current flowing even when the Atmega is asleep.

                      AWIA Offline
                      AWIA Offline
                      AWI
                      Hero Member
                      wrote on last edited by
                      #83

                      @napo7 This has been mentioned in this topic. @Yveaux Vcc library is the easiest way to handle this.

                      N 1 Reply Last reply
                      0
                      • AWIA AWI

                        @napo7 This has been mentioned in this topic. @Yveaux Vcc library is the easiest way to handle this.

                        N Offline
                        N Offline
                        napo7
                        Hardware Contributor
                        wrote on last edited by
                        #84

                        @AWI Ahh Sorry ! Didn't seen the comment !
                        I thought it was never mentioned since the how-to still refers to resistor divider method (which is, IMO a bad method since it will draw current...)
                        I'll have a look at Yveaux's lib.

                        1 Reply Last reply
                        0
                        • H Offline
                          H Offline
                          hiddenuser
                          wrote on last edited by hiddenuser
                          #85

                          I have used resistor ( 470K+1M ) to measure the voltage on a 5 minute interval. The Soil sensor is out in the garden where the container housing the arduino pro min gets exposed to sun. The voltage reading is high during 1 PM to 4 PM, when its under the sun. I am not sure if this is because of the heat.

                          0_1488370532353_Voltage Graph.JPG

                          The code is given below. Please note I multiply my actual voltage with calibration variable. however during the high voltage time the calibration variable does not seem to work.

                          • Battery powers the soil sensor.
                          • The voltage regulator has been removed.
                          • MCU powered using vcc pin.
                          //#define MY_DEBUG
                          #define MY_RF24_PA_LEVEL RF24_PA_LOW
                          #define MY_BAUD_RATE 38400
                          #define MY_RADIO_NRF24
                          #define VIEW_READING
                          
                          #include <MySensors.h>
                          #include <SPI.h>
                          #include <math.h>
                          
                          
                          #define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
                          #define N_ELEMENTS(array) (sizeof(array)/sizeof((array)[0]))
                          #define NUM_READS 10
                          #define CHILD_ID_MOISTURE 0
                          #define CHILD_ID_BATTERY 1
                          #define SLEEP_TIME 300000//10000 // Sleep time between reads (in milliseconds), was 10000
                          #define STABILIZATION_TIME 500 // Let the sensor stabilize before reading default BOD settings
                          #define VOLTAGE_PIN A0
                          
                          
                          int index;
                          long buffer[NUM_READS];
                          const long Known_Resistor = 4700;
                          
                          /// @brief Structure to be used in percentage and resistance values matrix to be filtered (have to be in pairs)
                          typedef struct {
                            int moisture; //!< Moisture
                            long resistance; //!< Resistance
                          } values;
                          
                          
                          MyMessage soil_msg(CHILD_ID_MOISTURE, V_LEVEL);
                          MyMessage voltage_msg(CHILD_ID_BATTERY, V_VOLTAGE);
                          
                          
                          void presentation() {
                            sendSketchInfo("Soil Moisture", "2.0");
                            present(CHILD_ID_MOISTURE, S_MOISTURE);
                            present(CHILD_ID_BATTERY, S_MULTIMETER);
                          }
                          
                          
                          void setup() {
                            pinMode(6, OUTPUT);
                            pinMode(7, OUTPUT);
                            digitalWrite(6, LOW);
                            digitalWrite(7, LOW);
                          }
                          
                          
                          
                          
                          void loop() {
                            //float dryLevel = readNoMoisture();
                            long moistureLevel = readAggSoilMoisture();
                          
                            //float coeff = 100.00 / float(dryLevel);
                            float voltage = readVoltage() * 1.57368; 
                          
                            float batteryPcnt = voltage / 3.3 * 100;
                          
                          #ifdef VIEW_READING
                            Serial.print("--Voltage:"); Serial.println(voltage);
                            Serial.print("--Battery %:"); Serial.println(batteryPcnt);
                            Serial.print("--Soil Sensor value:"); Serial.println(moistureLevel );
                          #endif
                          
                            send(soil_msg.set(moistureLevel, 1));
                            sendBatteryLevel(batteryPcnt);
                            send(voltage_msg.set(voltage, 3), 1);
                          
                          
                          
                            sleep(SLEEP_TIME);
                          }
                          
                          float readVoltage() {
                            analogReference(INTERNAL);
                            fakeRead(VOLTAGE_PIN);
                            int sensorValue = analogRead(VOLTAGE_PIN);
                            float voltage = sensorValue * 0.003363075;
                            analogReference(DEFAULT);
                            fakeRead(VOLTAGE_PIN);
                            return voltage;
                          
                          }
                          
                          void fakeRead(int pin) {
                            for (int counter = 0; counter < 5; counter++) {
                              analogRead(pin);
                              delay(STABILIZATION_TIME);
                            }
                          }
                          
                          
                          // Averaging algorithm
                          void addReading(long resistance)
                          {
                            buffer[index] = resistance;
                            index++;
                            if (index >= NUM_READS) {
                              index = 0;
                            }
                          }
                          
                          long average()
                          {
                            long sum = 0;
                            for (int i = 0; i < NUM_READS; i++) {
                              sum += buffer[i];
                            }
                            return (long)(sum / NUM_READS);
                          }
                          
                          int readAggSoilMoisture()
                          {
                          
                            measureRawSoilMoisture(6, 7, A1);
                            long read1 = average();
                          
                            measureRawSoilMoisture(7, 6, A2);
                            long read2 = average();
                            long sensor1 = (read1 + read2) / 2;
                            return int( ((sensor1 / (float)Known_Resistor) * 100.00));
                          }
                          
                          
                          
                          void measureRawSoilMoisture (int phase_b, int phase_a, int analog_input)
                          {
                            // read sensor, filter, and calculate resistance value
                            // Noise filter: median filter
                          
                            for (int i = 0; i < NUM_READS; i++) {
                          
                              // Read 1 pair of voltage values
                              digitalWrite(phase_a, HIGH);                 // set the voltage supply on
                              delayMicroseconds(25);
                              int supplyVoltage = analogRead(analog_input);   // read the supply voltage
                              delayMicroseconds(25);
                              digitalWrite(phase_a, LOW);                  // set the voltage supply off
                              delay(1);
                          
                              digitalWrite(phase_b, HIGH);                 // set the voltage supply on
                              delayMicroseconds(25);
                              int sensorVoltage = analogRead(analog_input);   // read the sensor voltage
                              delayMicroseconds(25);
                              digitalWrite(phase_b, LOW);                  // set the voltage supply off
                          
                              // Calculate resistance
                              // the 0.5 add-term is used to round to the nearest integer
                              // Tip: no need to transform 0-1023 voltage value to 0-5 range, due to following fraction
                              long resistance = abs(Known_Resistor * (supplyVoltage - sensorVoltage ) / sensorVoltage) ;
                          
                            
                              delay(1);
                              delay(STABILIZATION_TIME);
                              addReading(resistance);
                           
                            }
                          
                          }
                          
                          
                          
                          
                          1 Reply Last reply
                          0
                          • Moebius LutchingM Offline
                            Moebius LutchingM Offline
                            Moebius Lutching
                            wrote on last edited by Moebius Lutching
                            #86

                            Using voltage divider still might be necessary if you don't have battery directly connected to the MCU VCC, for example using step-up/down regulator to power the MCU. In this case you still can use a voltage divider and have a P+N Mosfet to control the current going through the voltage divider, so no leak to ground.

                            In practical terms you basically use another GPIO to enable or disable it the Mosfet when needed. I saw that on the Whisper Node board I'm using and seems to be effective (reference: https://bitbucket.org/talk2/whisper-node-avr#markdown-header-voltage-monitor)... In any case using high value resistors (over 100K) will reduce any current draw. Finally a small capacitor can be used to stabilize the voltage.

                            1 Reply Last reply
                            0
                            • Jarno BurgerJ Offline
                              Jarno BurgerJ Offline
                              Jarno Burger
                              wrote on last edited by
                              #87

                              I have a DHT11 + NRF24L01 + Pro Mini 3.3v 8Mhz
                              All is working fine when on usb cable.. but it fails when connected to 2x 1.5 AA batteries..
                              what could be wrong ?

                              1 Reply Last reply
                              0
                              • gohanG Offline
                                gohanG Offline
                                gohan
                                Mod
                                wrote on last edited by
                                #88

                                Dht 11 operating voltage is 3.3 to 5v, so 2 AA batteries are not enough. Better look at other more reliable sensors that can operate at lower voltages

                                1 Reply Last reply
                                1
                                • Jarno BurgerJ Offline
                                  Jarno BurgerJ Offline
                                  Jarno Burger
                                  wrote on last edited by
                                  #89

                                  I did a test with a variable power supply , and I can confirm that the pro mini does weird stuff at smaller then 3v, but it works at 3.3v.. I have now also ordered those 3.3v up-boosters (because I already bought the battery mounts) mentioned here.

                                  1 Reply Last reply
                                  0
                                  • maghacM Offline
                                    maghacM Offline
                                    maghac
                                    wrote on last edited by
                                    #90

                                    What would be the best approach if I wanted a battery powered node using a 5V sensor? I want to build a secret knock sensor but I want it to be battery powered.

                                    I was thinking about using 3xAA batteries (3x1.6 would be 4.8V max) and a 5V step-up converter and then power the sensor and the arduino (on the raw pin, since it's a 3.3V arduino). The radio would be powered from the VCC on the arduino.

                                    ileneken3I 1 Reply Last reply
                                    0
                                    • gohanG Offline
                                      gohanG Offline
                                      gohan
                                      Mod
                                      wrote on last edited by
                                      #91

                                      I think that isn't going to be a very efficient way. Are you sure there isn't any 3.3V sensor you could use?

                                      1 Reply Last reply
                                      0
                                      • maghacM maghac

                                        What would be the best approach if I wanted a battery powered node using a 5V sensor? I want to build a secret knock sensor but I want it to be battery powered.

                                        I was thinking about using 3xAA batteries (3x1.6 would be 4.8V max) and a 5V step-up converter and then power the sensor and the arduino (on the raw pin, since it's a 3.3V arduino). The radio would be powered from the VCC on the arduino.

                                        ileneken3I Offline
                                        ileneken3I Offline
                                        ileneken3
                                        wrote on last edited by
                                        #92

                                        @maghac

                                        Consider this option:
                                        Use 2 AA batteries.
                                        Change the BOD on the arduino to something lower than the 2.8V default.
                                        Power everything from the batteries except the sensor.
                                        Use the 5V step-up converter only for the sensor.

                                        maghacM 1 Reply Last reply
                                        0
                                        • ileneken3I ileneken3

                                          @maghac

                                          Consider this option:
                                          Use 2 AA batteries.
                                          Change the BOD on the arduino to something lower than the 2.8V default.
                                          Power everything from the batteries except the sensor.
                                          Use the 5V step-up converter only for the sensor.

                                          maghacM Offline
                                          maghacM Offline
                                          maghac
                                          wrote on last edited by
                                          #93

                                          @ileneken3 Good idea, i think I'll design it that way. I also had a closer look on eBay and found another sensor that runs on 3.3v.

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          20

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular