|
|
| Author |
Message |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 23:47 - 30 Jan 2013 Post subject: Homegrown Digi... *ahem* sorry Nowhere Elysium! |
 |
|
I stole your project!
I got an Arduino ages ago for tinkering with, as I had a few things in mind that I could do with it, and it looked fun. I tried doing a few thing with it for a few weeks then promptly forgot about it, so I've decided it's high time I get on and make something interesting.
I had the idea to do something like a 'digital dash' for a bike ages ago, and Nowhere Elesium's thread on it got me really interested. I thought I'd start off fairly simple and work my way up from there.
So far I've hacked an 18 LED RPM gauge, and a crude 3 digit speedo with gear indicator. At present there's no input from the bike (a 2001 Yamaha fzs1000) but to simulate RPM I'm using a pot so I can test things out and get the code working how I want it. I'm pretty much done with the LED strip, it's now at a point where I'm happy with how it displays.
Anyway, enough of me rambling; here's a video showing what progress I've made. Let me know what y'all think!
https://youtu.be/ccAnfeS_dZA ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| orac |
This post is not being displayed .
|
 orac World Chat Champion
Joined: 25 Sep 2011 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| nowhere.elysium |
This post is not being displayed .
|
 nowhere.elysium The Pork Lord

Joined: 02 Mar 2009 Karma :    
|
 Posted: 08:10 - 31 Jan 2013 Post subject: |
 |
|
Hey, don't apologise to me; I'm far from the first person to have a crack at doing this sort of thing
Have you turfed up the necessary code to do the interrupt-driven stuff for the rev counter and the speedo? It's not quite as simple as attaching it to a potentiometer.
Anyway; here I am, trying to sound all authoritative, and I never actually finished the damn thing. Suppose I should get off my arse and address that, really. ____________________ '10 SV650SF, '83 GS650GT (it lives!), Questionable DIY dash project, 3D Printer project, Lasercutter project |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| The Shaggy D.A. |
This post is not being displayed .
|
 The Shaggy D.A. Super Spammer

Joined: 12 Sep 2008 Karma :  
|
 Posted: 12:17 - 31 Jan 2013 Post subject: |
 |
|
Bah, blocked at work. ____________________ Chances are quite high you are not in my Monkeysphere, and I don't care about you. Don't take it personally.
Currently : Royal Enfield 350 Meteor
Previously : CB100N > CB250RS > XJ900F > GT550 > GPZ750R/1000RX > AJS M16 > R100RT > Bullet 500 > CB500 > LS650P > Bullet Electra X & YBR125 > Bullet 350 "Superstar" & YBR125 Custom > Royal Enfield Classic 500 Despatch Limited Edition (28 of 200) & CB Two-Fifty Nighthawk > ER5 |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| P.addy |
This post is not being displayed .
|
 P.addy Formerly known as P.
Joined: 14 Feb 2008 Karma :  
|
 Posted: 12:27 - 31 Jan 2013 Post subject: |
 |
|
Secretly, nowhere is printing a hammer to beat you with.  |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 13:45 - 31 Jan 2013 Post subject: |
 |
