Say It With Me: Aliasing

Suppose you take a few measurements of a time-varying signal. Let’s say for concreteness that you have a microcontroller that reads some voltage 100 times per second. Collecting a bunch of data points together, you plot them out — this must surely have come from a sine wave at 35 Hz, you say. Just connect up the dots with a sine wave! It’s as plain as the nose on your face.

And then some spoil-sport comes along and draws in a version of your sine wave at -65 Hz, and then another at 135 Hz. And then more at -165 Hz and 235 Hz or -265 Hz and 335 Hz. And then an arbitrary number of potential sine waves that fit the very same data, all spaced apart at positive and negative integer multiples of your 100 Hz sampling frequency. Soon, your very pretty picture is looking a bit more complicated than you’d bargained for, and you have no idea which of these frequencies generated your data. It seems hopeless! You go home in tears.

But then you realize that this phenomenon gives you super powers — the power to resolve frequencies that are significantly higher than your sampling frequency. Just as the 235 Hz wave leaves an apparent 35 Hz waveform in the data when sampled at 100 Hz, a 237 Hz signal will look like 37 Hz. You can tell them apart even though they’re well beyond your ability to sample that fast. You’re pulling in information from beyond the Nyquist limit!

This essential ambiguity in sampling — that all frequencies offset by an integer multiple of the sampling frequency produce the same data — is called “aliasing”. And understanding aliasing is the first step toward really understanding sampling, and that’s the first step into the big wide world of digital signal processing.

Whether aliasing corrupts your pristine data or provides you with super powers hinges on your understanding of the effect, and maybe some judicious pre-sampling filtering, so let’s get some knowledge.

Continue reading “Say It With Me: Aliasing”

Are You Down With MPPT? (Yeah, You Know Me.)

Solar cells have gotten cheaper and cheaper, and are becoming an economically viable source of renewable energy in many parts of the world. Capturing the optimal amount of energy from a solar panel is a tricky business, however. First there are a raft of physical prerequisites to operating efficiently: the panel needs to be kept clean so the sun can reach the cells, the panel needs to point at the sun, and it’s best if they’re kept from getting too hot.

Along with these physical demands, solar panels are electrically finicky as well. In particular, the amount of power they produce is strongly dependent on the electrical load that they’re presented, and this optimal load varies depending on how much illumination the panel receives. Maximum power-point trackers (MPPT) ideally keep the panel electrically in the zone even as little fluffy clouds roam the skies or the sun sinks in the west. Using MPPT can pull 20-30% more power out of a given cell, and the techniques are eminently hacker-friendly. If you’ve never played around with solar panels before, you should. Read on to see how!

Continue reading “Are You Down With MPPT? (Yeah, You Know Me.)”

Don’t Fear the Filter: Lowpass Edition

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”

200KV Capacitor Uses Cake Pan and Bowl

[PhysicsGirl] posts videos that would be good to use in a classroom or homeschool environment. She recently showed a 200KV capacitor made from a cake pan, a bowl, and some other common items (see video, below).

One of the most interesting things about the project was how they charged the capacitor. A PVC pipe and some common hardware made a wand that they’d charge by rubbing a foam sleeve up and down against the dome formed by a metal bowl. We might have used a cat, but there’s probably some law against that.

To discharge, they used the end of the wand and were able to get a 10 cm spark. Based on the dielectric constant for air, they estimated that equated to a 200KV charge. They also discharged it through someone’s finger, which didn’t seem like a great idea.

We’ve talked about [PhysicsGirl’s] videos before. Granted, a lot of this won’t help the experienced hacker, but if you work with kids, they are a great way to make physics interesting and approachable. We wish she’d spent more time on the actual construction (you’ll need to slow it down to see all the details), though. If you really want a capacitor for your high voltage mad science, you might find these more practical. We’ve seen many homemade capacitors for high voltage.

Continue reading “200KV Capacitor Uses Cake Pan and Bowl”

