
How to make the electronics and wire connections:
First of all, I used a Basic Stamp2 microcontroller to read the data from the serial port with 2400Bps baud. And the motors are driven with the use of Parallax's HB-25 motor controllers that converts the wiper motors to big servos! To position the motors using just the HB-25 is impossible so I wrote my own servo proportional code that does the job. The servo proportional code is implemented in p-basic and the bs2 runs it along with the demanding job of receiving the motion data from the computer.
To have feedback about the position of the motors I used special 90 degrees potentiometers (from hobby radio control unit) and ADC0831 to read them with the BS2. Then BS2 compares the motion data input with the pots feedback to calculate the speed of the motors and their direction. See sample code below:
-----------------------------------------------------
...sample code...
SetPoint = bank 'Sets the seek feedback signal pointed to the bank input value from USO.
idx = 0 'Selects the apropriate ADC chip.
GOSUB Read_0831 'Reads the feedback potentiometer angle.
bankpot = adc(idx) 'Sets the feedback potentiometer angle into a variable.
SetPoint = SetPoint MIN 35 'Provides input that is inside the limits of the feedback so to protect from overshoot outside the
potentiometers limits.
SetPoint = SetPoint MAX 220
error = SetPoint - bankpot 'calculates the difference between the received angle and the current angle.
p = Kp * error 'Calculates the proportional drive to the desired point.
bankpot = p + Offset 'Converts the proportional drive values to the servo pulses range.
bankpot = bankpot MAX 1000 'Limits the max speed that is feeded to the motors for either direction to the ones that the HB-25 can handle.
bankpot = bankpot MIN 500
PULSOUT bankport, bankpot 'Finally pulses the HB-25 with the speed and direction we need.
...etc
------------------------------------------------------
I decided to give you the entire code for the BS2 interface since I don't have to time to mess with it anymore. I almost finished my new AVR motion controller that is lots of times better than this BS2 interface. Just for a little comparison:
BS2 interface: Baud speed 2400bps, refresh rate 18ms, only 2 or 3 R/C servos output, max 4 feedback pots
AVR motion interface: Baud speed 115200bps, refresh rate 2ms, outputs 4 PWM channels or 4 R/C servo , 8 feedback potentiometers or 2 optical encoders!
Well, here it is the Open-Source BS2 code to adjust it to your needs: BS2_interface_v1_1_HB25_open_source.zip
If you wish to contact me for help with the basic stamp2 code or for help interfacing it with various motion software email me at:
In these photos you can take a closer look on the basic stamp2 and its connections to the external peripherals like the HB-25 motor controllers an the potentiometers. As you can see I have the ADC chips temporally placed on the breadboard of the BS2 board of education and made an extra little board with MAX232 and the serial port that reads the data from the computer. Even if the Bs2 board of education has already serial port I had to add a new one with Max232 chip as it seems that the echo, that the Bs2's serial port is producing, is causing communication errors.

To see how to use this simple connection setup look into the next schematic.
After experimenting with my new AVR controller I redesigned the above max232 circuit to a more reliable one, that introduces no data errors and filters any noise in the serial signal using several filters. I recommend you to built this circuit instead of the above simple one. Click on the right picture to download a PDF with 1:1 layout of this little board in case you want to etch it on an etching service:
Here is the list of parts for this max232 circuit board:
Resistors:
- 220 Ohm 1/4w
- 470 Ohm 1/4w
- 1 kOhm 1/4w
- 39 KOhm 1/4w
- 47 KOhm 1/4w
Capacitors:
- 4x 10uF /16volt
- 1n2 ceramic (1.2 nf)
- 103 ceramic (10nF)
- 22 pF ceramic
Other:
- MAX232 chip
- 2x transistors BC547
- Green LED
- 16 pin IC base (for max232)
- DB9 Female connector for PCB
Custom BS2 board and "all connections in one place"
interface:
In a try to concentrate all the connections and add more features, I designed a dedicated board that connects other components too like relays to switch-on the computer PSU's from the BS2, extra ADC inputs with the use of more ADC0831, some switches and piezospeaker. when I designed this interface board for flight sim and Portdrvr was not needed any RS232 buffer to read flight data. I included the extra Max232 chip interface in the final plans to be able to also use it with x-sim software. I also made plans for a small board that can host the original Basic Stamp2 chip from parallax. This board can be placed on top of the interface connections board and power it directly. This way you can save some money by buying only the BS2 chip from parallax.
The plans below has been updated on 18-12-2007
to fix some minor issues:

Below you can find the PDF's that contains the schematics and 1:1 PCB layouts to etch it to an etching service:
Here is the list of materials for the above custom BS2 interface:
| Qty: | IC's: |
| Parallax Basic Stamp2 chip | |
| MAX232 chip | |
| ADC0831 chip | |
| 2x | transistors BC547 |
| 2x | transistors 2N2222 |
| voltage regulator LM2940CT-5 | |
| Resistors: | |
| 3x | 220 Ohm 1/4w |
| 3x | 470 Ohm 1/4w |
| 4x | 10 KOhm |
| 1 kOhm 1/4w | |
| 39 KOhm 1/4w | |
| 47 KOhm 1/4w | |
| Capacitors: | |
| 1000uF /16volt | |
| 5x | 10uF /16volt |
| 2x | 104 ceramic (100nF, or 0.1uF) |
| 103 ceramic (10nF, or 0.01uF) | |
| 1n2 ceramic (1.2nf, or 0.0012uF) | |
| 22 pF ceramic | |
| Other: | |
| 2x | Diodes 1N4001 |
| Green LED | |
| 2x | Relays double switch /5volt |
| ALPS button | |
| 16pin IC base (for max232) | |
| 4x | 8pin IC base (for ADC0831) |
| 2x | DB9 Female connector for PCB |
| 20pin female row header | |
| 20pin male row header | |
| 20pin ic row header with long legs | |
| Power jack for PCB |
Check out this short PCB
MAKING GUIDE if you want to develop yourself these PCB layout plans.
And below are some photos of this board I made with some of the features in
the schematics above missing since I moved on using the much better AVR electronics.
Here is a clue on how to connect the 90 degree feedback pots on the joyrider:
As you see I used a bended piece of metal (computer junk) to fit in the potentiometer leaving in the front its rotating head.
Then I mounted it inside the cymbal support caster and used a small piece of sponge to have the pot's head follow the motion of the cymbal.
Where can you find a 90 degree potentiometer?
I got my 90 degree pots from the stick mechanism of a toy RC controller as seen in the photo below.
Another cool alternate you can use, is a modern 90 degree Rotary Sensor that uses hall effect electronics like this one: Rotary_sensor_dual_output_hall_effect_9900_series.pdf
After a long time using computer PSU's to power the motors, decided to buy a car battery to power the motors with all the extra power that needed sometimes. I choose a 100Ah deep-cycle one to ensure long play time and endurance. I can use it for straight 8 hours in my simulator before charging is needed.
If you need instructions on how can you develop good quality PCB boards at home the check out this short PCB MAKING GUIDE