Pages: [1]   Go Down
Author Topic: Slot car speed control via Arduino  (Read 1475 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Guys, looking for some help

We have a slot car set that uses the wired rheastat type speed controllers. What I would like to do is replace that with wireless units, and my thinking is that I could use 4 of these http://www.amazon.co.uk/Zeemote-Bluetooth-Mobile-Gaming-Controller/dp/B002GP7OBU as wireless 'joysticks' and use one axis of each to control a lane. Windows 7 accepts multiple input devices.

Is there some way of using one axis from each unit and assigning one of the arduino outputs to it? It would require simple speed control, either via variable voltage (0 to 22V) or PWM. I am assuming that the Arduino can modulate the voltage provided by an external power supply? Essentially the Arduino would be hard wired to the PC, which would act as the interface between the controllers and the board.

The output would be just a linear output between min and max, but as stated above would have to be from 4 different joystick units so that each player is independent.

I have not yet bought any hardware because I am not sure if it is possible. If there is an alternative way of acheiving this, I am open to ideas

Thanks for your thoughts and ideas

Les
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

What you want to do is not too difficult.  Your PC would send values via the serial port whenever the joystick moved and the Arduino would use the value to control the six PWM output pins.

The PC might send "A0," to set channel A to level 0 and "B128," to set channel B to half power and "C255," to set channel C to full power.  The Arduino would make note of the letter to determine the channel and set value to 0, accumulate each digit (value = (value * 10)+(newDigit-'0')smiley-wink, and when the ',' arrives, analogWrite(channelPin,value);  Very simple!
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks - you say 'serial port', but both the controllers and the Arduino are connected via the USB connection, would this make any difference?
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I thought the game controllers would be talking to the PC over Bluetooth.  The PC talks to the Arduino over USB.  Even if the PC has an external USB Bluetooth adapter it should not cause any problem with an Arduino on the same USB bus.  If the PC only has one USB port available, get a USB Hub.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

ok, it was the mention of serial port that threw me - none of my PC's have them any more, just USB's!

so the multiple input controllers can work them, that's good. I take it I would not need any extra hardwar to handle the 22v then, that would also be a relief!

I'll get the hardware together, then I'll have to look at the programming

Thanks for your help, any other assistance or ideas greatfully received!

Les
Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 201
Posts: 8669
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I take it I would not need any extra hardwar to handle the 22v then, that would also be a relief!

You will need an NPN transistor or N-channel MOSFET on the ground (-) side of each track to handle the power and voltage.  For the transistor you will need a resistor between the Arduino pin and the 'base' of the transistor.  You apply 22V to the + side of the track.  When the Arduino pin is HIGH the transistor/MOSFET conducts and power flows through the car.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Pages: [1]   Go Up
Jump to: