Fidget Spinner RPM Counter © GPL3+

Arduino Project: How to make a Fidget Spinner RPM counter with Hall-effect sensor.

  • 20,025 views
  • 19 comments
  • 74 respects

Components and supplies

Apps and online services

About this project

Hi everyone! This is my next project, Fidget Spinner RPM Counter or Arduino Tachometer with Hall-Effect Sensor.

1: Requirements

Parts Required:

  • Fidget Spinner
  • neodyimium magnet
  • Arduino Uno
  • LED + resistor 220 Ohm
  • Hall-Effect Sensor - a3144
  • resistor 10 k
  • Wires
  • Breadboard
  • LCD 1602

2: Hall-Effect Sensor

Using Hall-Effect Sensor we can measure the speed of rotation. I used Hall-Effect Sensor - a3144.

RPM (Revolutions per minute) – the number of revolutions per minute. Revolutions per minute – a unit of measurement of rotational speed: the number of complete rotations made by the body (fidget spinner, wheel etc.) around a fixed axis. Used to describe the speed of rotation of the mechanical components in the mechanisms and machines.

3: How does it work?

To measure the speed of rotation on the Fidget Spinner must be mounted a part of neodyimium magnet that affect the Hall sensor after each complete turn of the Spinner.

4: Indication

The presence of a magnetic field is indicated on the LED.

LCD 1602 indicates current RPM, maximum RPM and tachometr bar (from 0 up to 1260rpm). 1260 rpm is my personal record.

Also you can use Arduino IDE serial port.

5: Notes

I used a Hall-Effect Sensor A3144 and it worked well just connected to the pin 2 of Arduino Uno board. Also I tried to use a Hall-Effect Arduino module just like this one and it worked very bad.

I recommend not using this module bacause of false harmonics.

Thank you all! Please, write in comments about your Fidget Spinner RPMs!

Schematics

spinnerrpm_bb_7MRrxg3dQ0.jpg
Spinnerrpm bb 7mrrxg3dq0

Code

spinnerRPM_v2.2.inoArduino
#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8);
const int hallSensorPin = 2;                      // connect the hall effect sensor on pin 2
const unsigned long sampleTime = 1000;
const int maxRPM = 1260;                  // maximum RPM for LCD Bar
int rpmMaximum = 0;

void setup() 
{
  pinMode(hallSensorPin,INPUT);
  Serial.begin(9600);
  lcd.begin(16, 2);
  lcd.print("Initializing");
  delay(1000);
  lcd.clear();
}

void loop() 
{
  delay(100);
  int rpm = getRPM();
  if (rpm > rpmMaximum) rpmMaximum = rpm;
  lcd.clear();
  displayRPM(rpm);
  displayBar(rpm);
  
}
 
int getRPM()
{
  int count = 0;
  boolean countFlag = LOW;
  unsigned long currentTime = 0;
  unsigned long startTime = millis();
  while (currentTime <= sampleTime)
  {
    if (digitalRead(hallSensorPin) == HIGH)
    {
      countFlag = HIGH;
    }
    if (digitalRead(hallSensorPin) == LOW && countFlag == HIGH)
    {
      count++;
      countFlag=LOW;
    }
    currentTime = millis() - startTime;
  }
  int countRpm = int(60000/float(sampleTime))*count;
  return countRpm;
}
    
void displayRPM(int rpm) 
{
  lcd.clear();
  lcd.setCursor(0, 0); 
  lcd.print(rpm,DEC);
  lcd.setCursor(7,0);
  lcd.print(rpmMaximum, DEC);
  lcd.setCursor(13,0);
  lcd.print("MAX");
  Serial.print("RPM = ");
  Serial.print(rpm);
  Serial.print("  MAX RPM = ");
  Serial.println(rpmMaximum);
}

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);
      }
  }
} 

Comments

Similar projects you might like

Version 2.0 Advanced Attendance System (Without Ethernet)

Project tutorial by GadgetProgrammers

  • 2,512 views
  • 5 comments
  • 43 respects

Get The Arduino Dice

by Ingo Lohs

  • 238 views
  • 0 comments
  • 4 respects

Control LED Using Your Voice Command

by IoTBoys

  • 569 views
  • 0 comments
  • 7 respects

Critter: Crawling Arduino Robot

Project showcase by Slant Concepts

  • 4,804 views
  • 10 comments
  • 30 respects

Musical Fairy Lights

Project tutorial by Ian Cumming

  • 449 views
  • 0 comments
  • 4 respects

Cloud Costume

Project tutorial by Monica Houston

  • 1,014 views
  • 3 comments
  • 10 respects
Add projectSign up / Login