There comes a time in every electronic designer’s life when, whether they know it or not, they need an analog filter in their design. If you’re coming from a digital background, where everything is nice and numeric, the harsh reality of continuous voltages can be a bit of a shock. But if you’re taking input from, or sending output to the big analog world out there, it pays to at least think about the frequency-domain properties of the signal, and maybe even do something about them.
Designing an analog filter to fit your needs can be a bit of a daunting task: there are many factors that you’re going to need to consider, and they all interact. It’s easy to get lost. We’re going to simplify this as much as possible by instead focusing on a few common applications and building up the simplest possible filters that work well for them.
Today, we’re going to consider the lowpass filter, and specifically a Sallen-Key filter with Butterworth characteristics and a second-order rolloff. Sound like word salad? We’ll fix that up right away, because this is probably the single most important filter to have in your analog toolbox for two very common use cases: pulse-width modulated (PWM) output and analog-to-digital conversion (ADC) input.
Continue reading “Don’t Fear the Filter: Lowpass Edition”
Since we all have wires running throughout our houses to provide mains power, there’s a number of devices that piggyback on mains lines for communication. For his thesis project, [Haris Andrianakis] developed his own power line communication system.
The basic principle of the system is to inject a signal onto the power lines at a much higher frequency than the 50 or 60 Hz of the AC power itself. Using both active and passive filters, the signal can be separated from the AC power and decoded. This system uses frequency-shift keying to encode data. This part is done by a ST7540 modem that’s designed for power line applications. The modem is controlled over SPI by an ATmega168 microcontroller.
[Haris]’ write up goes into detail about some of the challenges he faced, and how to protect the device from the high voltages present. The final result is a remote display for a weigh scale, which communicates over the power line. Schematics, PCB layout, and software are all available.
[Udo] decided to build a clock using the DCF77 radio module seen above. This of course has been done before: the hardware draws a clock signal from the atomic clock in Braunschweig, Germany. So he grabbed a library for Arduino and got to work. But he was getting rather poor results and upon further investigation realized that the library had been written for 20 Hz modules and his operates at 300 Hz. This means better accuracy but the drawback is that the hardware is more susceptible to noise.
So began his journey to filter, process, and decode the DCF77 protocol. That link goes to the project overview. It will be in several parts all of which will be linked on that page. So far he has applied a low-pass filter and coded some exponential smoothing. He has yet to write the other four parts, but does mention that early testing shows that this technique will make the reception better than what is achieved with commercially available clocks. He was able to lock onto a signal that had more than 80% noise ratio. That’s impressive!
Just want to see a clock that uses a DCF77 module? Check out this PIC-based atomic clock.
The guys over at NerdKits put together a really informative video on a meat thermometer using predictive filtering which is viewable below. The video, supplemental text, and code is available on their website. The thermometer is constructed of a LM34 temperature sensor attached to a piece of 12 gauge solid copper wire. The thermometer signal is processed on an ATmega168 microcontroller and visualized using the pygame library for python. The real gem in this project is their excellent explanation of predictive filtering, which could easily be utilized for a large number of projects.
Continue reading “Meat thermometer using predictive filtering”