External Power Causing Sensor Issues

I have an arduino nano with 7 - Pololu Carrier with Sharp GP2Y0D805Z0F Digital Distance Sensors. I am powering the sensors via the 5V Output from the nano (initially had them on the external power supply).

When the board is hooked up to USB power everything works fine. When the board is connected to external power the sensors randomly false trigger. I have tried 5V - 6V and 7V in to the Vin of the board (multi voltage power supply) and tried a different power supply all together.

Even tried different sensors same issue.

Any idea what could cause this issue?

The voltage regulator on the Nano is quite small and can struggle to supply power to external devices. It would be worth trying the sensors with an external 5V supply- if they work fine then you know where the problem lies.

Sorry, I guess I did not explain it clear in my first post. I did try two different power supply's to the sensors directly and had the same issue. The only time the issue goes away is when I power the sensors through the nano and via USB power......

Ok, sounds like you need to share your wiring diagram and code with us.

Interestingly, if I cut a usb cord and connecting the external power supply to it (red and black) and then plug it into the USB port on the arduino, it works fine..... I will draw a schematic and share my code shortly.....

I have attached a basic schematic and the code my students wrote. As I said before, if I power the Nano via a computer USB port or a cut USB cable and connect it to a power supply there are no issues. If I power the Nano through Vin the sensors randomly false trigger, especially the sensors on pins 11 and 12. I did try powering the sensors directly from a 5V power supply and the issue still existed. (yes I connected the grounds :smiley: )

The sensor I am using is the Pololu Carrier with Sharp GP2Y0D805Z0F Digital Distance Sensor 5cm: Pololu Carrier with Sharp GP2Y0D805Z0F Digital Distance Sensor 5cm

There is a red light on the back of the sensor that flashes when it is triggered. Watching that red light and the serial monitor, I can see the false triggers.

Thanks,

SkeeBallBallSensorCode.txt (4.47 KB)

lotsoffear:
I did try powering the sensors directly from a 5V power supply and the issue still existed. (yes I connected the grounds :smiley: )

Damn, that was going to be my first question if I coudn't see anything glaringly obvious :slight_smile:

For future reference, can you have a look at point number 7 in this thread- it shows you how to include code in the post itself so we don't have to download it.

Your schematic looks ok. I did notice this in the FAQ section on the Pololu page for the sensors:

Q) This sensor isn’t behaving as I expect: I’m getting intermittent detection much farther than the q) maximum range of the sensor and it’s not detecting objects within the advertised detection range. What’s wrong?
A) Issues like this can be the result of power supply problems, especially since this sensor draws power in short, large bursts, so make sure your power supply is capable of delivering the necessary current. If you experience this problem, try adding a 10 µF or so capacitor across the sensor’s power and ground near the sensor; this compensates for an inadequate power supply and typically restores normal functionality.

I'd start by adding the recommended capacitors.

So... I put a 10uf 50V capacitor across the power line feeding all 7 of the sensors (they were all in close proximity) and it reduced teh false triggers by 1/2. I dug out my old electronics text book and after a bit of digging found that for the voltage and number of devices I was buffering the power for that a 100UF would be better. I replace the 10 with the 100 and get no false triggers at all.

I imagine that if I placed a 10UF capacitor at each sensor (all would have been across the same power wires) it would have the same effect and probably done just as well.

So this works but I am still curious why there was no issues when powering the Arduino and sensors via the USB jack....hmmmm....

BJHenry, thank for your assistance and next time I will include the code in the post.

No worries at all, I'm glad the issue was sorted out in the end.