Introduction: Circuit Playground Express Thermometer

I wanted an office thermometer. Rather than buy one I used an Adafruit Circuit Playground Express to make one. It's digital/quasi-analog. The color shows the temperature range (green here - for 70's), with the number of NeoPixels showing the digits (so office temp shown here is 75). When it's dark the display turns off.

Supplies

Adafruit Circuit Playground Express https://www.adafruit.com/product/3333

3D Printer (I used PLA)

M3 x 8 screws(x4) and M3 nuts (x4)

Magnetic tape (https://www.amazon.com/gp/product/B073519752)

Step 1: Mount

I wanted some airflow in back since I wasn't sure if the board getting warm would affect the readings. The mount was designed in Fusion 360. Model available on Thingiverse (https://www.thingiverse.com/thing:3659694). Rather than try to keep the screws threaded in the PLA, I provided a space to put M3 nuts in for the M3 screws.

Step 2: Program

The code is Circuit Python, using the Adafruit libraries for the CPE. Most recent code available on GitHub (https://github.com/KFW/CPE_thermometer) but it's fairly basic.

# Office Thermometer
# for Adafruit Circuit Python Express # Uses color to indicate temp range, and then neopixels for exact temp # light sensor turns off NeoPixels if it's dark from adafruit_circuitplayground.express import cpx import time BLANK = (0,0,0) BLUE = (0,0,24) # 50's BG = (0,12,12) # 60's GREEN = (0,24,0) # 70's ORANGE = (18,6,0) # 80's RED = (24,0,0) # 90's TEMP_COLOR = {5:BLUE, 6:BG, 7:GREEN, 8:ORANGE, 9:RED} while True: cpx.pixels.fill(BLANK) # make sure pixels refresh if cpx.light > 10: # don't display temp if room is dark temp = int(cpx.temperature * 1.8 + 32.5) # extra 0.5 to make sure temp # rounds correctly if temp < 50: temp = 50 # in the unlikely event temp is lower than 50's if temp > 99: temp = 99 # in unlikely event temp in the 100's tens = temp//10 digit = temp%10 # for temp ending in '0' light up only pixel 0 (tenth pixel as mounted) if digit == 0: cpx.pixels[0] = TEMP_COLOR[tens] # otherwise fill in digits clockwise from 7 o'clock position else: for i in range(digit): cpx.pixels[9 - i] = TEMP_COLOR[tens] # use '9 -' since pixels # in reverse order time.sleep(60) # cycle every 60 seconds

Step 3: Mount

I used some magnetic tape on the back to mount it.