False interrupts on bike R.P.M. reading - Panda II

Thanks realiser.
I managed to get to Communica for the parts but when I got back I had to run for a meeting.
And last night at home I didn’t get close to of this. Hopefully I’ll have some time tonight.

SteH, no I haven’t had the chance yet. Hopefully I will have time tonight.

Some feedback on my last results:

realiser - I actually forgot to put a cap across the input like you suggested but next chance I have time I will try that too. haven’t yet had time to do the soundcard scope thing but defintely will try it…will be on leave after Thursday so will soon have lots of time.

SteH - so far it seems your suggestion works quite well.

I changed from InterruptEdgeLow to InterruptEdgeBoth and then added the follow code to the interrupt:


            if (state != laststate)
                return;

            laststate = state;

            if (state == 1)
                return;

Only when it’s sure the state has changed it continues and records the new state. Then only if the state is 0 will it continue further and count the pulse.

From this I get the following at idle speed. You’ll notice some fluctuation still but I think that is fairly correct as you can see some fluctuation on the tachometer too. When riding at a steady speed the RPM calculation should also be more stable as the tachometer is then very stable.

1072
1072
1072
1046
1046
1046
1041
1041
1041
1099
1099
1083
1083
1083
1068
1068
1068
1056
1056
1056
1077
1077
1071
1071
1071
1087
1087
1087
1075
1075
1068
1068
1068
1100
1100
1100
1101
1101
1092
1092
1092
1064
1064
1064
1176
1176
1109
1109
1109
1119
1119
1119
1079
1079
1057
1057
1057
1106
1106
1106
1094
1094
1110
1110
1110
1103
1103
1103
1099
1099
1154
1154
1154
1148
1148
1148
1069
1069
1083
1083
1083
1097
1097
1097
1148
1148
1092
1092
1092
1163
1163
1130
1130
1130

interrupt is not best solution for getting engine RPM.
Must use frequency/voltage ship connected to FEZ ANx input

I use LM2917N (14 pin) for this application. see the LM2917 datasheet to internet, it’s very easy to use and very little price.

sample test video : http://www.billyoctet.com/video/rpmtest.wmv

I have build many datalogger for old car and i send data by wifi to computer and phone . before, with Motorola µc and Pic controleur but now, i working to a new version with Fez Panda II and there are ‘magic’ performance for this application. If you have facebook account, you can see Billy Octet page and Picture/Perftracker :wink:

Sorry for my langage, i just try to help you

Thanks a lot!

I’ll definitely check it out as an option.

That seems like it’s designed to do EXACTLY what you’re doing.

The car in that video sounds like a beast 8)

@ godefroi : Yes, Panda II is perfect for car or byke datalogger with minor external hardware. I can get many data with standard cars sensor. Just for RPM and speed, i create my personnal sensor with frequency/voltage converter. I write directly all data to sd card or usb key and send all at real time to 2 serial port. one com connected to wifi or bluetooth oem module and other to serial lcd.

@ ransomhall : yes, it’s realy big beast :slight_smile: . It’s Ford Mustang 1970 with V8 engine.

@ JacquesBlom : The timing interupt method is interesting for test or experimental but it’s not possible on practice at hight rpm. It take to much system ressource and you found wrong value and no enough time for convert data to real value and send or write it. As mall frequency/voltage converter ( 1" x 1" ) with LM2917 and good component choice value can directly powered by byke batterie, directly input connected to one negative coil and output directly connected to one AN input of Fez module. With c# Its very easy for software to get An value and convert it to real value. If you need, i can give you my method and code sample for data to real value.

Thanks for the help Billy.

I managed to find few circuits on the net around the LM2917N. With an electronics store right next to my workplace I quickly went there yesterday afternoon and got the necessary parts. This morning just before leaving for work I quickly built it on the bread-board.

Using a little pulse generator I built to simulate RPM, etc. signals I sort of tested the frequency to voltage converter and it does seem to work fine. I didn’t have the time to check at what frequency I’ve got the pulse generator butI know it can go up to about 800Hz. On my bike my max frequency will only be about 350Hz (10500rpm - 2cyl).

On my bike I’ll be getting the signal right where it goes into the tachometer as it is a 12V pulse. I’ll use an opto-isolator as a “switch” to trigger the converter circuit.

Thanks for the offer to give me example. Part of this whole project is to read to bike’s voltage (via voltage divider) and also to read the throttle position sensor. So the code is therefore not an issue for me. I will then use my pulse generator to get the correct conversion factor to convert the voltage into RPM.

Incidentally I’ll be using the same principle to get the speed as the speedometer gets a 5V pulse from the sender unit on the gearbox.

Hi there!
I know it took a long time. But could you tell me how you have joined the tachometer signal to LM2917n ?
I buy LM2917n with 14 pin on ebay. I connect it via optopare, but it didn’t work
:frowning:

I put 12-14 v on 8 pin, and via 470kOm on 9 pin. Could you be so kind to post scheme to me.