2.00b Toy Product Design

Thermometer Step-by-Step

Add user input

Many types of user interfaces are available for enabling users to affect how a product behaves. In this project, we'll be using switches, which are devices that open and close a circuit. For user input, we'll be using an OFF-(ON) switch. The parenthesis around "ON" indicates that the circuit is in the closed ON state only momentarily when the switch is flipped, and returns to the open OFF state immediately afterwards. A button that goes back to its unpressed state when the user releases the button is usually an OFF-(ON) switch. This is the type of button that we will be using now.

Later, in the final version of the thermometer, we will be adding an OFF-ON switch to turn on and off the battery power to the microcontroller. The user embodiment of this switch that we will be using is a rocker switch. When the user switches states on the rocker, the rocker stays in the state until the user switches states again. So, when the switch is turned to power ON, power is delivered until the switch is turned to power OFF.

For our initial prototype, we'll be using a button that has breadboard-friendly leads. For the final version, we'll swap it out with a more "real product" looking button. Despite the differences in appearance, they work in exactly the same way. One end is connect to ground and the other end to a digital pin of our microcontroller. For the tactile button, it does not matter which lead is positive and which lead is negative.

Place and connect the tactile button

Place the tactile button on the breadboard. It can be anywhere, but be sure that the two leads are in different rows of the breadboard! If they are in the same row on the same side, then the two leads will be electrically connected by the breadboard and the switch won't work! In our example, the leads are in 23i and 25i.

Wire the button:

  • Connect one lead (25j) to negative blue bus.
  • Connect the other lead (23j) to pin D2 (13j) on the Nano.

If you have trouble counting rows along components, using something thin like a toothpick to point as you count may help.

Test the button

Download button_test.zip. Open and run the button_test.ino file. Open the Serial Monitor to observe what happens when you press and release the button. A message will be printed when a button press is detected and when a button release is detected. Do you notice when the detection is not accurate? Try and see if you can get the program to inaccurately detect your button press or release (it may double/triple count it).

When a button is pressed or released, two pieces of conductive metal are coming together or apart. However, the pieces may "bounce" a bit (like a ball falling the the ground may bounce back into the air again before staying in contact with the ground permanently), so that instead of a single circuit state change event, the microcontroller detects multiple circuit state change events.

If you have problems with the button, please check your wiring. Be sure that one lead is connected to pin D2 of the Nano.

Test the thermometer

Now that we have all the parts wired up and tested individually, let's test our entire system together (minus the WiFi, which we'll add later)! Download thermometer_no_wifi.zip. Open and run the thermometer_no_wifi.ino file. If you wish, you may open the Serial Monitor to observe debugging information.

This program waits until the user presses and releases the button before taking a temperature reading. Watch the video below for a demonstration of this program.

We are not expecting you to read the code or to understand it at this point. But, if you have been reading the code, you'll notice that this program merges many of the concepts from the earlier test programs together. In addition, it includes the debouncing algorithm from Arduino for taking care of the inaccurate button press detections that might have been observed in the simple button test above.

Calibration

Take a look at the output in the Serial Monitor as you measure the temperature of different things. Notice that the temperature is being "adjusted" before being sent to the display. Your core body temperature is different from the skin temperature that the IR temperature sensor is measuring (further reading). Therefore, to get a comparable core body temperature result, the sensor reading must be adjusted.

We've provided you with a thermometer so that you can calibrate your IR thermometer. Over the next few days, please take contemporaneous readings with your Arduino thermometer and the off-the-shelf thermometer (oral readings are most accurate) and figure out what the adjustment in ° F should be in order for your Arduino thermometer to be most accurate. Because the IR temperature sensor has an accuracy of +/- 0.5 ° C, the adjustment factor will be different for each sensor.

Please note that the IR temperature sensor we are using is not a medical grade sensor, which has an accuracy of +/- 0.2 ° C. The medical grade sensors were over $50 each!