Build it step by step
0 of 7 doneTest the FSR
Print the reading as you squeeze.
Test the ring
Light it at low brightness.
Map squeeze to colour
Slow hue changes.
Add the soft glow
Dim glow when untouched.
Add the themes
Long squeeze to switch.
Make the ball
Foam around the sensor, sealed wires.
Try it with the child
Adjust the colours and brightness.
How do you build a sensory calm light?
A soft pressure ball changes the colour of a lamp, giving children a calming sensory tool. You need Arduino Nano, Force sensitive resistor FSR 402, Resistor 10 kΩ, WS2812B ring 16 LEDs, 5 V 2 A USB adapter and Resistor 330 Ω. It takes 7 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 6
Parts list
- Development BoardsBuyArduino Nano × 1
- SensorsBuy
- PassivesBuyResistor 10 kΩ × 1
- OptoelectronicsBuy
- PowerBuy
- PassivesBuyResistor 330 Ω × 1
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| FSR one leg | Nano 5V | Top of the divider |
| FSR other leg and 10 kΩ | Nano A0, 10 kΩ to GND | Squeeze reading |
| LED ring DIN | 330 Ω resistor to Nano D6 | Data |
| LED ring VCC and GND | Nano 5V and GND | Power |
| 5 V adapter | Nano USB | Power |
Code
The force sensor sits inside a soft ball, wrapped in foam so the sensor cannot be felt, and squeezing changes the colour of the ring through slow fades. A long, firm squeeze for about 2.5 seconds changes the theme. The lamp is deliberately soft: low brightness and no flashing, because sudden or flickering light can be upsetting for some children and can trigger seizures in people with photosensitive epilepsy. This is a comfort tool and not a treatment or therapy for autism or any condition; children with sensory needs differ a lot, so involve the child and, where there is one, their occupational therapist. Use a 5 V USB adapter only, enclose the electronics so nothing small can be swallowed, and use a thick ball with all wires through a sealed cable exit; watch young children with it. Arduino IDE, board "Arduino Nano" (try the Old Bootloader option if the upload fails).
Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).
// Sensory calm light: squeeze the ball, the colour drifts. Library: Adafruit NeoPixel. Board: Arduino Nano.
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel ring(16, 6, NEO_GRB + NEO_KHZ800);
const int FSR = A0;
int theme = 0; float hue = 0, bright = 0.0; unsigned long hardSince = 0;
uint32_t colourFor(float squeeze) { // squeeze from 0 to 1 maps to a colour in the chosen theme
float h;
if (theme == 0) h = 40000 + squeeze * 15000; // calm blues to purples
else if (theme == 1) h = 20000 - squeeze * 14000; // greens to warm oranges
else h = 3000 + squeeze * 6000; // soft warm sunset
return ring.gamma32(ring.ColorHSV((uint16_t)h, 200, 255));
}
void setup() { ring.begin(); ring.setBrightness(40); ring.show(); } // brightness kept low and soft
void loop() {
float squeeze = constrain(analogRead(FSR) / 700.0, 0, 1);
// a long, hard squeeze changes the theme
if (squeeze > 0.95) { if (!hardSince) hardSince = millis(); if (millis() - hardSince > 2500) { theme = (theme + 1) % 3; hardSince = 0; delay(800); } }
else hardSince = 0;
float targetBright = squeeze > 0.05 ? 1.0 : 0.25; // a soft glow when no one is touching it
bright += (targetBright - bright) * 0.03; // slow fades only
hue += ((squeeze) - hue) * 0.02;
uint32_t c = colourFor(hue);
for (int i = 0; i < 16; i++) ring.setPixelColor(i, ring.Color(((c >> 16) & 255) * bright, ((c >> 8) & 255) * bright, (c & 255) * bright));
ring.show(); delay(20);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Untouched | Soft glow |
| Gentle squeeze | Colour drifts slowly |
| Hard squeeze for 2.5 seconds | Theme changes |
| Release | Fades back to the glow |
If it does not work
Colour jumps
Increase the smoothing values.
No response
Check the FSR divider and the pin.
Too bright
Lower setBrightness.
Ball feels lumpy
Add more foam over the sensor.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the sensory calm light?
Arduino Nano, Force sensitive resistor FSR 402, Resistor 10 kΩ, WS2812B ring 16 LEDs, 5 V 2 A USB adapter and Resistor 330 Ω.
How long does the sensory calm light take to build?
About 60 minutes for a beginner maker, in 7 steps.
How do I know the sensory calm light works?
Untouched: Soft glow. Gentle squeeze: Colour drifts slowly. Hard squeeze for 2.5 seconds: Theme changes.
Colour jumps: what should I check?
Increase the smoothing values.
No response: what should I check?
Check the FSR divider and the pin.
Too bright: what should I check?
Lower setBrightness.
Ball feels lumpy: what should I check?
Add more foam over the sensor.
