Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Forums > Electronic Projects Design/Ideas/Reviews


Electronic Projects Design/Ideas/Reviews Are you building an electronic project or want to? Maybe you need some assistance? Come and submit your electronic questions here and let our experienced members find a solution.

Reply
 
LinkBack Thread Tools Display Modes
Old 19th April 2007, 08:02 PM   (permalink)
Unhappy I'm exhausted, and a newb...

Hi all, hope someone can point me in the right direction with the circuit i've built. I'm not an electronics engineer or anything, dabbled in a couple of cicuits and stuff over my lifetime, mucked about with Dick smiths beer powered radio's and stuff like that.. this is the first cicuit of any complexity (to me at least) that I've designed.

I basically do a lot of car racing simulator component building as a hobby, and until now, interfacing with already made joysticks and USB devices has been pretty easy as I just take them apart and wire in remote switches to the circuit boards to perform what I need to do (ie. make a pseudo gearbox out of wood and stuff, and have 6 microswitches at each gear gate, which close the circuit on each corresponding button on the joypad)... you get the idea I'm sure.

Now, I bought this premade gearshifter for sim racing the other day, and its really old, and features some weird cartidge system and a DIN plug of sorts. I dont have anything to plug that specific DIN plug into my pc, and need it to be USB.

The shifter works in the following way:

1 2 3
|_|_|
| | |
4 5 6
(it has gears 7 and 8, but I blanked those off cos its rubbish)

The shifter shaft works exactly like a cars one does.
Now, see my post here: http://forum.rscnet.org/showthread.php?t=288167

Something important to note is that when in neutral, obviously none of the microswitches in the shifter are closed...
3rd and 4th gear are easy because they are either the 'green' or 'blue' wires independantly.... but 1,2 and 5,6 are combination switches... AND - when you move the shifter to the left side it will activate the microswitch with the yellow wire first, then when you shift into 1st or 2nd it activates either green/blue wire together with the yellow... what i'm saying here is that I dont want the yellow wire (or the red wire for the right hand side gears (5,6)) to activate any button on the remote USB joystick.... So my whole thinking was to break the circuit into three sections:

1. -green/blue are normally closed (Activated) when in Neutral.
-red/yellow circuits are deactivated

2. -when yellow is activated (circuit now knows its moving to left axis)....
-deactivate green/blue for remote gears 3 and 4
-activate circuit green/blue for remote gears 1 and 2.
-all circuits on red wire (right side of gearbox, ie gear 5 & 6) are
deactivated.

2. -when red is activated (circuit now knows its moving to right axis)....
-deactivate green/blue for remote gears 3 and 4
-activate circuit green/blue for remote gears 5 and 6.
-all circuits on yellow wire (left side of gearbox, ie gear 1 & 2) are
deactivated.


Well, thats how it makes sense in my head, I hope someone here can follow my logic and really look forward to a response that could be of any use. After all the hours I've put in and it doesn't work (on the pc, it works with my multimeter set on CONTINUITY, testing each gear) I am really dissapointed.

I tried drawing up some logic charts with XAND/XOR symbols that I remember from computer science and just could not wrap my head around the logic of it that way....


Look forward to any reply!
Thanks!
Ryan
Franknstein is offline  
Old 23rd April 2007, 04:31 PM   (permalink)
Default

Anyone got any ideas?
Franknstein is offline  
Old 23rd April 2007, 06:07 PM   (permalink)
Default

hi ryan,
Looked at the link, copied this post so I can get my head round it off line!.

If I can suggest an idea, what logic devices etc do you have available??

Which part of SA, if you dont mind me asking??, I get to PE once a year.

Regards
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Old 23rd April 2007, 06:13 PM   (permalink)
Default

Hi Eric

Thanks for the reply. I suppose I have many logic devices available, I mean, I really dont mind what I use, I just thought relays would be the simplest... but if I could use diodes or transistors or even an IC I will do it... I just cant seem to bust this circuit.... I've now tried redesigning the whole circuit, and the only way I see it working is to use like 10 relays, which I am really sure is not necessary!!! Any help would be appreciated...

I stay in Johannesburg...

tnx
Franknstein is offline  
Old 23rd April 2007, 07:10 PM   (permalink)
Default

hi ryan,
Working thru your dwgs and text. Im drawing a block diagram, when finished I will post it.
Look thru it and check the idea, if OK, then we can give you a logic diagram.

I know someone in Oz, who will be able to come up with a relay option.
hi Len.
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Old 23rd April 2007, 08:47 PM   (permalink)
Default

Brilliant! Thank you so much! I owe you big time...
Franknstein is offline  
Old 23rd April 2007, 09:16 PM   (permalink)
Default

This is a fairly simple logic problem though there is a little complextity involved.