|
| orac wrote: | thats very nice, however you dont seem to have any resistors or driver transistors for the displays = i used a similar multiplexed design a while ago and needed transistor for the anodes as the IC was unable to sink the current from each display |
I've been thinking about that, and I need to figure out the right resistance value for the lcd display. Once I've done that I can add them to the finished circuit. The stuff on the breadboard is temporary while I figure a few things out.
| orac wrote: | also making a display work is easy, making it receive and interpret data get a bit more tricking, you will alos need the correct circuitry to tak the readng from the bike. |
Making the display work was relatively easy, once I disengaged derp mode and started thinking logically! The only real difficulty with taking something useful and putting it on said display will be interpreting and converting said something. I've already got a good idea of the converting part.
| orac wrote: | depending on what you already have on the bike you may have to use things like hal effect sensros and correct circit to get a digital reading |
Indeed. Certainly for the speedometer part I'll likely be using a digital reading. Though for the engine rpm (depending on the sensing circuit) I was thinking about an analogue input..
| nowhere.elysium wrote: | Hey, don't apologise to me; I'm far from the first person to have a crack at doing this sort of thing Laughing
Have you turfed up the necessary code to do the interrupt-driven stuff for the rev counter and the speedo? It's not quite as simple as attaching it to a potentiometer.
Anyway; here I am, trying to sound all authoritative, and I never actually finished the damn thing. Suppose I should get off my arse and address that, really. |
I've got several examples of rpm counters. The one that seems to work best uses an interrupt which increases an unsigned int, a timestamp, and when the unsigned int reaches a certain value it calculates rpm from time elapsed since the last calculation. This does mean that the frequency at which the rpm is calculated increases with the rpm, but as in the example code it doesn't necessarily have to display at the same frequency.. If that makes sense?
The pot in the circuit is just there to simulate an rpm input btw. It's a temporary thing so I can get the lights looking pretty. With those done, when I start on the rpm interpreting code I effectively remove any display code from the debugging process, since I know it does what it should. The only thing that changes what the leds do is a single value when it comes to tweaking rpm input.
I think you should update your project! How am I supposed to make progress when I have no one to plagarise?? What's your current progress on it? It's certainly a lot more ambitious than I'd like. I'm working on 2 inputs and 2 outputs at the moment, and trying to get those functioning right.
| ##Paddy## wrote: | Secretly, nowhere is printing a hammer to beat you with. |
I'd be very impressed at being beaten with a diy 3d printed hammer! I can appreciate ingenuity and creativity especially when it comes to computing and electronics. Even if it is demonstrated with a lot of kinetic energy.. ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 16:56 - 01 Feb 2013 Post subject: |
 |
|
Small update:
In the interests of not letting the magic smoke escape* from my beloved arduino mega (2560), I've been looking in to current draw. I worked out that with all LEDs lit at the same time (25), the draw is 183.8235 milliamps. This is very close to the mega's maximum limit.
(It's taken me a while to get round to all this calculating as it's more fun to just make stuff work! I just scared myself doing some of the calculations, which resulted in a value greater than 200mA by a fair margin, then realised that the lcd display is multiplexed, so only 1 digit is lit at once. A difference of 46 leds, and 25 leds all lit at once! Panic over..)
In a real world situation it's very unlikely that all LEDs will be lit at once, and if they are it will only be for a short time. As an estimate, in 6th gear, at 88 mph (assuming this is at about 10k rpm which I'm not sure about), that's 25 led's lit. Each LED will be drawing about 0.007352941 amps or 7.35 milliamps, which totals 183.8235mA. If I were to add anything else output wise, I'd need to seperate the mega's power from the output device's power supplies.
Still, knowing that I'm within the current supply limits is reassuring, and it also means I now know that I'd need to sort out transistors for anything more that I'd want to add. I have various ideas for extras once I've got the main parts working.
I've also ordered some proper value resistors for the leds (680ohm if anyone's curious), a frequency to voltage chip (for the rpm reading, seems the easiest way) and a hall effect sensor. Nowhere might remember from my posts in his thread that I was talking about using a reed switch and was told hall effect would be better.
*Magic smoke: stuff that makes the arduino 'go'. If this escapes then the arduino stops 'go'ing... ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| mysterious_rider |
This post is not being displayed .
|
 mysterious_rider World Chat Champion

Joined: 11 Sep 2010 Karma :   
|
 Posted: 17:05 - 01 Feb 2013 Post subject: |
 |
|
Really want that light but in red, and have it flashing side to side under my headlight like that 'kit' car with hasslehoff.  ____________________ KAWASAKIIIII |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| nowhere.elysium |
This post is not being displayed .
|
 nowhere.elysium The Pork Lord

Joined: 02 Mar 2009 Karma :    
|
 Posted: 18:24 - 01 Feb 2013 Post subject: |
 |
