RPM controlled LED Bar Graph Display

Discussion in 'The Projects Forum' started by MajorKhan, Jun 6, 2012.

  1. MajorKhan

    Thread Starter New Member

    Jun 4, 2012
    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.
  2. bretm


    Feb 6, 2012
    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

    Code ( (Unknown Language)):
    2. loop forever
    3. {
    4.     int rpm = measure_rpm();
    5.     turn_off_all_leds();
    6.     if (rpm > 640) turn_on_led(0);
    7.     if (rpm > 1280) turn_on_led(1);
    8.     if (rpm > 1920) turn_on_led(2);
    9.     if (rpm > 2560) turn_on_led(3);
    10.     if (rpm > 3200) turn_on_led(4);
    11.     if (rpm > 3840) turn_on_led(5);
    12.     if (rpm > 4480) turn_on_led(6);
    13.     if (rpm > 5120) turn_on_led(7);
    14.     if (rpm > 5760) turn_on_led(8);
    15.     if (rpm > 6400) turn_on_led(9);
    16. }
    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.