Close
0%
0%

Digital Speedometer

A new digital dash to replace the slow inaccurate one on my cheap Chinese bike

Similar projects worth following
Got a Lexmoto XTRS, a cheap and cheerful bike, but i really didnt like the dash. It was slow and inaccurate to update.
So I wanted to build a better one. The idea behind this is to have something that I can take off and put onto a big boys bike once I get a full license. But also be something thats not perminant and can put the bike back to its standard dash.

i started the project out on a Arduino Uno, i then transferred the project over to a Maple Mini clone for the higher speed processor.

It also uses a Nextion display for the central display.

I later added a Arduino Pro Mini to independently drive the motors to give a smoother motor flow.

Im also using addressable Led arrays as well. Thats a lot of fun.
I plan to have the final build looking like an off the shelf product. Will be 3D printing a case soon...
I wanted to show the continuing progress of this long but enjoyable project.

My mum passed away at the beginning of the year, which was a shock and terrible loss for all of us. I had just moved back home when she was diagnosed with cancer. She died a few weeks later.

I kept myself busy by painting and playing games. Trying not to think about anything too much. I suffer depression at the best of times, this just made it worse.

Soon the painting lost its charm ( I still do it and i have stuff i want to finish, like my mums portrait) but I really wanted to do some techie stuff.

For a while I've been itching to do a project, but I just couldn't for the life of me think anything up.

But then I got my first motorbike.

A very cheap and cheerful Lexmoto XTRS, looks the part, shame about its actual power :), but a decent first bike.

Only paid 250 quid for the thing. The previous owner was selling it as parts and spares and or as a project to do up... Well the bike was still fairly new and all that was really wrong with it was a broken flasher relay.

I wanted the Bike to also be a project to keep me busy, but so little needed doing with the bike I was done in no time. While riding around the yard testing out the bike I noticed the speedo and rev meter were really slow to catch up with the actual speed or rev. This bugged me and in the end decided to go ahead and start this project.

i don't have a lot of cash, but thanks to china and eBay i can get most of the parts really dirt cheap. Using Chinese clones of arduinos or maples. Even the 3D Printer I'm getting is a cheap Chinese thing. Reading up on it, it takes some work to get going but is a decent printer once its running.

This project has been going on now for a couple of months, so where am I at now?

I have the speedo in a cardboard mockup, Its now reading real RPM data and displaying it with accuracy of around a 200 rev window. The LCD display is showing the numbers and the LEDs are keeping up with the pointers, currently only showing a white light...

I'm also more than half way done making the case design for printing.

What needs doing?

I want to make the LED display more interesting, throw in some colours and a peak lag animation.

I also need to design the casing that would hold the MPH sensor... Im going to use the bikes MPH cable from the wheel. Thats going to drive a fan that a optical cut off sensor would read, much like a mouse wheel does.

I need to work out how many slices in the fan I'm going to use. Too few the MPH update data would be a little slow and inaccurate. Too many the code might not be able to handle all the extra resolution and or the optical sensor might not be able to detect the brakes in the fan when the bike goes at top speed.

A little note, currently i have 80MPH and 12RPM on my speedo. Thats only because this bikes realistic top speed is about 65MPH and the rev counter says 12thousand RPM though I think more realistically its 10000...

This is a simple thing to change, in the sketch i only need to change 2 variables at the top of the sketch to take into account any changes. Then print out a new silk for the gauges.

Future plans for the project? Well after I finish V1, I also plan to build a GPS tracker that would go into the dash, for if the bike is stolen... But thats a whole different ballgame :)

