Ultransonic distance sensor (HC-SR04) power issue

I am trying to use a HC-SR04 ultrasonic distance sensor, however whenever I plug the project into my IMac it shuts off all power to the project and says usb power disabled. I have tried this online in tinkercad and it works fine please does anyone know hove to solve this issue.

The project has a wiring or design error and is drawing far too much current from the USB port. You will need to fix the wiring or design error.

2 Likes

Post your tinkercad schematic

What else is connected to your project?


This sketch is basically the same as my real life project but instead of Arduino nano it uses an uno r1. this works perfectly but my real life project doesn't, the code is the exact same as well as the wiring.

Ignore the below; corrected by @jim-p
Need new glasses :frowning:

I'm not sure if I can follow the "schematic". The HC-SR04 seems to be connected to the second horizontal row. As a result all pins of the HC-SR04 are shorted (including Vcc and GND of the Arduino).

I'm not sure how you managed to get extra connections in the holes of the breadboard.

You will have to move the HC-SR04 one row down .

See e.g. How to Use a Breadboard - Thimble.io Online STEM Classes with the below image


The bus strips go all the way from the top to the bottom; on long breadboards there can be an interruption halfway.

It's not, look real close.

1 Like

Classic nano or one of the other nanos?

yep just a classic Arduino nano

If you disconnect the led and sensor can you download and run the blink example code?

Yes I can and I've experienced no issues with the Arduino itself, only the previously mentioned power issue and I've tried multiple distance sensors and they both have the same issue.

If you have everything connected exactly as shown in your picture it should work.
You don't by chance have the HC-SR04 pointing in the other direction like this?

Yes that is how I've arranged my distance sensor.

If you also did not change the wire connections, then you may have it wired backwards
You may have GND connected to arduino 5V and Vcc connected to arduino GND

no unfortunately that's not a problem as I have wired It correctly and it works perfectly online but not in real life even though the code and wiring is the same.

Either there is a short circuit somewhere or there is a problem with your mac.
Try moving the sensor to a different place on the breadboard
If still a problem , try powering the nano with a 9V battery or a 9V or 12V adaptor connected to Vin and GND

Amazing it works now after I moved the sensor because in the project all the pins of the sensor were short circuited together and I had just been a bit stupid and not seen it. anyway thank you for the help

Glad you found the problem.
Have a nice day!

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