Tuesday 12 July 2016

microcontroller - Battery powered Arduino on a breadboard


I am trying to run a low-power, battery powered Arduino on a breadboard. I followed these instructions exactly:



https://www.openhomeautomation.net/arduino-battery/


I uploaded the "Blink" sketch to the ATMEGA238P-PU from another Arduino then I installed the chip on the breadboard and connected all the components exactly as described. The led is off and not flashing. See the image below:


Battery powered Arduino on a breadboard


Things I already tried:



  • Had the ATMEGA + led + 220 ohm resistor installed on the Arduino Uno board. The led starts blinking as expected, the ATMEGA chip itself is functioning as expected.

  • Connected the led + 220 ohm resistor to VCC and GND. The led lights up which means both the led and the resistor are in good shape.

  • Swapped every component out with another identical one, one at a time. That did not help.


What else can I try to track down the problem? If anyone has any suggestions, it would be greatly appreciated!




Answer



One explanation could be the following:


Using an Atmega 328-PU with a 16MHz crystal on a 3 volt supply is out of spec. If you take a look at figure 29-1 the ATmega 328p datasheet on page 303 you'll see the maximum frequency for the MCU for a given Vcc.


Also keep in mind that the voltage of the batteries drops of quickly after losing some charge, pushing the the maximum frequency further down.


The manufacturer defines these limits to make sure that every chip sold will always function correctly while allowing some tolerances on their production process. Some chips will work perfectly onder these conditions, for example the one the author of the instructions has. Some others will not. Or worse, and some will have intermittent problems.


To confirm this, you could swap the battery for a stable 5 volt supply and see if your sketch works. E.g. stick the wire where the battery should be in the Vcc and GND of your UNO board with the USB connected.


Anyway I would never advise to build any embedded project using an MCU out of spec. A simple solution could be to use 3 batteries and operate the MCU at 4.5 volt. A less simple solution but a more robuust one is to use a voltage regulator.


-Max


No comments:

Post a Comment

arduino - Can I use TI's cc2541 BLE as micro controller to perform operations/ processing instead of ATmega328P AU to save cost?

I am using arduino pro mini (which contains Atmega328p AU ) along with cc2541(HM-10) to process and transfer data over BLE to smartphone. I...