Categories: all aviation bicycle gadgets misc motorcycle theater

Mon, 07 Mar 2011

More pictures, Arduino-style

I figured you might be interested to see the messy little prototype I've been working with.

Thrilling, huh? Not shown are the three lever switches (the nearest switches I had to hand) which are acting as temporary SET, + and - switches.

Posted at 23:05 permanent link category: /misc


Arduino Linux Serial Port Fix

I mentioned in my previous Arduino post that it was vitally important not to spam the serial port. Well, I found out that that's not actually as true as I'd thought.

I've been doing most of my development on Linux, for a variety of reasons. It turns out that there's a bug in most shipping Arduino boards that makes them behave poorly with the Linux drivers. I'm not sure why it impacts Linux and not Mac or Windows machines, but it does.

So if you're developing for Arduino on Linux, I highly recommend that you read through this article and follow its instructions:

Updating the Atmega8U2 on an Uno or Mega2560 using DFU

It will walk you through the process to upgrade the USB interface's firmware so the serial port behaves properly. I did it (it took about 10 minutes, including downloading the various bits and pieces), and developing on Linux is suddenly a much more civilized process.

In related news, the airspeed project is going quite well. I've got all the code working as separate pieces, and am now cobbling it together so it all works as one thing. To my delight and surprise, the barometric pressure sensor is easily able to determine height within a foot or two (it plainly shows 3 feet elevation gain when I pick the board up off the table and hold it 3 feet higher up). I haven't really tested the differential pressure sensor beyond seeing that it produces a signal, but I'm confident that it will show me something, and probably be quite useable.

Converting differential pressure into airspeed isn't very hard, but it's pretty imprecise below about 25 mph. The sensor outputs an analog voltage, where voltage is directly comparable to pressure in kPa. The Arduino's A/D converter returns a value between 0 (0 volts) and 1023 (5V).

I figured that the maximum airspeed I'd ever reasonably see on the bike is about 110-125 MPH (which assumes about 30 mph of headwind and maximum speed on the bike). I figured based on the datasheet that this sensor will indicate correctly up to 185 MPH airspeed, which is just silly. Rather than waste all that precision on top-end speed it'll never see, I'm going to use the Arduino's AREF pin to lower the sensor's "top speed" value to 111 MPH (2.5 volts).

That will give me 322 "points" per volt (I think; my notes aren't with me, and I'm not going to recalculate it right now), and even so, the speed will read 0, 4, 6, 7, 9 MPH before it is capable of displaying sequential discrete MPH differences. Then it doesn't reliably discriminate into fractional MPH until 19 MPH (the device will only display whole units of speed, though). The practical upshot is that for airspeeds below about 20 MPH, it's quite unreliable. I figured that would be the case going in, but it's interesting to see it worked out as a mathematical formula.

I found myself trying to explain airspeed to a non-technical friend this weekend, and fundamentally failing to get her mind wrapped around the idea that an airplane's apparent airspeed wouldn't be higher in a tailwind (since the plane is obviously moving faster over the earth) and lower in a headwind (moving slower over the earth). In fact, an airplane's apparent airspeed is just how fast it's moving through the surrounding air, and groundspeed is basically apparent airspeed + wind speed. It's a surprisingly difficult concept to convey if the basic understanding doesn't already exist.

Of course, things were confused, because I was trying to explain this project, where we have an object firmly attached to the earth, and moving through the air. Instead of seeing no difference in airspeed due to wind, it is by definition going to see different airspeeds based on wind. That was the whole motivation for starting this thing: I was curious to see how much of a headwind or tailwind I had while riding. Eventually we agreed that we'd exhausted all options for explaining airspeed, and moved on to other topics.

I expect to have some time this week to work on the code for this thing (I should come up with a name for the project), so hopefully by the weekend I should have it in good shape. Then all I need is for the LCD to show up, and I'll have all the pieces together. Then, of course, comes the not inconsiderable task of hacking it together into something that can reasonably be mounted on a motorcycle...

Posted at 16:38 permanent link category: /misc


Spring is busy springin'

I came out my front door and spotted this little flower poking up out of the dirt...

Picture post!

Posted at 12:14 permanent link category: /misc


Categories: all aviation gadgets misc motorcycle theater

Written by Ian Johnston. Software is Blosxom. Questions? Please mail me at reaper at obairlann dot net.