Powering Arduino Board

Hi all

I have the following components (Arduino Uno, two DC motors , three Ultrasonic Sensors, L298N module) , I want to connect them together. First I connect each motor to the A and B connections on the L298N module. Next, I connect battery (8 v) - the positive to 12V pin on the module and negative/GND to GND pin on the module. I connect +5V and GND pins of each sensor to +5V and GND pins of Arduino board. I fed up Arduino from 5v and GND pins of the module. ENA & ENB of module to PWM pin of Arduino. IN1 , IN2 , IN3, IN4 of module to 20-24 Arduino pins. But when I run Arduino the sensors don’t work normally and they result unstable readings, but when I just connect the Arduino board to the PC by USB cable without change any of pervious connections, the sensors and motors work good and normally. So, What is the problem ? Any advices about connection the components?

Thanks a lot and sorry for bad english

How about a drawing? I can't picture all those connections. Also need to see the sketch you're running. Could be a missing Gnd between power supplies as well.

thanks a lot CrossRoads

the drawing of components connection in the attachment.

Drawing.pdf (484 KB)

One question, when you plug usb do you disconnect batteries?

Looks like discharged batteries problem. Can you charge them?

Where is the Mega getting its power from? You said: "I fed up Arduino from 5v and GND pins of the module." So it gets 5V from the motor module?

mart256: One question, when you plug usb do you disconnect batteries?

Looks like discharged batteries problem. Can you charge them?

No I don't disconnect batteries when plug usb . And also the batteries are full charged.

CrossRoads: Where is the Mega getting its power from? You said: "I fed up Arduino from 5v and GND pins of the module." So it gets 5V from the motor module?

Yes I fed up Arduino from 5v and GND pins of the module. Is that wrong ?

You are sending your 5v from the stepper board to the Vin which goes to a 5V regulator. There is not enough voltage going into the regulator, so you are getting maybe 4.3V out.

You have several options, but the best is to send battery power to Vin of the mega.

Please get back to us if it works.

Robert

rcorr: You are sending your 5v from the stepper board to the Vin which goes to a 5V regulator. There is not enough voltage going into the regulator, so you are getting maybe 4.3V out.

You have several options, but the best is to send battery power to Vin of the mega.

Please get back to us if it works.

Robert

thanks a lot Robert

but the battery power that used to fed up motor board is about 16v and if I use it to fed up the Arduino Vin I am afraid that may damage the Arduino.

So, could I fed up the Arduino board with another battery (9v) ?

The other option is to take the 5V out of the stepper board and send it to the 5V of the mega board. It will work but do not make any mistakes, over voltage will damage when connected to the 5V of the mega.

Did You resolve your problem ? I got the same problem with almost identical setup ... all works fine when the USB is connected but when unplugged sensor readings are wrong and the motors not working wright either ...

any advise guys ?