You have 5 input values (sw1-5) and 8 output values (gears 1-8). There are many ways to solve this however you mention USB so that pretty much implies a microcontroller. There are a number of PICs that implement USB that could be used for this task.

Determining which gear is fairly simple in a PIC/microcontroller - take the 5 inputs as a 5 bit number and use it to index a 32 byte table. Each bit in a given table entry would indicate which gear was engaged. So, bit 0 set to 1 would indicate 1st gear, bit 1 set to 1 indicates 2nd and so on. all bits zero would indicate neutral.

You can figure out the table by doing the following table
Code:
Switches            gears
1 2 3 4 5          1 2 3 4 5 6 7 8
0 0 0 0 0          0 0 0 0 0 0 0 0
...
0 1 1 1 0          0 0 0 0 0 0 1 0   <-- SW2,3,4 -> 7th gear
...
1 0 0 0 0          0 0 0 0 0 0 0 0
...
1 0 1 1 0          0 0 0 0 0 0 0 1   <-- SW1,3,4 -> 8th gear
...
Figure out the other 6 gears.


Outside of a microcontroller/USB, you could solve this with a small EPROM if you have access to an EPROM programmer. Just use the 5 inputs as the address and the output byte as the 8 gear indicators similar to the PIC example above.

Or you could use 2 3 to 8 demuxes (like the 74HC138) to generate the 8 gear signals. Use SW 1 and 2 to select which chip and run SW 3,4 and 5 into both chips' inputs. Then it is a small matter of picking out which of the 16 outputs means a specific gear (use the above table, again). The outputs will be inverted so you will need to deal with that but it's easy. You can deduce neutral ANDing SW1 and 2 together. You should be able to run the outputs directly into the switch inputs on your USB interface if they are pulled high switches as well.

note, when I say use a given switch as input, you will need to use pulled high switches using pull-up resistors. this gives you active low logic - a bit value of 0 is actually a high voltage and a 1 is a low voltage.

Last edited by philba; 23rd April 2007 at 09:21 PM.
philba is offline  
Old 24th April 2007, 07:48 AM   (permalink)
Default

hi ryan,

Philba, has described in detail a good option, if he has covered what you need,let us know, so I can set the project to oneside.

Regards
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is offline  
Old 24th April 2007, 09:36 AM   (permalink)
Default

Hi guys

ok, I understand the very basic theory of what Philba has described (thanks for taking the time btw). I have no problem with using preporgrammed CMOS ic's, as I dont have access nor the knowledge to burn my own.

So if this 74HC138 chip is easily available, I can get two of them tomorrow. I will need help with the wiring diagram, I opened the PDF of the 74HC138 and it shows inputs select 'A,B,C' and then enable 'G2A, G2B, G1'.... whats select and whats enable... I know theyre inputs and I understand the binary logic table, and understand how the input binary corresponds to the outputs etc, but I have no idea how to wire this all up the real world...

Also, the USB joystick is powered up via the computer power supply, through the motherboard and through the USB cable into the joystick board. All I need to do is close switch, I dont need to put any external power through the switches (correct?). I understand you need a power source to power the 74HC138 IC's, do I tap into the power from the USB joystick, or use a seperate power supply (ie a battery).. and if I use a seperate power supply, would it not put extra current through the USB joystick board which I dont want? All I need to do is close the switches?

When you talk about active low and pulled high and pull-up resistors, I am completely lost
Franknstein is offline  
Old 24th April 2007, 11:18 AM   (permalink)
Default

Quote:
Originally Posted by ericgibbs
hi ryan,
Working thru your dwgs and text. Im drawing a block diagram, when finished I will post it.
Look thru it and check the idea, if OK, then we can give you a logic diagram.

I know someone in Oz, who will be able to come up with a relay option.
hi Len.
Yes, I'll design a relay one for you if you wish. Just post the details of what you need. I don't feel like wading through all of the above. Either Eric's block diagram or complete the table as posted above by philba would do.
__________________
Len
ljcox is offline  
Old 24th April 2007, 11:37 AM   (permalink)
Default

If I could do it the relay way that would be awesome, because its something I understand a lot more than IC's... Here is the table below... just keep in mind that whenever an output requires a combination of two switches, the switchs never get switched at exactly the same time, its always one before the other. Thanks again!


Switches gears
1 2 3 4 5 || 1 2 3 4 5 6
-=-=-=-=-=-=-=-=-=-=-=-=-
0 1 0 0 1 || 1 0 0 0 0 0
...
1 0 0 0 1 || 0 1 0 0 0 0
...
0 1 0 0 0 || 0 0 1 0 0 0
...
1 0 0 0 0 || 0 0 0 1 0 0
...
0 1 1 0 0 || 0 0 0 0 1 0
...
1 0 1 0 0 || 0 0 0 0 0 1
Franknstein is offline  
Old 24th April 2007, 08:20 PM   (permalink)
Default

