Picaxe Interface Options for use with the Parallax motion sensor
This
section describes other circuit options that can be connected to a
microcontroller. If you have not already done so see my page on controlling an MP3 player with a Microcontroller before reading this page. I use the Picaxe
microcontroller which I think is the cheapest and easiest to use but
you can use any microcontroller or controller (e.g. prop 1, etc) with
these circuits. By using one of the circuits below or the simple
transistor switch which is used to control the MP3 player should be
able to control just about any type of prop.
The
circuit below is used to control an electromechanical relay. A relay
can be used to switch both AC and DC voltages, close switch contacts
such as a prop try me button or a fogger control switch, or any other
prop or device that requires a switch closure to activate. NOTE: The
Diode across the relay must be used it is there to protect the
transistor. Current flowing through a relay coil creates a magnetic
field which collapses suddenly when the current is switched off. The
sudden collapse of the magnetic field induces a brief high voltage
across the relay coil which is likely to damage transistors and ICs.
The protection diode allows the induced voltage to drive a brief
current through the coil (and diode) so the magnetic field dies away
quickly rather than instantly. This prevents the induced voltage
becoming high enough to cause damage to transistors and ICs. This
circuit may also be used for a solenoid as well as a relay. By bringing
the pin high will activate the relay or solenoid.

This
circuit is used for a relay or solenoid whith a voltage other than 5
volts. Notice how the grounds (0V) are connected from the 2 different
voltages. All grounds in electroncis must be connected together.

Motors
can also be controlled just like relays. Motors being inductive devices
also require the protective diode to protect the transistor or mosfet.
You can use either a transistor or a mosfet to control a motor but a
mosfet is better suited to the task due to almost no voltage drop
across it thus allowing the full motor supply voltage to be applied to
the motor. Make sure the mosfet or transistor that you use has enough
current to handle the motor. As a rule of thumb the device should be
able to handle a least twice the current ot the motor. A heat sink may
be required on the mosfet or transistor for a high current motor. By
bringing the pin high will turn the motor on.

The
picaxe microcontroller can control servos directly. Some controllers
can not control servos. Check your controller documentation to be sure.
The servo can be controlled by the servo command. Please see the picaxe
documentation for more information (see link above). Once the servo
command is used the servo will hold that position until another servo
command is used or power is removed. Note the connection in the lower
left of the circuit is connected to the picaxe 5V ground (0V).

To
control AC devices an electromechanical relay can be used but there is
a better type of relay made from an electronic circuit and has no
moving parts and does not require a protection diode. It is called a
solid state relay or SSR for short. With this relay the AC is
completely isolated from the control circuit so it can not damage the
control circuit in case there is a problem. This is the preferred
method of controlling AC devices. The relay is controlled by a simple 5
volt supply from the controller. The two circuits below show how to
connect an SSR. In the first circuit everything in the dotted box is
the SSR contained in one package. The relay is switched on with a low
(0v) on the control pin. In the second circuit the relay is switch on
by a high (5V) on the control pin. Either circuit will work it depends
on your preference. The AC load indicated in the circuits can be a spot
light, a pnuematic valve, an AC motor, or any other AC device as long
as it does exceed the current ability of the SSR. Solid state relays
come in almost any current configuration.


 |