Posts | Comments

Planet Arduino

Archive for the ‘oversampling’ Category

For years [Edward] has been building professional grade underwater sensing nodes at prices approachable for an interested individual without a government grant. An important component of these is temperature, and he has been on a quest to get the highest accuracy temperature readings from whatever parts hit that sweet optimum between cost and complexity. First there were traditional temperature sensor ICs, but after deploying numerous nodes [Edward] was running into the limit of their accuracy. Could he use clever code and circuitry to get better results? The short answer is yes, but the long answer is a many part series of posts starting in 2016 detailing [Edward]’s exploration to get there.

Orange is 12 bits, red is 24

The first step is a thermistor, a conceptually simple device: resistance varies with temperature (seriously, how much more simple can a sensor get?). You can measure them by tapping the center of a voltage divider the same way you’d measure any other resistance, but [Edward] had discarded this idea because the naive approach combined with his Arduino’s 10 bit ADC yielded resolution too poor to be worthwhile for his needs. But by using the right analog reference voltage and adjusting the voltage divider he could get a 20x improvement in resolution, down to 0.05°C in the relevant temperature range. This and more is the subject of the first post.

What comes next? Oversampling. Apparently fueled by a project featured on Hackaday back in 2015 [Edward] embarked on a journey to applying it to his thermistor problem. To quote [Edward] directly, to get “n extra bits of resolution, you need to read the ADC four to the power of n times”. Three bits gives about an order of magnitude better resolution. This effectively lets you resolve signals smaller than a single sample but only if there is some jitter in the signal you’re measuring. Reading the same analog line with no perturbation gives no benefit. The rest of the post deals with the process of artificially perturbing the signal, which turns out to be significantly complex, but the result is roughly 16 bit accuracy from a 10 bit ADC!

What’s the upside? High quality sensor readings from a few passives and a cheap Arduino. If that’s your jam check out this excellent series when designing your next sensing project!

We’d seen it done with buttons, switches, gestures, capacitive touch, and IR remote, but never like this. [electron_plumber] made an LED that can be blown out like a candle, and amazingly it requires no added sensors. The project uses an Arduino to demonstrate turning a tiny LED on and off in response to being blown on, and the only components are the LED and a resistor.

[electron_plumber] used an 0402 LED and thin wires to maximize the temperature responses.
How is this done? [electron_plumber] uses an interesting property of diodes (which are the “D” in LED) to use the LED itself as a temperature sensor. A diode’s voltage drop depends on two things: the current that is being driven through the diode, and the temperature. If the current is held constant, then the forward voltage drop changes reliably in response to temperature. Turning the LED on warms it up and blowing on it cools it off, causing measurable changes in the voltage drop across the device. The change isn’t much — only a handful of millivolts — but the effect is consistent and can be measured. This is a principle [Elliot Williams] recently covered in depth: using diodes as temperature sensors.

It’s a clever demo with a two important details to make it work. The first is the LED itself; [electron_plumber] uses a tiny 0402 LED that is mounted on two wires in order to maximize the temperature change caused by blowing on it. The second is the method for detecting changes of only a few millivolts more reliably. By oversampling the Arduino’s ADC, an effectively higher resolution is obtained without adding any hardware or altering the voltage reference. Instead of reading the ADC once, the code reads the ADC 256 times and sums the readings. By working with the larger number, cumulative changes that would not register reliably on a single read can be captured and acted upon. More details are available from [electron_plumber]’s GitHub repository for LEDs as Sensors.

Embedded below is a video that is as wonderful as it is brief. It demonstrates the project in action, takes a “show, don’t tell” approach, and is no longer than it needs to be.

In the past we have seen LEDs that can be blown out like candles in different ways; one used a microphone to detect blowing while another used a thermistor to detect the temperature change from blowing. [electron_plumber]’s project is notable not only for using no added parts, but also for being documented in a way that just about anyone can get up and running, and that’s something we always like to see.



  • Newsletter

    Sign up for the PlanetArduino Newsletter, which delivers the most popular articles via e-mail to your inbox every week. Just fill in the information below and submit.

  • Like Us on Facebook