Problem when Joystick's 5v and Ground is connected to an Arduino Mega 2560

Hello. I am trying to use two HW504 Joysticks to control multiple servos. The Arduino Mega 2560 can power all of the servos just fine but when I add the Joystick/s to the load, the Arduino light saying it's on fades out. This also happens when none of the servos are attached to the power and only the joysticks are.

Attached is a gif of me plugging the 5v and ground wires into the left side of the breadboard where the wires to the joystick are plugged in, then plugging it into the right side where the servo wires are and it working(based on the lights).

On the joystick, it reads 5v+ on one of the pins so I may need a higher voltage.

Any help is appreciated!

gif2.gif

I didn't watch your video, but what you describe sounds like there is a short through the joystick. What kind of joystick is it? Does it have any documentation?

Delta_G:
I didn't watch your video, but what you describe sounds like there is a short through the joystick. What kind of joystick is it? Does it have any documentation?

It's an HW504/PS2 Joystick, and this is some documentation I found on it.

I hope this is what you need. :slight_smile:

Well if you've got it connected like it is in the picture there then it shouldn't be a problem. Maybe you have a bad joystick.

Can you provide a schematic of what you have? Hand drawn is fine. If you insist on one of those silly fritzing things then at least make sure it is accurate. Don't give it to me and then tell me that actually this is not the same or that but you couldn't find the part or whatever. Make it really what you have. Or really, just draw it out and attach a picture of it.

Delta_G:
Well if you've got it connected like it is in the picture there then it shouldn't be a problem. Maybe you have a bad joystick.

Can you provide a schematic of what you have? Hand drawn is fine. If you insist on one of those silly fritzing things then at least make sure it is accurate. Don't give it to me and then tell me that actually this is not the same or that but you couldn't find the part or whatever. Make it really what you have. Or really, just draw it out and attach a picture of it.

Here you go. Sorry if the picture is bad and sorry that the schematic I made is bad. But I hope it helps.

OP's image where we can see it.

All those servos are powered from the Arduino? That's your problem. You can't pull that kind of current through the 5V pin. You're lucky it still works at all.

Servos need their own power supply.

If that's not what the picture shows, then I want you to sit and think about how you might take the picture differently where it is easier to see. I mean at least try to lay it flat and get over with a camera and put some light on it. Try just a little here and I'll try to help you.

I did not know that. So is it confirmed that the joysticks are shorted out or how can I check?

fierymoto:
I did not know that. So is it confirmed that the joysticks are shorted out or how can I check?

Are all the servos powered from the Arduino 5V pin?

Yes.

Delta_G:
All those servos are powered from the Arduino? That's your problem. You can't pull that kind of current through the 5V pin. You're lucky it still works at all.

So in other words, no it's not a confirmed short through the joystick it's a confirmed you're pulling too much power through the 5V pin and you're lucky that you haven't completely smoked the Mega.

Servos need their own power source.

I have connected the servos to an alternate power source. But when joystick/s are connected to the power from the alternate source or the Arduino it shuts it off. So if I connect the joystick to the power source, the power source shuts off, the same happens with the Arduino

Try a different joystick then. Maybe it is a short. Hard to tell cause I can’t see the current wiring.

fierymoto:
Here you go. Sorry if the picture is bad and sorry that the schematic I made is bad. But I hope it helps.

Your presentation is a complete rats nest and impossible to follow.
Look up how circuit drawings are laid out.
There are millions of examples out there.
Then you might get some meaningful help.

bluejets:
Your presentation is a complete rats nest and impossible to follow.
Look up how circuit drawings are laid out.
There are millions of examples out there.
Then you might get some meaningful help.

Thank you Delta for helping me even if my drawing was a complete "rats nest" as bluejets kindly pointed out. I will try using another joystick and see if that works. Again thank you so much for putting up with my noob mistakes as I am still learning.
:slight_smile:

Delta_G:
All those servos are powered from the Arduino? That's your problem. You can't pull that kind of current through the 5V pin.

Although OP said in the opening post that the problem presented when joysticks were added to the servos on the 5v pin s/he then immediately said the problem was the same with the servos out of the mix.

OP when you measure the resistance across the pot's outer pin's, what is the value?

edit: let me re-phrase after looking at the schematic of the joystick in the linked datasheet. There are 2x 10k resistors in parallel across Vcc and Gnd, so you should read 5k.

ps2 joystick.GIF

Only way to see if it's shorted is to measure....

ps2 joystick.GIF

We've also yet to see the code running on that Arduino. It's also possible he's got something misconfigured and an input pin is actually outputting and that's shorting it out.

With this sort of thing, always good to post code and schematics.

Does it work without the servos and using example code for the joystick?

Delta_G:
always good to post ... schematics.

But not all schematics are created equal

meltDown:
But not all schematics are created equal

https://forum.arduino.cc/index.php?topic=382458.0