Using a Jewelry Kit to Resin-Encase Electronics

clear-cast-squareSome of us have looked at clear resin jewelry casting kits online and started to get ideas. Hackaday’s own [Nava Whiteford] decided to take the plunge and share the results. After purchasing a reasonably economical clear resin jewelry casting kit from eBay, a simple¬†trial run consisted of embedding a solar lantern into some of the clear resin to see how it turned out. The results were crude, but promising. A short video overview is embedded below.

The big hangup was lack of a proper mold. [Nava]’s attempt to use a plastic bag and a cup as an expedient stand-in for a proper mold was not without its flaws, and the cup needed to be broken before the cured resin could be removed. Despite this, the results were good; the mixing needed careful measurement and the curing process was lengthy but the cured resin is as attractive as the advertisements promise. Mixing introduced many air bubbles into the mixture, but most of them seemed to disappear on their own during the curing process. The results of this quick test may not be pretty, but the resin seems to have held up its end of the bargain and delivered the expected smooth, clear finish.

Continue reading “Using a Jewelry Kit to Resin-Encase Electronics”

A Solar-Powered Headset From Recycled Parts

Solar power has surged ahead in recent years, and access for the individual has grown accordingly. Not waiting around for a commercial alternative, Instructables user [taifur] has gone ahead and built himself a solar-powered Bluetooth headset.

Made almost completely of recycled components — reducing e-waste helps us all — only the 1 W flexible solar panel, voltage regulator, and the RN-52 Bluetooth module were purchased for this project. The base of the headset has been converted from [taifur]’s old wired one, meanwhile a salvaged boost converter, and charge controller — for a lithium-ion battery — form the power circuit. An Apple button makes an appearance alongside a control panel for a portable DVD player (of all things), and an MP4 player’s battery. Some careful recovery and reconfiguration work done, reassembly with a little assistance from the handyman’s secret weapon — duct tape — and gobs of hot glue bore a wireless fruit ready to receive the sun’s bounty.

Continue reading “A Solar-Powered Headset From Recycled Parts”

Dummies Guide to Reverse Engineering

[Juan Carlos Jim√©nez] has reverse engineered a router — specifically, a Huawei HG533. While that in itself may not sound substantial, what he has done is write a series of blog posts which can act as a great tutorial for anyone wanting to get started with sniffing hardware. Over the five part series, he walks through the details of identifying the hardware serial ports which open up the doors to the firmware and looking at what’s going on under the hood.

The first part deals with finding the one or several debug ports on the hardware and identifying the three important pins – Rx, Tx and GND. That’s when he shows novices his first trick – shining a flashlight from under the PCB to find the pins that have trace connections (most likely Rx and Tx), those that don’t have any connections (most likely CTS and DTR) and those that have connections to the copper pour planes (most likely VCC and GND). The Tx signal will be pulled up and transmitting data when the device is powered up, while the Rx signal will be floating, making it easy to identify them. Finding the Baud rate, though, will require either a logic analyser, or you’ll have to play a bit of a guessing game.

Once you have access to the serial port and know its baud rate, it’s time to hook it up to your computer and use any one of the several ways of looking at what’s coming out of there — minicom, PuTTY or TeraTerm, for example. With access to the devices CLI, and some luck with finding credentials to log in if required, things start getting interesting.

Over the next part, he discusses how to follow the data paths, in this case, looking at the SPI signals between the main processor and the flash memory, and explaining how to use the logic analyser effectively and decode the information it captures. Moving further, he shows how you can hook up a USB to SPI bridge, connect it to the flash memory, take a memory dump of the firmware and read the extracted data. He wraps it up by digging in to the firmware and trying to glean some useful information.

It’s a great series and the detailed analysis he does of this particular piece of hardware, along with providing a lot of general tips, makes it a perfect starting point for those who need some help when getting started on debugging hardware.

Thanks, [gnif] for posting this tip.

Continue reading “Dummies Guide to Reverse Engineering”