Some new stuff
  1. Arduino Park Control
  2. Arduino USB2serial programming the bare bone
  3. Arduino Projects Videos added
  4. Arduino Xbee projects
  5. Arduino dB Meter 
  6. Trying to get the IOIO going. 
  7. IOIO is going....bluetooth
  8. Attiny 2313 bluetooth bee RC car
  9. Compass and temperature added
  10. AVR programmer
  11. USB2Serial and Ethernet POE
  12. Arduino LPG Sensor
  13. Program the Arduino Mini 05
  14. Lipo Rider Pro in action
  15. EZ Robot Builder kit arrived 10 Nov 2012
  16. Arduino VA Meter!
  17. 05 Nov 2012 Project Sentry Gun.
  18. Attiny85 PIR Sensor 10 Dec 2012 
  19. 0-30VDC3A and 2-28VDC10A bench PSU's
  20. 19 Dec 2012 Arduino Voltmeter LCD
  21. 29 Dec 2012 Arduino Tachometer&Speedometer LCD
  22. 03 Jan 2013 Arduino AC Phase Control. 
  23. 18 Jan 2013 Arduino Distance Meter
  24. 22 Jan 2013 Arduino Digital Clock and Date
  25. 31 Jan 2013 Arduino Digital Clock and Date 8x2 LCD
  26. Feb 2013 LCD and Backpack
  27. Feb 2013 7 Segment Serial Clock Sparkfun. Distance Sensor with "newping" library
  28. Feb 2013 Lelo Remote
  29. 01/03/2013 Arduino Adafruit 7 Seg Digital Clock with RTC and backpack 
  30. Arduino Frequency Meter 26/03/2013
  31. Another RC  Car controlled by Arduino 06/04/2013
  32. My quadcopter project update 25 April 2013
  33. My Aqua Quad Copter Flying 26 April 2013enlightened
  34. Another monster RC truck;strong one! 11July2013cool
  35. X-Frame Quad Copter 31 July 2013cool
  36. Arduino GSM Sheild added.28/8/2013
  37. 1.8inch TFT screen 13/09/2013cool
  38. 04/11/2014 added PID Soldering Iron Control
  39. Added bluetooth servo control 04/11/2014
  40. ESP8266 first try.16/03/2015
  41. Arduino Uno Quadcopter 19 May 2015
  42. IOT WemosD1 Amp Meter

 

 



https://sites.google.com/site/measuringstuff/more-sensor-examples

I copied the code and changed the lcd pins. 

Arduino Tachometer LCD display. I used the LCD Keypad Sheild DF Robot and changed the code accordingly to pins of the LCD shield. I also changed/add some else..if statements to make provision for SHIFTLED indication.

I used hall effect OHS3020 uni-polar.

Only one pole of magnet influenced the sensor correctly!

Important to add 10 k pull up resistor on signal. From signal to 5v+

Sensor view from front(text);

1. 5v+ far left

2. Ground

3. Signal out. 

Code: 

/*  RPM meter code (tested on device rotating at 10,000 rpm) 

  I changed the code to provide SHIFTLED indication,valus can be changed accordingly

 */

// include the library code:

#include <LiquidCrystal.h>

 

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(8,9,4,5,6,7);

// read the hall effect sensor on pin 2

const int hallPin=2;

const int shiftLed=3;

const unsigned long sampleTime=1000;

const int maxRPM = 10200; 

void setup() 

{

  pinMode(hallPin,INPUT);

  pinMode(shiftLed,OUTPUT);

   Serial.begin(9600);

  // set up the LCD's number of rows and columns: 

  lcd.begin(16, 2);

  // Print a message to the LCD.

  lcd.print("initializing");

  delay(1000);

  lcd.clear();

}

void loop() 

{

  delay(100);

  int rpm=getRPM();

  lcd.clear();

  displayRPM(rpm);

  displayBar(rpm);

}

int getRPM()

{

  // sample for sampleTime in millisecs

  int kount=0;

  boolean kflag=LOW;

  unsigned long currentTime=0;

  unsigned long startTime=millis();

  while (currentTime<=sampleTime)

{

    if (digitalRead(hallPin)==HIGH)

{

    kflag=HIGH;

}

if (digitalRead(hallPin)==LOW && kflag==HIGH)

{

kount++;

kflag=LOW;

}

currentTime=millis()-startTime;

}

int kount2rpm = int(60000./float(sampleTime))*kount;

return kount2rpm;

}

void displayRPM(int rpm) 

{

  lcd.clear();

  // set the cursor to column 0, line 1

  lcd.setCursor(0, 0); 

  // print the number of seconds since reset:

  lcd.print(rpm,DEC);

  

  if((rpm)==60)  //change value to own choice

{

  digitalWrite(shiftLed,HIGH);

}

else if((rpm)==120)  //change value to own choice

{

  digitalWrite(shiftLed,HIGH);

}

else if((rpm)==180)  //Change value to own choice

{

  digitalWrite(shiftLed,HIGH);

}

else

{

  digitalWrite(shiftLed,LOW);

}

  lcd.setCursor(7,0);

  lcd.print("RPM");

}

void displayBar(int rpm)

{

  int numOfBars=map(rpm,0,maxRPM,0,15);

  lcd.setCursor(0,1);

  if (rpm!=0)

{

  for (int i=0; i<=numOfBars; i++)

{

 lcd.setCursor(i,1);

 lcd.write(1023);

}}}

You can view video HERE

 

Back Back to top