IR and Ultrasonic doesn't work while using external power supply

I'm a junior high sudient using a arduino uno for a selfdriving car competition but when I use power out for IRsensor ( TCRT5000 using 5v) and Ultrasonic (HC-SR04 3.3V) also 4 logic output(L298n without pwm) on arduino it doesn't work ,I'm guessing it's over the max current (40mA) of arduino so I use another battery to power the sensors but its not working at all

I'm a newbie please help

a sketch of my sollution but it doesn't work

The external power supplies grounds must also go to the Arduino ground.

Electronic circuits are "circular". There must be a return to the processor for the outgoing signal.

so it means that I must use the arduino power out?

No, connect the battery grounds to the Arduino ground. Blue line.

External power supply (battery) grounds must go to their respective device grounds and to Arduino ground.

1 Like

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