Excursions in Datalogging

Well, it’s been far too long since I’ve blogged… well, anything. So I wanted to drop a quick line to mention three interesting datalogging examples I’ve hit upon during the last few months. In some cases, these are only ideas to be built upon, but they should give you food for thought on datalogging with the NXT. All these images are up in my Brickshelf gallery if you want to look – plus more.

First, I was contacted by someone who wanted to know if it was possible to use the NXT to log the accelerations of a Hulahoop. So I said “I don’t know”… and tried it.

The first task was trying to get a semi-balanced hoop with the weight of the NXT. So I used the best thing I could to counterbalance an NXT… another NXT. Using duct tape (a lot of duct tape) I taped one NXT with a Hitechnic accelerometer to one side, and another NXT to the other side as a counterbalance. OK, now the next problem… I can’t Hula-hoop. At all. And a hula-hoop with a dozen AA batteries duct-taped to it isn’t the easiest thing to work with in the first place. But I was able to get it to at least spin around my neck… until the NXT slammed into my skull (note: this hurts. A lot. I was seeing stars for a few seconds, and had a huge goose-egg). In the end, I did get some interesting data from spinning it around my wrist in a vertical orientation (far safer), and found you could see both the rotation of the hoop (about one rotation every 4 seconds) as well as the revolution of the center of the hoop around my wrist (every fifth of a second or so… yes, I labeled the graph the wrong way around, I think). The folks who originally asked me about this work on electrically illuminated hula-hoops triggered by internal sensors, and I hope they were able to use some of this information practically… but even if they didn’t I had a lot of fun trying to get the data.

Another fun project was actually not mine, but my sons. I firmly believe that a science fair project should be the job of the student, not the parent. In this case Ben wanted to determine who was noisiest in the school hallway (his hunch was the 6th graders), and decided after watching me, to do it with an NXT. He and I played around with using the US sensor or the light sensor, and eventually came up with a way to both “count” people and keep the system very well hidden from curious students. The idea was to use a very low-power laser (class I – a very low-power laser similar to what you see in a supermarket barcode scanner, for safety) next to the NXT at floor level, directed off a tiny inconspicuous mirror on the far side of the hallway and back onto the light sensor (set in “ambient” mode). Now every time someone walking down the hallway broke the beam of light, the NXT would add one to a “count” variable, recording the value of that variable and the average sound level detected during that interval every so often. Since the “system” was just an NXT with two sensors (with an ingenuous sliding positioning system for the light sensor) and a separate “super laser pointer”, it was easy to hide behind a box or under a video cart, and the laser spot was so dim it wasn’t noticed by students on their feet. All in all, a really interesting automated way to get information about traffic flow in the school hallways. And everything was done by my 10-year-old: designing the hardware, selecting the method, programming the datalogging, downloading everything & analysis. Oh, and he found the morning announcements by the principle were the loudest thing on most days, a fact he gleefully pointed out to her. My only contribution was soldering up a laser system that would run off AA batteries – the rest was his, and I was very proud of the result.

Finally, for another project I’m working on (more later), I was curious if you could use the NXT as a simple pedometer, logging each footstep. Most pedometers simply keep a running count – by the end of the day, you might know how many footsteps you’ve taken, but you’d have no idea if you’d done those at the beginning, middle, or end of the day. Since the NXT can be fitted with an acceleration sensor, it should in theory be able to determine the moment every footstep happens, and record that information any way you like – not just the running total, but details like how the footstep frequency changes throughout the day (when you get tired), or when you were sitting still, etc. Here’s a quick test of this idea, with the NXT logging the total acceleration measured about 50 times a second. At this resolution each footstep is clearly visible, and you could probably pick out details like how the acceleration changes when walking up or down stairs. Now, can my NXT record an entire hike for later…

Brian Davis


Damien Kee said…
Fantastic experiments Brian. It's nice to know that people are willing to put their bodies on the line in the name of science :)
David Levy said…
I'd like to see a wireless sensor that communicates to the NXT brick or another sensor plugged into a NXT input port. Such a sensor may be much smaller as it would not be required to house an RJ jack.

Brian Davis said…
Damien - Thanks, it's fun thinking them up. And, in some cases, surviving them :). I'd love to hear ideas from other readers/bloggers as to things to datalog, or similar ideas.

David - I suspect it would not be smaller. A wireless sensor might do without the pseudo-RJ jack... but will need it's own wireless transmitter, as well as power (batteries). Even for very small batteries, they won't be much smaller than the pseudo-RJ connector. Now if there was a read-writable RFID sensor (RFID's can incorporate very tiny batteries as well as sensors), that would work...

Brian Davis
Anonymous said…
Great job Brian! Also, great job of your DS on his science fair project. My 7yr old used the NXT for his science project as well. I was really impressed at the work he did and how well it came out. He tested if hot water cools down at the same rate that cold water warms up to room temperature. He used the LEGO temp sensor. My father-in-law, a chemical engineer, was surprised at how good the curves were.

This summer, my boys and I are doing MarsBase command mission. I'm waiting for the book to come in to have the mat made. Just 1.5 weeks of school left and then it'll be LEGO MINDSTORMs time!!! WOOHOO!

Anonymous said…
are you using nxt-g for datalogging and then exporting to excel or are you using robolab?
Brian Davis said…
I'm actually using NXT-G exported to Excel. Robolab would work, but I like the more powerful abilities of Excel here. That way I need to do less on-brick calculation, and can do more post-run processing.

Popular Posts