|
| blade023 wrote: | I think you should update your project! How am I supposed to make progress when I have no one to plagarise?? What's your current progress on it? It's certainly a lot more ambitious than I'd like. I'm working on 2 inputs and 2 outputs at the moment, and trying to get those functioning right. | Heh. Uh... it's kind of been mothballed for the past few months, due to significant stuff happening at home. I'm hoping to be able to finish it up before too long, but life has been somewhat fraught over the past year or so, so I've had to get on with the more pressing stuff. One thing I can tell you is that Section 20 of the Landlord and Tenant Act is the work of the world's biggest bastard.
When I get the chance to make progress on my dash, I will. I'll probably also pick your brains on how to you manage to tie your tachometer in to the bike itself; that's the bit that I had kinda stalled on - the code wasn't an issue, although I didn't really get very far with the physical implementation of it, so I'll happily copy from your exercise book for that one. ____________________ '10 SV650SF, '83 GS650GT (it lives!), Questionable DIY dash project, 3D Printer project, Lasercutter project |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 21:14 - 01 Feb 2013 Post subject: |
 |
|
Nowhere; The simplest method of reading the rpm, is not to use interrupts at all, but use a frequency to voltage converter. that way you don't have to mess about with time calculations or whatnot, you just have an analog input measuring the voltage, and setting how that voltage range corresponds to the rpm. About 2 lines of code. I've ordered a f-v converter form RS Components (I highly recommend them for electronics btw) and here is the datasheet for it if you're interested. It's the LM2917M-8/NOPB, the datasheet is for 2 models.
Off the top of my head, I'd then do..
{code}
// the first line here reads the voltage from the f-v converter, the second line converts it to our rpm range
rpmVoltage = analogRead(rpmInputPin);
rpmActual = rpmVoltage / cleverNumber;
{/code}
To me that seems infinately simpler and more elegant than messing about with a second interrupt! There's already going to be one interrupt for the hall effect sensor mounted near the wheel. This will detect wheel rpm and convert to actual speed.
In fact, thinking about it, I may at some point get another of these f-v converters and hook that up to the speedo to read that in the same way. No interrupts at all! and there's no chance of (due to timing issues) a discrepancy in the rpm or speed readings. As long as the voltage converts to rpm properly.
There's just one thing that I need to get my head around. There was me thinking I'd hook up speedo + to f-v +input, speedo - to f-v -input... then hook up the f-v g - arduino g, and f-v output + to arduino analog input.....
https://www.kenhawley.co.uk/arduino1.png
Seems it not so simple. Looking at the datasheet there are examples of how to wire it up, and a couple of them are relevant to rpm reading. But until I take the time to read through it and figure out what I need to wire up where, I'm a tad confused. I've never really got into wiring diagrams, so I'm a little in the dark. Hah, and you think school is over when you leave! I'd have paid more attention if I'd have known how useful all this sheet is..
| nowhere.elysium wrote: | Section 20 of the Landlord and Tenant Act |
You know what, I absolutely hate that part. Total nightmare. ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| Xenocide |
This post is not being displayed .
|
 Xenocide Scooby Slapper

Joined: 17 Aug 2008 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| orac |
This post is not being displayed .
|
 orac World Chat Champion
Joined: 25 Sep 2011 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| RhynoCZ |
This post is not being displayed .
|
 RhynoCZ Super Spammer

Joined: 09 Mar 2012 Karma :     
|
 Posted: 14:43 - 03 Feb 2013 Post subject: |
 |
|
Looks great so far, but I can't really imagine this being on a actual motorcycle, vibes will ruin the thing in a few seconds  ____________________ '87 Honda XBR 500, '96 Kawasaki ZX7R P1, '90 Honda CB-1, '88 Kawasaki GPz550, MZ 150 ETZ
'95 Mercedes-Benz w202 C200 CGI, '98 Mercedes-Benz w210 E200 Kompressor |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| The Shaggy D.A. |
This post is not being displayed .
|
 The Shaggy D.A. Super Spammer