I will try and keep things updated here as I go. Wish me luck

  • 1 × Nextion 2.8 inch Display A LCD screen with built in ARM processor to handle the GUI stuff.
  • 1 × Baite Maple Mini (Chinese Leaf Maple Mini Clone) The main brains of the project. 75Mhz Arm processor for all that crunching...
  • 1 × Arduino Mini Pro 16Mhz mini Arduino just for driving the stepper motors
  • 2 × Swift x27 gauge stepper motors For the anilogue gauges
  • 80 × Addressable LEDs (NeoPixel compatible) For the Flashy lighty stuff...

  • Admitting defeat... V1 project, maybe dead... Maybe...

    Mangus Tiranus12/08/2017 at 12:47 0 comments

    Well this is sad. I really didnt want to post this but the last few weeks I've been really struggling and contemplating doing this... 

    I have to admit defeat. This version of the project is now dead. Which is a painful shame given all the hard work ive put into it.

    So whats happened?

    The custom FTDI EVE display i designed... I just cant get it to work. I've spent the last few months going over it, I went through 3 different PCB designs on paper it should work but it just does'nt. Part of the problem is the LCD panel itself.

    It uses an ILI9488 chip, and datasheets for the real nitty gritty how to get this to work is scarce. For starters, in the mian datasheet it says to get teh display running in 18bit parallel mode you only need to set the IM0,1,2 pins to 0, I've tested this both as floating/unconnected or low to ground. Neither automatically sets this to the correct mode.

    With James Bowman from Gameduino we worked out that the datasheet is actually wrong, and to get the display to work You have to first set it to serial mode, then send a bunch of undocumented commands to the chip to flip it into the correct mode. This is not written in ANY datasheet. its purely worked out from random bits of code found online from various Chinese sites.

    I've had a huge amount of help from James  trying to get this to work. hes even written a whole article on how to get ILI9488 displays to work on the FTDI EVE, you can read it here: http://www.excamera.com/sphinx/article-ili9488.html

    And we nearly got it working, if it wasnt for James I would have posted a post like this weeks ago...

    So heres whats happening with the display...

    Considering all the resoldering and 5V logic ive been putting this through, its possible Ive now damaged one or two or more parts and it would never work correctly...

    Also my bike stuff has changed, I'm now in the process of getting my full bike license and I have a new bike already, A Kawasaki ER6f... Given that I have a nice new bike, and this isnt working. I dont want to throw any more money at this project :/

    I wasnt aware before about the bridgetek display James mentions in the article beforehand. I could buy one of them and that would solve this and I could get on with programming and finishing the project, but its more money than I'm willing to spend right now for this. ($49, roughly £35)

    By all means if anyone is willing to donate me a bridgetek display, ill carry on the project with that :)

    The main board works, the LEDs work... and looks great. The power requirements for them is a little high and so I might replace the vRegs with buck converters if I continued. But thats only when it runs at full white bright that they get HOT! i normally only run them at 50%

    So where does this leave this project? No I am not killing the project as a whole. just V1, I had always envisioned a more advanced V2, only that originally it was going to look some what the same with analogue dials and a screen in the centre...

    This would now likely be using a prebuilt 5 inch display from HOTMCU, so I wont have to worry about messing up its design.

    One of V2's key features would be GPS tracking for theft recovery with no subscription charges, using a free mobile provider like Freedompop to handle the minuet bandwidth requirements. So you find your bike is missing, you text the bike a command like "Where are you?" And it fires up the gps and replies with a gps location. it would then ask if you want real time updates? which you reply yes to and you then get a link to your phone with map and regular updates being posted online. 

    This could be linked to a google account or some other service. i've still yet to work out the details on that. i might even design an app for the phone that the bike connects to through the internet and provides the location info to. V2 is very much a product version of the digital speedo. Something I want to develop to sell.

    So yeah, for now it seems, this project is kinda some what dead......

    Read more »

  • Something is coming, a sneak peak

    Mangus Tiranus08/19/2017 at 17:11 0 comments


    Still a ton of things to do, but I am starting to put together the new prototype. 

    Ive been playing with my new 3d printer this last couple of weeks and still need to do some more work on it before making the main case. But hay some news, its coming together. Expect a proper update in a few weeks... (i ordered the wrong diodes so its going to be at least 2 weeks for the new ones to turn up >.<  )

  • So whats been happening

    Mangus Tiranus07/23/2017 at 10:39 0 comments

    Ive noticed a fair few more followers recently and because of this I thought Id give an update on whats happening, so people know the projects far from dead.

    Well things have slowed down because of a few issues at home... Family trouble, fun eh?

    So it might be another month before theres a real hardware update on everything.

    But I've been doing tons of work on the computer towards having a functioning 'attached to the motorbike' prototype final build for V1.

    I had some pcbs made by easyEDA and they looked great, only trouble was I roushed it and made a few little mistakes in the design. 

    Also the LCD i got was unsuitable as I couldnt find a touch panel to fit its unique aspect ratio...

    So Ive now found a new display its a little larger at 3.5 inches but actually it fits better for the design.

    I've been finishing up the case design in CAD (f360) with only a little bit left to do, i need to design some kind of bracket for the speedo to mount onto that connects to the bikes frame.

    Ive also designed a speed sensor that fits into the casing. This is just a disk with magnets and a hall effect sensor reading the disks rotations. This gets attached to the bikes speedo drive cable that comes off the wheel.

    And the other major thing, Im getting a 3d printer. Its being shipped as i type and I should get it within the next couple of weeks. Only trouble is because of the trouble at home I may not be able to go home to put it together and print out the bits.

    I need to save a little to get new pcbs made as well as get all the components. But Im nearly there. Soooo sooo close. Once I got it made ill make another video update.

  • Onward and upward... And, oh hay, some renders...

    Mangus Tiranus06/02/2017 at 17:01 0 comments

    Well it seems the PCB renders i previously posted arent to be... mostly because I decided to try and reintegrate the LED arrays onto the mainboard.

    This would half my PCB making costs and as Im going to get my next board professionally madeI thought the issues I would have had before with low yield or pcb damages shouldnt be a problem now.

    Also whats new is the speedos going to get a slightly larger and higher res LCD display. This is because it was proving incredibly hard to find a cheap 2.8 inch display that was compatible with the eve chip. They existed but were just too expensive...

    Though getting a 3.2 inch display hasnt been perfect either. Again finding a display wasnt so hard. But then none came with a touch screen film. So ive managed to find one that should fit and I can manually attach it to the screen.

    The PCB design is nearly complete. I need to track up the LCD board but other than that the boards done.

    In the mean time ive spent some time learning Maya, as a Max artist ive been wanting to learn maya for a while and this is a perfect opportunity to mess about with it.

    I made a new Cad project to fit the new board designed and imported that case to Maya, did some mesh cleaning applied some textures and churned out a few renders.

    Sadly this laptop isnt really built for rendering so these take ages to render within arnold and theyre not perfect.

    Anyway thought you might like to see them.

  • A setback, Maybe what I need!

    Mangus Tiranus05/06/2017 at 14:33 0 comments

    Well Ive had a setback today, Today i discovered that Virtual Box works in mysterious ways...

    As Im using a Macbook I had to run Vbox to use some small windows apps, this including the Nextion Editor for building the GUI on the lcd display...

    A few weeks ago i did some house cleaning on my computer and deleted some unused large files. Including some Snapshots of the VM I used. I kept the main virtual drives I had setup believing my important files to be in those drives... only to today find out thats not how VBox works. It puts everything you to in the machine into a second Virtual Drive for some strange reason. Strange because that takes up a huge amount of space for no reason at all...

    I recovery the VM got it working again and tried to find my files... Nothing. Its not there... All gone. All the Nextion Editor program and project files. Gone.

    I still have the graphic assets as I made them in Mac. But the project gone...

    There is some one who maybe able to recover some of the project from the firmware file. But it will still be a fair amount of work getting it running again.

    Pretty gutting... And Yes I should have had a recent backup. But trouble is with all the stuff going on in my life at the moment. Backing up has been the last thing on my mind.

    I do have a backup but its old. its from when I had to move out of home so late January...

    But silver lining... This might be the kick I need to finally make the proper move over to the EVE display solution. Im already designing my mainboard with the ability to use an EVE setup. But Im currently struggling with making the display board itself. I need to find and stick to one LCD panel but finding one is proving more complicated than I had hoped.

    In either situation. I have a lot of work to do... If i can recover the project in a partical state I have a fair bit of work to fix it. But it would be availible to show mockups to a potential backer... Moving to FTDI EVE will also be a huge amount of work. Not only would I have to learn its entire process. its documentation isnt the best... I would also have to completely rebuild the project from scratch anyway...

    But I do intend to make some graphic design changes with the new system.

    Lets see where this goes :)

  • New LED Array ...

    Mangus Tiranus05/02/2017 at 17:39 0 comments

    Another smallupdate just to show the new LED Array design. This version does away of the 40 ws2811 chips in favour of 5 TLC5947's. This does how ever mean I have to do some hefty rewriting of code to work with the new chips. I dont want to totally rewrite my led code, but I will have to rewrite the adafruit library to work nicely with my current functions...

    Anyway heres a little render

    Im nearly ready to send these new boards off to a fab house to print for me... But I want to do some further research to make sure every things right...

    Im not entirely comfortable with the tracks out of the TLC5947s being only .3mm, while all the real energy is send out the LEDs, Im still worried the .3mm might be too little for the grounding off the LEDs... Maybe I got my understanding of electronics totally mixed up :D

  • Rev6? Small Update

    Mangus Tiranus04/30/2017 at 14:14 0 comments

    Well ive been doing some researching and redesign work of the main board....

    This is a small update as really its just pcb design work and schematic editing, however... Could this be the rev6 board?

    Ive been getting to grips with KiCad, boy was it a learning curve. There are still some things eagle does metter... Arrays for a start... but Once i got round most of KiCads niggles I managed to get some good work done...

    So yes this could be Rev6, I want to do some more research before I set this design in stone... This current design allows for both Nextion and EVE displays so the transition can be done using the same board, I have also incorporated the new rpm filter. Made nearly all the resistors SMD... Have a 2x10 socket for an easier less messy cable connection. And also have an alternative way of running the leds.

    Some people mentioned that there are multi channel alternatives to ws2811's... And while I might have to create a new library so the code I already have can interface with them, It does seem worth it and would make the led arrays a little cheaper to build, as I would only need 5x tlc5947s to drive all 40 rgb leds... rather than 40 ws2811s...

    Im yet to design the new array pcbs and I need to continue having a think about how to go about with the new chips...

    Oh and as this quite possibly would be the final circuit design im going to have this version fabbed at a factory...

    Anyway wish me luck :)

  • HUGE UPDATE

    Mangus Tiranus04/17/2017 at 14:16 0 comments

    Apologies for not keeping people more updated, but as some of you know Ive had some upheavals at home which have made it difficult for me to work on my project as much as I would like… And post updates even less.



    While changes to hardware is near impossible at the moment I have used the time I had to do a lot of software work. Ill try and bullet point these changes…



    • Corrected fuel gauge and volt meter graphics to match the input data.
    • Reworked the menu list changing options available
    • Fixed the preview led colours in the colour menu
    • Heavily reworked the colour picker menu
    • Made the display talk to the MCU and programmed in the menu navigation
    • To do this I had to implement a mixture of Nextion library use and Serial talking
    • Ive done a lot of recoding of the LED update functions. Including reworking the peak lag spot animations and menu interactive animations.
    • You can change colours for the LEDS through the menu system, though currently this doesn’t save, so when power is cut off it returns to the default settings.
    • Fixed RPM calculation functions now accurately detects RPM through millisecond readings(this may be turned into a hardware timer interrupt in the next major hardware version…)
    • Built the wizard for setting the high and low fuel level readings. However the hardware needs changing as the current design doesn’t work… even though it should Sad
    • And other ‘stuff’ I cant even remember right now……. Lots of tweaking….



    Ive also gone through a few different versions of RPM signal filter to try and get a working readable signal. This bit really has been a nightmare esp given my current circumstances making it really hard to RnD this bit.



    Though ive managed to get it working. I may still do some changes to the rouge filter I got now. Just to guarantee a cleaner signal, but its working…



    I nearly gave up on my project because of this… Whats the use of a speedo dash thing if it cant even read the RPM………….



    Once Ive totally locked down the filter design Ill add it into the design of the new main PCB, Ill also upload a schematic of the filter so anyone else can use it if they like… Its only fair as I based my working design off a design someone else made elsewhere…



    Ive uploaded a video of the update onto youtube… I talk through some of the updates ive done. I warn you its unscripted, not even got bullet points so theres lots of Umms and Uhhs as I try to think of what I need to say.



    I hope you like.

  • Not dead!

    Mangus Tiranus02/20/2017 at 20:18 0 comments

    Well not got good news I'm afraid, the projects "NOT" dead. Far from it, ive been working a lot on getting the interface to talk properly with the maple. With mixed results.

    Some times some serial messages just dont seem to get through and its a real head scratcher.

    Normally I would consider some sort of call back and confirm error correction. But to do something like that on the Nextion display is near impossible as its so called programming is very very limited.

    Its a puzzle thats for sure. And one which I would solve. If hopefully i have the opportunity...

    Sadly its very likely im going to have to put the project on hold for maybe a few months. This is because after family issues, im going to be unavailable to really work on the project that much. This may last a few months. Ill have a clearer image tomorrow. But suffice to say. I'm not in a good place right now.

    For those that follow me. Sorry.

    This will get done I promise that. But its just going to be a while now.

  • Another little update.............

    Mangus Tiranus01/16/2017 at 23:30 0 comments

    After the break over christmas I have finally got round to making the second LED Array module for my project. Its a tweaked layout design of the first (right hand side) ive removed most of the vias, cleaned it up a little... Improved it...

    Anyway ill get on with some coding tomorrow. I need to get the real RPM signal reading bits working. I was having trouble with that before. Not sure why....

View all 19 project logs

Enjoy this project?

Share

Discussions

geraldjust wrote 09/01/2017 at 08:21 point

hey! i have a circuit to be able to interface with the -neg trigger on the ignition coil if you want to take a look at it! Also, if you have any questions on how to integrate other sensors into your project i suggest looking into "seeeduino". Its a open source ECU. Look at there schematics. you will find how to integrate with water sensors air sensors etc! 

  Are you sure? yes | no

Martin wrote 06/06/2017 at 07:38 point

Obviously there are different qualities of LCD. I have two different thermometer sensors hanging outside, side-by-side, one is completely blacked out since several years, the other perfectly readable.

For your idea of using voltage regulators to condition input signals: Excuse me, that's a really bad idea.

1. They are not tolerant to the spikes in a typical vehicle electrical system

2. And they will not work stable without 100nF caps at input and output. They can oscillate in the MHz range which leads to EMI disturbance and they can even overheat.

3.  And they are way to complicated

Optoisolators are also not a good idea. Every time you use an optoisolator but connect both sides to the same ground reference, you defeat it's purpose. It can be substituted with a transistor, a voltage divider or sometimes with a single resistor.

For adapting inputs to CPUs, a passive solution is the way to go:

The STM CPU is a 3V3 CPU, but it has some 5V tolerant inputs. You should NOT primarily use this as they do not have clamping diodes to VCC (3,3V). If you want to use the 5V tolerant inputs, you need to add extra clamping diodes to 3V3. Something like BAV99 or 1N1´4148 is sufficient.

