rev counter
Moderator: Benj
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
rev counter
hi all is it possible to build a rev counter using a pic and lcd as a display, has anyone attempted this in the past, I would appreciate some advice and be pointed in the right direction to attempt this,
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: rev counter
Have you tried to search the forums? There are several messages concerning this subject. Search for 'rev counter' or 'rpm'...
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: rev counter
input the amount of teeth on tone wheel at the top
then type in if its cam or crank driven here
cam is a constant =60
crank is a constant=120
it works by measuring the amount of time in 10u/s increments for a rotation
Code: Select all
//------------------------------------------------------------------
// #define crank 120
// #define cam 60
tonewheel = 1 //number of teeth on tone wheel
Code: Select all
count = (100000 / count) * crank //tachometer calculation
crank is a constant=120
it works by measuring the amount of time in 10u/s increments for a rotation
- Attachments
-
- TACHOMETER.fcf
- (14.75 KiB) Downloaded 477 times
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: rev counter
i rigged it up for lcd, the digits change for the position as it should be, *** i had to add variable rpm and its a float to increase resolution as it should
it doesn't matter as a two stroke because the crank is still gonna be whats measured, inthis case your gonna get a firing for each cylinder every crank rotation instead of cam rotation
is your rpm higher than 10,000? and how many pulses? how are you implimenting the circuitry?
it doesn't matter as a two stroke because the crank is still gonna be whats measured, inthis case your gonna get a firing for each cylinder every crank rotation instead of cam rotation
is your rpm higher than 10,000? and how many pulses? how are you implimenting the circuitry?
- Attachments
-
- TACHOMETER fixed with lcd.fcf
- (23.56 KiB) Downloaded 512 times
-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: rev counter
i was playing around with accuracy and wanted to add this one so you can play with this in the simi or on hardware with your signal generator, in this flowchart its currently set up for 8 pulse crank wheel,
on the bottom line it shows the counts of the tmr for one rotation of (cam or crank) which ever you selected
the math---> rpm = (100,000 / number it shows)*120 for crank or 60 for cam
you'll see that the resolution and update speed is very good! keep in mind that it does hog up the processing power with the 100k interrupt
on the bottom line it shows the counts of the tmr for one rotation of (cam or crank) which ever you selected
the math---> rpm = (100,000 / number it shows)*120 for crank or 60 for cam
you'll see that the resolution and update speed is very good! keep in mind that it does hog up the processing power with the 100k interrupt
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
Re: rev counter
hi the red line is 10500 rpm, not sure how to implement it yet was thinking of trying to attatch some thing to the HT lead to trigger the circuit rather like when you connect a strobe light to check your timing
-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: rev counter
no don't do that, i created a neat injector stobe light thingy about 5years ago with a ignition timing light http://www.youtube.com/watch?v=8JxgWZWyLyQ but the point is it takes minimum 66volts kickback to get the timing light to flash!!!, i would imagine this would kill the pic directly, i would try using a npn darlington transistor hooked to a pnp transistor to safely do it.... darlington will trigger off of ignition wire and pnp will flip the signal, on the pnp base you will need a 1K pull down to get a square wave coming out of itthinking of trying to attatch some thing to the HT lead to trigger the circuit rather like when you connect a strobe light to check your timing
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
Re: rev counter
do you mean the single ignition wire on the primary side of the ignition coil that comes from the CDI module
-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: rev counter
i thought you men't secondary, does it have electronic ignition or points, the way i designed the rpm deal is that it hooks to a hall effect sensor or can make a circuit to hook to a variable reluctance sensor, i'm sure there is someway to make it workdo you mean the single ignition wire on the primary side of the ignition coil that comes from the CDI module
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
Re: rev counter
hi I have electronic ignition with one wire coming from this to the primary side of the ignition coil , one idea I have is to use some sort of PIR sensor monitoring the flywheel ? if I put a reflective marker on the flywheel at say a point when the piston is top dead center this could count the revolutions but its from here im at a standstill as to get this to some sort of code in the pic 

