Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino Nano-Based Tachometer with LCD Display and Hall Sensor

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based Tachometer with LCD Display and Hall Sensor

Circuit Documentation

Summary

This circuit is designed to function as a tachometer using an Arduino Nano as the central processing unit. It reads the rotational speed of an object via a Hall sensor and displays the measured RPM (Revolutions Per Minute) on an MKE-M07 LCD1602 I2C display. The circuit is powered by a 9V battery, and a diode is used to protect the Arduino from potential reverse voltage damage. The Hall sensor's output is connected to one of the digital pins of the Arduino, which counts the number of pulses per second to calculate the RPM. The LCD display communicates with the Arduino via the I2C protocol.

Component List

Arduino Nano

MKE-M07 LCD1602 I2C

9V Battery

Hall Sensor

Diode

Wiring Details

Arduino Nano

MKE-M07 LCD1602 I2C

9V Battery

Hall Sensor

Diode

Documented Code

/*
 * Arduino Tachometer Project
 * This code reads the speed from a Hall sensor and displays it on an LCD.
 * Connections:
 * - Hall Sensor S pin to Arduino D5
 * - LCD SDA to Arduino A4
 * - LCD SCL to Arduino A5
 * - Power and ground connections as per the net list
 */

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

// Initialize the LCD, address 0x27, 16 chars, 2 lines
LiquidCrystal_I2C lcd(0x27, 16, 2);

const int hallSensorPin = 5; // Hall sensor connected to D5
volatile int rpmCount = 0;
unsigned long lastTime = 0;

void setup() {
  pinMode(hallSensorPin, INPUT);
  attachInterrupt(digitalPinToInterrupt(hallSensorPin), rpmCounter, RISING);
  lcd.begin();
  lcd.backlight();
  lcd.setCursor(0, 0);
  lcd.print("Tachometer");
}

void loop() {
  unsigned long currentTime = millis();
  if (currentTime - lastTime >= 1000) { // Update every second
    detachInterrupt(digitalPinToInterrupt(hallSensorPin));
    int rpm = (rpmCount * 60); // Calculate RPM
    rpmCount = 0;
    lastTime = currentTime;
    lcd.setCursor(0, 1);
    lcd.print("RPM: ");
    lcd.print(rpm);
    attachInterrupt(digitalPinToInterrupt(hallSensorPin), rpmCounter, RISING);
  }
}

void rpmCounter() {
  rpmCount++;
}

This code is responsible for reading the number of pulses from the Hall sensor, which is indicative of the rotational speed. It then calculates the RPM and displays the value on the LCD. The rpmCounter function is an interrupt service routine that increments the rpmCount variable each time a pulse is detected from the Hall sensor. The main loop updates the display every second with the latest RPM value.