You use just a high value voltage divider 2*10k or 2*22k to reduce the voltage and current of your 12V signal and a small cap 100nF at the CPU pin. Of course this voltage divider gives you nominally 6V but this is completely acceptable as it has an impedance of 5k or 11k and thus a short circuit current of 1,2mA or 0,55mA and less than half of it into the microcontroller input pin. Which is completely acceptable. Look into the datasheet for "injection current" specification. You can/should add an extra small cap (10nF to 100nF) on the 12V side of the divider for increased protection against spikes like ESD and Rf interference.

If you need another switching threshold than 3V3 (2 times VCC/2) than you can adjust the voltage divider but don't use lower resistors than 10k.

This way you can easily interface any signal, digital and analog to the microcontroller. So please do away with the opto isolators and LM7805 for signal conditioning, although it is a creative solution. :-)

  Are you sure? yes | no

Mangus Tiranus wrote 06/06/2017 at 12:47 point

Hi the LM7805s arnt for signal conditioning... Theyre being used for the main power lines. I have fairly large caps on the ins and outs of the regulator. 

A voltage divider wont work as the input voltage can vary fairly widely. (11.8-16v+) Depending on the condition of the battery and regulators on the bike. Even for a healthy bike the voltages can reach 12-14.5/15v when the engines really going. So a simple divider would easily throw out MCU killing voltages.

