Thermometer Make Art Project

by baileyay in Craft > Cardboard

388 Views, 0 Favorites, 0 Comments

Thermometer Make Art Project

8BC231CF-BB87-4D54-8739-BC2A7F711587.jpeg

This is my thermometer I made for John Gallaugher's Physical Computing class at Boston College in Spring of 2022. The thermometer does an animation while playing a sound bite when Button A on the Circuit Playground Bluefruit (CPB) is pressed and then displays the temperature on the LED strip after the sound bite and animation are over. The thermometer can be useful for giving you the temperature when you wake up in the morning so you know what to expect when you step outside.

Supplies

- Long piece of cardboard (~18 inches by ~5 inches)

- Adafruit NeoPixel LED Strip with Alligator Clips (30 LEDS)

- 2 alligator clips

- Adafruit Circuit Playground Bluefruit

- Micro USB data cable

- 3 AAA batteries

- Adafruit Circuit Playground Bluefruit Power Pack

- Adafruit Circuit Playground Bluefruit External Speaker (with charging cable)

Build It

36EAAEE9-4170-45AF-B465-F91C0DF81424.jpeg
F38BB8A6-AB07-49A8-924B-8C47420362D8.jpeg
Screen Shot 2022-03-29 at 2.42.03 PM.png
Screen Shot 2022-03-29 at 2.39.34 PM.png
Screen Shot 2022-03-29 at 2.41.25 PM.png
Screen Shot 2022-03-29 at 2.40.36 PM.png
8BC231CF-BB87-4D54-8739-BC2A7F711587.jpeg

I used four sheets of white printer paper, cut them to size and then tape them down to cover the cardboard (this step is purely aesthetic, you can skip it if you want).

I then used scissors to puncture small holes in the card board so the three wires for my LED strip, my wire for the power pack, and my two alligator clips attached to the speaker wouldn't clutter up the front of the board too much.

I taped down the CPB underneath the holes I just punctured.

I taped down the LED strip above the CPB in such a way that it resembles a thermometer with the CPB being the red bulb at the bottom (see picture of finished product). The alligator clips for the strip run through a hole on the front side before coming back up through a whole on the backside and getting clipped to the V-Out, Ground, and TX pads on the top of the CPB. This is done to prevent the wires from cluttering up the front side too much.

The wires connecting the power pack to the CBP get run through a hoe just above the CPB before they're plugged in. I taped the power pack to the back of the cardboard.

I taped the speaker to the back and clipped one alligator clip to the base of the plug and the other one to the tip. These alligator clips were then run through the last remaining hole to the top left of the CPB, the clip attached to the base of the plug needs to go a Ground pad and the one attacked to the tip should go to the Audio pad at the top of the CPB.

I printed out numbers to represent the degrees Fahrenheit and Celcius on thermometer. The way I laid out the LED strip left me with seven LEDs to make up the interior of the thermometer, so each light represents about 14.2857 °F. Keep that in mind when taping down your numbers.

You can add whatever cool accessories you want/have space for at this point, I printed out a cool little sun clipart.

Code It

Screen Shot 2022-03-29 at 2.35.14 PM.png
Screen Shot 2022-03-29 at 2.35.34 PM.png
Screen Shot 2022-03-29 at 2.36.07 PM.png
Screen Shot 2022-03-29 at 2.36.17 PM.png

We're gonna need to import the modules time, board, random, neopixel, digitalio, and adafruit_thermistor as well as PWMAudioOut (from audiopwmio) and MP3Decoder so go ahead and import those right away.

I use red lights on the boarder the thermometer and then for the interior lights I start at a dark blue and get progressively yellow-er and then red-er as you go up the thermometer. It might be helpful to assign each color you want to use with an appropriate RGB right away. Put all these colors in an array for later.

I then set up the pixels and strip next and then coded the wake up animation. The wake up animation can be anything you want, you don't have to copy mine.

I then set up Button A, the CPB's built in thermometer, and the speaker/built-in audio. I defined up my play_audio function which will be very useful when we get to the while True loop at the bottom of the code. Make sure to call the wake_up_animation while the audio is playing in the play_audio function so the audio and animation play simultaneously.

My display_temp function animates the pixels on the CPB and then the first 23 lights on the strip in a manner similar to the wake up animation (just a little faster). The last seven lights are lit up based on the temperature reading from the temperature object we set up earlier. Each of the seven lights will light up in their corresponding color from the colors array we set up earlier. That final if statement in the last for loop of the function slows down the speed at which the lights are lit up progressively (only works for the last three lights to be lit up).

Before I get to the while True loop let me describe how you can get any audio clip you want onto your CPB. If you go to https://www.converto.io/en38///?, you can paste in the link of any YouTube video, crop it to your liking and save the audio to your computer, from there you can drag it from your downloads to your CPB. I used clips from Family Guy, Good Morning Vietnam, and Groundhog Day and obviously you can use clips from just about anything you want on your project. Keep in mind the CPB only has about 2 MB of space so you'll want to use MP3 files, not Wav files as those require much less storage.

In my while True loop I set all lights to black to clear any lights that may have been lit from previous animations when Button A is pressed (actually I should also have set the strip to black as well but I didn't run into any issues). I convert the temperature to Fahrenheit and choose a random sound bite from my list to play (which will also play the wake up animation). I then call the display temperature function.

Bask in Its Glory

GOOOOOOOD MOOOOOORNING VIETNAAAAAAAAM (Make Art Project Thermometer Normal Video)

Congratulations, you've made your own thermometer! Here's a video of my working thermometer.