Entry Top Next
10/26/2004 - Interfacing the Motors, Sensors & Soil
Sampler to the OOPic II
Photo showing the completed interface for the Leg Section
nine wires coming from each Motor as well as the Soil Sampler
must be interfaced to the OOPics.
involves two circuit boards, one purchased off the shelf and another
which I designed and had produced for me.
first is the Magnevation
Dual PMW Driver Board which I purchased. This printed
circuit board (PCB) allows the OOPic to control two DC motors.
It has inputs for ground and the motor voltage (24vDC in
my case) and outputs two wires for each motor. It is made
to work with the OOPic and the two are connected together via
their 40 pin connectors using a short ribbon cable.
other 7 wires (S1, S2, S3, L1, L2, +5vDC, GND) feed out of a custom
designed PCB which I created using the service provided by www.ExpressPCB.com
This Encoder Interface Board (EIB) provides a spot for the resistors
and transistors needed to allow the OOPic to power (L1, L2, GND,
+5vDC) and read the Encoder outputs (S1, S2) and the optical switch
a photo of my Encoder Interface Board with components:
are the EIB's circuit diagram and the board layout files. Note
that you'll need the free ExpressPCB
software to open these!
a shot of the EIB after build up:
Here it is attached to the Magnevation Dual PWM board.
terminals crimped and soldered.
using a H21A1/2/3 Slotted Optical switch. This
device has four pins (1-4). Pins 2&4 go to Ground, Pin
1 connects to L1 & Pin 3 is the output which connects to S3.
Here's the data sheet
for this switch (pdf). These can be purchased from
DigiKey. (DigiKey part #
H21A1-ND, $1.08 each)
the EIB and the Magnevation Dual PWM we have completely interfaced
both of the 9-pin motor connectors (both the Hip Actuator motor
and the Torso Rotation motor).
leaves the Soil Sampler interface as the last responsibility of
the leg section OOPic.
had planned to use relays but decided it would be best if I could
come up with a solid state circuit that the OOPic could use to
control the Soil Sampler.
I also wanted to be able to stop the Soil Sampler in mid-motion
when the Power Pack is pulled. So I bring both the
SS's ground supply wire and it's trigger wire up to the OOPic
using a two wire cable. Black(SS1) is the SS's ground
line (cut this and everything stops, ie Power Pack pulled). Purple(SS2)
is the SS's Trigger line (hold this to ground for about three
seconds to start the cycle).
didn't make a PCB for this. Instead I soldered everything together
in-line and used wire shrink tube to protect it. Basically
there are two circuits, SS1 & SS2, each of which can connect
it's output line to ground under OOPic Control. The
OOPic will control the Soil Sampler by grounding SS1 (cycle power)
for 20 seconds (long enough to cycle) and SS2 (trigger ground)
for about three seconds. If the power pack is pulled then
SS1 can be opened and the Soil Sampler will stop moving until
SS2 is closed again (Power pack plugged back in).
used some transistors from Radio Shack to construct the solid
circuit I used:
here to Download the ExpressPCB Circuit File)
Bus and OOPic Power connections
using 16 gauge AC power cords to bus DC power through the Robot.
They are readily available, flexible, and can be purchased
with connectors on each end.
ones I am using are three wire conductors. I'm using Green
as Ground, Blue as 12vDC and Brown as 24vDC. A patch cord
with a sliced in feed for the leg section circuits is used in
the leg section:
I/O Line Usage
sensor(input) and every output from the OOPic needs a dedicated
I/O line. Here's a list of the I/O lines used and their
Line 1: SS1 - Active Low Output. Connects the Soil
Sampler's Ground line.
I/O Line 2: SS2 - Active Low Output. Triggers the Soil Sampler
cycle when held low for three seconds.
Lines 18, 24 & 26 - PWM outputs for motor 1 (Hip actuator).
Lines 17, 25 & 27 - PWM outputs for motor 2 (Torso Rotation).
Lines 15 & 14- Motor 1 (hip) Encoder inputs (S1, S2).
I/O Lines 13 Motor 1 (hip) Optical switch input (S3)
Lines 10 & 11- Motor 2 (torso) Encoder inputs (S1, S2).
I/O Lines 12 Motor 2 (torso) Optical switch input (S3)
Entry Top Next