Joined: 12 Sep 2008 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 08:16 - 05 Feb 2013 Post subject: |
 |
|
orac: The reason I was thinking of using analogue was that it's constant regardless of timing discrepancies. I could use a 555 timer with the arduino I guess, which would solve that. It also means the code is much simpler, as it's a simple analogRead(tachPin) function followed by a conversion from V to RPM instead of a whole mess of code. There are several ways of doing it though, and I've been thinking about a few. One thing I would like to do in the future (especially having seen the price of the tiny arduino boards without pins that look ideal for small tasks and wiring up to pcbs..) is as you said; let slave chips handle things like counting rpm and just send the filtered value to the master controller.
RhynoCZ: Yes, vibrations are an issue in some cases, which is why I ordered a hall effect sensor (also on other's recommendations) for the speed sensor instead of using the reed switch I had. I hooked up the reed switch and tested a simple rpm program which didn't seem quite right. I then hooked up the hall effect sensor, and the rpm was smooth as silk. I could have just used h.e. in the first place but that's not my nature. I have to see for myself, it's fun experimenting! As for the rest; vibrations won't really be an issue as it's all solid state. As long as the connections are good (my soldering skills have progressed enormously) everything will be fine..
The Shaggy D.A.: "Main consideration.." There's a reason why I STILL haven't gotten round to plugging anything into the bike yet. I do have a multimeter which (weather permitting) I will use to test some things today, along with a voltage divider circuit I have in mind to get from 12-14v to <=4v. The only thing that troubles me, is that if the wires I test output a frequency of 1.21 gigawatt pulses (guess the film reference) the voltmeter setting on my multimeter will show a lesser voltage depending on the frequency. Kind of like how you can dim an led using PWM from the arduino.
If anyone can suggest a way of testing the actual voltage regardless of frequency variations, without using my arduino in kamikaze mode, I'd love to hear it. I'll have a search around and see what google thinks, but what I've come up with so far is to see if said wires I test will fry an led. Seems cheaper to lose one of those, over a £40 board I got for my birthday!
On a completely unrelated note.. This very early post is due to the fact that I didn't get a wink of sleep last night. I've no idea why, but I gave up in the end, and just sat around googling stuff for the project after going out for a bimble to the 24hr garage.  ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| orac |
This post is not being displayed .
|
 orac World Chat Champion
Joined: 25 Sep 2011 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 09:01 - 05 Feb 2013 Post subject: |
 |
|
I might look into picaxe at some stage. I was thinking about signal filtering too. There's an input to the tacho (+ and - on the last one i looked at, which outtput 12v frequency pulse) which must be reasonably clean, as it drives the needle on the RPM gauge. Finding information on that isn't particularly easy but I did manage to unearth a few things. There are a few different needle moving systems, one of which drives a stepper motor (I *think*) from the frequency of the wires I mentioned. Often the voltage is dropped down to about 6v in the actual RPM circuit. I even found a description of a mechanical RPM gauge which sounded fascinating.
Another thing is that servos use frequency to dictate the position of the arm, and work on 3-7 volts, so that seems like a sensible way to make RPM needles move. Assuming the voltage conversion within the RPM circuit.
I don't have access to a scope at all, and looking at prices I certainly won't be buying one. I did wonder about using the arduino itself as an oscilloscope, but then again I'd have to make sure the voltage was nice and low. Simple enough as long as you know what the starting voltage is. So I could...
1) Use the arduino to figure out the voltage from the RPM gauge input wires..
2) make a voltage divider to drop that voltage to ardu-safe levels..
3) invent a time machine..
4) use the voltage divider with the arduino to make a simple oscilloscope and
oh look basil, I've gone cross eyed.
I need to do some testing and find the RPM signal wires. I'll pea roast as soon as I've done that.
Oh, and the arduino does have a pulsein function, which I'm going to try out once I figure out some code to go with it. I've got a hall effect test bench set up to simulate pulse generation for program testing.
12v batt --> pc fan with magnets --> h.e. sensor --> arduino ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| orac |
This post is not being displayed .
|
 orac World Chat Champion