A good friend of mine helped me with the logic circuit this evening. So I've come up with this diagram which looks pretty promising, couple of questions though:

1. Can I use the power from the USB joystick (use my multimeter and try find a terminal with like 5v or something when its plugged in? Or could tapping into the power on the board cause a drop in voltage or something?

2. Looking at my new diagram below as it stands, do I need to add any resistors or anything?

3. Will current flow through the switches on the joypad switches coming from the outputs of the IC's? Or does will it just close the switch?

here are the diagrams I've drawn... I've split it into two, otherwise there is just too much wire and it becomes confusing.


logic:
-=-=--=

yellow & green = gear 1
yellow & blue = gear 2
green = gear 3
blue = gear 4
red & green = gear 5
red & blue = gear 6

diagram 1:


diagram 2:
this shows how each gear is wired to the USB joystick, and how I have made the joystick common ground common with the grounds on the IC's... and the power source tapped into the USB joystick too... Any resistors needed anywhere here? Any suggestions?

Last edited by Franknstein; 24th April 2007 at 08:24 PM.
Franknstein is offline  
Old 25th April 2007, 02:09 AM   (permalink)
Default

Here is the relay one. Switches 2 & 4 are not required.

The diodes protect the switch contacts from the back EMF when a relay is released.

All outputs should have a 4k7 pull up resistor as shown for G6.

Sorry about the scribble, I'm a bit busy.

EDIT.
From your original diagram, it appeared that the outputs had to be active low. So I designed the circuit for AL.

But the table you posted indicates that they are active high.

Also, what is the USB joystick interface? Is it TTL or CMOS? If TTL and the JS requires active high signals, then I'll have to alter the circuit.

If it is a CMOS interface, then all you need to do is connect +5 Volt to the lever spring of relay S3 and replace the +5 Volt behind the resistor with gnd.
Attached Images
File Type: png Gear relays.png (83.5 KB, 14 views)
__________________
Len

Last edited by ljcox; 25th April 2007 at 04:09 AM.
ljcox is offline  
Old 25th April 2007, 02:19 AM   (permalink)
Default

Quote:
Originally Posted by Franknstein
A good friend of mine helped me with the logic circuit this evening. So I've come up with this diagram which looks pretty promising, couple of questions though:

1. Can I use the power from the USB joystick (use my multimeter and try find a terminal with like 5v or something when its plugged in? Or could tapping into the power on the board cause a drop in voltage or something? The current will be small so you should be able to power it from the USB joystick. Withn 4k7 pull down resistors as I recommend below, the max current will be about 2 mA.

2. Looking at my new diagram below as it stands, do I need to add any resistors or anything? Assuming the ICs are CMOS, you will need 4k7 pull down resistors at the inputs

3. Will current flow through the switches on the joypad switches coming from the outputs of the IC's? Or does will it just close the switch? I don't understand this question.

here are the diagrams I've drawn... I've split it into two, otherwise there is just too much wire and it becomes confusing.
The NOR package should be a NAND. But it could be done with only 2 ICs. If you want to do it this way, let me know and I'll post the circuit.

The PD resistors are required to cause the input voltage to change when a switch is opened or closed. When open the input voltage will be 5 Volt, when closed, 0 Volt.

EDIT
My edit to the previous post is also partly relevant to this one.

The outputs of this circuit are active high.

You also need to know what the JS interface conditions are, ie. TTL or CMOS.

You did not indicate what ICs you would use in this circuit. If TTL, then you don't need the PU resistors. But if the JS needs CMOS levels then you will need CMOS ICs.
__________________
Len

Last edited by ljcox; 25th April 2007 at 04:01 AM.
ljcox is offline  
Old 25th April 2007, 06:13 AM   (permalink)
Default

Thanks for your help LJCox, I really do appreciate it.

Firstly, please explain why I should be using a NAND and not a NOR for the 2nd IC, because that would suggest that only when red and yellow wires are '1', does the the gate open... (its impossible for both red & yellow to be '1' at the same time), so this would be a null and void package to use???? If not, please explain?

Thanks for the relay diagram, I really appreciate your efforts. A little confused by some of the symbols you have used:

Where I've circled, I can see a diode on the left, but whats to the right of it?

Yes, I think the inputs to the joystick will require Active High.

Not sure if its CMOS or TTL, will check tonight. But checking this description of the difference between the two, http://www.epanorama.net/phpBB2/viewtopic.php?t=2431& I see they both require almost the same input voltage, and the output voltages are very similar too... so why would I need resistors for the TTL and not the CMOS???? Please explain.

I would like to try do it with the IC's and with the relays... as I'm using this as a learning experience too... and would like to experiment with both. So if you could post a circuit with the IC's too, it would be very helpful to me.

tnx again
Franknstein is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:59 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker