1. Welcome to Tacoma World!

    You are currently viewing as a guest! To get full-access, you need to register for a FREE account.

    As a registered member, you’ll be able to:
    • Participate in all Tacoma discussion topics
    • Communicate privately with other Tacoma owners from around the world
    • Post your own photos in our Members Gallery
    • Access all special features of the site

Building a digital inclinometer

Discussion in 'CameronTech' started by Cannikin, Sep 18, 2013.

?

What display color do you prefer?

Poll closed Dec 8, 2013.
  1. White on black

    23.5%
  2. Yellow on blue

    0.9%
  3. Red on black

    33.0%
  4. Black on green

    7.0%
  5. OLED Blue on black

    32.2%
  6. OLED Yellow on black

    3.5%
  1. Nov 29, 2013 at 8:12 PM
    #281
    Dizo

    Dizo Well-Known Member

    Joined:
    Apr 8, 2013
    Member:
    #101676
    Messages:
    109
    Gender:
    Male
    First Name:
    Oliver
    North of 62°, Canada
    Vehicle:
    2005 DCLB TRD Sport
    Aux Audio-input, 5100's @ 1.75", 2" Wheeler's AAL, LED Underhood Lighting, Anytime ABS-Off Switch,
    Sneak Peak:
    48ADBFB5-016B-4A25-B68B-FC844399E1E1-1_426696ad12650f07cce7e0edcdef57ae713a6485.jpg

    The 4 wires you see coming out of the stock switch spot are for the inclinometer switch. My plan is to try to build a switch that will fit in the stock location and hold a 3-axis switch.

    Based on an Arduino Nano with the same 3-axis switch and 9-axis sensor as Rob and using a 2x16 SparkFun LCD with a serial backpack.
     
    Last edited: Nov 29, 2013
  2. Nov 29, 2013 at 8:26 PM
    #282
    emelianenkov

    emelianenkov Santa/Alex Emeliahoweveryouspellhislastname

    Joined:
    May 3, 2012
    Member:
    #78151
    Messages:
    21,511
    Gender:
    Male
    First Name:
    Alex
    NORTH POLE
    Vehicle:
    Alex's Shitbox Emporium
    NE Special Rust Edition
    That looks factory! Great work man!
     
  3. Nov 29, 2013 at 8:50 PM
    #283
    OZ-T

    OZ-T I hate my neighbour

    Joined:
    Dec 15, 2009
    Member:
    #27584
    Messages:
    50,579
    Gender:
    Male
    First Name:
    Peter North
    British Columbia
    Vehicle:
    Mag Grey 09 Trd Sport DCLB 4x4
    OME 885x , OME shocks and Dakars , Wheelers SuperBumps front and rear , 275/70/17 Hankook ATm , OEM bed mat , Weathertech digifit floor liners , Weathertech in-channel vents , headache rack , Leer 100RCC commercial canopy , TRD bedside decals removed , Devil Horns by Andres , HomerTaco Satoshi
    That looks awesome

    Great job
     
  4. Nov 29, 2013 at 9:00 PM
    #284
    Taqoma

    Taqoma Well-Known Member

    Joined:
    Jan 9, 2012
    Member:
    #70332
    Messages:
    1,351
    Gender:
    Male
    First Name:
    Brennan
    Los Angeles
    Vehicle:
    2011 TRD Off-Road
    TRD Supercharger, TRD CAI, Camburg LT, Fox 2.5x8 coilovers, Fox 2.0 bumps, Deaver e30 leafs, Fox 3.0x18 triples, Avid sliders, Yaesu 2900R, Pro Comp 7089 16x8, DDM 55w HID Hella 500FF, DDM 35w HID headlights, Magnaflow 11255 muffler, PLX DM-100 OBDII, Autometer Ultra-Lite II Boost gauge, Flex Pod gauge mount, LSK tube bumper, McNeil fenders, Fiberwerx bedsides, 285/75/16 Toyo MT's
  5. Nov 30, 2013 at 2:15 PM
    #285
    Dizo

    Dizo Well-Known Member

    Joined:
    Apr 8, 2013
    Member:
    #101676
    Messages:
    109
    Gender:
    Male
    First Name:
    Oliver
    North of 62°, Canada
    Vehicle:
    2005 DCLB TRD Sport
    Aux Audio-input, 5100's @ 1.75", 2" Wheeler's AAL, LED Underhood Lighting, Anytime ABS-Off Switch,
    Mostly-finished Product:

    D8C8CF38-CB95-4C70-AF3F-58651867E114_c03e6bd3b98518a68b5f35d88b0580c5b8aa6f7e.jpg

    The USB coming out is for programming (i'm still tweaking the code to my taste), and the other 4 wires bound together are for the 3-direction switch. I'm still thinking i'd like to make a custom switch holder for this to fit in the stock spot, but in the meantime it's an extra long cord coiled up in the sunglasses holder.

    The underside:

    B9BAD2DE-CE2A-4BD5-A01C-4AC9C2AF8C9B_74ba5b1d657e1df29085fed9d2afbde7cf9a0c76.jpg
    (my housekeeping of wires leaves something to be desired, but this is a beta version!)

    I've mounted the 9-axis sensor flat and tried to keep it somewhat far away from the metal body pieces. Seems to be working well for me. My arduino board fried two of the digital output ports (TX1 and D4), so i've used D5 (a motor control output - supposedly a little more durable) to control my LCD. As you can see, my voltage regulators were hand soldered and encased in silicone because it was quickest, but i'd use a pre-made low profile board if I were to do it again (see https://cameron-tech.myshopify.com/products/dual-regulator).

    I got power from the stock temperature/compass display by pushing in two solid core wires into the stock connector. No cutting, tapping ... nothing. You could also solder directly to one of the exposed dome light sections.

    Now if only I could get my hands on one of the stock mirrors with a temp display inside ... ;)
     
  6. Nov 30, 2013 at 2:23 PM
    #286
    Dizo

    Dizo Well-Known Member

    Joined:
    Apr 8, 2013
    Member:
    #101676
    Messages:
    109
    Gender:
    Male
    First Name:
    Oliver
    North of 62°, Canada
    Vehicle:
    2005 DCLB TRD Sport
    Aux Audio-input, 5100's @ 1.75", 2" Wheeler's AAL, LED Underhood Lighting, Anytime ABS-Off Switch,
    I've quadrupled the fetch timer for my inclinometer display to 1000ms (yours is 250ms I believe) and it's much smoother. You could go a little higher for road travel, but for off road I think something close to 1000ms is about right. It still samples just as frequently for the min/max values, so you'll still get that crazy tip-over moment value if you look in the min/max, it just won't display it as quickly when it's happening.

    I've also thought about increasing the inclinometer sample size. Rob has it sample 10 values and then averages them to find an accurate reading, but with so much spare processor capability left over i'm thinking i'll boost mine up to 50 or so. For things like altitude there's really no reason not to use a sample size of 100+ (keep fetch rate the same) because response time is less of a worry. I'm not planning on sky-diving in my Tacoma, so an update on altitude every 3 seconds will do :).
     
  7. Nov 30, 2013 at 2:48 PM
    #287
    emelianenkov

    emelianenkov Santa/Alex Emeliahoweveryouspellhislastname

    Joined:
    May 3, 2012
    Member:
    #78151
    Messages:
    21,511
    Gender:
    Male
    First Name:
    Alex
    NORTH POLE
    Vehicle:
    Alex's Shitbox Emporium
    NE Special Rust Edition
    This would be awesome! If only I knew how to program. If Rob could do that, I'd be stoked! I could send you my processor chip thingy for reprogramming at some point if you could do what this dude is saying
     
  8. Nov 30, 2013 at 3:11 PM
    #288
    Cannikin

    Cannikin [OP] Well-Known Member Vendor

    Joined:
    May 30, 2012
    Member:
    #79785
    Messages:
    145
    Gender:
    Male
    First Name:
    Rob
    San Marcos, CA
    Vehicle:
    2012 TRD Offroad
    Dude that looks amazing!

    You sure that only the 3.3v display will fit in that spot and not the 5v? They look like they're the same size in any images I've seen...
     
  9. Nov 30, 2013 at 3:30 PM
    #289
    bongwhisperer

    bongwhisperer Well-Known Member

    Joined:
    Jun 3, 2012
    Member:
    #80029
    Messages:
    488
    Gender:
    Male
    horn that plays "la cuka racha,"
    For utilitarian purposes I chose black on green, could you do a green on black? I think the human eyes sees shades of green the best, hence why most night vision optics are green.
     
  10. Nov 30, 2013 at 3:55 PM
    #290
    Dizo

    Dizo Well-Known Member

    Joined:
    Apr 8, 2013
    Member:
    #101676
    Messages:
    109
    Gender:
    Male
    First Name:
    Oliver
    North of 62°, Canada
    Vehicle:
    2005 DCLB TRD Sport
    Aux Audio-input, 5100's @ 1.75", 2" Wheeler's AAL, LED Underhood Lighting, Anytime ABS-Off Switch,
    The screen itself will fit, yea, but it's the board it's attached to that won't. The stock console lens has two tabs to hold the stock temp/compass display, and these are spaced ~80mm apart. Most of the 5V displays are on a 103mm wide board (same 71.3mm display size), so these wouldn't be able to fit down flush in the stock lens.

    Some of the 5V displays would work (like https://www.sparkfun.com/products/791), but you need to make sure the board footprint is small enough unless people are willing to bring out a file to take down their stock lens tabs. I'd really like to see if the completed unit you're going to be selling will fit in there assembled. It'd be a whole lot cleaner than my install, but i'm worried everything together would be too tall.

    Did you build a Kalman filter into the accelerometer calculations like we were talking about before? I've read through the code a few times and can't find anything that attempts to filter the accelerometer data outside of sample/avg. I took my inclinometer out for a rip and found the angle was falling out if I was accelerating or decelerating, which the gyro should be able to correct. I'll read that Kalman filtering article again this weekend, but I'm lost on how to get the gyroscope data with which to implement it.
     
  11. Dec 2, 2013 at 5:48 PM
    #291
    Cannikin

    Cannikin [OP] Well-Known Member Vendor

    Joined:
    May 30, 2012
    Member:
    #79785
    Messages:
    145
    Gender:
    Male
    First Name:
    Rob
    San Marcos, CA
    Vehicle:
    2012 TRD Offroad
    Yeah so the Kalman filter (and the related complementary filter, which is what I'm basing this information on) is just a way to average two values together over time, given that one is accurate in the short term (gyroscope) and one is accurate in the long term (accelerometer). All of the example code I've seen is used to try and self-right a two-wheeled robot. The equation "wants" to equal 0° so that the robot is standing upright. So the quick tipping motion of one of those robots falling forward triggers the gyro and uses the filter to take like 98% of that measurement and compare it to 2% of the accelerometer reading and uses that to determine the true angle that the robot is tipped at. But since it heavily favors the gyroscope measurement it'll just return to 0° if the sensor isn't constantly rotating (as soon as the rotation stops the gyroscope reads 0, even though the sensor could be holding steady at a 45° angle). So it should return an accurate measurement as the vehicle is rotating through a climb or over a rock, but if you paused and then read the incline it would be 0˘. Ugh. So I'm back to the drawing board.

    Again, this is all based off the way the complementary filter works, which is simple enough that you can just look at the equation and figure it out. From what I've read the Kalman is just a more accurate version of the complementary, so I dismissed them both, but maybe I'm missing something?

    I did use a complementary-ish filter for the altimeter: I take 90% of the current reading and add it to 10% of the previous reading to cut out all the noise of the barometer varying a little bit. I tried taking 10, 25 even 50 measurements and averaging them together but they were just so wildly different than your altitude still changed +/- 3 feet when you're just standing still. The filter cut though all that noise nicely.
     
  12. Dec 2, 2013 at 5:51 PM
    #292
    Cannikin

    Cannikin [OP] Well-Known Member Vendor

    Joined:
    May 30, 2012
    Member:
    #79785
    Messages:
    145
    Gender:
    Male
    First Name:
    Rob
    San Marcos, CA
    Vehicle:
    2012 TRD Offroad
    Yep, I found a green OLED board! If I remember correctly our eyes are most sensitive in the green part of the light spectrum. So I assume they use green because you'd be able to discern the most detail from a green image. If you want to preserve your natural night vision you're supposed to use red.

    [​IMG]
     
    MtnClimber likes this.
  13. Dec 2, 2013 at 5:52 PM
    #293
    Cannikin

    Cannikin [OP] Well-Known Member Vendor

    Joined:
    May 30, 2012
    Member:
    #79785
    Messages:
    145
    Gender:
    Male
    First Name:
    Rob
    San Marcos, CA
    Vehicle:
    2012 TRD Offroad
    Sorry for the lack of updates lately guys, I'm just waiting on the circuit boards...I've got everything else ready to go. Whenever I've ordered boards in the past they've come back in a couple of weeks and it's been three...hope my order didn't get lost somewhere. :( I've contacted the guy to get a status update so hopefully I'll know more tomorrow.
     
  14. Dec 2, 2013 at 6:39 PM
    #294
    anders99

    anders99 The Sailing Member

    Joined:
    May 28, 2013
    Member:
    #105101
    Messages:
    1,917
    Gender:
    Male
    First Name:
    Matthew
    Penscola, FL
    Vehicle:
    (07 Base 4cyl 4x4 - RIP) -> 2018 4Runner SR5 Premuim
    Taco SOS Offroad Concepts hybrid front bumper Iggy Corp. Switch panel Famous Fab ditch lights and cb antenna mount Pioneer Appradio 2 Halo Led Headlights Led Taillights 3'' toytech spacer lift on front end Toytec AAL on rear AFE cold air intake 4Runner Stock
    So does that mean they are almost into production?
     
  15. Dec 2, 2013 at 8:04 PM
    #295
    Utard

    Utard Well-Known Member

    Joined:
    Nov 5, 2011
    Member:
    #66532
    Messages:
    3,121
    Gender:
    Male
    First Name:
    Mark
    Tidewater, OR
    Vehicle:
    2019 Tacoma SR5
    So true and this is why this world sucks.
     
  16. Dec 5, 2013 at 8:19 AM
    #296
    Cannikin

    Cannikin [OP] Well-Known Member Vendor

    Joined:
    May 30, 2012
    Member:
    #79785
    Messages:
    145
    Gender:
    Male
    First Name:
    Rob
    San Marcos, CA
    Vehicle:
    2012 TRD Offroad
    Got a response from the circuit board dudes. I placed a "medium" order which is for a larger quantity, but at a 30% discount. What they failed to mention is that a medium order can take a month or more to get printed. :( The small orders usually come back in two weeks or less. If I would have know that I would just paid a little extra and got the quick turnaround. :(

    So it looks like we're still a couple weeks out from shipping these things out, sorry guys.

    But some good news: I found a white on black and red on black OLED supplier! I'm going to order a couple sample boards and see if they work with the current hardware. Updates soon...
     
  17. Dec 5, 2013 at 8:35 AM
    #297
    davidpick

    davidpick NWXPDTN

    Joined:
    Jan 21, 2010
    Member:
    #29760
    Messages:
    2,380
    Gender:
    Male
    First Name:
    David
    Leavenworth, WA
    Vehicle:
    1988 Pickup 22R 5sp 2wd
    Weber 32/36, RV Cam, LCE exhaust headers, Desmogged
    mmmm red on black oled!!
     
  18. Dec 12, 2013 at 9:31 AM
    #298
    TacomaN8

    TacomaN8 Well-Known Member

    Joined:
    May 22, 2013
    Member:
    #104712
    Messages:
    115
    Gender:
    Male
    First Name:
    Nate
    tbd
    do you think these will be available by Christmas? by January? I'm just curious...
     
  19. Dec 12, 2013 at 9:54 AM
    #299
    Cannikin

    Cannikin [OP] Well-Known Member Vendor

    Joined:
    May 30, 2012
    Member:
    #79785
    Messages:
    145
    Gender:
    Male
    First Name:
    Rob
    San Marcos, CA
    Vehicle:
    2012 TRD Offroad
    The latest email from the circuit board guys says they'll be mailing them out to me by "thursday the 14th" ... today is Thursday, but the 14th isn't until Saturday, so I'm not sure which of those is correct. :) Either way I should get them next week so they should *definitely* be available in time for Christmas.

    Sorry again for the wait everyone!
     
  20. Dec 12, 2013 at 10:18 AM
    #300
    BradyT88

    BradyT88 Well-Known Member

    Joined:
    Nov 3, 2011
    Member:
    #66419
    Messages:
    36,722
    Hmmm... The next Thursday the 14th is in August... haha
     
To Top