RPM controlled LED Bar Graph Display

Thread Starter

MajorKhan

Joined Jun 4, 2012
1
Hello Everybody,
I am a new around here.I am currently working on this project of making a digital tachometer.I am using a Variable Reluctance sensor which sends me two pulses per revolution.I have calculated the rpm using the arduino ,but i am facing problems for making the led bar graph controlled by the rpm.Like i want all leds (2 green, 6 yellow, 2 red) to glow at around 7000 rpm and according to certain rpms i want certain leds to glow.I have read about the IC MAX7219 but did'nt get any idea of how to control the leds according to the specific rpm and how to input the IC.
Thank you for helping.
 

bretm

Joined Feb 6, 2012
152
Do you have 10 digital output pins available? If so, it's just a matter of connecting each LED to a pin and turning the pins off and on depending on the RPM. You say you've measured and calculated the RPM successfully, so (psuedo-code) might look something like

Rich (BB code):
loop forever
{
    int rpm = measure_rpm();
    turn_off_all_leds();
    if (rpm > 640) turn_on_led(0);
    if (rpm > 1280) turn_on_led(1);
    if (rpm > 1920) turn_on_led(2);
    if (rpm > 2560) turn_on_led(3);
    if (rpm > 3200) turn_on_led(4);
    if (rpm > 3840) turn_on_led(5);
    if (rpm > 4480) turn_on_led(6);
    if (rpm > 5120) turn_on_led(7);
    if (rpm > 5760) turn_on_led(8);
    if (rpm > 6400) turn_on_led(9);
}
Fill in whatever numbers you want, and provide the named functions. You could also put the values in an array and use a loop, or if the numbers are a linear progression you could just calculate how many LEDs to turn on based on the RPM value.
 
Top