Arduino running as expected only with battery and USB conection

I have been making a car with ultrasound. I use 2 Li-ion batteries of 3.7v (when measure both added up to 7.34v) And the Arduino turns on and starts the program, after it uses the Ultrasound module it seems to become stuck, I have made some test and the Ultrasound measures as expected. The program Only fully runs when connect via USB to my computer. Making some voltage measurements, I found out that the USB adds approx 0.49v (total of 7.83v)

Self-Driving-Car/CAutoMove.ino at main · CopyGameplays/Self-Driving-Car · GitHub it stops at line 22 and skips every "if statement" till line 64

Interesting, and welcome. Your eye sight is much better then mine so you need to tell us what is there. In the language of electronics post an annotated schematic showing all the connections you made, power, ground and power sources. Also include links to each of the hardware devices that give technical information. I would guess you do not have enough power.

The Arduino cannot supply power to the motors thru the +5v pin from the batteries without overheating on on board voltage regulator. The USB can supply 10x the current, so it can drive the motors.

1 Like

I am using a key studios pack multi function self-driven car pack, I followed these connections in their tutorial page File:超声波-1.png - Keyestudio Wiki
File:Ks0192-pro9 原理图.png - Keyestudio Wiki
(edited with the scheme of connections and the right link)

Regardless of what there instructions state madmark2150 is correct you cannot drive motors or much of any load with the Arduino 5V. You might want to contact keyestudion and ask where they got there arduino.

That's why the batteries are connected to the L298N motor driver.

We can keep playing guessing games but it would be best if you posted that annotated schematic. Be forewarned that the L298N is an obsolete driver and does damage to your performance by burning about 2.5 volts of your motor current as heat.

1 Like

List of Components:
keyestudio UNO R3
keyestudio Shield V5.1
keyestudio L298N Motor Shield
keyestudio Bluetooh HC-06
HC-SR04 Ultrasonic Sensor
Servo Motor (unsure witch model)
Mental Motor (also unsure)

Scheme of the circuit:

Also tested if using an extra 3.7 battery helped and it didn't

Sorry part of the drawing is fuzzy and not readable, also the links do not work and how is the arduino powered? Also show the sensor shield connections. How much of this have you had working?

1 Like

Thanks you. You made me take a look at the electronics and to make the scheme, and made me notice that the power wasn't running fully to the Arduino, so I made a secondary power source for the Arduino (also 7.4v). Thank you for your time, now I just need to fix my code because is left and right are inverted (ops).

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.