I made this Tachometer using IR sensor!
Steps to make this tachometer:
1. Put the Arduino Nano on the breadboard
2. Connect the SDA and SCL pins of OLED to A4 and A5 respectively.
3. Connect the OUT pin of the IR sensor to digital pin 2 of Arduino nano and give +5v and GND connections.
4. Upload the code. (The code is pinned in the first comment.)
Explanation:
The current time in milliseconds is stored in the 'currentMillis' variable.
If the time difference between the current time and the previous time stored in previousMillis is equal to or greater than 1000 milliseconds (1 second):
The interrupt is temporarily detached to avoid conflicting with the counter variable.
The RPM value is calculated by dividing the counter value by 2 (assuming each revolution triggers two interrupts) and multiplying it by 60 to convert it to RPM.
The counter is reset to 0.
The interrupt is reattached to the IR sensor pin.
The previousMillis is updated to the current time.
The OLED display is cleared.
The RPM value is displayed on the OLED display.
Видео I made this Tachometer using IR sensor! канала THE ELECTRONIC GUY
1. Put the Arduino Nano on the breadboard
2. Connect the SDA and SCL pins of OLED to A4 and A5 respectively.
3. Connect the OUT pin of the IR sensor to digital pin 2 of Arduino nano and give +5v and GND connections.
4. Upload the code. (The code is pinned in the first comment.)
Explanation:
The current time in milliseconds is stored in the 'currentMillis' variable.
If the time difference between the current time and the previous time stored in previousMillis is equal to or greater than 1000 milliseconds (1 second):
The interrupt is temporarily detached to avoid conflicting with the counter variable.
The RPM value is calculated by dividing the counter value by 2 (assuming each revolution triggers two interrupts) and multiplying it by 60 to convert it to RPM.
The counter is reset to 0.
The interrupt is reattached to the IR sensor pin.
The previousMillis is updated to the current time.
The OLED display is cleared.
The RPM value is displayed on the OLED display.
Видео I made this Tachometer using IR sensor! канала THE ELECTRONIC GUY
Показать
Комментарии отсутствуют
Информация о видео
Другие видео канала
![10 Easy ESP32 Projects for Beginners in 2023](https://i.ytimg.com/vi/huHHAXzTP5c/default.jpg)
![DIY Step Counter using ESP32!](https://i.ytimg.com/vi/T2tqk6CIBxY/default.jpg)
![Level Measuring Device using #esp32](https://i.ytimg.com/vi/rOwf5Mz5b60/default.jpg)
![How to make a Flappy Bird Game using #esp32?](https://i.ytimg.com/vi/pCMFS2Yeq48/default.jpg)
![Crypto Price Ticker using #esp32project](https://i.ytimg.com/vi/TEsPgNuWL8A/default.jpg)
![Stocks Price Ticker using ESP32!](https://i.ytimg.com/vi/FcG3KbGGDqs/default.jpg)
![New Arduino UNO R4 WiFi In-depth Review](https://i.ytimg.com/vi/V5opcT_fWys/default.jpg)
![Internet Clock Using ESP32 Web Server!](https://i.ytimg.com/vi/uPBg8vZN1QI/default.jpg)
![An Electronic Dice #arduinoproject](https://i.ytimg.com/vi/xTOvKZYJ7Rc/default.jpg)
![Scan nearby WiFi networks using ESP32!](https://i.ytimg.com/vi/XLqSVp_omWE/default.jpg)
![A Smart way to Display a Message #esp32project](https://i.ytimg.com/vi/ONxEGxK-K40/default.jpg)
![Wi-Fi strength checker using ESP32! #esp32](https://i.ytimg.com/vi/MgkKTInd3us/default.jpg)
![Boost Your Reflexes with this #ArduinoProject](https://i.ytimg.com/vi/5bFxI5wG0J8/default.jpg)
![DIY Stopwatch made in 30 seconds using #arduino](https://i.ytimg.com/vi/oxBfuWTVv4Q/default.jpg)
![Digispark ATtiny85 with Arduino 2.0: How to program?](https://i.ytimg.com/vi/JGf6P52LO5c/default.jpg)
![Temperature controlled fan control using #arduino](https://i.ytimg.com/vi/NqsnLNea_to/default.jpg)
![Automatic garage door using Arduino! #arduinoproject](https://i.ytimg.com/vi/FpIXk01Ejzs/default.jpg)
![16 LED circuit on a Breadboard!](https://i.ytimg.com/vi/yHyCcrrKoNc/default.jpg)
![Operating a Servo Without an #arduino!](https://i.ytimg.com/vi/3SpRfi4g60Q/default.jpg)
![Simple Ultrasonic Sensor Project #arduino](https://i.ytimg.com/vi/wtXR5FhtJcc/default.jpg)