Build it step by step
0 of 7 doneTest the thermistor
Read it in the air and in your hand.
Convert to degrees
Check against a thermometer.
Map to colour
Blue cool, red warm.
Smooth the change
A slow fade.
Cut the power use
Pulse the divider and dim the LED.
Calibrate
Adjust the cold and hot points.
Build the ring
Small holder and a window for the LED.
How do you build a mood ring thermometer?
A ring that changes colour with your skin temperature. You need ATtiny85-20PU microcontroller, NTC thermistor 10 kΩ (B3950), RGB LED 5 mm common anode, CR2032 coin cell, CR2032 coin cell holder, Resistor 10 kΩ, Resistor 220 Ω × 3 and Slide switch SPDT (SS12D00). It takes 7 steps and about 60 minutes.
- Level
- Beginner
- Time
- About 60 min
- Parts
- 8
Parts list
- Integrated CircuitsBuy
- SensorsBuy
- OptoelectronicsBuy
- BatteriesBuyCR2032 coin cell × 1
- PowerBuy
- PassivesBuyResistor 10 kΩ × 1
- PassivesBuyResistor 220 Ω × 3
- SwitchesBuy
Tick what you already own. It saves to My Garage, so “Build with what I have” knows.
Wiring
| From | To | Why |
|---|---|---|
| Coin cell plus | Slide switch, then ATtiny85 pin 8 and the LED common anode | Power |
| Coin cell minus | ATtiny85 pin 4 | Ground |
| NTC and 10 kΩ | Divider to ATtiny85 PB3 (pin 2), top of the divider from PB2 (pin 7) | Temperature sense (powered only while reading) |
| RGB red cathode | 220 Ω to ATtiny85 PB0 (pin 5) | Red |
| RGB green cathode | 220 Ω to ATtiny85 PB1 (pin 6) | Green |
| RGB blue cathode | 220 Ω to ATtiny85 PB4 (pin 3) | Blue |
Code
A 10 kΩ NTC thermistor changes resistance with temperature; with a fixed 10 kΩ it forms a divider that the ATtiny85 reads, and the B-parameter formula turns that into degrees. The thermistor should sit in a small hole where it touches skin; skin temperature changes with the room, exercise and circulation, not with feelings, so this is a fun gadget and cannot tell your mood. The divider is powered from a pin for a few milliseconds per reading to save the battery, and the LED runs at about 30 percent brightness. A coin cell has little current to give, so keep the LED dim, add a slide switch, and expect days rather than weeks of use. Coin cells are dangerous if swallowed, especially by young children, so use a closed holder and keep spares away from them. Calibrate against a trusted thermometer in a glass of warm water.
Runs on a virtual ATtiny85 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).
// Mood ring: skin temperature to colour. Board: ATtiny85 (ATTinyCore, 1 MHz). Common-anode RGB: PWM 255 = off.
const int R = 0, G = 1, B = 4, PWR = 2, SENSE = A3;
const float TCOLD = 28.0, THOT = 36.0; // blue at 28 C, red at 36 C
float shown = TCOLD;
float readTemp() {
pinMode(PWR, OUTPUT); digitalWrite(PWR, HIGH);
delay(5);
long sum = 0;
for (int i = 0; i < 8; i++) sum += analogRead(SENSE);
digitalWrite(PWR, LOW); pinMode(PWR, INPUT);
float v = sum / 8.0;
if (v < 5 || v > 1018) return TCOLD;
float r = 10000.0 * v / (1023.0 - v); // NTC on the low side of the divider
float k = 1.0 / (log(r / 10000.0) / 3950.0 + 1.0 / 298.15);
return k - 273.15;
}
void setRGB(int r, int g, int b) { analogWrite(R, 255 - r); analogWrite(G, 255 - g); analogWrite(B, 255 - b); }
void setup() { pinMode(R, OUTPUT); pinMode(G, OUTPUT); pinMode(B, OUTPUT); }
void loop() {
float t = readTemp();
shown += (t - shown) * 0.2; // smooth fade between colours
float f = constrain((shown - TCOLD) / (THOT - TCOLD), 0.0, 1.0);
int r = (int)(255 * f * 0.3); // low brightness saves the coin cell
int b = (int)(255 * (1.0 - f) * 0.3);
int g = (int)(255 * (1.0 - fabs(f - 0.5) * 2.0) * 0.3);
setRGB(r, g, b);
delay(200);
}Test checklist
What you should see at each check. If a reading is far off, stop and use the troubleshooting list.
| Check | Expected |
|---|---|
| Cold fingers | Blue |
| Warm hands | Green then red |
| Slide switch off | Dark |
| Colour change | Smooth, not jumpy |
If it does not work
Wrong colours
Check the common-anode wiring and PWM inversion.
Temperature off
Calibrate and check the divider side.
Dim or dead
Fresh coin cell and lower brightness.
Jumpy
Increase the smoothing.
Still stuck? Find the fault step by step with your multimeter →
Common questions
What parts do I need for the mood ring thermometer?
ATtiny85-20PU microcontroller, NTC thermistor 10 kΩ (B3950), RGB LED 5 mm common anode, CR2032 coin cell, CR2032 coin cell holder, Resistor 10 kΩ, Resistor 220 Ω × 3 and Slide switch SPDT (SS12D00).
How long does the mood ring thermometer take to build?
About 60 minutes for a beginner maker, in 7 steps.
How do I know the mood ring thermometer works?
Cold fingers: Blue. Warm hands: Green then red. Slide switch off: Dark.
Wrong colours: what should I check?
Check the common-anode wiring and PWM inversion.
Temperature off: what should I check?
Calibrate and check the divider side.
Dim or dead: what should I check?
Fresh coin cell and lower brightness.
Jumpy: what should I check?
Increase the smoothing.
