Built-in project · no microcontroller

Squeeze and bend

A force-sensing resistor lights a lamp harder the harder it is pressed, and a flex sensor climbs from 25 k on a multimeter as it bends. There is no microcontroller in it: the simulator solves the 5 parts as a circuit, so it runs the moment you press Run, and nothing needs compiling.

StarterRuns in your browser. Free, and no account needed.

Squeeze and bendlive0.000 s 0.00x
Click to open it in the editor
The circuit itself, running here on the simulator. Press what can be pressed; click anything else to open it in the editor.

How it works

There is no microcontroller in this one, so nothing is compiled: the simulator solves the circuit itself. The file in the editor is the notes that come with it.

sketch.ino
// Squeeze and bend: an FSR lighting a lamp, a flex sensor on a meter.
//
//   5 V -> 220 ohm -> lamp -> FSR -> ground
//   meter on ohms, across the flex sensor
//
// The FSR is open until about 20 g, then falls from about 36 k to under 1 k
// at 2 kg, so the lamp goes from off, to dim, to bright. The flex sensor is
// 25 k flat and climbs as it bends.

Parts list

7 parts, plus the jumper wires. Every one is in the editor's parts bin.

How it is wired

6 connections, pin by pin, read from the circuit itself. Each line is one set of pins joined together, by a jumper wire or a breadboard strip.

  • 5 V: Resistor, 220 Ω pin 1
  • Ground: Force-sensing resistor pin 1
  • Resistor, 220 Ω pin 2; LED, yellow pin A
  • LED, yellow pin C; Force-sensing resistor pin 2
  • Flex sensor pin 1; Multimeter pin V
  • Flex sensor pin 2; Multimeter pin COM

Change it and keep it

Open it in the editor, change the circuit or the code, and keep your version in a free account.