Joined: 25 Sep 2011 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 19:25 - 05 Feb 2013 Post subject: |
 |
|
Ok so I did some checking on the bike. I found this neat looking connector block to the dash which was surprisingly easy to get to, and looks very easy to tap a couple of extra wires in. I also found an wiring instruction manual for a gear indicator which taps into the exact wires that I want to use. It has wire colours for the fzs100 (2001) so I'm going by that.
In the photos below, numbering the wires on the connector block 1-8 on one side, and 9-16 on the reverse (second photo) like so:
| Code: |
16 15 14 13 12 11 10 9
1 2 3 4 5 6 7 8 <-- As seen in the first picture..
| |
\___________________________/
| |
|
https://www.kenhawley.co.uk/fzs1_dash_connector_1.jpg
https://www.kenhawley.co.uk/fzs1_dash_connector_3.jpg
In this picture the wires are 9-16 left-right.
wire 10 is the neutral light wire, 11 is the speedo wire and 12 is the tacho signal wire. How interesting.
It's gone dark now, and it's raining so I may not mess about with it any more. If anyone knows though, it would be handy to find out what sort of signal is output with these wires. ac/dc pulse? Any info would be helpful. I'm guessing the dash unit converts the signals to use.
At any rate, it looks like I'm going to be able to get all the info I need for now from those 3 wires plus a ground wire, and just process the data with the arduino. I may even build a little test circuit to make sure I can get a nice friendly 4-5v dc pulse to the arduino without untoward side effects (like heat.) ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| orac |
This post is not being displayed .
|
 orac World Chat Champion
Joined: 25 Sep 2011 Karma :   
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
 Posted: 00:14 - 08 Feb 2013 Post subject: |
 |
|
Well, there has been a bit of a crisis at home, so I've not had much time to do all the things I wanted to. I was planning on testing a few wires on the bike, making a voltage converting circuit, getting the 12v down to about 3-4 and inputting it into the arduino to start testing. Since my last post, I went round to a friends', and we started testing some wires with his multi meter. Then suddenly the neutral switch stopped working. I still haven't got round to sorting it yet (that was a couple of days ago) due to this crisis...
Our beloved cat of 17 years passed away after her final visit to the vet Wednesday morning. Mum was quite upset, and I'll admit it's hit me pretty hard. I made a memorial cross type thing for the grave. But as if that wasn't enough, the other cat we have, who's about 7 months old, decided to go out Thursday morning and not come back! He's never been out for more than a few minutes at a time (usually) or at most an hour or two. Especially since he eats a lot, he's always popping back in for food.
Everyone's been out searching, asking around, phoning around to try and find some info, but nothing. As I got half way through this post (started at 11:30, it's now 12:07), GUESS who's come back in! I'm so relieved. If he could talk, I'm sure he'd say something nonchalant like "sup..." as if nothing has happened.
So anyway, as soon as I have time tomorrow this project WILL resume. I've now got to the stage where I can plug in a couple of wires to the bike, and get some meaningful output, as I've made an LED shield for the 'duino, and added all necessary bits into a handy portable package. Once I've got the basic coding infrastructure down (about 80% done) it's plug and test time. Oh and figuring out where this fuse is for the neutral sensor so I can change it.
I'll post up another vid and/or some pictures hopefully tomorrow. ____________________ Current: VFR800 2008 13.7k and rising rapidly!
Sorn: 2003 FZS1000 30k(ish) looking to sell. |
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
| blade023 |
This post is not being displayed .
|
 blade023 Trackday Trickster
Joined: 09 Oct 2011 Karma :  
|
|
| Back to top |
|
You must be logged in to rate posts |
|
 |
Old Thread Alert!
The last post was made 13 years, 25 days ago. Instead of replying here, would creating a new thread be more useful? |
 |
|
|