1

I worked on an Arduino project for school that was a self-driving security robot that also acted as a smart home system.

It was essentially a self-driving Roomba-like car that included several LED's(resembling home appliances), three distance sensors, an LCD screen, a motion sensor, an audio amplifier with a speaker, an SD card module to store .wav files, a Bluetooth module to connect with MIT App Inventor, and a motor driver that controlled two electric motors. It's a long list of modules so the Arduino Mega was required. When assembling all of these modules and building the code, I would perform intermittent tests that would isolate the obstacle avoidance and driving, turning on appliances(LED's), and sending and receiving data from the phone app. Every aspect of the project worked in isolation until I combined everything.

When everything was combined, instead of simply driving forward until an obstacle is detected as its programmed, the car would jitter around and not react to walls or obstacles. Also, the LCD screen was heavily dimmed as opposed to when the Arduino was running off of laptop power. Especially when the phone app called for turning on heat or AC, the proper LED's would turn on, but the whole system seemed to respond to the initial load required to read a .wav file and play the corresponding audio and made the jitter worse.

So my question is this, with all these modules plugged into an Arduino, is it possible that the number of modules all needing some input from the digital pins has highlighted a current limitation? All of these issues were exacerbated when the laptop power was replaced with a 9v battery. I was able to confirm that the code was not the issue as I would simply comment out major portions but leaving all the pins initialized. Also, if there is a current output limitation, is there any way to explain why? Thank you for reading my lengthy post and for giving feedback. enter image description here enter image description hereenter image description here

6
  • what kind of a 9 V battery are you using?
    – jsotola
    May 8, 2020 at 6:38
  • Is the battery one of these 9V block batteries, that are also often used in smoke alarms? You cannot use these batteries, since they are not able to provide enough current. They are for low power applications. And how are all the modules and motors powered? All through the Arduino 5V pin?
    – chrisl
    May 8, 2020 at 6:40
  • It's a 9v block battery, I did some research and found a simple connector that was apparently made for Arduinos. Actually, I thought that maybe it didn't supply enough current initially, so I jumped two of these 9v batteries in parallel with one another hoping to boost the current output. All the modules I listed are powered via the 5v pin I connected to the breadboard and the digital pins do all of the driving and data stuff.
    – Jared M
    May 8, 2020 at 6:46
  • 1
    a 9 V block battery consists of six AAAA cells ... try using six AA or six C cells
    – jsotola
    May 8, 2020 at 7:04
  • 1
    All the way through this essay I was thinking "It's a 9V battery... it's a 9V battery..." ... and it was.
    – Majenko
    May 8, 2020 at 10:33

1 Answer 1

2

As mentioned in the comments, you cannot power your robot from a 9V block battery. These are made for low power projects (like a smoke detector) and cannot provide enough current to drive even only the motors correctly. Using 2 of them does not really help much. You need to change to a different battery type. If you want to stay with alkalines, you could use six AA batteries or C cells, like jsotola suggested. But you might want to upgrade to a fitting LiPo/LiIon battery (in combination with a fitting battery charger module). That would give you enough power for all your needs, while being rechargable.

A different issue: It seems to be, that you provide all the components (sensors and motors) with power through the 5V pin of the Arduino. But especially with motors you can easily reach the current limitation of the voltage regulator on the Arduino. When drawing more current through it, than recommended, the regulator will go in emergency shutdown (with a genuine Arduino; with the cheap clones, the regulator will melt and be destroyed).

Instead you need to be sure, that the drawn current does not exceed the maximum current for the voltage regulator (depends also on the voltage provided). At least the motors should be provided with power parallel to the Arduino, so that the motor current will not flow through the Arduino. It is unclear, how you are controlling the motors. If you are using a motor shield, then look for the terminal for external power supply on it. Most motor shields have them. Depending on the batteries, you will use in future, and on motors and shield, you maybe an directly connect the battery voltage to the shield. Or you need to buy an extra (switching) voltage regulator, which brings the battery voltage down to 5V. In that case be sure, that the regulator can provide the needed current plus some overhead clearance.

1
  • Thank you for your input, I included details about the motor driver, not the motors themselves. The motors have their own main power source, an array of 4 AA batteries. It's the Arduino's digital pins that were driving the motor driver.
    – Jared M
    May 8, 2020 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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