Low Power Arduino - Sleeping at 0.3mA perfect for batteries (Arduino Nano deep sleep)

Поділитися
Вставка
  • Опубліковано 23 лис 2024

КОМЕНТАРІ • 87

  • @DIYTECHBROS
    @DIYTECHBROS  2 роки тому +2

    Want to support us? Buy us a coffee ☕️ ​buymeacoffee.com/DIYTechBros​​

  • @TheRealStructurer
    @TheRealStructurer Рік тому +2

    Late to the game but just what I needed for an ongoing project. Thanks for sharing 👍🏼

  • @carlos2004
    @carlos2004 4 роки тому +1

    this is helpful if you already have the nano on hand and don't plan to do other projects. however, if you want to run on battery power, getting the atmega chip itself seems like a better idea since that one can go into super deep sleep.

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому

      True!
      But, instead of getting the atmega328 from the Nano it would be easier using the attiny85 (or a newer like the attiny1604). Less components and same ultra low power consumption in sleep.

  • @jjones503
    @jjones503 4 місяці тому

    Just keep in mind that lowering the clock speed means your sample rating is also affected. You could run into the situation where your sample times are actually longer at lower clock speed therefore running longer than had you left the clock speed alone and for just a shorter period.

  • @naboulsikhalid7763
    @naboulsikhalid7763 2 роки тому

    i SEE A GREAT SKILL OF UNDERSTANDING THE ARDUINO CONCEPT. lOOKING FOR MORE INSTRUCTIVE VIDEOS. THANK YOU FOR SHARING AND MAKING US BETTER

  • @H2ON_MEA
    @H2ON_MEA 10 місяців тому +1

    CLKPR = 0x80; CLKPR = 0x00; // Normal speed for 16 Mhz

  • @MrTalhakamran2006
    @MrTalhakamran2006 4 роки тому +1

    Wow! great technique , never thought of it like that

  • @takerunder6437
    @takerunder6437 4 роки тому +3

    Good work bruh , wondering why this video is not getting more views👏👍

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому +1

      Thanks! This is a video for experts - so kind of small niche ;-)

    • @takerunder6437
      @takerunder6437 4 роки тому

      @@DIYTECHBROS I wish this video get more view as much , so that it can encourage you to do more videos . Never stop this kind of work . We need your guidance.

  • @kychemclass5850
    @kychemclass5850 3 роки тому +3

    Great! Thank you!!! But if you lower the clock settings, how do you restore them on wake up so that you don't mess up Serial comms?

    • @oguzhanergin224
      @oguzhanergin224 Рік тому

      Hi, did you learn this topic?

    • @kychemclass5850
      @kychemclass5850 Рік тому

      @@oguzhanergin224 No. Not yet. (i.e the effect of lower cock speed upon Serial comms)

    • @oguzhanergin224
      @oguzhanergin224 Рік тому

      @@kychemclass5850 Thanks

  • @vuanhminhle6928
    @vuanhminhle6928 5 років тому +5

    This is exactly what I am looking for!!!

    • @DIYTECHBROS
      @DIYTECHBROS  5 років тому

      Great :-)

    • @orthodoxoshellinas6752
      @orthodoxoshellinas6752 5 років тому

      dear sir, i did exactly as you did on the video. but how i will wake up the arduino nano? im using a pir sensor for interrupt, but nothing happens! it doesnt wake up. any solution sir? thank you

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому

      Hi!
      Two questions that will allow us to help.
      1. How does the wiring look?
      2. What does your code look like?

  • @marcelo329524
    @marcelo329524 4 місяці тому

    Hi, I tried this skecth with Arduino UNO (not Arduino NANO). The results are quiet diffenrent. The consumption in sleep mode is just 15% less than running at full speed (16MHz). I think this should also work in UNO? Or am I wrong? (I do not have a NANO to try it

  • @michaelweatherby8648
    @michaelweatherby8648 4 роки тому +2

    Great video, found a discussion on Arduino forum from 2016, this really fills in the gaps. Investigating idea of battery operated lock for hidden wall safe, want to see if I can do 2 factor, biometric lock and maybe some kind of hidden magnetic switch for power activation. Just started concept today and found all the pieces in the Arduino library. What a great ecosystem of stuff....! will check out reduced boot time video

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому +1

      ohh... that sounds really exciting :-)

  • @chimpofm
    @chimpofm 4 роки тому +1

    great video. quick question how would i wake it up using a touch sensor

  • @croydon21H
    @croydon21H 4 роки тому +1

    Can you help me understand what you mean by destroy led than resistor? are you suggesting to either remove resistor or led? What battery you are suggesting to use? 3.7v ? if yes, then it doesnt work with VIN right?

    • @seattledanr5363
      @seattledanr5363 4 роки тому +1

      On the "easier to destroy the LED than the resistor" question, he means, using a heat gun or soldering iron to remove the component is more likely to destroy the LED than the resistor due to the high heat. It's safer to remove the resistor if you ever decide to repurpose the board and reinstall the resistor.

  • @anaselaymach8975
    @anaselaymach8975 3 роки тому +1

    if I put arduino uno into sleep mode does it keep variables values and continue the code instructions using interrupt ?

  • @sezeryal
    @sezeryal 4 роки тому +4

    Vin is NOT 5V, it's 7V+ up to 12V.
    You use Vin and have lower mA because you DOWNCLOCK it with a low voltage.

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому +2

      Hi Sezer!
      The AMS1117 (5V) is, as you are saying, ment to convert down to 5V. But here we are manipulating the voltage to get a lower power consumption on the microcontroller (and a bit lower on the board as well). While we do value all comments, it is also important for our viewers that they are not just based on assumptions but on actual testing.
      Did you test this?
      I have no problems getting the needed power (amps) out of the 1117. And further more, as seen in the video, the Arduino also runs as expected.

    • @sezeryal
      @sezeryal 4 роки тому +1

      @@DIYTECHBROS Ok I understand, it makes sense to lower power consumption but I just wanted to note that Vin= 5V won't work work at same clock as VCC=5V

    • @davidhagstrom9350
      @davidhagstrom9350 4 роки тому +1

      ​@@DIYTECHBROS It makes no sense that involving MORE components (the AMS1117) make the arduino consume LESS power/current. And on your comment above you say that you manipulation the voltage but on the video (0:30) you are clearly stating that you are using 5 volt on the VIN pin (using the AMS1117).

    • @jimchristensen9577
      @jimchristensen9577 4 роки тому

      You are correct, although they are not downclocking it -- they are just running at a lower voltage. When they power through the Vin pin, the actual voltage going to the uC is less than 5V. This is because the linear regulator requires a headroom between the input voltage and output voltage. Even LDO's (Low Drop Out regualators) have some headroom. Lower voltage naturally reduces power consumption in the uC, however, running the uC at 16MHz really needs 5V to have guaranteed reliability. If you reduce the clock speed, then this method is fine.

    • @Ed19601
      @Ed19601 2 роки тому +1

      @@DIYTECHBROS sorry but thats bogus. If you want to have the atmega run on a lower voltage, say 3.3 volt then apply that directly to the chip and bypass/remove the voltage regulator on the board. A comparison between 5 volt on Vin and 5Volt on the 5 volt pin is just odd

  • @oguzhanergin224
    @oguzhanergin224 Рік тому

    thanks, how to wake up again if sleep mode is enabled? I'm using the RTC module and if I reverse the code can the arduino wake up at the time interval I want?

  • @ckechinski
    @ckechinski 4 роки тому +1

    Hi. Thanks for the video! As a beginer, I would like to ask you some questions:
    1 - It is possible to create an instruction that according to the inputs received, the clock of the processor changes up or down, without the necessity to reset it?
    2 - What about the consumption of Nano + NRF2401 + Analog Joystick?
    3 - Do you think that its possible to connect the configuration above in 2x 1/2AA lithium batteries?
    Thanks in advanced!

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому +1

      Hi Cristiam! Seems like you main question is about power consumption? IF you want to go beyond whats in this video, I would recommend having a look at the ATTINY85 (we have a video on how to program it). It will run on low voltage and lower the power consumtion!

    • @ckechinski
      @ckechinski 4 роки тому

      DIY TECH BROS Thanks for your answer. My project consists in one base connected directly on the power supply and a remote station supplied by batteries that needs to wake up when the base send an “activate” signal to it, otherwise it must sleep for less power consumption. I checked about ATTNY85 as you suggested and I think that the Nano can be replaced by this. Thanks! But I read that the RF24 module itself consumes 12mA, so I’m afraid about my batteries... Other question, do you know some small module that has the processor and the radio communication integrated in one circuit?

    • @sambahnan2954
      @sambahnan2954 2 роки тому

      ​ @Cristiam Kechinski Did you find any solution to your problem? I am trying to make a "lock opener" which is contacted to a NFC / RFID scanner on the front of the door. The actual unlocking mechanism is handled by a stepper motor, which should be connected to smth like an Arduino. The issue now is that I also need to power a NRF2401 module and the Arduino itself by using batteries. The whole thing should last at least a couple of months, otherwise it would make no sense at all. I would really appreciate your help.

  • @dontmindme402
    @dontmindme402 Рік тому

    Thank you for the vid, but i do wanna ask if i want to time it for it to wake up in 4 mins and half, how do i add the millisecond

  • @polsoft
    @polsoft 4 роки тому

    @DIY TECH BROS, why you use RST pin? You don't use VIN pin.

  • @zaferaltun
    @zaferaltun Рік тому

    Amazing man!

  • @fech1285
    @fech1285 3 роки тому +1

    Thanks for this great video. I do have a question though. Can this process be done on any Arduino Nano of just for this model? Thanks.

    • @UserName-cb6jz
      @UserName-cb6jz 5 місяців тому

      Yes, it should be possible on all models.

  • @Ed19601
    @Ed19601 2 роки тому

    Are you serious saying that if you feed it on Vin (what voltage?) It consumes 12mA and on the 5 volt it consumes 18mA? Eventhough the x volt on the Vin has to go through a lineair regulator to get to 5 volts?? That seems very illogical unless you voltage you put on the Vin is too low

    • @jrstf
      @jrstf 11 місяців тому +1

      He probably fed 5V into Vin (instead of the required 7-12V), this sent about 4V to the processor which is why current consumption went down. As you point out, it'd be better to feed 4V into the 5V pin so you don't lose 20% of your power in the regulator, which is what he did.

  • @neermud1126
    @neermud1126 3 роки тому

    If in sleep mode can it wake up with an external button press.

  • @fedecherny5476
    @fedecherny5476 3 роки тому +1

    Great video! It really helped me. I have a question, if you remove the voltage regulator, can you power the arduino the Arduino with two Li-Po batteries of 3,7V (getting 7,4V) by the VIN pin? Or it may burn?

    • @matthias5209
      @matthias5209 3 роки тому

      use a voltage regulator

    • @Ed19601
      @Ed19601 2 роки тому

      Remove the regulator and your Vin is not connected to anything anymore.
      Should you put 7.4 volt (in worst case even 8.4 volt) directly on your chip it will go up in smoke

  • @emilmitev9905
    @emilmitev9905 4 роки тому +1

    Hi! Thanks for your interesting videos!
    Can i ask you, how we can use Li-Po or Li-Ion battery to supplying an Arduino Nano?
    I can't find good information, about the best way to use 3.7V battery.

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому +2

      Sure, there are two options.
      Power it on the 5V pin with the battery. As it drops too low you might run into issues, but over all it is usually quiet reliable on lower voltages (until you reach a certain level).
      Alternatively, use a step up converter!

    • @emilmitev9905
      @emilmitev9905 4 роки тому

      @@DIYTECHBROS Thank you very much! Really great channel! :)

  • @simonparker4992
    @simonparker4992 4 роки тому +1

    Nice detail.

  • @PatrickBotz
    @PatrickBotz 3 роки тому

    What temperature for the heat gun is "safe" for removing the resistor? I'm concerned about breaking nearby components.

    • @matthias5209
      @matthias5209 3 роки тому

      just don´t touch them while removing the voltage regulator

  • @ArcanePath360
    @ArcanePath360 4 роки тому +2

    Nice!

  • @jeffbeck6501
    @jeffbeck6501 2 роки тому +1

    Perfect

  • @Weesy
    @Weesy 4 роки тому +1

    how can i wake it up, when the arduino is in deep sleep mode?

  • @sameerk12982
    @sameerk12982 4 роки тому +2

    Thank you very much Tech Bros for such an informative tutorial........learned a lot.

  • @Antz_411
    @Antz_411 7 місяців тому

    This works great if you never want the Nano to wake up again...

  • @Sparklift
    @Sparklift 3 роки тому

    Very useful video. Thanks

  • @somerandomvideos645
    @somerandomvideos645 5 місяців тому

    why do you need remove voltage regulator for a sleep mode?

    • @UserName-cb6jz
      @UserName-cb6jz 5 місяців тому

      The regulator ITSELF uses a few milliamps without any current being output from it.
      That's why.

  • @duketheduke390
    @duketheduke390 4 роки тому

    This is great!!!

  • @andytren9498
    @andytren9498 5 років тому +1

    Too low power 0.3mA but no show led on for 1sec, and led off for 10sec?

    • @DIYTECHBROS
      @DIYTECHBROS  5 років тому

      Hi Andy! Not sure I fully understand your question? :-)

    • @vuanhminhle6928
      @vuanhminhle6928 5 років тому +1

      I think he would like to say "put the Arduino into sleep mode in 10 seconds and then wake it up and turn on the LED in 1 second, in each loop". 😁

    • @DIYTECHBROS
      @DIYTECHBROS  5 років тому +1

      Thanks Vu Anh Minh Le!

  • @kleberzeitounian
    @kleberzeitounian Рік тому

    Muito bom, parabéns.

  • @user-ur9qq8us4y
    @user-ur9qq8us4y 4 роки тому +1

    If I want to connect sensors to my Arduino and also want them to be low power, what would be the best way? Would it make sense to switch their power in off with a Mosfet or Transistor while the Arduino is in sleep Mode?

    • @DIYTECHBROS
      @DIYTECHBROS  4 роки тому +2

      Hi Tim! Many sensors have a power down mode or a sleep mode. So if possible, that is often a good option. Otherwise a transistor is a good option, or MOSFET is the power consumption requires it!

    • @user-ur9qq8us4y
      @user-ur9qq8us4y 4 роки тому

      @@DIYTECHBROS thank you very much 👍

  • @roboticsguyy
    @roboticsguyy 5 років тому +2

    This video made me smile! I'm trying to build a 4-button RF remote control with Atmega 32p-pu (Arduino uno) and I need it to last 6 months off of two 3V coin cells. This video MAKES THAT POSSIBLE! THAANK YOU!!!
    Ps: I have 1 million questions to ask you on that very project, I don't want to be a bother...But Can I email them to you?

    • @DIYTECHBROS
      @DIYTECHBROS  5 років тому

      Perfekt :-)

    • @DIYTECHBROS
      @DIYTECHBROS  5 років тому

      One tip that can be an option for your project is the HT12D and HT12E RF modules!

    • @roboticsguyy
      @roboticsguyy 5 років тому

      @@DIYTECHBROS Woah. I just googled it... Can it replace atmega itself?

    • @DIYTECHBROS
      @DIYTECHBROS  5 років тому

      On the sender, yes :-) There are 4 inputs that can be transmitted to the receiver (decoder) that in turn can be read by an Arduino. That way you can skip the Arduino on the sender (encoder). If you can skip the Arduino the on the receiving end is depending on what you are doing with the data. Best of luck, and just ask any questions if there are any problems!

    • @roboticsguyy
      @roboticsguyy 5 років тому

      @@DIYTECHBROS Basically in my project, I want to transmit the state of 4 separate buttons over a short distance (300cm tops). It will be a controller for a simple emergency vehicle siren system. At the receiver I will control the lights and sirens using relays depending if the button on the controller is on or off.
      I see simple RF remotes last 1 year +...I need mine to last that long. Can a HT12D and HT12E serve as transmitter and receiver in this project?
      Can I interface the HT12D with an nRF240L?
      Lol I just gave you a ton of work

  • @DIYTECHBROS
    @DIYTECHBROS  5 років тому

    You can also save power by reducing the time your Arduino spend restarting. Have a look at our other video: ua-cam.com/video/lsa5h2tVM9w/v-deo.html

    • @DIYTECHBROS
      @DIYTECHBROS  5 років тому

      On a side note: using higher value resistors and using active low instead of high will also increase battery life.