Projects / Sensory calm light

Sensory calm light

Beginner1 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANOFSR402

    Test the FSR

    Print the reading as you squeeze.

  2. NANO18.5 mA

    Test the ring

    Light it at low brightness.

  3. NANO

    Map squeeze to colour

    Slow hue changes.

  4. NANO

    Add the soft glow

    Dim glow when untouched.

  5. NANO

    Add the themes

    Long squeeze to switch.

  6. NANO

    Make the ball

    Foam around the sensor, sealed wires.

  7. NANO

    Try it with the child

    Adjust the colours and brightness.

In short

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

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
FSR one legNano 5VTop of the divider
FSR other leg and 10 kΩNano A0, 10 kΩ to GNDSqueeze reading
LED ring DIN330 Ω resistor to Nano D6Data
LED ring VCC and GNDNano 5V and GNDPower
5 V adapterNano USBPower

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.

CheckExpected
UntouchedSoft glow
Gentle squeezeColour drifts slowly
Hard squeeze for 2.5 secondsTheme changes
ReleaseFades 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 →

Ask Lark AI

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.