Go Down

Topic: Setting a wire to ground when it always has a voltage on the other end. (Read 2227 times) previous topic - next topic

RyanfaeScotland

Aug 24, 2013, 09:34 pm Last Edit: Aug 24, 2013, 11:51 pm by RyanfaeScotland Reason: 1
Hey folks,

I'm trying to create a simulator of a controller for the Sega Master System using the Arduino however I've became a bit stuck since the controller doesn't work quite how I imagined and, as you probably expected, I'm pretty new to the whole Arduino and electronics business.

The main issue is in bold

What I've done so far is stripped the connecting wire from the controller so that I have the connector and its 7 wires. I know what each of the wire does by taking note before disconnecting them (I may be new but I'm not daft  ;)) and also from the several sources of information that are available on-line.

It's a simple controller and here is a quick explanation for those who aren't aware: It has 6 buttons, Up, Down, Left, Right, 1 and 2 each of which has its own wire. The 7th wire is ground. Each of the button's wires has a small voltage through it and when a button is pressed it is connected to ground completing a circuit and the system detects that the button is pressed. You can read about it at http://pinouts.ru/Game/sega_ms_joy_pinout.shtml.

The problem I'm facing is that I assumed each of the buttons would have no voltage and that wire 7 would be 5v or so, so that when a button was pressed it would get voltage and the system would know it is on. I could simulate this myself easily by connecting the 6 wires to digital outs and switching between HIGH or LOW however this clearly isn't the case and it appears the reverse is true.

The way I was thinking of doing it was to connect the pins directly to the Arduino despite the voltage and set the pins to HIGH for the button not being pressed then LOW for when they are. This doesn't 'feel' right though as it wouldn't be completing a circuit, would it?

I'm not comfortable putting the wires into the digital pins knowing they have a voltage across them without guidance first for fear of blowing them up. I've read a fair few posts on the forum already about this issue but none really matched. http://forum.arduino.cc/index.php/topic,49070.0.html comes close but I'm still at a loss.

Would someone be kind enough to help me through this?

RyanfaeScotland

I'm continuing to look at this whilst hovering on the forum trying to help where I can.

Just thought I should point out that I'm not looking for anyone to do this for me, post me a link to someone who's done it before or hold my hand all the way! I'm looking for exactly what the forum says, guidance. I'm not sure if I need to use diodes to control the flow of current or pull-down / pull-up resistors or something else.

I put together a little circuit that got me thinking, since I can't turn off the voltage what I'm looking to do is connect and disconnect the circuit from ground, creating a 'floating' voltage which is what is described in http://www.ladyada.net/learn/arduino/lesson5.html.

I'll continue down that avenue until advised differently.

(Sorry for the double post, really eager to get on...)

Grumpy_Mike

Quote
The way I was thinking of doing it was to connect the pins directly to the Arduino despite the voltage and set the pins to HIGH for the button not being pressed then LOW for when they are. This doesn't 'feel' right though as it wouldn't be completing a circuit, would it?

Close.
Set them to be inputs when they are not to be pressed and outputs with a logic low on them when they should be.

RyanfaeScotland

#3
Aug 25, 2013, 12:28 am Last Edit: Aug 25, 2013, 03:45 am by RyanfaeScotland Reason: 1

Quote
The way I was thinking of doing it was to connect the pins directly to the Arduino despite the voltage and set the pins to HIGH for the button not being pressed then LOW for when they are. This doesn't 'feel' right though as it wouldn't be completing a circuit, would it?

Close.
Set them to be inputs when they are not to be pressed and outputs with a logic low on them when they should be.


Ah right, of course! I take it a pin set to input is the equivalent to (for all intents and purposes) a ground. I had a feeling an output set to low just wasn't the same.


I've got that back to front  :0 I want it grounded when it is pressed so OUTPUT LOW is the same as ground and INPUT in not ground? Seems counter intuitive.

I measured the voltage coming from the pins as being 4.8v, should I connect up resistors to the Arduino pins for safety or should I be ok going straight in? This is my biggest concern with being new to hardware projects, burning things out.

EDIT - I'm going to add them in since I am adding some LEDs to make it clearer about the controller state anyway. As far as I see it it can't hurt to have them in since it is the voltage that is important to the circuit not the current.

EDIT2 - Well counter intuitive or not, it works! Had to take the LEDs out as it didn't work with them in, even with 0 resistors, but I put the resistors back in and hooked it up again and its going. Big thanks Grumpy Mike!

Grumpy_Mike

Quote
I've got that back to front   I want it grounded when it is pressed so OUTPUT LOW is the same as ground and INPUT in not ground? Seems counter intuitive

It is not.
An output low is the sme as ground, a low impedance connection to ground.
An input is a high impedance path, therefore is the same as nothing connected at all.

Glad you got it going.

lewtwo

When I read the tittle I thought ....
... is he talking about an arc welder ?   :~

RyanfaeScotland


When I read the tittle I thought ....
... is he talking about an arc welder ?   :~


Haha no not quite.

At first the topic described my project but I thought it better to try describe my issue, of course being new to things I'm not exactly sure how to do that! I can still change it if you can think of something more descriptive / accurate which will help people looking for it in the future.

lewtwo


Haha no not quite.
...
I can still change it if you can think of something more descriptive / accurate which will help people looking for it in the future.


Don't do that, not everyone's mind sinks to my demented level.
For those that do ... well a good smile is always welcome.

Go Up