986/5000 first steps with battery node



  • As the title suggests, I am starting to take the first steps to develop some battery-powered nodes, and I started with some work already done found here on the forum.
    I have some Atmel 328P barebones on which following this:
    link text
    procedure and with an arduino Uno and Arduino IDE, I managed to burn an 8Mhz Bootloader with internal oscillator, and to load a simple scketch of a motion sensor, which should work on battery power, and during sleep, it has an absorption of 0 , 19mA (maybe a little high ???).

    At this point reading this discussion: link text

    it reads that I should set the fuses in order to disable the BOD, which if I understand correctly serves to make my circuit work even with lower voltages !!
    Someone tells me the precise setting that I have to give, so I modify my fuses with AVRDUDESS ???

    Then another thing, when I connect the serial monitor through my arduino Uno that I use to load the sketches I get this Why ???
    IMG_20200613_164614.jpg



  • @sindrome73 said

    Then another thing, when I connect the serial monitor through my arduino Uno that I use to load the sketches I get this Why ???

    Probably you have not set the correct baud rate for the device you are connecting. If it is 5V then usually it is 115200 and if it is 3.3V then it should be 38400.



  • Turning off BOD will save you ~25 µA. AFAIK, if you are going to use MySensors, this is automatically handled in software for you. It turns BOD off before it goes to sleep, which keeps the current consumption low, and reactivates it on wake, which ensures stability.

    I wouldn't recommend messing with the fuses manually right away, if it's not neccessary. If something goes wrong or you accidentally set the wrong bit, you risk "bricking" your MCU, which might only be recoverable using a high voltage programmer. Anyway, here's a fuse calculator in case you may need it.

    I recommend making yourself familiar with the megaAVR datasheet if you are diverting away from preconfigured Arduinos - it also includes expected current consumptions (see chapters 29, 35) . Nick Gammon has a great guide regarding power consumption, making the topic far more accessible for beginners.

    Regarding your serial issues: A baud rate of 115200 is rather high for an 8MHz ATmega328P. Try setting it to 57600, 38400 or even as low as 9600. Both in the code and the serial monitor - they have to match up!



  • For manipulating fuses I use the minicore board definitions by mcudude( Google for the GitHub) in Arduino IDE. It's really nice to be able to set the BOD level. It's also handy when writing to atmega 328pb if you try that in the future. One of the big things drawing current is the analog converter. Disabling it saved quite a lot if I remember correctly.

    What is the current draw of the sensor itself?



  • @niclas said in 986/5000 first steps with battery node:

    le defi

    currently the node absorbs 19mA, it seems a bit high !!
    As a motion sensor I am using an sr501, without removing the voltage converter on board !!
    If you can give me some more info on Minicore and how to disable the analog converter ??



  • @sindrome73 Like @BearWithBeard wrote, reading Nick Gammons guide is a must! I read it and used most of the stuff in there when I was making my battery node. The analog converter is super easy to turn of, ADCSRA = 0 does it. It's also in the guide by Gammon.

    Regarding the Minicore definitions, see here: https://github.com/MCUdude/MiniCore
    Just follow the "how to install" and when it's added in Arduino IDE you select the relevant options in the Tools menu under "board". Then select your programmer (also in tools menu) and finally "Burn bootloader".

    Edit:
    Did a quick google on the sensor. Found this: https://www.iot-experiments.com/pir-sensors-hc-sr501/
    I just took a quick glance but it seems relevant.


Log in to reply
 

Suggested Topics

  • 5
  • 10
  • 13
  • 5
  • 14
  • 1
  • 1
  • 11

211
Online

9.6k
Users

10.2k
Topics

106.2k
Posts