Sharing the same ground is fine, as ultimately it all shares the same negative line as the bike.

Normaly the bikes mains would be DC, but I cant rule out that there might be some AC noise. Ive not actually put my Ocili on the mains line to check. 

Im currently only using optos on for the light inputs of the board now. This wont cause any major trouble and in reality I could get away with not using optos anyway.

As for clamping. As I mentioned it shouldnt be AC anyway, currently doesnt appear to be needed. But maybe i could add some extra protection in some inputs.

  Are you sure? yes | no

RandyKC wrote 08/28/2016 at 15:52 point

I'm sorry to hear about your mother. I recently lost my dad.

I wanted to comment on your using an LCD screen on your motorcycle. I had a GPS I mounted on my bike and left it on the bike all the time, even when parked. The screen eventually "blacked out". The problem was UV exposure from the sun and an imperfect UV filter on my older model GPS. The liquid crystals in the LCD are organic and break down under UV exposure. Since the GPS screen was angled up so I could view it it was also angled up so that the sun was shining directly on the screen. I would recommend some sort of cover for your screen when you park it

  Are you sure? yes | no

Mangus Tiranus wrote 08/28/2016 at 18:18 point

Thanks, on both counts. I didnt know for sure but I did wonder if UV light might damage the screen. I'll look into a UV filter to place on the screen... 

  Are you sure? yes | no

cmduarte wrote 08/28/2016 at 15:20 point

Sorry, you lost your Mum.  I like your project and wish it and you well.

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates