Duct-taping strange devices to my motorcycle



  • Phase 1 of my evil plan to trick out my dirt bike for my next Rocky Mountain vacation has been completed!

    This is an Adafruit Trinket Pro, which is a fully Arduino-compatible and extremely affordable microcontroller. I have it reading data via I2C from a barometric altimeter which also has a temp sensor on it, and writing the results to a character LCD display.

    The next phase is to integrate the I2C digital compass I have to display my heading. After that, I have some crazy plans involving a Phillips FM receiver, GPS module, a Raspberry Pi, and QGIS... 😈



  • Looks cool. Have you stress / vibration tested this? I'm going to assume that this is just a test rig and that phase 2 is making the circuit board and housing it in a weather proof case.

    👍


  • 🚽 Regular

    This post is deleted!

  • 🚽 Regular

    That looks very cool, I thought it said 'storage devices' at first, if you do need storage then the FAT-16 filesytem on a little compact flash card is extremely simple to write some routines for. Or the Atmel serial DataFlash devices are great little things for datalogging without any hassle.

    If you want to have a single board fabed then pcb-pool.com do a very decent job and are much cheaper than having a house doing you a full panel. I use them for all my home stuff.

    Edit: Yes, body is very similar, I replied to the wrong person Discourse and you wouldn't let me change it!



  • That reminds me. @mott555 Have a look at the marine world. They do lots of cool gadgets for boats that would work well for you - except (possibly) altimeters as I can't see much need for them in the boat world, but then I guess there would be the same for small private planes.

    That said: I used to stuff like this 30 years ago, and it is far more enjoyable (and cheaper) than going out and buying the stuff I used to keep a collection of boating type magazines with my pron collection, just in case I fancied a change



  • @mott555 said:

    The next phase is to integrate the I2C digital compass I have to display my heading. After that, I have some crazy plans involving a Phillips FM receiver, GPS module, a Raspberry Pi, and QGIS...

    And then a bunch of road flares taped to a dollar-store alarm clock. Just to keep Homeland Security on its toes....



  • @loose said:

    Looks cool. Have you stress / vibration tested this? I'm going to assume that this is just a test rig and that phase 2 is making the circuit board and housing it in a weather proof case.

    This is just a test rig while I figure everything out. Casing it is probably going to be about phase 5 or 6 lol. For simplicity, I'll either go with an Altoids tin and/or some clear liquid electrical tape (if such thing exists).



  • The compass works...well, it worked last night anyway. Now it's permanently stuck on 325°. 😕

    The barometric altimeter is about what you'd expect without atmospheric calibration. I lost 100 feet overnight due to weather. It looks like the altimeter chip I'm using has some calibration registers I could get into if I wanted, and I'm not yet sure if I want to get into that. It's quite precise for measuring altitude differences though. I can pick it up a foot and the value raises by a foot.



  • @Cursorkeys said:

    That looks very cool, I thought it said 'storage devices' at first, if you do need storage then the FAT-16 filesytem on a little compact flash card is extremely simple to write some routines for. Or the Atmel serial DataFlash devices are great little things for datalogging without any hassle.

    No data logging yet, and if I do I'm going to have this talk to a Raspberry Pi over I2C and do stuff on the Pi instead where I have a bit more RAM, storage, and CPU. This microcontroller I'm using only has 2K of RAM so I think filesystem access would be problematic.

    @Cursorkeys said:

    If you want to have a single board fabed then pcb-pool.com do a very decent job and are much cheaper than having a house doing you a full panel. I use them for all my home stuff.

    I'm just going to get one of those solderable perma-protoboard things from Adafruit. They even have one perfectly sized to fit within an Altoids tin.

    (Go away red DiscoToaster)


  • I survived the hour long Uno hand

    @mott555 said:

    Adafruit Trinket Pro

    Ooh, the Trinket. It's got the same basic controller as the Gemma, right? I'm way more interested in the Gemma for my own nefarious purposes ;)



  • @Yamikuronue said:

    Ooh, the Trinket. It's got the same basic controller as the Gemma, right? I'm way more interested in the Gemma for my own nefarious purposes

    Not sure. I've heard of the Gemma when I was reading Trinket how-tos but I don't know how they compare.

    This is the Trinket Pro though, which is far closer to a full-blown Arduino. I have a couple Trinkets lying around too but they're pretty limited.


  • I survived the hour long Uno hand

    Hmm.

    The Gemma you have to program as a Trinket in the IDE, so I wonder if the Trinket Pro and the Flora (the bigger version of the Gemma) are similarly linked?



  • Looks like it. Judging from the info page, the Trinket/Gemma are the same exact thing in a different shape, and so are the Trinket Pro/Flora. Same processor, same number of GPIOs, etc.


  • I survived the hour long Uno hand

    Next time I work on my soft circuits I'll be sure to make a thread here :)

    This is my project:

    http://radiantvanguard.com/blog/2015/04/28/soft-circuits-laikas-hat/



  • you might need to "box" the compass. Large lumps of metal (magnetic fields) tend to bugger magnetic compasses. No, wait. You said GPS. In which case I think you have to "move" in a direction long enough for it to figure out which way you're going



  • It's a magnetic compass, not GPS.

    Probably too many electronics in the office, it worked in my apartment so I'm hoping it's just the location.



  • @mott555 said:

    They even have one perfectly sized to fit within an Altoids tin.

    If you're looking at Pi-class hardware, the BeagleBone Black is also perfectly sized to fit in an Altoids tin.


  • FoxDev

    that reminds me... i really should dust min e off and start playing with it some more



  • RPi or BBB?


  • FoxDev

    yes.



  • BBB? 


  • FoxDev

    and RPi

    i have several of each gathering dust from projects i never completed/started


  • Discourse touched me in a no-no place

    So what sensors are you using?

    How much, if any, code are you writing?



  • So far, I have an MPL3115A2 barometric altimeter and temp sensor, and an HMC5883L 3-axis digital compass. Eventually I'm going to get this GPS board and an active antenna for it to get GPS Lat/Lon values. I also have a stash of TMP36's somewhere so I'm going to glue one to my radiator for a digital engine temp display just for fun. Of course, I'll need a bigger LCD for all this.

    I actually don't have much code written, maybe 70 lines max, most of it is formatting/spacing along with unit conversion from metric to standard. Adafruit provides nice libraries for most of their stuff so reading values and writing to the LCD were all library calls. For the final device I'll try to go through their libraries and trim some fat, there are features I definitely won't be using and the altimeter code is painfully slow.



  • @mott555 said:

    The barometric altimeter is about what you'd expect without atmospheric calibration. I lost 100 feet overnight due to weather. It looks like the altimeter chip I'm using has some calibration registers I could get into if I wanted, and I'm not yet sure if I want to get into that. It's quite precise for measuring altitude differences though. I can pick it up a foot and the value raises by a foot.

    Yeah -- look up something called an "altimeter setting" ;)



  • I can get the raw pressure in Pascals, so I thought about doing the conversion/calibration myself, but I can't find an accurate pressure-to-altitude equation. Each one I found gave me wildly inaccurate results, ranging from -32,000 ft to +17,000 feet.

    I'm also uncertain about how I'd get the proper calibration data. Just glancing at the register list, it looks like I'd need to know the hypothetical sea level temperature and air pressure for my area. Does that even exist for Colorado/Wyoming?



  • Had a job once that involved a lot of travelling up north. Didn't have any issues getting there but would often get "turned around" going home. I had a small boats compass, so i thought I would use that. couldn't mount it on the dash, as it always pointed in the same direction. I found if i could put it behind me it seemed ok. I didn't need it to navigate, I just used it to check I was heading south.

    One day I decided to swing the compass (previously referred to, in error, as "boxing" which is something slightly different, but related - I blame 25 year old memories).I discovered that the compass would only read between SW and SE, depending on which direction the car was pointing. i.e it always pointed south(ish).



  • @mott555 said:

    I'm also uncertain about how I'd get the proper calibration data. Just glancing at the register list, it looks like I'd need to know the hypothetical sea level temperature and air pressure for my area. Does that even exist for Colorado/Wyoming?

    The sea level air pressure should be available anywhere weather reports are found -- if nothing else, use the altimeter setting reported by the nearest airport's weather station.



  • @mott555 said:

    unit conversion from metricstandard to standardarchaic

    :trollface:


  • ♿ (Parody)

    👎



  • Wouldn't the GPS receiver give you altitude that's just as much if not far more accurate? Why even bother with a pressure reading if it is mostly just going to tell you what the weather is like?



  • @anotherusername said:

    Wouldn't the GPS receiver give you altitude that's just as much if not far more accurate? Why even bother with a pressure reading if it is mostly just going to tell you what the weather is like?

    GPS readings give you a computed altitude, which can be a fair bit off from the baro altitude...(you need more birds to get a 3-D fix anyway, and the baro altitude can be quite a bit of help during initial lock as it allows you to rule out false solutions with fewer birds in view)


  • FoxDev

    @tarunik said:

    you need more birds to get a 3-D fix anyway

    As I recall you need three to get a fix on a "2D" plane (surface only, no elevation) and 4 to get a 3D fix.

    but that's probably low from practical standpoints as you would likely want more than the absolute minimum to ensure a quality lock (and also make the lock more resilient about losing a bird behind a big building or mountain if it's currently rather low in the sky.)



  • Well no, I wouldn't expect the GPS altitude to be spot on the money right after it's powered up, but that shouldn't be a huge problem. You just have to wait a minute or so before you trust anything it says.

    I'd still expect that waiting a few seconds for the GPS to get a good lock would give you an altitude that's more accurate than trying to compute altitude from the barometric air pressure which varies a lot, and also less trouble because it shouldn't require any calibration.



  • @anotherusername said:

    I'd still expect that waiting a few seconds for the GPS to get a good lock would give you an altitude that's more accurate than trying to compute altitude from the barometric air pressure which varies a lot, and also less trouble because it shouldn't require any calibration.

    I'm not so sure about that -- the ADIRUs on a modern airliner are going to be quite accurate coming from the factory, given that you dial the correct altimeter setting in, of course ;)


  • Discourse touched me in a no-no place

    @accalia said:

    you would likely want more than the absolute minimum to ensure a quality lock

    Not to mention that you'd want more to decrease DOP. 4 sats can give you a pretty big error bar.

    With GLONASS and other systems coming online, it's not uncommon to be able to get more than a dozen sats in your solution these days.



  • At the altitude a modern airliner operates at, sure... you're above most of the weather. Once you get closer to ground level, it's a totally different question. (And don't airliners have radar to give them a more accurate AGL altitude reading for exactly this reason?)

    If you were trying to calibrate your carburetor or, heck, if you were operating under your own power (bike, jog) I'd say yeah, go with the barometric pressure because that's a more accurate description of the conditions than the altitude is anyway. But if you want altitude for informative purposes and not to figure out how much oxygen per cubic foot of air or something, then I'd expect GPS to be far more accurate.



  • @anotherusername said:

    Once you get closer to ground level, it's a totally different question. (And don't airliners have radar to give them a more accurate AGL altitude reading for exactly this reason?)

    That's needed because a radar altimeter measures AGL, but a baro altimeter measures ASL. Two different beasts -- AGL isn't useful for separating planes from each other, while ASL isn't so helpful for staying away from cumulogranitus.



  • It's easy to get AGL if you have ASL and a good topographical map, so that's not the only reason to use radar instead of barometric pressure.



  • @anotherusername said:

    Wouldn't the GPS receiver give you altitude that's just as much if not far more accurate? Why even bother with a pressure reading if it is mostly just going to tell you what the weather is like?

    Everything I read online said GPS altitude is so inaccurate, don't even bother. Like sometimes 1000 feet off.

    I figured out the calibration registers on this barometric altimeter and added a dial + menu to set the calibration. It seems to be within about 5 feet when I calibrate it to the current Weather Channel air pressure for my area, if the online elevation data I compared my reading to can be trusted.



  • My cell phone is always within a few feet of the correct altitude. The Buffalo airport is listed at 724 feet above sea level and my cell phone says 695. I'm currently across the street from the airport.



  • @Jaime said:

    The Buffalo airport is listed at 724 feet above sea level and my cell phone says 695

    I would not call almost 30 feet "within a few feet of the correct altitude".



  • I misread the title as "ducktaping strangers to my motorcycle". I clicked expecting to hear how you avoided cops by surrounding yourself with your human shields and riding off into the sunset.

    Disappoint.


  • Discourse touched me in a no-no place

    @cartman82 said:

    I misread the title as "ducktaping strangers to my motorcycle".

    Are you sure you're not German?



  • @lesniakbj said:

    I would not call almost 30 feet "within a few feet of the correct altitude".

    Across the street is about half a mile from the terminal. Also, it's entirely possible that the altitude reported is at the tower or somewhere in the terminal rather than the runway level.



  • Considering the PURPOSE of reporting the altitude of the airport is to assist incoming planes, I'm kind of guessing they're not going to report the altitude of the tower.

    But that's just silly ol' me, being not-an-idiot.



  • @blakeyrat said:

    Considering the PURPOSE of reporting the altitude of the airport is to assist incoming planes, I'm kind of guessing they're not going to report the altitude of the tower.

    I just looked into it. There are two main runways. One goes from 674' to 727' and the other from 699' to 709'. My office is closest to the 699' end. So, four feet of error.



  • @Jaime said:

    Across the street is about half a mile from the terminal. Also, it's entirely possible that the altitude reported is at the tower or somewhere in the terminal rather than the runway level

    The elevation documented for the airport would be the airport reference point, which is somewhere on the airside of the airport, although often off in the infield grass. (Runway ends have their elevations documented separately as you noticed.)


  • Java Dev

    @mott555 said:

    I can get the raw pressure in Pascals, so I thought about doing the conversion/calibration myself, but I can't find an accurate pressure-to-altitude equation. Each one I found gave me wildly inaccurate results, ranging from -32,000 ft to +17,000 feet.

    Pressure difference equals air density times height difference times the gravity constant.

    P - P₀ = ρ (h- h₀) g
    h = h₀ + (P - P₀) / (ρ g)

    Where P₀ is the pressure at the calibration point and h₀ is the altitude at the calibration point. Based on metric system, should be the same in imperial but don't trust me on that bit. Gravity constant is 9.81 m/s², not sure on air pressure or on whether air pressure is constant enough for these purposes or a calibration item.



  • @cartman82 said:

    ducktaping strangers to my motorcycle

    https://www.youtube.com/watch?v=xmnLRVWgnXU


Log in to reply