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

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

  • 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 mixed up and penned in a track that wasnt there,...

    Read more »

View all 16 project logs

Enjoy this project?

Share

Discussions

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