1
\$\begingroup\$

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!

\$\endgroup\$
8
  • \$\begingroup\$ What pin were you connecting the LED to on the Arduino board? \$\endgroup\$
    – user39382
    Jul 23, 2016 at 22:16
  • \$\begingroup\$ I am connecting the led to digital pin #13. I made sure the positive/negative side are correctly positioned (longer side goes to +) \$\endgroup\$ Jul 23, 2016 at 22:20
  • \$\begingroup\$ Assuming everything in the circuit is wired correctly, have you checked the polarity of the battery pack? Additionally, in the past I've gotten those flexible wires you're using and about 1/3 of them were open circuits when I continuity checked them due to left over resin on the connector tips. \$\endgroup\$ Jul 23, 2016 at 22:36
  • \$\begingroup\$ @NaderChehab - Do you have a multimeter, with probes which have small tips? \$\endgroup\$
    – SamGibson
    Jul 23, 2016 at 22:38
  • \$\begingroup\$ Wow, 1/3 is a lot. On my way to buy a multimeter to check every wire. Will report back. Thanks. \$\endgroup\$ Jul 23, 2016 at 22:39

2 Answers 2

2
\$\begingroup\$

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

\$\endgroup\$
3
  • \$\begingroup\$ That was it! Adding a 3rd battery fixed the problem. You saved me several more hours (or days) of headaches. Much gratitude for the detailed answer! \$\endgroup\$ Jul 24, 2016 at 14:49
  • 1
    \$\begingroup\$ This is not surprising - however we don't actually know if it was failing to run at that slightly out of spec clock rate, or if it was refusing to run based on the typical brownout detector fuse setting of default Arduino board configurations. \$\endgroup\$ Jul 24, 2016 at 16:32
  • \$\begingroup\$ You are right Chris, it could also be the BOD. I read somewhere that the BOD fuse is set to 2.7V for Arduino. So two 1.5v batteries running empty will cause the BOD to keep the MCU in reset. Anyways, I'm glad your problem is fixed! \$\endgroup\$ Jul 26, 2016 at 7:51
3
\$\begingroup\$

Here's a photo of a minimal ATmega328 on solderless breadboard (this is equivalent to an Arduino Pro Mini or an Arduino UNO without the USB interface):

enter image description here

Note the small 0.1uF ceramic capacitors, with very short lead lengths, placed as close as possible to both of the VDD-GND supply pins of the ATmega328. Also note that after I cut the resistor and capacitor leads, I recycled the bare wire trimmings as short jumper connections elsewhere on the board. Longer wires add inductance, and these solderless breadboards already have a lot of unwanted inductance to begin with.

On your board, I don't see any 0.1uF ceramic bypass capacitors near the IC - only a large bulk Al electrolytic where power enters the board. Missing those 0.1uF bypass capacitors can cause a lot of weird problems on digital ICs. Whenever any of the internal transistors switch on or off, the current in both VDD and GND changes. This change in current, together with the inductance of long wires, causes the supply voltage to (very briefly) go out of spec.

Usually I try to avoid using solderless breadboard, due to the parasitic inductance and somewhat unreliable connections... in this case I had already prototyped a design using the Arduino Pro Mini board, and was designing a PCB around that circuit. But since my PCB was going to be custom built with blank ATmega328, I needed to verify that I had tools and equipment to initialize blank ATmega328 chips.

\$\endgroup\$
1
  • \$\begingroup\$ Thank you for the detailed info, will look into hooking up 0.1uF ceramic capacitors as close as possible to VCC-GND. \$\endgroup\$ Jul 24, 2016 at 14:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.