STEP 1 / 6ELECTRONICS

Whisker for Robots

Whiskers on robots are simple sensors that work like an animal's whiskers, picking up on things in the environment that are close by. When the sensor is moved, it sends a pulse to the rob…

Robot prototype with a steel-string mechanical whisker, LM339 comparator circuit and three-wire controller interface
PROJECT#015
TRACKElectronics
PARTS11
STAGES06
STEP 1 / 6 · Overview

Know the mission before touching a wire.

Understand what you are making, prepare the right tools, and make the workbench safe.

01

Project details

Whisker for Robots is a electronics project. Whiskers on robots are simple sensors that work like an animal's whiskers, picking up on things in the environment that are close by. When the sensor is moved, it sends a pulse to the rob…

Source pages
60-61
Named parts
11
Build goal
Working, tested prototype
02

Tools you need

  • Digital multimeter
  • Wire stripper and side cutters
  • Soldering iron with a fine tip
  • Current-limited bench supply

Use eye protection, good lighting, and a clean insulated surface throughout the build.

03

Safety precautions

  • Disconnect every power source before changing a connection.
  • Check component polarity, pinout, and supply voltage twice.
  • Use a current limit for the first power-up.
  • Keep liquids, loose metal, and uninsulated wires away from the bench.
Ready to continue?
STEP 2 / 6 · Circuit-verified parts library

Gather, identify, and understand every part.

Use the standardized inventory, then open What's this? to learn each part's role, advantages, limitations, handling, and specifications.

✓ COMPLETE CIRCUIT BOMAll 11 component references, values, and stage-specific names from the reviewed schematic are included below.
CIRCUIT-VERIFIED PROJECT INVENTORY11 PART LINES
PARTTYPEQTYREADY
PPWR1 - regulated +5V DC supply with a common 0V returnPOWER1
What's this?Image, role, pros, cons, handling & specifications
Regulated 5V DC supplyPOWER LEARNING VIEW

PWR1 - regulated +5V DC supply with a common 0V return

A power component supplies, converts, stores, or regulates energy for the project.

What it does here

It must provide the documented voltage, polarity, isolation, and sufficient current safely.

Buy / compare this part

Advantages

  • Stable power improves reliability
  • Current limiting protects first tests
  • Regulation reduces resets and noise

Limitations

  • Wrong polarity can cause immediate damage
  • Underrated parts overheat
  • Mains circuits require qualified supervision

Handling

  • Measure output before connection
  • Use a fuse or current limit
  • Insulate exposed conductors

Specifications to verify

  • Use the exact model, value, package, and rating listed for PWR1 - regulated +5V DC supply with a common 0V return; similar-looking parts are not always interchangeable.
  • Confirm input/output voltage, current, polarity, connector, isolation, and thermal rating.
SIC1 - LM339 quad voltage comparator in a DIP-14 package; channel 1 uses pins 2, 4 and 5SEMICONDUCTOR1
What's this?Image, role, pros, cons, handling & specifications
LM339 quad voltage comparatorSEMICONDUCTOR LEARNING VIEW

IC1 - LM339 quad voltage comparator in a DIP-14 package; channel 1 uses pins 2, 4 and 5

A semiconductor stage performs switching, amplification, regulation, rectification, or logic.

What it does here

It controls current or signal flow at a defined point in the circuit.

Buy / compare this part

Advantages

  • Fast and efficient
  • Compact
  • Can control larger loads from smaller signals

Limitations

  • Pin order varies
  • Sensitive to overvoltage and reverse polarity
  • May need cooling or bias components

Handling

  • Verify the datasheet pinout
  • Avoid static and soldering heat
  • Check notch, stripe, or flat-face orientation

Specifications to verify

  • Use the exact model, value, package, and rating listed for IC1 - LM339 quad voltage comparator in a DIP-14 package; channel 1 uses pins 2, 4 and 5; similar-looking parts are not always interchangeable.
  • Confirm pinout, maximum voltage/current, dissipation, gain or forward voltage, and package.
SR1 - 10kΩ pull-up resistor for the whisker input and LM339 pin 4SEMICONDUCTOR1
What's this?Image, role, pros, cons, handling & specifications
LM339 quad voltage comparatorSEMICONDUCTOR LEARNING VIEW

R1 - 10kΩ pull-up resistor for the whisker input and LM339 pin 4

A semiconductor stage performs switching, amplification, regulation, rectification, or logic.

What it does here

It controls current or signal flow at a defined point in the circuit.

Buy / compare this part

Advantages

  • Fast and efficient
  • Compact
  • Can control larger loads from smaller signals

Limitations

  • Pin order varies
  • Sensitive to overvoltage and reverse polarity
  • May need cooling or bias components

Handling

  • Verify the datasheet pinout
  • Avoid static and soldering heat
  • Check notch, stripe, or flat-face orientation

Specifications to verify

  • Use the exact model, value, package, and rating listed for R1 - 10kΩ pull-up resistor for the whisker input and LM339 pin 4; similar-looking parts are not always interchangeable.
  • Confirm pinout, maximum voltage/current, dissipation, gain or forward voltage, and package.
