Digital Thermometer


Digital real-time arduino thermometer

Created December 2020
Arduino
DHT-11
7 Segment Display
Transistors

Intro

When I recently moved into an apartment, there was no digital read of the temperature on the thermostat. I have been fascinated with these aesthetic brass circuit-sculptures on Instagram. I decided to merge the two ideas into a project, making a digital thermometer circuit sculpture.

Materials

This project had very few parts. I ordered the 0.8mm brass rod from kitkraft.com

Items
0.8mm Brass Rod
Arduino Micro Pro
8 Segment Display (4 digit)
4x Transistors (BC549)
DHT-11 Temperature Sensor

Method

After seeing other circuit-sculpture designs online, I wanted to have the display tilted upwards and the micro-controller to stand on a few pins as legs. While not visible, the four transistors are nestled under the display. I decided that best looking location for the sensor was hovering above the micro-controller.

When cutting the brass connections for the display to the micro-controller I just tried to be consistent. I mainly eyeballed the length and bend angles (Which is why they're not as straight as I anticipated). The connections for the temperature sensor turned out to be a series of bends to avoid the other connections.

Schematic

The display pins were correlated to the micro-controller's pins in a way that allows display to "sit" on top of the micro-controller. I placed the transistors inline with the common-cathode pins, as they will be tucked under the display.

Code

The full file on GitHub shows the pins mapped out across the device.

* I will not go over all of the functions in this file as there are many that only pertain to display initialization.

Here is the basic pin-to-variable setup along with DHT-11 instantiation.

I began by making very low-level code to simply switch a pin on, off, or blink it.

Furthermore making a higher-level function to turn all on/off.

This function implements a switch which correlates segments to display numbers.

A helper function to determine where to display the decimal point

flicker() coordinates the toggling of each 7 segment display in order to display a multi-digit number.

displayValue() calls flicker() depending on the result of dpIndex(), adjusting the digits and decimal point.

The setup() is fairly standard as all pins are outputs, hence not showing it.

This is the highest level of all the functions. The data is taken from the sensor, NaN condition is checked, and displayValue() is called.

Results

I should have spent more time on this project; there are many things that can be approved upon. Despite this thought, this project works fine & I do use it to take the room temperature. Looking at this project's appearence, I definitely could have done better.

While I tried to maintain a constant shape for all the brass rods, it was quite difficult. After soldering the brass connections to the display, they were not parallel & began to change color from the heat of the soldering iron. Working with the nested transistors under the display was a pain as the legs were tiny.

The code is another story. By no means is this the most efficient way to approach this problem. I will be writing better code when I complete this alphanumeric display project in the future.

Another "problem" arises from the temperature sensor's accuracy. I conducted an experiment, DHT-11 Accuracy, to test an array of these sensors.

This was my first project using brass rod, so I'm still trying to become better at using it. That being said, I enjoyed this project and plan on doing more with brass rod in the future.