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...

  • 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....

  • Rev 4... >.>

    Mangus Tiranus11/29/2016 at 23:39 0 comments

    As you could see in my last video... Rev 3 didnt go too well. The leds were failing fast...

    So I decided to go ahead with the through hole led approach... Trouble is they dont make 3mm domed addressable leds... The smallest addressable leds I could find were 5mm domed. But theyre too big to fit 40 leds in the array.

    I can however fit 5mm rectangle leds, but their are no addressable rectangle ones.

    If anyone knows where i can find some please let me know as it would save me a whole lot of trouble.

    Anyway i now have 5 mm rectangle RGB leds driven by individual ws2811 chips.

    I have designed and built the array to be modular and bolt on both sides of the main control board.

    This should last the whole prototyping stage now.

    I also cut these boards out so theyre more like the final design.

    Im still waiting for the controller chips to turn up then I can solder everything on.

    i was going to update once I did that but i wanted to put something up on here as i've been a little quiet on here for a few weeks.

  • Umm Rev3 :D

    Mangus Tiranus10/22/2016 at 19:26 0 comments

    Sooooooooooooo. Rev 2 had so much promise, but after getting it working I quickly discovered it had some serious issues with power distribution.

    So I had to redesign the board and give more thought to the power lanes.

    I now have 5v regs dedicated for each of the led arrays and a third 5v reg for the rest of the project.

    Because I need a stable regulated 12v to run the backlights and run the fuel sender probe, a friend recommended that i remove the 12v regulator I had because it would be better to use a boost converter from the third 5v supply.

    Its a stop gap measure that might change in a later version. But this does solve some issues with the widely ranging 12v line off the bike.

    The old 12v reg I was using needed a 2volt + headroom to get a stable 12v. The other option I had was to use a low drop 12v reg. I found one, but they're expensive.

    And its also possible that the bikes voltage could end up dropping bellow 12.5v... (the bikes voltage/rectifier is on the blink i think, I will fix that, but it does highlight a possible real world issue the dash has to contend with.

    I would like to make this a product I can sell, so while I'm learning how to build it, its good to find these issues and work out how to fix them.

    Anyway, I've etched the board and got a solder mask on both sides. I might even put on a silk :D Who knows...

    Anyway tomorrow ill be reflowing the SMD bits. Ill post a pic then.

  • The Fall & Rise of Rev 2

    Mangus Tiranus10/15/2016 at 16:40 0 comments

    So its been a while since I made an update. As always I've been busy behind the scenes, doing lots of head scratching and getting mild concussion from banging my head against the wall :p

    So where am I at?

    Well I've built the Rev 2 prototype board. YAY, however it really wasn't simple sailing.

    Come with me on a journey of frustration and insanity...

    I got tired of waiting for the toner transfer paper to come from china. Its still not turned up and I think I might have to log it as an undelivered item in Ebay... So I went ahead and used some magazine paper to do the transfer, and it didnt go quite as nicely as I've seen other peoples transfers go.

    While it was better than the baking paper some toner just didnt pass over that well. I think the ink on the magazine paper interfered some what with the heating or mixed into the toner. Not sure.

    So I still had to get the sharpie out and fill in some missing or broken bits. But it looked alright and I etched the board. So far so good. A few weak or broken tracks but reenforced them with some solder.

    I was going to do a whole solder mask and silk screen layer, but as the solder mask didn't come out as nice as I hoped, i decided not to bother with the silk screen.

    I think the issue with the soldermask is I was using a UV torch and it just wasn't strong enough to penetrate into the paint to make it stick to the board correctly. So when I pulled the OHP sheet off it also pulled some of the mask up as well.

    Anyway I managed to patch that up and had clean pads for some reflow soldering.

    I also got my paste in the post the day after I set the solder mask and was eager to try and solder on the 80 addressable LEDs.

    Pasted on and placed the SMD parts, and then I went to a old mini baking oven that was my mums and put it in. I used the reflow chart for the LEDs as a rouge guide knowing the oven wouldn't exactly match it. Hand controlling the temperature dial I preheated and then sent it to the peak temp, and watched through the window to wait for the solder to melt and set.

    Well that worked.

    I spent the next day drilling all the vias and soldering the rest of the stuff on...

    It was time to switch it on. I got my 12v PSU out and wired it in. And turned it on... keeping an eye on the PSU light incase there was a short. (the light normally goes dim if there is)

    And nothing.

    Nothing turned on, the PSU light was still on so there couldnt have been a short. But then I noticed the jumper wire I was using to power the board was melting and smoking... I quickly pulled the power out of the board before it caught fire.

    Turned out there was a short, but because it was on the other side of the 5v regulators my PSU didnt seem to notice.

    So the next day i started to look at the board closely. I couldnt find it. I exspected maybe some solder was touching ground where it shouldnt be, or a bad track etch somewhere. I spent hours looking and couldnt find anything.

    Using my continuity tester I was able to find that there was certainly a short somewhere from the 5V line, but just couldnt find it anywhere. Then thats when I started to fear the worst. What if some solder paste made contact underneath the many smd LEDs, its certainly possible. If that was the case it would have been a total nightmare to find and fix.

    It was at this point a good friend stepped in and suggested a way to isolate where the short was, simply by cutting the power rail traces into segmnts and testing each segment. Starting with the LEDs... Good idea. Easy to repair too.

    So I isolated the left array of leds. Nope not there, Thank fluff... Isolated the right array... YAY not there either. So it wasnt underneath the leds. That part of the nightmare was over.

    I then managed to Isolate the short to a 1 inch by 2 inch area and I still couldnt find it. Took me a few hours to figure out what 'I did wrong'... My fault entirely.

    When the toner didnt transfer quite right I penned on some of the missing tracks and i stupidly got...

    Read more »

  • MAJOR FAIL!!!!!!! RIP Prototype N.o1 You didnt even have a chance :(

    Mangus Tiranus09/29/2016 at 22:13 0 comments

    I guess it was always going to happen... At least with the first.


    I failed... Really failed.........


    So with this prototype board I got impatient. I really want to get on with coding the project, but i need a working board to do that.


    So instead of waiting for the solder mask paint I went ahead and started soldering bits on. I learnt a lot about the board, things i need to change and fix...


    Stupid things like needing to put solder pads on the opposite side of the board to the component... Or wiring the serial connection between MCUs correctly and not having the tracks lead to one pin to the left -.-Embarassed Those I fixed with some bogging... But still this is the prototype board. Its for finding these mistakes and fixing them...



    But the final nail in the coffin for the board... After bodging on a solder mask. Ive discovered even with paste, I cant use a soldering iron to solder on the addressable leds. It kills the LED chip really really quickly. When trying to remove one of the dead leds with the iron, it basically ripped up the track and half the fibre board Sad

    Live and learn I guess...


    Well im going to have to make a new PCB, this time ill fix the tracks and correct the solder pad sides... Ill get a nice solder mask painted on as well before i do anything. And buy extra flux because BOY do i need it. This lead free solder is terrible... Really sticky and turns gloopy very quickly.


    Anyway here is the carnage...

  • Prototype PCB!!!!!!!

    Mangus Tiranus09/22/2016 at 14:52 0 comments

    So last night I etched my first PCB is about 20 years.... scary...

    Its not gone perfect.y, I used the toner transfer method on some baking paper. But toner cracked and flaked a bit and didnt iron on perfectly... So its a little messy and one or two traces might be broken, I can fix those with some solder.

    But its a functioning board so should work for the prototype.

    When I make the final build of this version of dash ill make a cleaner board.

    Anyway heres a couple of pics of the thing.

  • Could do with a few sets of eyes, my wiring schematic

    Mangus Tiranus09/03/2016 at 10:21 0 comments

    So I've reached the stage in my project that my skills are at their weakest... Electronics! Funny that, this being a electronics hacking/making site >.> ...

    I've put together this schematic based from various sources of how toos and i really need some proof reading before I order in all the parts and build this on the breadboard.

    I'm pretty certain I've made mistakes, got some values wrong or implemented the wrong type of circuit for the task...

    One issue I have with my bike is its mains voltage is anywhere between 12 and 15 volts. So I need the various 12v lines in off the bikes wiring loom to be able to handle that variable.

    I have a 12-5v module for powering the project that can handle that (purple thing), just bellow that is the jumper for the 12v mains in, and 2 voltage test circuits. One for testing the mains voltage and one for testing the fuel level. Looping the 12v back down the FUEL_Y wire (yellow wire) and reading the voltage off the FUEL_B (blue wire) that comes back. In the tank there is a float on an arm thats attached to some kind of variable resistor. At this stage I have no reason to assume the voltage going into the variable resistor in the tank is anything other than the 12v mains off the bike. (other than 12v being a nice high tank exploding voltage if the resistor failed :D ) Though I will look that up more and confirm that its possible I guess that the gauge on the bikes original dash dropped the voltage level before sending it back, I will test this...

    On the Adrafruit powering neo pixel guide, it says to use 1000uf caps to stop any voltage spikes coming up the line. I ordered some and theyre pretty big... I may have also ordered the wrong type, being electrolytic. These are about 1cm in diameter and 1.5 cm long... Are there any smaller package options I could use?

    Im using opto isolators for many of the inputs from the bike. This to protect the IC from any spikes...

    But I'm a little unsure if I've got the circuit right for them.

    The RPM in, I'm using a resistor to drop the voltage as I dont want to interfere with the signal. At the moment I believe the signal is 12v (bike mains voltage level) pulsing. Im going to confirm this once I get an oscilloscope. Would a voltage regulator interfere with the signal? Smooth it out?

    And If using a resistor is the right thing to do what value should I give it? Given the wide variable the bikes voltage is...

    On the left of the maple mini are some other inputs.

    I have the Running Headlights and High Beam going through a regulator, as they will be turned on for long lengths of time.

    The indicators are on 630 ohm resistors are they just flash, I dont think heat should be an issue there?

    Will the voltage regulators have a heat issue? Do I need to think up some sort of heat dissipation into my design?

    And finally, pay little attention to the gear number inputs... Im not entirely sure how Im going to handle them at this point, my bike only detects neutral, Ill have to change the switch for that to work, and If i do, would I run it through the loom or just send a signal down from the dash unit... Again at the moment these are using 7805 regulators...

    I also have a space issue with the 7805 regulators... having this many takes up a lot of pcb space. Even to the point of me thinking about making a second PCB board. I much rather keep this all on one.

    Anyway, anyone please take a look over the schematic and tell me if you see any real issues with it, and if you think my resistor values are wrong :)

    Thanks in advance :D

  • RIP Pin12, you will be missed.

    Mangus Tiranus08/29/2016 at 17:51 0 comments

    So it seems yesterdays RPM failed test was not without its casualties...

    The 12-5v module is dead :( RIP as is pin12 on the maple mini... :(

    Its a good thing I have 4 more Maple Minis... and 3 more 12-5v modules...

    To be honest I think its pretty impressive I've not managed to kill the entire board if not more pins this far down the development... So I think 1 pin so far isn't too bad :P

    Ill replace the board when i do the final build. Or until I run out of spare pins to burn :p

    Its a good thing these things only cost a couple of quid each.

    Though this does continue to raise the question. How am I going to read the RPM signal.


    I was using a MOSFET transistor to switch the 12 to a 5 signal. (I may have had the pins mixed up on it, not sure) I guess I'm going to need some kind of protection circuit. Trouble is I'm not an electronics engineer by trade, so I dont know how to make one off the top of my head. Time for more reading.

    PS I'm happy to take suggestions if you have ideas how to fix certain problems I will come across.

View all 12 project logs

Enjoy this project?

Share

Discussions

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