Voltage drop at Arduino project with HC-06 + 4 Motors + 2 LD293DNE

Hi

I have built a project with Atmega328 to control 4 motors using bluetooth HC-06. This project controls a car with four motors using a phone via the bluetooth interface (well known project with different versions).

My schematic is attached. A picture about the PCB is also attached.

I’m using a Serial terminal app from my phone to communicate to the HC-06. Think about two signals that I’m sending ‘F’ to move the car forward and ‘S’ to stop the car.

Code simply looks like:

void loop() {
 if(btSerial.available() > 0){     
 inputFromSerial = btSerial.read(); 
 }
   
 if (inputFromSerial == 'F') {
 MotorMoveForward();
 }        
 else if (inputFromSerial == 'S'){
 MotorStop();
 }
}

I have a problem with the project. There is a voltage drop which cases the Arduino to reset. I have done different experiments.

  1. First experiment: voltage drop when I connect the PCB to 12 volt power supply.
    Instructions:
    1.1) Connect the power supply to the PCB
    1.2) HC-06 blinks
    1.3) I open the app in the phone, connect to the HC-06, the phone is connected, the HC-06 stops to blink (an indication that it is connected)
    1.4) I send the ‘F’ character to the Bluetooth, the motors move forward for a fraction of a second and then the motors stop moving. The HC-06 disconnects.
    1.5) I connected and oscilloscope to the different points in the PCB. Marked with red arrows in the schematic and are numbered from 1-3. See pictures from the osciliscope for the three different cases. As you can see, there is a voltage drop on the main power supply input, but also on the 5V wire which is the output of the voltage regulator.

I don’t know what is the reason of the voltage drop. It causes Atmega to reset.

  1. Second experiment: connect the PCB to 9V rechargeable battery.
    In this case, when I perform exactly the above steps, but when I send the ‘F’ character to the HC-06, the four motors move forward for few seconds (lets say 5-10 seconds) but then the Arduino get reset and I loose connection with the HC-06 and the motors continue to move forward.
    If I want to stop the motors, I have either to disconnect the battery, or connect again to the HC-06 and then send the ‘S’ (Stop) character. Only then the motors stop moving.

The reason I’m confident that there is a reset in the Atmega is that I programmer the microcontroller to beep on the buzzer at the setup stage, so whenever there is a reset, I hear the beep from the buzzer indicating the microcontroller reset pin went down.

As I said earlier, I confirmed that on the oscilloscope. The voltage drop causes the reset.

  1. Third experiment: I isolated the impact of the HC-06 so I programmed the Atmega to move the motors in a loop and checked whether it will reset. But it DID NOT.

Here is a psedo code:

void loop() {
        // Move forward 
 MotorMoveForward();
 delay(500);
 MotorStop();  
 delay(1000);    
        
 MotorMoveRight(); 
 delay(500);
 MotorStop();   
 delay(1000);    

 MotorMoveLeft();
 delay(500);
 MotorStop();  
 delay(1000);    

 MotorMoveBackward();
 delay(500);
 MotorStop();   
 delay(1000);
}

and the car worked flawlessly. for about two minutes it continued to move forward, turn right and left and move vbackwards, exactly as expected, without any disconnects, till I switched the 9V power off.

So I’m confused why I’m getting the voltage drop when I communicated with the HC-06. What would be in the HC-06 communication that causes the voltage drop? Is it really the HC-06? or there is something wrong that it doesn’t manifist when I run the project automatically, but for some reason, that I don’t know, the problem becomes bigger when HC-06 communication is involved.

Couldn’t it be related to the fact that I’m triggering some delays between the moves, is the reason that it doesn’t disconnect?

I tried adding extra 10uF capacitors in addition to the 100uF. didn’t work. I added couple of them. It didn’t work.

I replaced the two LD293DNE with other ones (thought they might be corrupted), but same probelm.

Is it a problem of reverse current? Isn’t the LD293DNE assumed to protect the circuit from backward current?

any advice is much appreciated.

Thanks in advance

3.png

You didn't post any information about the type of motor, but suffice it to say your various power sources are totally
inadequate (and by extension I suspect the 293 will cook itself quickly if the power was adequate).

Even the tiniest motors pull lots of current, an amp or so isn't uncommon, and as motors get bigger the
stall currents rise to 10A, 100A, and more.

You should be powering the Arduino separately from the motors anyway, power rails driving motors can
get nasty voltage spikes on them destroying all the logic chips, not to mention the voltage drop-outs you
are seeing.

10µF won't do anything for a motor supply, think 10,000µF or more to make any meaningful difference
since the current levels are very high. Even 10,000µF at 12V can only store less than one joule of energy.

Hi

I’m using 4 simple yellow Micro DC motors. See picture attached.

Every two motors are driven by L293D. See schematic attached.

Every one of the motors consumes ~100mA current.

When I communicate with the bluetooth module, and the motors start running, I see the voltage drop.

The source voltage (9-15V) is connected to a 5V volatage regulator (LM7805) which is connected to the power of the Atmega (so it is true that I’m powered the 4 motors and the Atmega with the same power supply, but the Atmega is at 5 volt coming from the voltage regulator.

As I mentioned, when I run the motors there is a big voltage drop which causes the Atmega sometimes to reset.

Any idea how to solve the issue?

Thanks

dkaiss:
Every one of the motors consumes ~100mA current.

Yeah right...
That might be the free-running current, which is irrelevant.

What matters here is the current they draw from a stand-still, the stall current.
An educated guess, with a 12volt supply and those ancient 293D chips...
Could be 1Amp or more per motor.
Your 12volt supply should have been capable of delivering 5Amp.

Stall current of the motors is of course lower with a 9volt supply, but...
You use an ancient 7805 for the Arduino, which needs at least 2-3volt overhead to work.
Any dip in the main supply below ~7volt will also show a dip the 5volt output.
A modern LDO (low drop-out) regulator would do better there.

Try a battery pack made with rechargeable AA batteries (6-8).
Leo..

I measured the total Amper for the 4 motors inlcude the microcontroller. Overal it is ~900mA. These motors consum ~150 mA each. Not that much. I don't think it is the current limit. My power suppy cable supports 2A max current so this shouldn't be the source of the problem.

Please notice that the voltage drop is INSGTANT, meaning that when I run the motors, there is an instant drop in the voltage and then is it back up again.

What is the reason for this instant voltage drop and how can I minimze it?

This instant voltage drop brings the reset pin of the microcontoller to reset.

Regards

You have already been told twice why the voltage drops when you start the motors!

Paul