Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help designing analogue switch sytem

Status
Not open for further replies.

danger_85

New Member
Hi guys,

I am fairly new to electronics and circuits and could really use some help with a circuit I have been trying to design for my Thesis. What I have is a joystick with an 8 way hat. I need to convert the signals from the hat onto one channel to send through to an external A/D card. My problem is the 8-way hat uses four buttons that when pressed determine what position the hat is in. eg: up, button 1 is pressed, Bottom right, buttons 2 and 3 are pressed at the same time.

**broken link removed**

I am trying to design a circuit similar to the one linked above, however I need each combination to have a distinct voltage drop so it can be interpreted by the computer running the system. I can not manage to get the parrallel loops to produce a distinct voltage drop from the single loops, ie when only one switch is closed. I know I have to alter the resistors but have had no luck finding a combination that works. Any help or advice would be greatly appreciated. Hope this makes sense. LOL.

Cheers
Danger
 
Fairly obviously you need to provide the greatest voltage swing you can.

So for a start one button should short it completely to ground. This gives you two reference points, 5V (no button) 0V (the lowest button), this leaves three buttons in between those two points - so calculate the values to spread then evenly.

You can do a LOT more than 4 buttons like this, but by spreading them out it makes it as easy as possible.
 
Hi Nigel,

I understand about when only one switch is closed at any one time, however my problem lies in that when the hat is pushed diagonally two buttons are pressed. So it is no longer a simple series calculation but, there end up being two resistors in parallel. This results in voltage drops for the parallel circuit being too close to the voltage drops for the single switch series case. ie for the circuit linked in my first post the voltage drops are as follows:

switch 1 – 3.979
switch 2 – 2.9545
switch 3 – 1.93
switch 4 – 0.9798
switch 1&2 – 4.211
switch 1&4 – 4.0279
switch 2&3 – 3.3737
switch 3&4 – 2.33

As you can see there is a distinct voltage drop of about 1 volt for the single switches, but when a combination is closed, say 1 & 4 the difference is too small compared to the switch 1 case.

I need a distinct voltage drop across all individual switchs and two switch combinations. Is this possible?

Cheers
Danger
 
This simple 4-bit D/A may not give you optimum separation, since it has 16 possible output levels and you only need 8 of them, but it should give adequate separation.
For maximum separation, you could encode the 8 used output states into 3 bits, and drive a 3-bit DAC.
 

Attachments

  • 4 bit DAC.PNG
    4 bit DAC.PNG
    15.1 KB · Views: 326
Hi Roff,

What I am unsure as to what the triangle symbols are. Are they a hex inverter. What does that do to the signal? and how can I check the voltage drops over it? Also I don't need to convert the digital signals from the stick as I am hijacking them before they get to the joysticks A/D, then sending them on to an Advantech PCL812PG board.

Sorry if this is all really basic, but I really have no idea.

Thanks
 
danger_85 said:
Hi Roff,

What I am unsure as to what the triangle symbols are. Are they a hex inverter. What does that do to the signal? and how can I check the voltage drops over it? Also I don't need to convert the digital signals from the stick as I am hijacking them before they get to the joysticks A/D, then sending them on to an Advantech PCL812PG board.

Sorry if this is all really basic, but I really have no idea.

Thanks
What kind of thesis is this, that you don't know what an inverter is?
 
I'm doing aeronautical engineering, which doesn't involve any electronics throughout the course, and thus the only electronics I have done is abit of basic stuff in high school physics. The bulk of the thesis is aircraft simulation development for a variable stability flight simulator, and this bit of electronics has come up.
 
danger_85 said:
I'm doing aeronautical engineering, which doesn't involve any electronics throughout the course, and thus the only electronics I have done is abit of basic stuff in high school physics. The bulk of the thesis is aircraft simulation development for a variable stability flight simulator, and this bit of electronics has come up.
OK, I apologize for sounding like I was belittling you. I truly was curious.
The circuit I drew is just another way of getting a unique voltage for each combination of switches. With the scheme you posted, the smallest step was less than 50 mV. With the scheme I drew, the smallest step is over 300mV. This is easy to discern with a data acquisition system.
EDIT: I previously stated that there were 8 possible states, which you could encode into 3 bits and then generate a unique voltage for each state using a 3-bit D/A (digital to analog converter, which is what the circuit you referenced is also). I was wrong. There are 9 possible states, including when all switches are off (joystick centered).
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top