Let's Make Robots!

How to use microcontroller to stand in for joystick

I wasn't sure if I should post this in another forum or not. I consider it a beginners question having to do with electronics but I need to give some back story.

Back in the day (probably around 1985) I bought this quickfire SVI-2000 robot arm (http://www.theoldrobots.com/arms2a.html). I thought it was so super cool. We had them at my school and when I found one for sale for $19 at a local factory outlet store I snatched it up. Back in '85 that was a lot of allowance money. It has five degrees of motion each controlled by a small motor and gears. Unlike the Armitron, sold by radio shack at the same time, each joint has an independent motor which I would think would make it an ideal target for microcontroller control. There were originally two ways to control it. You can hook up two standard atari 9 pin joysticks and use them to control all of the motions or you could use the optional computer interface card (which I never had) and control the arm with a MSX Computer. When used like this, the arm was seen as a kind of trainer to teach programming. It used a language called Rogo which was very similar to Logo.

I never did use it with a computer but I recently dug it out and wondered if I could control it with a micro controller. It runs on 4 D cell batteries. From what I understand of the joysticks, they are just switches. I can see from some info online (http://pinouts.ru/Inputs/JoystickAtari2600_pinout.shtml) that pin 8 is the ground and then the joystick just connects that to the other pins to close the circuit. I measured the current across the relevant pins and it looks like 2.5 volts. I can see inside the arm there is a little circuit board between the joystick inputs and the motor wires and it appears to have transistors on it.

I'm planing of buying the start here microcontroller kit from solarbotics to do that beginners project but I'm wondering if that microcontroller could also be used to drive this arm. Since the power for the motors is already provided by the 4 D cells, I would just need something to stand in for the switches in the Joystick. Pardon my completely beginner question, I'm very new to microcontrollers. My impression is that I wouldn't need an actual motor driver for this application as I don't need to control direction and current and all that, I simply need to open and close circuits just like the joystick would. I'm guessing it would involve the analog out pins on the chip but I'm a bit at a loss as to exactly how I would wire it to make a complete circuit since that is what the joystick does. Would the ground pin (pin 8) have to be connected into the circuit somewhere as well?  I wonder if that 2.5 volts is just opening one of the transistors to pass the larger current to the motors. I realize it may be hard to give an exact answer when no one has the exact robot arm in front of them. I tried looking in the manual for the Picaxe but it didn't really seem clear as to how to use a microcontroller to do this. Any thoughts?

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Great. I'll give it a try and report back. Now if only the start here kit was on back-order...

Make that, if only it wasn't on back order.

Assuming I reading the multimeter correctly, it looks like the motors pull 40 mA when running.


In that case I'd definitely use the ULN2803A to buffer your outputs, which as rik has reminded me is actually included in the Start Here bundle already =)

Go ahead with your plan, buy the kit. Then, learn how to switch anything on/off using a digital output pin. Then, learn how to wire a transistor to switch something on/off using an output pin. Then learn that the provided darlington chip is just a compact package holding exactly eight (!) such transistors. Then figure out how to wire the digital outputs to your arm and start switch them on and off.

The only disappointment you might encounter is lack of sensor feedback from the arm. Cross that bridge when you get there,

If, along your way, you formulate new questions, you know where to ask!

 

You should be able to use digital outputs as a switch is either on or off. There is no, in between and therefore, no analog.

This is definitely possible.

Can you please measure how much current flows between pin 1/2/3/4/6 and pin 8?
If less than 20mA is required, you can drive the robot inputs directly from the microcontroller's digital outputs.
If the current is greater you'll need to use something to increase the current drive, such as the popular ULN2803A NPN darlington transistor array IC. The ULN2803A can be dropped into the Start Here board as a direct replacement for the L293D motor driver or the 330Ω DIL resistor array IC. It's capable of driving up to 500mA, which is much bigger than you're likely to need.

Regardless of whether you connect the micro directly or via an IC like the ULN2803A, you'll need to "common the grounds", which in this case means connecting pin 8 from the robot to one of the ground pins on the Start Here board.