PR2 - 10kΩ upper resistor of the half-supply reference dividerPASSIVE1
What's this?Image, role, pros, cons, handling & specifications
10kΩ axial through-hole resistorPASSIVE LEARNING VIEW

R2 - 10kΩ upper resistor of the half-supply reference divider

A passive component sets current, voltage, timing, filtering, or signal behaviour without adding gain.

What it does here

Its exact value and tolerance determine how the surrounding stage behaves.

Buy / compare this part

Advantages

  • Simple and dependable
  • Low cost
  • Easy to measure before installation

Limitations

  • A wrong value can stop or damage the circuit
  • Ratings must not be exceeded
  • Polarized parts require correct orientation

Handling

  • Measure unclear values
  • Observe capacitor polarity
  • Avoid overheating leads while soldering

Specifications to verify

  • Use the exact model, value, package, and rating listed for R2 - 10kΩ upper resistor of the half-supply reference divider; similar-looking parts are not always interchangeable.
  • Confirm value, tolerance, power or voltage rating, polarity, and package size.
PR3 - 10kΩ lower resistor of the half-supply reference dividerPASSIVE1
What's this?Image, role, pros, cons, handling & specifications
10kΩ axial through-hole resistorPASSIVE LEARNING VIEW

R3 - 10kΩ lower resistor of the half-supply reference divider

A passive component sets current, voltage, timing, filtering, or signal behaviour without adding gain.

What it does here

Its exact value and tolerance determine how the surrounding stage behaves.

Buy / compare this part

Advantages

  • Simple and dependable
  • Low cost
  • Easy to measure before installation

Limitations

  • A wrong value can stop or damage the circuit
  • Ratings must not be exceeded
  • Polarized parts require correct orientation

Handling

  • Measure unclear values
  • Observe capacitor polarity
  • Avoid overheating leads while soldering

Specifications to verify

  • Use the exact model, value, package, and rating listed for R3 - 10kΩ lower resistor of the half-supply reference divider; similar-looking parts are not always interchangeable.
  • Confirm value, tolerance, power or voltage rating, polarity, and package size.
SR4 - 10kΩ pull-up resistor for the LM339 open-collector output at pin 2SEMICONDUCTOR1
What's this?Image, role, pros, cons, handling & specifications
LM339 quad voltage comparatorSEMICONDUCTOR LEARNING VIEW

R4 - 10kΩ pull-up resistor for the LM339 open-collector output at pin 2

A semiconductor stage performs switching, amplification, regulation, rectification, or logic.

What it does here

It controls current or signal flow at a defined point in the circuit.

Buy / compare this part

Advantages

  • Fast and efficient
  • Compact
  • Can control larger loads from smaller signals

Limitations

  • Pin order varies
  • Sensitive to overvoltage and reverse polarity
  • May need cooling or bias components

Handling

  • Verify the datasheet pinout
  • Avoid static and soldering heat
  • Check notch, stripe, or flat-face orientation

Specifications to verify

  • Use the exact model, value, package, and rating listed for R4 - 10kΩ pull-up resistor for the LM339 open-collector output at pin 2; similar-looking parts are not always interchangeable.
  • Confirm pinout, maximum voltage/current, dissipation, gain or forward voltage, and package.
PWS1 - 10cm flexible steel guitar-string whisker contactPART1
What's this?Image, role, pros, cons, handling & specifications
Robot prototype with a steel-string mechanical whisker, LM339 comparator circuit and three-wire controller interfacePART LEARNING VIEW

WS1 - 10cm flexible steel guitar-string whisker contact

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for WS1 - 10cm flexible steel guitar-string whisker contact; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
PTB1 - copper tube approximately 20mm long and 4mm in diameterPART1
What's this?Image, role, pros, cons, handling & specifications
Robot prototype with a steel-string mechanical whisker, LM339 comparator circuit and three-wire controller interfacePART LEARNING VIEW

TB1 - copper tube approximately 20mm long and 4mm in diameter

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for TB1 - copper tube approximately 20mm long and 4mm in diameter; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
PG1 - insulating rubber bush that centres the steel string inside the copper tubePART1
What's this?Image, role, pros, cons, handling & specifications
Robot prototype with a steel-string mechanical whisker, LM339 comparator circuit and three-wire controller interfacePART LEARNING VIEW

G1 - insulating rubber bush that centres the steel string inside the copper tube

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for G1 - insulating rubber bush that centres the steel string inside the copper tube; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
BW1-W2 - two insulated hookup wires, one soldered to the copper tube and one to the steel stringBUILD1
What's this?Image, role, pros, cons, handling & specifications
Robot prototype with a steel-string mechanical whisker, LM339 comparator circuit and three-wire controller interfaceBUILD LEARNING VIEW

