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. Hardware
  3. Low power Distance Sensor - Hardware issues

Low power Distance Sensor - Hardware issues

Scheduled Pinned Locked Moved Hardware
37 Posts 11 Posters 15.0k Views 8 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.
  • mfalkviddM mfalkvidd

    @qqlapraline the atmega will handle up to 0.5V difference in voltage levels (29.1 Absolute Maximum Ratings in the datasheet), but not more.

    The us-100 datasheet says 3V minimum, so that explains why it stops working below 3V.

    So you need to convert the logic level. That can be done by creating a voltage divider, but that will be hard since the difference in voltage will vary over time. You need to stay within 0.7*Vcc and Vcc + 0.5 (also from the atmega datasheet)

    I think the best option is a logic converter, like this https://www.aliexpress.com/item/Free-shipping-10pcs-lot-4-channel-IIC-I2C-Logic-Level-Converter-Bi-Directional-Module-5V-to/32458109285.html
    I think it can be run at lower voltages than 3.3 and 5V, since sparkfun's version works with voltages as low as 1.8V.

    qqlapralineQ Offline
    qqlapralineQ Offline
    qqlapraline
    wrote on last edited by
    #8

    Well, @mfalkvidd, I think you got it ! Your piece of hardware sounds pretty good to fix my issue. In the meantime, I've looked after the exact electrical tolerance of the digital inputs and found the information you are referring to. I thought about using the pullup resistors of the digital inputs but it works only for high/low inputs..not outputs..!
    So, basically, I think the logic converter is what I need. I will keep you postee.

    @chrille, thanks for your project. Unfortunately, I'm very drastic on battery lifetime and that's why I'm using Sensebender. My setup allows up to 2 years of battery lifetime (measuring distance and temp/hum). And Sensebender works with low voltage (with no voltage regulator).

    QQ

    1 Reply Last reply
    1
    • qqlapralineQ Offline
      qqlapralineQ Offline
      qqlapraline
      wrote on last edited by
      #9

      Hello all,

      It tooks some long time to update my setup but finally, I did it (this weekend)
      And....it works ! Like a charm :)
      Now the battery voltage is under 3v (2900 mv) and the logic converter does its job very very well.
      I only have accuracy issues but, hey, this is a well, so this is a very very aggressive environment for mainstream electronics :)
      Thanks again for your help :+1:

      QQ.

      1 Reply Last reply
      0
      • qqlapralineQ Offline
        qqlapralineQ Offline
        qqlapraline
        wrote on last edited by
        #10

        Oh, for whom is interested, here is a (very very bad) schema of the setup :)

        0_1477256371969_SenseBender - Distance Sensor 2.png

        1 Reply Last reply
        3
        • qqlapralineQ Offline
          qqlapralineQ Offline
          qqlapraline
          wrote on last edited by
          #11

          Oh, forgot it..
          Here is the INO file (beware, it is a 1.5 version of MySensors libraries)
          0_1477341898945_DistanceSensebenderMicro.ino

          QQ.

          1 Reply Last reply
          0
          • qqlapralineQ Offline
            qqlapralineQ Offline
            qqlapraline
            wrote on last edited by
            #12

            A quick update on this topic.
            I have pimped it up using a ME-007 ULS sensor. This one is waterproof, more acurate and can measure longer distances (up to 8 meters).
            After some issues related to delay between measures, it works like a charm.

            1 Reply Last reply
            2
            • qqlapralineQ Offline
              qqlapralineQ Offline
              qqlapraline
              wrote on last edited by
              #13

              The finale update !
              After numerous tests (using used batteries, adapted software and a lot of patience), it appears that the step up booster was not working under a certain voltage (around 2.7v).
              Futhermore, the sleep time before distance measure was very variable.

              I have questionned myself a lot and finally, my doubts went to the capacity of the Arduino to feed the dc-dc converter with enough current.
              To fix this issue, I have used a BC548B transistor with a base resistor of 1K to drive the step-up converter. And, miracle, it works !
              My finale test was with a set of used batteries delivering 2 V !

              Now, I have a sensor that tests distance, temp/hum and battery level every 15 minutes. The average power consumption is 55 µA (25 µA during sleep time and 15 mA for 1 second during measures).

              QQ.

              1 Reply Last reply
              3
              • qqlapralineQ Offline
                qqlapralineQ Offline
                qqlapraline
                wrote on last edited by qqlapraline
                #14

                And here the latest battery graph displaying two things:

                • The first phase with not that optimal battery consumption (until Jan, 14th)
                • The second one with everything optimized (after Jan, 14th).

                0_1486072908594_chart.png

                QQ.

                1 Reply Last reply
                1
                • stevebusS Offline
                  stevebusS Offline
                  stevebus
                  wrote on last edited by
                  #15

                  Very nice project and thanks for sharing. I have a deer feeder in a corner of my yard, and it's always getting empty without me knowing. I'm planning on this exact same type of project to measure the level of corn in the feeder. Would love to see your final schematic and parts list (as it changed across the thread), but no worry if you don't have it as I'm sure I can figure it out.

                  Thanks again for sharing.

                  Vera Edge/UI7; mysensors; Arduino's and RPIs; data posted to Azure for an IoT 'dashboard' of my house

                  Opinions expressed here are my own and do not necessarily reflect Microsoft's feelings on a given topic :-)

                  qqlapralineQ 1 Reply Last reply
                  1
                  • bjacobseB Offline
                    bjacobseB Offline
                    bjacobse
                    wrote on last edited by bjacobse
                    #16

                    I think batteries and sonar distance sensor is not the best, it consumes too much power, since you must measure too often. A better solution if possible is to only get a interrupt with a switch when water tank is empty, then Arduino can sleep forever, or maybe you want to let it wake up once a day to provide a live puls. with a sonar you must check often and spend precious battery for distance measuring. Also there is no need of a DC-DC converter when using the switch, since the DC-DC converter also drains your batteries

                    Can you use something like this instead?
                    http://www.ebay.com/sch/sis.html?_nkw=New+Hot+Sale+Small+Liquid+Water+Level+Sensor+Horizontal+Float+Switch+WB&_id=301886450361&&_trksid=p2060353.m2749.l2658

                    qqlapralineQ 1 Reply Last reply
                    0
                    • stevebusS stevebus

                      Very nice project and thanks for sharing. I have a deer feeder in a corner of my yard, and it's always getting empty without me knowing. I'm planning on this exact same type of project to measure the level of corn in the feeder. Would love to see your final schematic and parts list (as it changed across the thread), but no worry if you don't have it as I'm sure I can figure it out.

                      Thanks again for sharing.

                      qqlapralineQ Offline
                      qqlapralineQ Offline
                      qqlapraline
                      wrote on last edited by
                      #17

                      Thank you @stevebus. It's now live at its outdoor spot measuring the water in my well. It works perfectly :)

                      I'll post the photos and schemas once I get back from skiing ;)

                      1 Reply Last reply
                      0
                      • bjacobseB bjacobse

                        I think batteries and sonar distance sensor is not the best, it consumes too much power, since you must measure too often. A better solution if possible is to only get a interrupt with a switch when water tank is empty, then Arduino can sleep forever, or maybe you want to let it wake up once a day to provide a live puls. with a sonar you must check often and spend precious battery for distance measuring. Also there is no need of a DC-DC converter when using the switch, since the DC-DC converter also drains your batteries

                        Can you use something like this instead?
                        http://www.ebay.com/sch/sis.html?_nkw=New+Hot+Sale+Small+Liquid+Water+Level+Sensor+Horizontal+Float+Switch+WB&_id=301886450361&&_trksid=p2060353.m2749.l2658

                        qqlapralineQ Offline
                        qqlapralineQ Offline
                        qqlapraline
                        wrote on last edited by qqlapraline
                        #18

                        @bjacobse , I do understand your concern ! That was my challenge for the past months. But the combination of digital output to trigger on/off the sensor, low update frequency (15 minutes) and a low power ultrasonic sensor makes it possible (ser posts above).

                        Qq.

                        1 Reply Last reply
                        1
                        • HarrySteffH Offline
                          HarrySteffH Offline
                          HarrySteff
                          wrote on last edited by
                          #19

                          Hello @qqlapraline
                          i want to build exactly this sensor like you do.
                          Can you help me with a wiring schema and a parts list?

                          Thank you so much!

                          1 Reply Last reply
                          0
                          • qqlapralineQ Offline
                            qqlapralineQ Offline
                            qqlapraline
                            wrote on last edited by qqlapraline
                            #20

                            Here is the schematics (freshly made for you :))
                            0_1496348113224_upload-8af864a8-ed84-400a-ad21-5adc67c72da4

                            And here the part list:

                            • Arduino pro mini (3.3v with BOD disabled) or Sensebender Micro
                            • Ultrasonic sensor: ME007-ULS (available here)
                            • NRF24L01+ (I use the PA - LNA version for long range communication)
                            • NPN Transistor: BC548 (the B version if prefered)
                            • Base resistor: 1k
                            • 3.3V Step-up Voltage regulator: NCP1402 (available here)
                            • Logic Level Converter (available here): it says 3.3/5 but actually it's any to any voltage.
                            • Waterproof case (available here)

                            And finally here is my code (not cleaned, sorry).
                            0_1496348693347_DistanceSensebenderMicro.ino
                            And the Eagle SCH
                            0_1496348714531_Low power Distance Sensor.sch

                            And now, I realize that it may have been wise to upload that to openhardware.io :)

                            Regards,

                            QQ.

                            sq9njjS 1 Reply Last reply
                            4
                            • HarrySteffH Offline
                              HarrySteffH Offline
                              HarrySteff
                              wrote on last edited by
                              #21

                              Thank you very much!

                              1 Reply Last reply
                              0
                              • qqlapralineQ qqlapraline

                                Here is the schematics (freshly made for you :))
                                0_1496348113224_upload-8af864a8-ed84-400a-ad21-5adc67c72da4

                                And here the part list:

                                • Arduino pro mini (3.3v with BOD disabled) or Sensebender Micro
                                • Ultrasonic sensor: ME007-ULS (available here)
                                • NRF24L01+ (I use the PA - LNA version for long range communication)
                                • NPN Transistor: BC548 (the B version if prefered)
                                • Base resistor: 1k
                                • 3.3V Step-up Voltage regulator: NCP1402 (available here)
                                • Logic Level Converter (available here): it says 3.3/5 but actually it's any to any voltage.
                                • Waterproof case (available here)

                                And finally here is my code (not cleaned, sorry).
                                0_1496348693347_DistanceSensebenderMicro.ino
                                And the Eagle SCH
                                0_1496348714531_Low power Distance Sensor.sch

                                And now, I realize that it may have been wise to upload that to openhardware.io :)

                                Regards,

                                QQ.

                                sq9njjS Offline
                                sq9njjS Offline
                                sq9njj
                                wrote on last edited by
                                #22

                                @qqlapraline would you mind reupload your sketch?

                                mfalkviddM 1 Reply Last reply
                                0
                                • sq9njjS sq9njj

                                  @qqlapraline would you mind reupload your sketch?

                                  mfalkviddM Offline
                                  mfalkviddM Offline
                                  mfalkvidd
                                  Mod
                                  wrote on last edited by
                                  #23

                                  @sq9njj the link works if it is opened in a new window or if you right-click and select "save as".

                                  1 Reply Last reply
                                  0
                                  • qqlapralineQ Offline
                                    qqlapralineQ Offline
                                    qqlapraline
                                    wrote on last edited by
                                    #24

                                    Does it work fine ?
                                    In case, you need it, here it goes again :)
                                    0_1504557254355_DistanceSensebenderMicro.ino
                                    Beware, it uses a former version of the MySensors library.

                                    QQ.

                                    sq9njjS 1 Reply Last reply
                                    0
                                    • qqlapralineQ qqlapraline

                                      Does it work fine ?
                                      In case, you need it, here it goes again :)
                                      0_1504557254355_DistanceSensebenderMicro.ino
                                      Beware, it uses a former version of the MySensors library.

                                      QQ.

                                      sq9njjS Offline
                                      sq9njjS Offline
                                      sq9njj
                                      wrote on last edited by
                                      #25

                                      @qqlapraline thanks! It works fine, thanks again!

                                      1 Reply Last reply
                                      0
                                      • C Offline
                                        C Offline
                                        chbla
                                        wrote on last edited by
                                        #26

                                        I tried this with a similar setup but RFM95 for LoRaWan and without the transistor as I'm testing it directly on USB.

                                        A pololu 5V stepup regulator does not even work directly on VCC - if I connect the HC-SR04, voltage drops from 5V
                                        to 1.2V after the regulator.

                                        I then tried a different regulator from aliexpress, this setup works with the regulator on VCC, but if I try to control it through a
                                        Pin, Voltage also drops and does not even power the regulator (it has a LED) :(

                                        1 Reply Last reply
                                        0
                                        • qqlapralineQ Offline
                                          qqlapralineQ Offline
                                          qqlapraline
                                          wrote on last edited by
                                          #27

                                          From my experience, the transistor (or mosfet) is key to allow enough current to the DC-DC booster. Otherwise, it will not provide the appropriate voltage because max current getting out of a digital pin from Arduino is around 40 mA.

                                          QQ.

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


                                          22

                                          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