LED warning system based on different input frequencies.

Hi Guys,

Im completely new to arduino and i currently have an arduino UNO. As part of my university dissertation project i have to complete a safety circuit, the circuit will be connected to a speed sensor which will be fitted on a turbine dynomometer, it will input frequencies to my board based on the rpm of a roating shaft.
Depending on the frequency values 1 of 3 leds will light, green will indicate a safe speed, amber will indicate it is getting unsafe and red will indicate the shaft is over speeding and from this the system will cut.

However i am unsure how to program this as i have not came across any tutorials or examples which use frequency as an input and from this a set of commands are then followed.

if anyone has any advice i would appreciate it greatly.

That sounds like it is probably possible but your specification needs rather more detail.

What sensor is it? And exactly what type of signals are the "frequencies" you are expecting to get from it? What range of "frequencies" are you expecting? Is "cutting the system" part of what you expect the Arduino to do? If so what exactly does it need to do in order to "cut the system"?

Steve

The speed sensor is a microepsilon dz140, the shaft will be rotating at a max speeed of 150,000 rpm which equates to a frequency of 15kHz.

The specific details for now are not the main issue, my main issue is how to starting writing a program for a simple circuit which uses a frequency as an input to provide an output by lighting 1 of 3 leds.

is there any examples or tutorials you are aware of which would use frequency as an input?

Thanks.

Well I think the interesting part is what the exact signal from the sensor is and how you capture that and turn it into a usable frequency.

But if you already know how to capture the frequency from that sensor then the rest of it is easy. Just a few if/else statements. I don't really see what you're having trouble with unless you've never done any programming.

Steve

The shaft will be rotating at a max speeed of 150,000 rpm

WOW! Really? Please excuse my curiosity, but how on earth do you get a shaft to go at that speed and what kind of bearings does it use?

The blades can't be rotating at 150,000 rpm, so that speed must be the output of a gearbox. It would seem much more sensible to measure the rotation of the input of the gearbox.

150,000 rpm isn't at all unusual for an exhaust driven turbine...but measuring the speed is still an interesting challenge.

Steve

Oh, I was assuming "wind turbine". Feel stupid now...

How about connecting the signal to an external interrupt pin, set to detect rising edges, and have the interrupt routine increment a counter. When you want to measure the frequency, read the counter, delay(100) and immediately read the counter again. At 150KHz, the counter should increase by 1,500. Multiply that by 10 to get the frequency. Don't forget to declare the counter as "volatile".

150,000 rpm isn't at all unusual for an exhaust driven turbine

It's not? Really? That fast?! I'm amazed, thank you :slight_smile:

dylan_deery:
However i am unsure how to program this as i have not came across any tutorials or examples which use frequency as an input and from this a set of commands are then followed.

Well according to Section 5.6 of the manual you can get a linear analog 0-5V output for 0-200 (or 400, depends on mode) krpm.

So, replace the potentiometer in this example with your sensor, and your dissertation's almost done.

Just need to sort out an output to handle a relay or something to off the system before it self-destructs, and you'll be done by the weekend....

Guya,

Thanks a lot for all your help and advice, this is greatly appreciated i will have a look at this example now and hopefully all goes well.

As for the dissertation i wont be finished this weekend unfortunately as this safety system is only one of the numerous improvements i am making to the turbine dynomometer rig i then have to complete my 6000+ word report lol.

D.

slipstick:
Well I think the interesting part is what the exact signal from the sensor is and how you capture that and turn it into a usable frequency.

But if you already know how to capture the frequency from that sensor then the rest of it is easy. Just a few if/else statements. I don't really see what you're having trouble with unless you've never done any programming.

Steve

Unfortunately no i have never done programming apart from the tutorials in the Arduino Uno handbook but with a little practice il get it done thats why i was interested in finding some web pages which may help improve my skills.

Thanks for your help.
D

dylan_deery:
As for the dissertation i wont be finished this weekend unfortunately

Yeah I was being a little facetious there, I guessed there was more to it... I proof read my daughter's final year engineering project a while back, it's not trivial thing.

What's your thoughts for powering down once it's in overspeed? Do you have access to say the fuel input which you could kill with a solenoid valve maybe?

But in any case have a look at that example I linked. A pot across 5V and ground provides an analog reading just as your sensor will, then use map to turn that into rpm which according to the manual is linear.

You can mimic the whole thing with a pot as your sensor, leds exactly as you want to show speed, and another led to mimic fuel being on or off.

Yes i have access to the oil, air and gas which are currently controlled by an existing safety loop within the lab, my circuit will then come off this loop using a relay and will kill the system completely when there is an over speed.

That's great thanks for taking the time to help me!