ADAfruit makes some amazing little devices. One of them is the Circuit Playground.
I had this issue where I would do several projects at once, some involving the soldering iron, so i flip it on, do the job, and that’s it. notice what was left out of that sentence? yeah, sometimes i forget to turn it off. There have been several occasions where the iron was on overnight unattended. NO MORE.
I needed a temperature sensor,a micro controller, a speaker +amp, and LED’s to make a proper warning system that the soldering iron area is hot. guess what i used.

When the area above the iron reaches anything above 33° Celsius (almost 92 Fahrenheit), the circuit playground above the station switches to RED, and beeps a 1 KHz tone every 15 seconds. Every time it beeps, it takes a fresh measurement and resets that state.

When the temperature goes below 33°C, it goes back to its safe state, no beep, changes color to Green, and polls the temp about every second. it pulses a tiny LED on the board each time it is polled.
*One little warning, if you have a fan like the one pictured here (home made charcoal solder filter fan… for another post) and it is blowing on the iron, you may not get a good reading or warning. you can adjust the code if you need to.

I send the serial output to its connected COM port so you can do like i do, and monitor it yourself with the Arduino IDE, putty, or whatever you like to use.

with this info, you can read the simple code down below and see exactly what it is doing, and my hopes that anyone else that has ever left their iron on, uses my simple idea..
and YES, binder clips are what it being used to hold it, as you can see, it is perfect, so laugh, or improve it. I’d like to see other users do better, really. Send me an email or post a picture and let me know about it, ill include it here.
and here is the code i used to do this.
#include <Adafruit_CircuitPlayground.h>
float tempC, tempF;
void setup() {
Serial.begin(9600);
CircuitPlayground.begin();
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() { // use modified blink sketch for polling identifyer
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on
delay(10); // wait 10ms
digitalWrite(LED_BUILTIN, LOW); // turn the LED off
delay(10); // wait 10ms
tempC = CircuitPlayground.temperature();
tempF = CircuitPlayground.temperatureF();
Serial.print("tempC: ");
Serial.print(tempC);
Serial.print(" tempF: ");
Serial.println(tempF);
if (tempC < 33) {
for (int x = 0; x <= 9; x++) {
CircuitPlayground.setPixelColor(x, 0, tempC, 0); //(pixel#, RRR, GGG, BBB)
}
delay(1000);
}
else {
for (int x = 0; x <= 9; x++) {
CircuitPlayground.setPixelColor(x, tempF, 0, 0);
}
CircuitPlayground.playTone(1000, 50);
delay(15000);
}
}
#include <Adafruit_CircuitPlayground.h>
float tempC, tempF;
void setup() {
Serial.begin(9600);
CircuitPlayground.begin();
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() { // use modified blink sketch for polling identifyer
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on
delay(10); // wait 10ms
digitalWrite(LED_BUILTIN, LOW); // turn the LED off
delay(10); // wait 10ms
tempC = CircuitPlayground.temperature();
tempF = CircuitPlayground.temperatureF();
Serial.print("tempC: ");
Serial.print(tempC);
Serial.print(" tempF: ");
Serial.println(tempF);
if (tempC < 33) {
for (int x = 0; x <= 9; x++) {
CircuitPlayground.setPixelColor(x, 0, tempC, 0); //(pixel#, RRR, GGG, BBB)
}
delay(1000);
}
else {
for (int x = 0; x <= 9; x++) {
CircuitPlayground.setPixelColor(x, tempF, 0, 0);
}
CircuitPlayground.playTone(1000, 50);
delay(15000);
}
}
<code>
// This line includes the necessary library for the Adafruit Circuit Playground.
// It gives you access to all the functions for controlling its sensors, LEDs, and speaker.
#include <Adafruit_CircuitPlayground.h>
// Declare two global variables to store the temperature readings.
// `float` is used because temperature values can have decimal points.
float tempC, tempF;
void setup() {
// Start the serial communication at a baud rate of 9600.
// This allows you to view output from the board in the Arduino IDE's Serial Monitor.
Serial.begin(9600);
// This function must be called in setup to initialize all the Circuit Playground's components.
CircuitPlayground.begin();
// Set the built-in red LED pin as an output.
// The LED_BUILTIN variable is defined by the board's library.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
// --- Start: Modified Blink Sketch for Polling Identifier ---
// This section of the code provides a quick visual feedback loop.
// A brief blink of the red LED indicates that the program is running and actively polling sensors.
digitalWrite(LED_BUILTIN, HIGH); // Turn the built-in LED on.
delay(10); // Wait 10 milliseconds.
digitalWrite(LED_BUILTIN, LOW); // Turn the built-in LED off.
delay(10); // Wait 10 milliseconds.
// --- End: Modified Blink Sketch ---
// Read the temperature from the on-board sensor.
// `temperature()` returns the value in Celsius.
tempC = CircuitPlayground.temperature();
// Read the temperature from the on-board sensor and automatically convert it to Fahrenheit.
tempF = CircuitPlayground.temperatureF();
// Print the temperature values to the Serial Monitor for debugging and monitoring.
Serial.print("tempC: ");
Serial.print(tempC);
Serial.print(" tempF: ");
Serial.println(tempF);
// --- Start: Temperature Logic and Output ---
// Check if the temperature in Celsius is below 33 degrees.
if (tempC < 33) {
// If it is, iterate through all 10 NeoPixels on the board.
for (int x = 0; x <= 9; x++) {
// Set the color of each NeoPixel to a shade of green.
// The amount of green is based on the temperature (tempC),
// effectively creating a visual thermometer.
// (pixel#, RRR, GGG, BBB)
CircuitPlayground.setPixelColor(x, 0, tempC, 0);
}
// Pause for 1 second to make the color change visible.
delay(1000);
}
else {
// If the temperature is 33 degrees Celsius or higher, execute this block.
// This creates a different visual and audible alert.
for (int x = 0; x <= 9; x++) {
// Set the color of each NeoPixel to a shade of red, based on the Fahrenheit temperature.
// (pixel#, RRR, GGG, BBB)
CircuitPlayground.setPixelColor(x, tempF, 0, 0);
}
// Play a tone to indicate a higher temperature.
// The tone is 1000 Hz and lasts for 50 milliseconds.
CircuitPlayground.playTone(1000, 50);
// Pause for 15 seconds.
// This creates a longer delay when the high-temperature alert is triggered.
delay(15000);
}
// --- End: Temperature Logic and Output ---
}
</code>
