Digital Electronics

PHYS 432 - Spring 2020
(mini-)Projects

Updated Friday May 22, 2020

Final (mini-)Project

To finish the term, you will need to complete a (mini-)Project of your own design with the Arduino. I don't want this to be a major undertaking (unless you want it to be one) so I have a default project in mind for anyone who wants something more straightforward. The default project is to build a temperature sensor. The 4 tasks in Lab 6 introduce all of the Arduino concepts needed to build a thermistor-based temperature probe and write a (semi-calibrated) temperature to an LCD display.

If you want to be a bit more ambitious, there are a wide range of possibilities using the parts in our lab kit. Some examples will be discussed in class, but some random ideas in no particular order include the following. If you want to try something like this, you should discuss this with me to ensure you can succeed before you start.

(mini-)Project Requirements

You will need to show me your circuit in action over Zoom before Wednesday June 10th at 5PM. You need to schedule a time for this checkout, which shouldn't take more than 15 minutes. In addition, you need to turn in a brief (a few pages is fine) report describing the design and implementation of your project. This writeup should contain a summary of your design, implementation including a wiring diagram and narrative explanation of your code, and a summary of the problems you had and any thoughts as to what you might do differently next time. You also need to send me your code. This report and the code needs to be turned in by 5PM Friday June 12th at the latest. No late submissions will be accepted.

Temperature Sensor

If you don't want to think about a project idea, or you just want something straightforward, I am proposing the following temperature sensor as the default project. The information below outlines the idea, although you will still need to do some work to fully design the system.

A widely used technique for measuring temperature is to measure the resistance of a device that is temperature sensitive. In your lab kits, there is a negative temperature coefficient (NTC) thermistor that is designed for this purpose. The thermistor is a passive device with two leads, and is nothing more than a resistor with a large temperature dependence. The thermistors I sent you have the part number XLX-1516 with a nominal resistance of 10k. To get the best temperature sensitivity, this thermistor should be placed in series with an ordinary 10k resistor between +5V and ground. The voltage between the resistor and thermistor can then be measured, and with a bit of math, the actual resistance of the thermistor can be determined based on the voltage value measured. A 10k resistor was provided in your parts kit for this purpose. If you have lost it, you can also string together as many of the 1k resistors as you wish. As long as you are close to 10k, this technique will still work. An Arduino project that describes this idea more fully can be found here.

The resistance of a thermistor as a function of temperature is a slightly complicated function known as the Steinhart-Hart Equation. Ideally, the three parameters of this equation should be directly calibrated by comparing the thermistor resistance at three known temperatures. There is an approximation to the S-H equations that only requires one free parameter: 1/T = 1/TO + (1/beta) x ln (R/RO). For a relatively small range in temperatures, this approximation works well with some corresponding loss in accuracy. One benefit is that you only need to measure two points (say room temperature and freezing) to determine beta and calibrate your device. Most thermistors of a given type are very similar, so if you find typical coefficients for the XLX-1516 10k NTC thermistor online, they probably will work just fine.

Note that even though it isn't listed on the Language Reference page, the ATMega supports a fairly complete math library. In particular, log(x) gives you the natural log. The functions available are discussed here, although it appears as though you no longer need to include the math header in your sketch to use these functions.

Using the techniques presented in Lab 6, you should be able to create a circuit to measure the thermistor resistance, and then convert that into a temperature. For debugging it may be easiest to write this all to the serial port, but to complete the project you might as well write your temperature to the LCD display, or if you want a challenge you can try to use the dual 7-segment display. You should do some basic tests along the way, such as checking that the thermistor resistance you measure goes down as you heat the thermistor up, and once you think you have a reasonable calibration, you can try some experiments to see how accurate your thermistor is. You should also try to estimate the precision of your temperature probe (what is the smallest change in temperature that you can detect) and decide whether this precision is real, or whether you are just measuring noise. Averaging multiple ADC readings can be helpful to suppress statistical noise. Typically a sensor shouldn't report digits of precision that are dominated by noise, so you should match the precision of your display to the actual information you are getting from your circuit.

Remember to describe all of the details of your resistance measurement, temperature calibration, and testing in your report!