Jump to content

Hello, I just got a Fakeduino UNO to make a rev limiter for a 1 cylinder engine. I was going to use a capacitive pickup on the spark plug wire, but I decided to use a hall effect sensor instead.

 

So, there is a magnet on the flywheel of the engine, and the hall effect sensor should pick it up every revolution. 

 

I need this to limit to 5000 rpm, which would be 83 hertz from the hall effect sensor.

 

So basically I need the code to do this:

When input is greater than or equal to 83hz set pin (insert pin # here) high. 

 

That would turn on a relay when the pin goes high, and ground the ignition coil. This would hopefully loop and work as a rev limiter.

 

`

Link to comment
https://linustechtips.com/topic/632620-help-with-arduino-rpm-code/
Share on other sites

Link to post
Share on other sites

You could use simple timer to find the current uptime. look here

http://playground.arduino.cc/Code/SimpleTimer

 

Basically you find the time singe the last passing and the current passing and ift its over a value, you activate the relay.

Link to post
Share on other sites

I've found that measuring frequency on arduino's is a bitch, so I always recommend you get another chip to do that part.

Find something which will measure frequency and output an analogue voltage proportional to that frequency.

Then use the analogRead function to measure the analog voltage to get your limiter working.

Can't remember the exact syntax, but I think it would be something like this:

analogRead(pin # from output of chip)= int Speed;
if(Speed>512){
	CODE TO MAKE THE ENGINE STOP INCREASING IN SPEED
	}
else{
	CODE TO LET ENGINE DO WHAT IT WANTS
	}

analogRead will give a value of between 0 and 1024 for voltages between 0 and 5V.

512 is half way, or 2.5V (I just picked a random value, but for you it will be whatever the voltage output is at 83Hz).

Hope this helps :)

Link to post
Share on other sites

2 hours ago, rhyseyness said:

I've found that measuring frequency on arduino's is a bitch, so I always recommend you get another chip to do that part.

Find something which will measure frequency and output an analogue voltage proportional to that frequency.

Then use the analogRead function to measure the analog voltage to get your limiter working.

Can't remember the exact syntax, but I think it would be something like this:


analogRead(pin # from output of chip)= int Speed;
if(Speed>512){
	CODE TO MAKE THE ENGINE STOP INCREASING IN SPEED
	}
else{
	CODE TO LET ENGINE DO WHAT IT WANTS
	}

analogRead will give a value of between 0 and 1024 for voltages between 0 and 5V.

512 is half way, or 2.5V (I just picked a random value, but for you it will be whatever the voltage output is at 83Hz).

Hope this helps :)

There is actually a specific chip for this: www.ti.com/cn/lit/gpn/lm2907-n&ved=0ahUKEwjnqoi_-ZDOAhUIGj4KHcL-BzkQFghMMAI&usg=AFQjCNGJ7Wn9ZT99oecuxVMEHm16SrnmJA&sig2=WnPUedb5B3PRcE4cte0TJw

 

I will try that, thanks for your help.

 

`

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×