Intro: Simple Bot Switches, Sensors, and Modules
Sometimes we want to add some complexity to our Simple Bots so that the motors do more than spin in one direction. This is where switches, sensors and modules come in. These tools allow us to not only change the direction of the motor, but also vary the speed and toggle the motors on and off. These tools are indispensable in giving our bots personality and purpose. It is these added complexities that make the bots seem less like out of control machines and more like living creatures. Don't be afraid to experiment and try adding any of these modules to any of the Simple Bots.
Get the Simple Bots eBook for more projects!
Step 1: DPDT Switches
DPDT switches are mighty tools in bot building because they can allow you to reverse motor direction with the flick of a switch.
The way we typically use these switches, in Simple bots, is to have a lever attached to the motor shaft, which rotates around and toggles the switch, hence reversing its direction. In other words, the motor hits the switch and changes its direction and rotates the other way, and then again hits the switch and changes its direction and rotates back the way it came and hits the switch and changes its direction, etc.
You can get quite complex behaviors by using this technique. For instance, you can have something attached to a motor hit the switch back and forth very rapidly to quickly change motor direction. If you put this motor in parallel with other motors, the bot can have two motors quickly moving back and forth in unison, which is ideal for a walking bot.
Alternately, the motor can have a wheel do a full rotation, hit a switch, and reverse itself. You can then use this technique to have two motors which are both doing this at the same time, but slightly out of synch. This will create a bot which is constantly alternating between turning, and driving forwards and backwards.
So, as you can see, using this simple switch, you can get a bot to do a lot of complex and interesting activities.
Step 2: Reed Switch
A reed switch is essentially a magnetically actuated switch. To put it simply, when you move a magnet past it, it closes the switch and turns on the motor.
You can incorporate this into your bot to add a little more control. For instance, you can put a magnet on a rotating wheel and have it pass by a reed switch to turn on a different motor.
In this way, you can use one motor to pulse another motor at different rates and speed up or slow down its speed. In robotics, this is called pulse width modulation (or PWM for short).
Step 3: Tilt Switch
Tilt switches typically are metal tubes with a rolling metal ball inside. When the tube tilts, it makes an electrical connection between the body of its casing and the wire lead sticking out of it. Some other variations of tilt switches have two wires sticking out for each end of the switch.
Tilt switches are fun because they can be used to activate a motor when your bot tilts forwards or backwards. This is cool because it allows your bot to respond when it tilts in a certain way. This means, you can make a bot that is constantly correcting its own posture or, better yet, comically throwing itself off balance repeatedly.
Step 4: Simple Light Switch
In building Simple Bots, we are going to use a series of photo-coupled devices called modules. But, before we can do this, we need a good photo-couple to use as a light-activated switch. To make one of these switches, we will be using a special OSRAM-brand photo transistor and any standard NPN transistor (like a 2N2222, 2N3904, BC546, etc.). These switches will allow the motor to spin in direct correlatoin to how much light it senses. In other words, the more light, the faster the motor goes and the less light, the slower.
To learn how to build your own visit the Simple Light Switch instructable.
Step 5: Modules
In the Simple Bots eBook, modules are going to refer to photo-coupled consumer devices that allow you to "steal" logic and sensor output from standard consumer devices.
In other words, we are putting a light switch in front of an LED and when that LED gets turned on by computer logic or a sensor, the motor gets activated.
A few of the basic ideas for this are going to be demonstrated, but this technique can be used with anything that has an LED. As such, anything that your bot can carry and that has an LED, can be used as a controller.
Some example modules include the light module, the blink module, and the motion module