SEAPERCH II MODULE 1:
Robotic Whisker Sensor
Make your own simple and inexpensive touch sensors that work both in the air and underwater. Flick the whisker sensor and make an LED (light-emitting diode) light up on a remote display.
The sensors are completely DIY, from the cast silicone base to the electrical resistive components. On an underwater robot such as the SeaPerch, feedback from the sensors is used to inform the operator of obstacles, and help the operator keep the robot moving in areas where it can move freely. Touch sensors can also be mounted in a navigation course where the robot completes a challenge by touching a specified set of sensors.
How it works
This “robot whisker” is an inexpensive waterproof device that allows the SeaPerch to detect when it has made contact with a physical object. The whisker is a plastic stick mounted in stretchable silicone rubber. Embedded in the rubber is a path of conductive grease that serves as a resistor in a simple circuit. When the whisker is deflected, the rubber deforms and the conductive grease path changes shape, impacting its resistance. An Arduino microcontroller is programmed to detect the change in resistance and inform the operator of this “touch” with a flash of light (or a tone if a speaker is used).
This guide outlines the steps for making a whisker, the attachment to SeaPerch, and the electronic/Arduino connections.
Project tools and materials
|Quantity||Cost||Part Name||Link to Part|
|1 per whisker, reusable||$1||Molds to 3D print (3 parts: Base, Cast1-groove, Cast2-top)||Whisker molds – 3D printable (STL) files|
|1||$45||Ecoflex 00-30 Silicone (Parts A and B)||Ecoflex 00-30 – Super-Soft, Addition Cure Silicone Rubber – Pint Unit (Amazon)|
|1||$17||Disposable mixing cups, with wood mixing sticks, 8oz, pack of 100||100 Pack Plastic Measuring Cups (Amazon)|
|1 per whisker||$4||Cotton swabs with plastic stick||Swisspers Swab 500 ct (Amazon)|
|2||$13||10 ml plastic syringes||12 ml Plastic Syringes (Amazon)|
|1||$28||Carbon Conductive Grease, tube. MG Chemicals||MG Chemicals – 846-80G Carbon Conductive Grease, 80g Tube: Automotive Anti Seize Lubricants: Amazon.com: Industrial & Scientific (Amazon)|
|1||$12||24 AWG wire, silicone insulation, stranded (this is softer and more flexible than the standard PVC insulation wire).||BNTECHGO 24 Gauge Silicone Wire Kit 7 Color Each 25 ft Flexible 24 AWG Stranded Tinned Copper Wire (Amazon)|
|1||$10||25ft Ethernet Cable, or similar multi-conductor cable, 2 conductors per whisker. Old cables can be repurposed.||Use this page for reference: https://www.mcmaster.com/communication-cable/ethernet-cable-8/|
|1||$30||Multimeter to measure resistance||Such as: Crenova MS8233D Auto-Ranging Digital Multimeter Voltmeter Ohm Volt Amp Tester with Backlight LCD Display Test Leads (Amazon)|
|2||$6||Vinyl gloves, 100 count (do not use latex gloves)||Such as: ForPro Vinyl Gloves (Amazon)|
General tools and materials
Wiring and Soldering Equipment:
- Wire stripper
- Needle nose pliers
- Wire cutters
- Soldering iron
- Brass sponge
- Helping hands soldering aid
- Heat shrink tubing
- Heat gun
- 3D printer and filament
- Utility knife or Exacto knife
- Zip ties
- Hot glue gun
- Vinyl gloves
- Paper towels
Programming and Control:
- Arduino Uno (or similar microcontroller) and programming environment
- Jumper wires
- Solderless breadboard
- Resistor assortment
Overview of sensor molding process
Part 1 - Print molds and cast the first layer of silicone rubber
Step 1.1: Print the molds
Make the three mold pieces on the 3D printer: the Base, the Cast1-groove, and the Cast2-top. Check that Cast1-groove can fit on the Base. Trim any pieces that interfere with a good fit.
Check that Cast2-top can fit on the Base. Trim any pieces that interfere with a good fit.
Set aside the Cast2-top for now.
Step 1.2: Prepare the cotton swab (whisker)
Take one of the cotton swabs (must have a plastic stick, not paper). On one end, use scissors to cut about half of the cotton part off. On the other end, pull off all of the cotton.
Step 1.3: Measure and mix Ecoflex 00-30 silicone rubber
Ecoflex 00-30 has two parts: part A and part B. When these two parts are combined, they cure to form a solid, soft rubber-like material. The ratio of A:B is 1:1, and it can be measured by weight or volume. In either case, use a disposable plastic cup and wear vinyl gloves to protect skin. Before you begin, pre-mix Part B thoroughly.
Scale method: Place the plastic cup on the scale and zero the scale. Pour 3 g of part A into the cup, then pour 3 g of part B into the cup. The scale should read 6 g.
Volume method: Pour 3 ml of part A into the mixing cup, then pour 3 ml of part B into the cup.
Mix slowly and thoroughly for three minutes using a wood stick, scraping the sides and bottom of the cup. Do not stir quickly as it causes air bubbles to form.
Refer to Science/Tech Notes or EcoFlex instructions for more details.
Step 1.4: Pour silicone in the Base mold
Collect the Base mold, the Cast1-groove mold, a prepared plastic swab, and a paper towel.
Lay the paper towel on a flat surface and place the Base on top of it.
Pour silicone up to the first step in the Base mold. Overfilling is okay since any excess silicone will be pushed out by Cast1-groove.
Step 1.5: Add whisker and place Cast1-groove mold piece
Insert the whisker (swab) into Cast1-groove with the cotton side on the bottom (the horseshoe side of the mold).
Place the Cast1-groove piece on top of the Base mold, and align it.
Apply light downward pressure on the mold piece to push any excess silicone out of the Base mold.
Press down on the top of the plastic swab to ensure that the cotton swab is fully immersed into the silicone.
Leave the assembly in a well-ventilated area for four hours to let the silicone fully cure.
Step 1.6: Prepare the wires
For each whisker, cut two wire pieces from 24 AWG silicone wire, about 4” (10 cm) long.
Strip the insulation on both ends. The end that goes in the silicone should be stripped only ⅛” (3 mm). The other end will be soldered to another wire and should be stripped about ⅜” (1 cm) or longer.
Part 2 - Add grease, wires, and the second layer of silicone rubber
Step 2.1: Remove Cast1-groove cover and excess silicone
After the first cast is cured, remove the Cast1-groove mold piece by slowly lifting the handle.
There may be air bubbles in the cast silicone but it is not a problem since they can get filled in the second cast.
Cut or peel off excess silicone so there is a smooth channel for the wires.
Step 2.2: Insert the wires
In the Base mold, there are two notches on the sides of the wall. One notch is centered on the swab, and the other indicates where the exposed wire should begin.
Insert the wires into the two mold channels and line up the bare ends with that notch. Press the wires all the way into the channels. If the wires do not lay flat, try rotating the wire or take it out and straighten it until it lays flat.
Step 2.3: Prepare the grease syringe
Wear vinyl or latex gloves. Collect the 10 ml syringe and the Carbon Conductive Grease Tube.
Open the tube and insert the point of the syringe deep into the tube.
Pull the syringe back (it will most likely resist and try to return back to a relaxed state).
Hold the syringe in the pulled back position for several seconds to pull grease into the syringe.
It may be necessary to trim the tip of the syringe to make the opening bigger.
Step 2.4: Insert grease into grooves
Practice applying the grease in a smooth even line on a paper towel. Slowly push the plunger while moving the syringe away from the dispensed grease.
When ready, carefully insert the point of the syringe into the U-shaped channel in the silicone. Slowly push the plunger while moving the syringe throughout the channel to fill the channel completely with grease. The grease should be at least level with the height of the channel. If the wires poke up while spreading the grease, simply push them back down with the nose of the syringe.
Make sure the entire exposed part of the wire is fully covered in grease. Use a wood stick to remove any excess grease that is higher than the channel. The grease should be as level as possible with the silicone rubber.
Step 2.5: Repeat Step 1.3: Measure and mix Ecoflex 00-30 silicone rubber
Repeat Step 1.3: Measure and mix Ecoflex 00-30 silicone rubber
Step 2.6: Pour silicone into the Base mold, over grease and wires
Collect the Base with the silicone, wires, and grease, the Cast2-top mold, and a paper towel.
Lay a paper towel on a flat surface and place the Base on top.
Pour silicone up to the second cast level/step in the Base mold. Overfilling is okay since the excess silicone will be pushed out by the Cast2-top piece.
Step 2.7: Place the Cast2-top mold piece on the Base mold
Place the Cast2-top mold piece on top of the Base mold, and align it.
Apply light pressure on the mold piece to push any excess silicone out of the Base mold.
Leave the assembly in a well-ventilated area for four hours to let the silicone fully cure.
Step 2.8: Remove the Cast2-top cover
Remove the Cast2-top mold piece by slowly prying up the edges. It may take a minute or two since the silicone will stick to the top mold piece. There may be a couple of air bubbles – this is not a problem unless the bubble is exposing the grease. In that case, simply fill it once more with a little bit of silicone to cover up the bubble, and let it cure.
Step 2.9: Extract the whisker assembly and remove excess silicone
Once the silicone is ready to remove, slowly peel up the edges of the silicone rubber and pull upward. After a bit of peeling, the whisker assembly should come free out of the Base mold. If it is very difficult, use a utility or craft knife to cut along the edges of the silicone rubber base. Lift the whisker assembly out of the base mold. Use scissors to trim any excess silicone along the edges and near the wires.
Part 3 - Test the whisker sensors
Step 3.1: Find the baseline resistance of the whisker sensor
Use a multimeter to measure the resistance between the wires. The expected value is about 5 kΩ. Deflect the whisker to each side and verify that the resistance changes by about 20%. Leave the meter on the wires after deflecting the whisker and notice how the resistance slowly changes back to its original value.
Step 3.2: Create a display and an input circuit for the whisker sensor
The whisker sensor is fundamentally just a variable resistor. To read the change in that resistance, it needs to be used in an input circuit such as a simple voltage divider. Refer to Science/Tech Notes for more information on the voltage divider circuit used for the whisker sensor.
To build the input circuit, select a resistor that is about the same resistance as the whisker sensor in its undisturbed state, as determined in the previous step. In the example, the resistance chosen is 4.7 kΩ.
Use an LED to indicate a whisker touch and to check that the system is functioning appropriately.
Build the circuit shown here to test one whisker sensor.
- Whisker sensor
- Arduino Uno
- Solderless breadboard
- Resistor, ~100 Ω
- Resistor, ~4.7 kΩ
- The (+) end of the LED is connected to a digital pin (pin 8 in this example)
- The (-) end of the LED is connected to a resistor of ~100 Ω
- The other end of the resistor is connected to GND
- Make a voltage divider circuit with the 4.7 kΩ and the whisker sensor as shown
- Connect the sensor reading pin to an analog pin (pin A0 in this example)
Step 3.3: Connect the sensor and the Arduino and test the sensor in air
Connect the whisker sensor and the Arduino and use this sample code to test the whisker sensor: Whisker_Sensor_Test.ino.
To test the whisker, deflect it to any side, as if the robot were brushing by an object. Also try flicking it quickly. See this video for a demonstration: Whisker testing.mp4.
Here are a few ideas to fix or improve performance:
- Modify the percent change in resistance that indicates a touch by changing the value of the variable “change” in the code.
- Use a different resistor in the voltage divider.
- Watch the values on the Arduino Serial Monitor or Serial Plotter to better understand the problem.
Part 4 - Test on SeaPerch robot underwater
Step 4.1: Create a long cable for the whisker sensor(s)
Once the sensor is verified, make a longer cable so it can be used underwater.
Obtain a length of multi-conductor cable that fits the application. Cut back the outer covering about 4” (10 cm). Use one pair of wires for each whisker sensor. Strip the ends of the wires about ½” (1.5 cm) using the 26AWG section of the wire stripper.
Step 4.2: Connect the Whisker sensor wires to the cable wires
Use soldering tools, make good electrical connections between the whisker sensor wires and the cable wires. Make note of which wires go to which sensors. Use heat shrink tubing to insulate the connections. These connections do not need to be waterproof, however the exposed wire should be insulated from other conductors.
Step 4.3: Make the Arduino end of the cable
Add pins to the ends of the cable wires that will go to the Arduino. Collect jumpers with at least one pin end, two for each whisker.
Half of the jumpers can be the same color since they will all connect to GND. The other jumpers should be different colors, one for each whisker.
Choose colors that match the cable wires where possible. If some colors do not match, record a color code.
Cut the jumper wires in the middle and strip the cut end ~1 cm. Solder the wires to the cable wires. Put heat shrink tubing on each wire to stop the wires from touching each other.
Step 4.4: Connect the whisker cable to the Arduino and test
Connect the sensor(s) and add to the LED display as done in Steps 3.2 and 3.3.
Connect the cable wires to the Arduino. Fasten the cable to the display board with zip ties so the wires cannot be pulled out inadvertently.
The diagram here shows four whisker sensors and an LED display that corresponds to the positions of the whiskers.
Arduino code for this circuit, including a moving average filter, can be downloaded here: Whisker_Sensor_Test_4sensors.ino
Step 4.5: Attach the whisker assembly to PVC tubing for testing
The whiskers are easily attached to PVC pipe with zip ties.
Collect two zip ties for each whisker assembly. Place the whisker assembly flat on the PVC pipe and loosely fasten two zip ties around the pipe and silicone rubber. Keep the zip ties away from the grease channel. Tighten the zip ties only until the whisker is securely attached to the pipe. Do not over tighten the zip tie to the point where the silicone is crushed. Trim the ends of the zip ties.
Step 4.6: Test the whisker sensor(s) underwater
Create a test platform for all the sensors, such as the one shown that is made of PVC pipe.
This demo uses an 8-wire Ethernet cable to connect four whiskers. Remove the cable covering as needed in order to separate the wires and place the whisker sensors appropriately on the SeaPerch. Find a good place to secure the cable and use two zip ties to fasten it to the frame.
Neatly coil or wrap the excess wires and fasten them to the robot frame with zip ties or tape.
See this video of the example test: Whisker Demo
Now add the Robot Whiskers to the actual SeaPerch and have fun experimenting and exploring underwater!
Safety: Practice tool safety with an adult and follow directions for materials used in this module (e.g. work in a properly ventilated area, wear safety glasses, long sleeves, and vinyl gloves).
Cost: $95 – 160 (less if repurposing other materials)
Knowledge and skills needed:
- Familiarity with Arduino and wiring on a breadboard
- Basic wiring and soldering