-
- Posts: 438
- Joined: Mon Aug 29, 2011 12:26 am
- Location: arizona
- Has thanked: 175 times
- Been thanked: 173 times
Re: rev counter
no worries, the code that i posted for second flowchart can do any combo of trigger for a engine, you tell it "cam" or "crank" then tell it how many pulses you have on your tonewheel, in this case how many peices of tape and it does the rest because it works on counting the time it takes in 10u/s increments to pass the number you selected for teeth plus 1.... check it out here is the full version that you can set all parameters on http://www.youtube.com/watch?v=BAEJS0CZ5IEif I put a reflective marker on the flywheel at say a point when the piston is top dead center this could count the revolutions but its from here im at a standstill as to get this to some sort of code in the pic
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: rev counter
I just had a thought:
Can a single wire be wrapped around the HT lead.
This wire can then go to an i/p of Microcontroller.
You may need to experiment with a high value pulldown resistor, and you may even require a 5V zener between the ADCi/p and GND for addition protection as I do not know what the voltage will be induced, but it use to be done this way with transistors years ago.
Not sure it it will work or not its only theory.
Can a single wire be wrapped around the HT lead.
This wire can then go to an i/p of Microcontroller.
You may need to experiment with a high value pulldown resistor, and you may even require a 5V zener between the ADCi/p and GND for addition protection as I do not know what the voltage will be induced, but it use to be done this way with transistors years ago.
Not sure it it will work or not its only theory.
Martin
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
Re: rev counter
hi martin on that note do you see a possible problem with PIR sensors near the fly wheel, the biggest problem I could see with this is heat on the PIRs as it does get very hot in this area, any input would be appreciated
-
- Valued Contributor
- Posts: 2045
- Joined: Wed Aug 27, 2008 10:31 pm
- Location: Netherlands
- Has thanked: 553 times
- Been thanked: 1081 times
Re: rev counter
PIR as in passive infra red detector? Those work by detecting temperature changes, so reflective tape will not be detected. Also most sensors divide their view window into some sort of grid and require at least two cells next to each other to have a difference to prevent false triggers.
Using a led and a photo detector might be better. (check http://stab-iitb.org/wiki/Contactless_Tachometer for an example circuit)
Using a led and a photo detector might be better. (check http://stab-iitb.org/wiki/Contactless_Tachometer for an example circuit)
“Integrity is doing the right thing, even when no one is watching.”
― C.S. Lewis
― C.S. Lewis
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: rev counter
I would agree with kersing,
I don't believe PIR is way to go.
Either what I said or LED transmitter and receiver all in one like this:
http://uk.rs-online.com/web/p/photoelec ... s/6165709/
Or hall effect transistor and magnet.
You can get stick on flat magnets not much different than sticking on tape.
Martin
I don't believe PIR is way to go.
Either what I said or LED transmitter and receiver all in one like this:
http://uk.rs-online.com/web/p/photoelec ... s/6165709/
Or hall effect transistor and magnet.
You can get stick on flat magnets not much different than sticking on tape.
Martin
Martin
-
- Matrix Staff
- Posts: 9521
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
Re: rev counter
Hi I have been asked to post this on behalf of Steve001 since he can't post in V5 section:
Steve001 wrote:Hi Martin,
Could you please post this for me ?
http://www.kasensors.co.uk/
They make all sorts of sensors for motorsports they list a high speed hall effect crank sensor
Don't know of the price range though
Steve
Martin
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
Re: rev counter
after looking at the ignition system on the bike I have a sensor behind the flywheel which when the magnet passes over it induces a voltage that is then used to trigger the cdi (capacitor discharge ignition) any thoughts whether this signal could be used to trigger the second flow chart from brandonb on this thread ????
Re: rev counter
Hi Silicon chip
What bike is it??
different bikes use different types of sensing depending on age
Regards
Dazz
What bike is it??
different bikes use different types of sensing depending on age
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Posts: 392
- Joined: Wed Jan 05, 2011 11:24 am
- Has thanked: 101 times
- Been thanked: 25 times
Re: rev counter
HI
Changed post as i was thinking of an earlier model, blue/yellow should be your pick up wire so try measuring the outputs with a multimeter,(high voltage ac first, don't disconnect pulse coil put meter lead into connector block, check voltage as you kick it over , if low voltage try checking whether its ac or dc, i would probably use an opto isolator and use that as a trigger to a rev counter, )as i think yours is the self generating CDI system , i used to have all the test data for bike pickups but i can't find any of it grrrrr
Regards
Dazz
Changed post as i was thinking of an earlier model, blue/yellow should be your pick up wire so try measuring the outputs with a multimeter,(high voltage ac first, don't disconnect pulse coil put meter lead into connector block, check voltage as you kick it over , if low voltage try checking whether its ac or dc, i would probably use an opto isolator and use that as a trigger to a rev counter, )as i think yours is the self generating CDI system , i used to have all the test data for bike pickups but i can't find any of it grrrrr
Regards
Dazz
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php