W1-W2 - two insulated hookup wires, one soldered to the copper tube and one to the steel string

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for W1-W2 - two insulated hookup wires, one soldered to the copper tube and one to the steel string; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
PJ1 - optional three-pin interface header carrying comparator signal, +5V and common 0V to the robot controllerPART1
What's this?Image, role, pros, cons, handling & specifications
Three-pin robot controller interface headerPART LEARNING VIEW

J1 - optional three-pin interface header carrying comparator signal, +5V and common 0V to the robot controller

A named project component whose exact role is defined by the source circuit and build guide.

What it does here

It performs a documented electrical, control, interface, or construction function in this project.

Buy / compare this part

Advantages

  • Selected for this project
  • Can be checked independently
  • Supports modular troubleshooting

Limitations

  • Substitutes may differ
  • Generic names can hide variants
  • Pinouts and ratings vary

Handling

  • Compare the received part with the source
  • Keep it labelled
  • Do not force connectors or adjusters

Specifications to verify

  • Use the exact model, value, package, and rating listed for J1 - optional three-pin interface header carrying comparator signal, +5V and common 0V to the robot controller; similar-looking parts are not always interchangeable.
  • Confirm dimensions, ratings, connection method, polarity, and environmental limits.
Ready to continue?
STEP 4 / 6 · Source code

Confirm the hardware-only control path.

This project does not include firmware in the source. The circuit itself provides the required behaviour.

01

How to connect

  1. Match every controller label to the circuit view and source pin map.
  2. Join grounds before signal wires when separate low-voltage supplies are used.
  3. Keep motors, relays, pumps, and other loads on a suitable driver and external supply.

Common mistakes

Reversed VCC/GND, board-label versus GPIO-number confusion, missing common ground, and charge-only USB cables.

Troubleshoot

Disconnect loads, continuity-test one path at a time, then test with a current limit.

02

Software preparation

No IDE, board package, library, or firmware upload is required for this project.

If you add a programmable controller as an extension, document its pin map separately.

03

How to upload code

The original design is implemented entirely in hardware, so proceed after verifying the circuit and supply.

Ready to continue?
STEP 5 / 6 · Build

Assemble, deploy, test, and troubleshoot.

Use the complete source notes in build order, then pass the final checks before calling the project finished.

ASSEMBLY

Build in functional stages

  • Power and regulation
  • Controller or processing stage
  • Inputs and sensors
  • Outputs and loads
  • Enclosure and strain relief
TEST

Power up safely

  • Inspect unpowered continuity first
  • Apply the lowest safe current limit
  • Measure supply rails before signals
  • Add one load at a time
  • Record expected and actual results
TROUBLESHOOT

Work from simple to complex

  • Confirm power, ground, polarity, and orientation
  • Compare each pin with the source
  • Test inputs separately from outputs
  • Replace only one variable at a time
  • Power off before every correction
PROJECT-SPECIFIC BUILD NOTES

Follow the documented instructions.

These notes come from this project's source and remain in their original order.

01

Project overview

Project build note

Whiskers on robots are simple sensors that work like an animal's whiskers, picking up on things in the environment that are close by. When the sensor is moved, it sends a pulse to the robot to let it know there is an obstacle.

Steel guitar strings can be used to make whiskers that are sensitive and inexpensive for general use. These strings are very flexible, easy to use, and conduct electricity. Take a copper tube that is 2 cm long and 4 mm wide. Cut a 10-centimeter piece of guitar string and slide it into the copper tube. Use a rubber bush insert at the tube's end to keep the string in the middle of the tube. Figure 1 shows how the last mechanical whisker should look. Solder a wire to one end of the copper tube and another wire to the end of the steel string. Only one of the four channels that can be made with one LM339 is shown in the diagram (IC1). The IC LM339 series is made up of four independent precision voltage comparators. The offset voltage for all four comparators can be as low as 2 mV. These are made so that they can work on a wide range of voltages from a single power source. Here, we have only used the first one. Pin 5 of the IC LM339 is a non-inverting input, and resistors R2 and R3 connect it to a fixed voltage. As shown in Fig. 2, the inverting input (pin 4) is pulled high by R1 and connected to the mechanical whisker. Because the LM339 only has open-collector outputs, the pull-up resistor R4 is used. The way it works is easy. At first, when there are no interruptions, the comparator's output stays low. When something touches the guitar string of the whisker switch, pin 4 of IC1 goes low and pin 2 of IC1's first comparator goes high for a short time. We've only talked about one comparator, but the other three can be used in the same way. Through this comparator output, the robot's brain, or microcontroller, can now find out what the whisker switch is doing.

Ready to continue?
PROJECT ACHIEVED

You built Whisker for Robots.

You followed the full workflow from understanding the mission to testing the finished project. That is a real engineering achievement - well done.

Farmhouse Lantern-Cum-Flasher project thumbnail featuring Operational amplifier, LM358, T1, T2 - transistor stages identified in the circuit
NEXT ELECTRONICS ADVENTURE

Farmhouse Lantern-Cum-Flasher

Ready to reuse what you learned in another project from the same track?

Start this project
Browse all 500 projects