Northy
|
posted on 21/9/04 at 05:51 PM |
|
|
DIY shift lights
Hi guys,
I'm thinking of building my own shift lights so I've got something to do over the winter.
Does anyone know of any projects on line? Prefereably using a PIC.
Cheers
Graham
Website under construction. Help greatfully received as I don't really know what I'm doing!
"If a man says something in the woods and there are no women there, is he still wrong?"
Built 2L 8 Valve Vx Powered Avon
|
|
|
Rob Lane
|
posted on 21/9/04 at 06:12 PM |
|
|
I think I did this about two years ago in Pic Basic. Something like twenty lines of code if I remember right.
Measure revs, set port when rev point reached, reset when drop below. Repeat according to revs.
I also did a sound output on point before maximum revs.
I'll see if I can find it somewhere.
|
|
ned
|
posted on 22/9/04 at 08:48 AM |
|
|
people have spoken about building there own shift lights before, but i've never see one finished. is it worth all the bother? how much time does
it take and what do you need. I'm not that electrically knowledgable so was gonna go and buy the weber aplha one for £50 when the time comes.
Ned.
beware, I've got yellow skin
|
|
Rob Lane
|
posted on 22/9/04 at 08:52 AM |
|
|
Just realised it was all on original laptop which my son now has.
I took off what I wanted and told him he could delete rest.
Sorry.
|
|
stephen_gusterson
|
posted on 22/9/04 at 09:08 AM |
|
|
you dont need a processor
Use an LM2917
http://www.national.com/ds/LM/LM2907.pdf
atb
steve
|
|
Rob Lane
|
posted on 22/9/04 at 03:33 PM |
|
|
Single output device, one per rev point shiftlight. With a processor it's easier to add sequential lights
I was originally using PIC as it was also doing other tasks such as rev counter, speedo, switchable bargraph etc.
I'm sure I did a backup to a floppy disk of my original coding. Trouble is they are deep in storage cupboards plus I have no floppy disk in this
machine.
|
|
Northy
|
posted on 22/9/04 at 05:18 PM |
|
|
No worries Rob, I'll work it out
Can you remember any more details though to give me a head start...
Graham
Website under construction. Help greatfully received as I don't really know what I'm doing!
"If a man says something in the woods and there are no women there, is he still wrong?"
Built 2L 8 Valve Vx Powered Avon
|
|
Rob Lane
|
posted on 22/9/04 at 07:53 PM |
|
|
Memory is a bit hazy.
Assuming you are using Pic Basic.
The heart of it is a rev counter using the pulsin command. It is about 4 lines of code.
Pulsin taken from rev counter drive on ecu or via coil with a conditioner circuit.
Then a routine to check revs and if/then goto for shift lights via ports according to rev breakpoint.
I think I did a 'sound' out at light just before change point as it takes a half second to react for gearchange.
If and thens for a max reading store, always handy.
I think I did rev counter, speedo, shift light, water temp, oil pressure, using about 200 lines of code, this included LCD and button commands.
|
|
Northy
|
posted on 23/9/04 at 06:58 AM |
|
|
CheersRob,
I've never used Picbasic, but I might give it a go.
Graham
Website under construction. Help greatfully received as I don't really know what I'm doing!
"If a man says something in the woods and there are no women there, is he still wrong?"
Built 2L 8 Valve Vx Powered Avon
|
|
stephen_gusterson
|
posted on 23/9/04 at 09:54 AM |
|
|
there are lots of C compilers for PIC processors.
do a google and loads come up
ive not used this, but its only 50 dollars approx
http://www.imagesco.com/catalog/pic/comp.html
atb
steve
[Edited on 23/9/04 by stephen_gusterson]
|
|
jmbillings
|
posted on 23/9/04 at 04:33 PM |
|
|
I did one with a 2917 and a 4 off comparator, worked but was a bit flaky.
Now done one with a basic stamp (more $$ than a pic but easier).
Works a treat most of the time, but sometimes resets itself during a journey... plus setting the shift light values ended up being trial and error as
my calculations seemed completely out! Anyways, below is the code I used if anyone else wants to do one...
'{$STAMP BS2sx}
'{$PBASIC 2.5}
'4 LED Shift Light with Low RPM Relay activation
'
'(c) Copyright 2004, J. Billings
'
'PROGRAM DESCRIPTION:
'Count pulses per second on input pin.
'A 4 Cyl engine will give 2 pulses per revolution,
'so for instance 500 rpm = 1000 pulses/min (16.66666/sec,
'and 5000 rpm = 10000 pulses/min (166.66666/sec.
'
'If Pulses/sec < 1300 (650 rpm) then activate output 1
'For shift lights, activate outputs 1 > 4 at 11000, 12000, 13000, 14000 "rpms" (i.e. twice req' rpm)
'(equates to 183, 200, 216, 233 pulses per second)
'***Above now found to not work correctly***
'Shift Light LED's to be connected to pins 12,13,14,15
'Output to Transistor for relay operation pin 8 (at 650 rpm = 21 pulses/sec)
'Turn off relay when RPM's greater than 1200 (else valve opening would cause it
'to go off again making a rapid on/off loop! Raise the RelayOff val if this occurs...
'Input from ignition pulse to pin 2
'Activate LED for cold-start...
'GOSUB RelayOn
'Test the LED's in sequence
HIGH 12
PAUSE 100
HIGH 13
PAUSE 100
HIGH 14
PAUSE 100
HIGH 15
PAUSE 250
LOW 12
PAUSE 100
LOW 13
PAUSE 100
LOW 14
PAUSE 100
LOW 15
'Test rapid up-down
HIGH 12
PAUSE 50
LOW 12
PAUSE 50
HIGH 13
PAUSE 50
LOW 13
PAUSE 50
HIGH 14
PAUSE 50
LOW 14
PAUSE 50
HIGH 15
PAUSE 50
LOW 15
HIGH 14
PAUSE 50
LOW 14
PAUSE 50
HIGH 13
PAUSE 50
LOW 13
PAUSE 50
HIGH 12
PAUSE 50
LOW 12
'Flash all at once...
PAUSE 50
HIGH 12
HIGH 13
HIGH 14
HIGH 15
PAUSE 50
LOW 12
LOW 13
LOW 14
LOW 15
PAUSE 50
HIGH 12
HIGH 13
HIGH 14
HIGH 15
PAUSE 50
LOW 12
LOW 13
LOW 14
LOW 15
PAUSE 50
HIGH 12
HIGH 13
HIGH 14
HIGH 15
PAUSE 50
LOW 12
LOW 13
LOW 14
LOW 15
PAUSE 50
HIGH 12
HIGH 13
HIGH 14
HIGH 15
PAUSE 1200
LOW 12
LOW 13
LOW 14
LOW 15
'Initialisation of LED's completed... go into main program loop...
Ign VAR Word 'Declare variable to hold number of pulses
INPUT 2
Main:
'Count pulses on input pin
COUNT 2,1000,Ign
DEBUG DEC Ign 'Debugging - output the variable amount.
DEBUG " - "
'IF Ign < 22 THEN GOSUB RelayOn
'Relay on values
IF Ign > 600 THEN GOSUB LED1On 'SILLY VALUES BUT MAY WORK!
IF Ign > 770 THEN GOSUB LED2On
IF Ign > 890 THEN GOSUB LED3On
IF Ign > 1050 THEN GOSUB LED4On
'Relay off values
IF Ign < 500 THEN GOSUB LED1Off
IF Ign < 700 THEN GOSUB LED2Off
IF Ign < 800 THEN GOSUB LED3Off
IF Ign < 960 THEN GOSUB LED4Off
GOTO Main
'End of main loop... Sections below for indivdual operations called from main loop above...
'RelayOn:
'HIGH 8
'RETURN
'RelayOff:
'LOW 8
'RETURN
LED1On:
HIGH 12
RETURN
LED2On:
HIGH 13
RETURN
LED3On:
HIGH 14
RETURN
LED4On:
HIGH 15
RETURN
LED1Off:
LOW 12
RETURN
LED2Off:
LOW 13
RETURN
LED3Off:
LOW 14
RETURN
LED4Off:
LOW 15
RETURN
'Later date - programmable "on car"?
'Have 2 pos switch - prog or run. Check input at start and use appropriate mode.
'3 buttons to program: up, down, next.
'Programming mode will ask for LED1 RPM. User use up/down to set and then next
'program then ask for LED2. Up/down, next, LED3 etc.
'Save values, then display msg to switch to "run" and reset (power off/on).
'Will need small 2-line LCD for display of rpm/instructions.
|
|
Rob Lane
|
posted on 23/9/04 at 04:56 PM |
|
|
I've found an in between code segment.
i.e. partially written and some functions not working, just idea stage. Certainly the rev counter and single shift light output worked. It was
written in Pic Basic and developed on the old PE tutor board for pin outputs.
I had strange results with mine until I realised the clock speed was the culprit.
I used the 4mhz device and a serial LCD running at 9600 baud, then the values remained fixed.
If you want it posting I can put it on my website as a page if you wish.
|
|
Rob Lane
|
posted on 23/9/04 at 05:04 PM |
|
|
This is the revs routine :-
Rpm: For n=1 to 100
Input 7
PulsIn 7,1,W2 ----"'Change to 1 for high or 0 for low pulses.
LET W2 = W2/10 ---- "'This should be 100 for 4 digit up to 3000rpm but
LET W2 = 60000/W2 ----'"will slow down appreciably as count rises.
LET W2 = W2/2
IF w2 >= 750 Then Limit ----"' 7500 rev limit warning, W2 is 3 digit
SerOut 1,N9600,(254,134)
SerOut 1,N9600,(#W2,"0""rpm") ---- "'send to display, extra 0 is because W2 is 3 digit.
IF W2 > W6 Then Store ----"'compare reading and store if greater
Button 4,1,255,0,b0,1,Welcome
Next n
|
|
chrisg
|
posted on 23/9/04 at 05:23 PM |
|
|
Whoooooooooooosh!!!!
*the sound of another thread going over my head*
Can't one of you make some and sell them to the likes of me?
Would that be too hard mmmmm?
I can't do anything that doesn't respond to a bigger hammer!
Cheers
The Non electrical bloke
Note to all: I really don't know when to leave well alone. I tried to get clever with the mods, then when they gave me a lifeline to see the
error of my ways, I tried to incite more trouble via u2u. So now I'm banned, never to return again. They should have done it years ago!
|
|
jmbillings
|
posted on 24/9/04 at 09:04 AM |
|
|
Could make them to sell, but you'd want the version that could be set by yourself which pushes the cost up... How much are "real"
sequential lights?
Alternative is for someone clever than me to do one with pic's and non-serial LCD which I think are all cheaper but involve more work... Heh
|
|
Rob Lane
|
posted on 24/9/04 at 10:01 AM |
|
|
As with many homebrew projects they are usually not cost effective to resell unless it's in many, many units.
I used a 4 line 20 character LCD display because the unit was meant as a mini dash with lots more functions button selectable. If left out then the
code could be 20 lines only to achieve a shift light as the ports will drive an LED direct.
To add user progged setpoints is not too difficult using button and read commands.
Like everything else it's a case of deciding where to finish.
I no longer use Pics in interfaces for my business as suppliers have caught up now and offer off the shelf solutions.
The latest electronic controller we use in business has multi selectable features plus in/outs that a few years ago weren't available. All for
the same price as two years ago!
|
|
jmbillings
|
posted on 24/9/04 at 10:15 AM |
|
|
Thats the thing - Im guessing an off the shelf 4 Led shift light is around the 100 quid mark? So... take a basic stamp, serial LCD, switches,
LED's and other bits and bobs and you're getting towards that anyway - if it can offer extra features then so be it- Parralax flog a dual
axis accelerometer thingy, don't know how it would work, but could theroetically be used to display acceleration/cornering G on the display etc.
etc. so you get more value from the bits... but for making something to sell on its not v. cost effective unless people want a specific function that
off-the-shelf units don't offer!
|
|
stephen_gusterson
|
posted on 24/9/04 at 10:49 AM |
|
|
the main issue with selling this kinda thing semi commerically is making it decently manufactured, so it doesnt look like a prototype on veroboard.
I design circuits thro to their manufacture as a finished board (dont do the pcb layout tho!).
getting an average pcb made to production standard costs around a grand.
If its something small and simple that can be knocked up on strip board, and potted to hide the sins, its not so bad.
I have (in a bored moment) designed a full digital dashboard that would sell for less than 200 quid commerically, but the costs of getting it
manufactured are too risky. It would take an order book of approx 20 to make it worthwhile.
If shift lights cost 100 quid, I would have thought it possible to make money for less than half that!
atb
steve
[Edited on 24/9/04 by stephen_gusterson]
|
|
Rob Lane
|
posted on 24/9/04 at 11:24 AM |
|
|
I usually make up a PCB for any project I intend to use for a long period.
Certainly for commercial use even, I couldn't get away with anything looking amateurish.
The trouble with all the extra hardware is that it pushes costs up considerably.
Simple connectors, LED bezels, box, wiring etc are probably the most expensive parts. Added up they are significant percentage of a simple project.
Just look at the Megasquirt box and hardware costs!
For one off home projects then the labour is free but then do it for someone else and the cost of time alone outways any advantage against commercial
bought.
Unfortunately electronics is not for everyone and even supplying the parts and saying build it yourself is not really feasible.
[Edited on 24/9/04 by Rob Lane]
|
|
Bob C
|
posted on 24/9/04 at 11:51 AM |
|
|
I did a dash
http://www.locostbuilders.co.uk/photos.php?action=showphoto&photo=Dsc00525.jpg
using CAD free off the web and a "no NRE" PBC manufacturer called pcbtrain (newbury electronics). So you can get a reasonable result for
low cost... I went the FPGA route rather than the microcontroller route & it works really well. It includes a "what gear are you in"
display calculated from revs & speed for BECs and a true zero intertia tacho.
This has programmable shift lights but I'm not entirely sure how best to control them -
1) all at once or make like a magnified bit of the tacho?
2) optimum shift point varies with gear - worth considering?
3) I have this feeling thet the shift light should be REALLY big & bright!
cheers
Bob
|
|
ned
|
posted on 24/9/04 at 12:19 PM |
|
|
the weber alpha shift light is only £50 new as i said in my earlier post..
Ned.
beware, I've got yellow skin
|
|
stephen_gusterson
|
posted on 24/9/04 at 02:11 PM |
|
|
you can by 2 ins dia red led clusters (use approx 50 hi brightness leds) that would make you crash with blindness, if that was your want...........
atb
steve
|
|
stephen_gusterson
|
posted on 24/9/04 at 03:03 PM |
|
|
hence my earlier comment in another thread that getting electronics to work in a car environment can be the tricky bit.......
atb
steve
[Edited on 24/9/04 by stephen_gusterson]
|
|
jmbillings
|
posted on 22/10/04 at 11:47 AM |
|
|
Well, the project is coming along... here is the "stuff" so far:
it has a setup mode where you can set the light up value for each LED. In "run" mode, the same buttons turn the backlight on or off and
also allow a reset of the "g" calibration. Its bound to be horrendously inaccurate, but a bit of fun
There is also a small mpeg of the startup sequence here: Shiftlight/G Meter Bootup
|
|
dern
|
posted on 22/10/04 at 12:53 PM |
|
|
Can anyone point me to an online resource for these PIC things maybe including some tutorials so I can learn all about it ?
Thanks,
Mark
|
|