How to make light up antenna for your robot
These whisker/antenna sensors work like normal touch sensors but change colour when they touch something.
The first video is my original prototype using a single coloured LED. It is the same circuit shown here.
The second video is my final prototype with the bi-colour LED. It is just as easy to make and looks better.
The third video shows the centipede in action with the three antenna. Input from the rear antenna just stops it from reversing too much in a tight corner with the present code.
Click on the photos for a closer look :-)
The photo below shows how I have bent the wires back and into the board again for greater strength.
This is a simple digital input sensor that can be used on any robot. It can run on 3.3V although the 220 ohm resistor will need to be reduced to 75 ohms.
The digital output has a 1K resistor in series to protect the digital pin of the processor in case it is accidently set to output.
When the antenna is not touched the output is held low by the 4K7 resistor.
The red LED does not light up as both connections go to ground by resistors. The green LED is always powered as it has positive connected directly to it's anode and the cathode goes to ground through the 220 ohm current limiting resistor. My antenna use a bi-colour LED with a common cathode but a seperate red and green LED can be used.
When the antenna hits an object and bends enough to touch the ring around it the output is now connected to the positive as is the anode of the red LED.
Those who are new to electronics might think that both LEDs would light up as the both have their anodes connected directly to positive and their cathodes are connected to ground by a common current limiting resistor.
This is not so. LEDs require a minimum voltage across them befor they conduct called a forward voltage drop. The red LED typically has a voltage drop of 2.1V. The green typically has a higher voltage drop of about 2.4V. Because they are wired in parallel they can only have one voltage across them so once the voltage reaches 2.1V, the red LED comes on and prevents the green LED from turning on.
Other colours can be used as long as the LED with the highest voltage drop is the one wired directly to the positive otherwise the colour won't change when the antenna is touched.
While I have used a simple loop of wire to make my switch any switch will do. The advantage of the wire loop is that it works in any direction.
The disadvantage is that is the antenna hit something hard enough then the wire loop may get bent out of position causing the output to stay high. A lot depends on the length and springyness (is that a word?) of your antenna wire.
Straightened paper clips is a popular source of wire. My loops are just the offcuts of my component leads.