Another 3-D field visualization, this time with carving

6 Dec

Magnetic fields are another three-dimensional field that you can represent using a threshold. Instead of using a lighted LED as a threshold, as in the RFID visualization, how about carving out a solid representation of the field?

(Thanks to Dan Bowen for the link!)


Number Crunching

14 Nov

We want to process the electromagnetic field (EMF) data in real time to determine if it’s 60 Hz or maybe in another frequency range. Wow, having different colors to indicate the type of EMF around an appliance, that would be very interesting! But before getting carried away, there is some number crunching to do.

We could do an analog filter so the Arduino would not have any calculations do. That’s elegant but harder to modify later on, and it adds components. Same for adding a DSP (digital signal processing) chip.

Another way to do this is the Fourier transform to tell us what amplitude EMF we have at what frequency. Even the discrete “fast Fourier transform,” designed specifically for computers, involves floating-point multiplication and calculating sines and cosines. The FFT saves some work by keeping results in a lookup table but still. There are plenty of other things the Arduino needs to do, and these calculations will probably slow down the maximum sampling rate.

We could do a variant called the Goertzel algorithm that computes the amplitude at just one frequency. Here’s a good implementation of the Goertzel algorithm:

Goertzel algorithm from mstarlabs

Still a lot of number crunching. Would a result every two seconds be too slow for us? Maybe there is a more continuous way to apply this algorithm.

Alternatively, there’s digitally filtering out everything but the 60 Hz, then finding the amplitude of that filtered signal. Here’s a very good implementation of a digital 60 Hz bandpass filter. The application is getting a robot to locate a power plug by “feeling” the 60 Hz electric field. The best thing is that the algorithm was run on an ATmega 168 and was able to update about 50 times per second!

Robot, Feed Thyself

Here is my version of this bandpass filter:

It was generated using the following MATLAB code…

Continue reading

Tracking EM fields

9 Nov

Since last time, we have been working on visualizing the EMF sensor data. Here’s a video with the Arduino EMF sensor “scanning” a microwave oven:

We analyzed the video using a MATLAB program to track the coordinates of the largest red object, then drew a red square over the LED. This kind of tracing will help us create a still image of the fields surrounding an appliance.

Here is the Matlab m-file used to generate the two videos from an original .avi file that had about 4x higher frame rate than was really necessary to track the led… Continue reading

I am an antenna

18 Oct

I looked at the spectrum of the EMF detector. (ours has an 8 M resistor rather than a 3 M but otherwise is the same as the original) There is a big AC component (probably 60 Hz) that shows up when I touch the wire. The Arduino can read the serial port fast enough to sample this and higher frequency components. My datalogger shield is in use, so I just logged it using a cable to my Mac. The Arduino serial terminal could also work. (The cable probably is affecting the signal in some way that won’t be happening in a portable system, so a datalogger shield will be coming back soon!)
Here’s the signal from touching the antenna five times:

Look at what happens right when I start to touch the antenna (it’s a zoom at the center spike in the image above) The touches are made of the positive side of a high frequency wave. By touching it, I am making the antenna much larger and picking up some 60 Hz from the room.

From MATLAB here’s a frequency analysis on the “touch” and “non-touch” parts of the signal, blue spikes are the spectrum when it’s touched. Green spikes are from when it’s not touched. Note that the amplitude of the blue spikes, shown on the left side, is much higher than that of the green.

Could we use this to detect not only a person touching the antenna (there are other, better touch sensors out there) but also, whether there are transformers or light switches near the person, and whether those are on or off?

Here’s the code on the Arduino, it’s just a simple loop at the highest serial speed I tried (115200)

int inPin = 5;                                  //analog 5
float val;                                         //where to store info from analog 5

void setup() {



void loop() {

val = analogRead(inPin);

To log this on the Mac, open a X11 window and type
screen -L /dev/tty.usbmodemXXXXX 115200
(your usb modem name will vary). Start the sketch on the Arduino whenever ready. This will write a file called screenlog.0 in the working directory. Caution, it appends new data to the existing screenlog–so you should probably rename your log file and erase screenlog.0 when done.

I found this to log at about 1414 samples/sec, by guessing the first peak in the spectrum being 60 Hz. This sampling frequency is consistent with the approximate amount of time I ran the sketch and the number of samples I got. A timestamp would be much nicer, and that is another bonus of going to the datalogger shield.

Metawatch platform: warranty voided

4 Oct

I looked inside an analog MetaWatch. The MetaWatch connects to an Android phone and brings small important bits of information to your attention. This could be a good wrist-based sensor platform. (Wrists are near things your fingers are doing, for example switching lights on/off) It’s a good place to put a short-range sensor for electromagnetic fields (EMF)

Can we tap into the MetaWatch’s MSP430 processor? There are lots of TPs (Test Points) here.

I took off the back with the 4 tiny screws. The battery is a coin cell one, I thought maybe there would be a LiPo. The white thing is the buzzer.Take out the red thing after removing 4 more tiny screws, shift it clear from the small metal clips at the sides. Behind the red thing, a circuit board. Press on the lever with a toothpick in order to pull out the knob that’s used to set the analog clock. The black thing is the MSP430 chip that does everything.

Now the watch pops out easily. I wanted to see what was on the other side of the circuit board. Did I have to take the hands off the watch? No, but I did (it turned out OK but wasted some time). Instead, I could have just undone the super tiny screws near the toothpick in the picture above, in addition to two philips (+) screws that held it to Red Thing 2.

Analog Metawatch remove red thing 2

Finally, Red Thing 2 comes off. You can see the watch motor stuck to Red Thing 2 and the rest is a circuit board.

OLED side of MetaWatch circuit board

Here are the two OLED screens, flipped up.

Finally, the watch is safely back together and working 🙂 for now

Point cloud visualization of electric field around RFID reader

3 Oct

If you have not seen this from 2009, check it out. This is a good example of sensor-based visualization of electric fields around appliances:

Field around a RFID reader visualized using sensor and LEDs by Berg design firm


Other work at the Berg design firm’s site deals with wi-fi visualizations.

Sensors Everywhere Meeting Monday Sept 26

3 Oct

HI all, for the Sensors Everywhere energy-monitoring project we had on Monday at 6pm:

-An Arduino with data logging shield and electromagnetic field (EMF)
–it’s a wire and a resistor, we plugged in an 8 Megohm resistor.

-Amplified EMF detector shield (Thank you Chris Isert for getting this

-The “Batphone,” an ipod that collects the acoustic signature of your
location–works ok, let’s see how it does at the space to keep track
of where the Arduino went.
Result: maybe it can keep track of location to within about ten feet.

-I got the Kill-A-Watt out of its horrible plastic clamshell and it is
ready to go measure things. Result: can tell if my computer’s plugged into the wall wart or not, can see its power consumption.

-We could easily get the EMF detector to light up near plugs, the microwave and a high voltage source

-We found we needed a tripod and a brighter LED to image how the Arduino EMF detector is picking up the electronic noise around appliances. The red LED on the EMF Arduino is too directional for good video analysis. A pingpong ball makes a good diffuser but the LED has to be brighter.