2 in 1 - RPM and Temperature Meter
by Caio Felipe Tacão in Circuits > Arduino
52 Views, 0 Favorites, 0 Comments
2 in 1 - RPM and Temperature Meter

As I mentioned in my last project report, the double-check pulley aligner; I left my old job as a technical assistant and joined an agricultural equipment company, in this new journey as a quality inspector; I was able to make several observations and face problems as a man and with great responsibility, because customers have dreams and, like me, it would not be fair to buy a probable source of income that already comes with defects... Due to my proactivity in the assembly line and my work style, they decided to put me in the famous 6th operation, in this stage of machinery inspection, details, as well as testing, are extremely important; I was able to observe for a month that the methods were lacking... and the safety of measuring noise, RPM, temperature and vibration data could be potential sources of workplace accidents... this is because at the same time that I had to measure all the points listed in my checklist, the employees/assemblers did not stop surrounding the machine, greasing and placing warning stickers all over the machine... jumping over hoses and avoiding workers, I then decided to enhance the test, creating a space where I was not the one who got in the way but the one who helped, I decided to create a 2-in-1 equipment that would measure RPM and temperature; I am still in the implementation company... but I did not get any interest from the superiors; Everyone I presented my equipment to, whether they were the assemblers, the leaders, or even the company's deputy manager... thought my work and proactivity were wonderful. But finding it wonderful is one thing, putting it into practice is another... I'm still waiting for the movement they told me about, but I don't expect it to happen... I decided to do what I know best: pass on the idea so that new enthusiasts can have absolute success and success!!!
I humbly make my work available to you and I thank the platform for existing.
Supplies


To build this equipment, you will need some components...
- 01 - ESP32 - microcontroller
- 01 - Battery +YS 2.41Wh (-101842 650mAh) -- in my case taken from those Vapes
- 01 - Charge Control BMS - still from the same vape I used...
- 01 - 6-way female and male JST connector
- 01 - Latching button switch - taken from an old wifi modem
- 01 - Approximately 7 meters of 1mm wire -- 6 meters for connecting the 2 sensors (RPM and Temp.) and 1 meter for internal connections of the case
- 01 - Hall sensor module KY-003
- 12 - Neodymium magnets + 3 for tests....
- 01 - 4.7K Resistor
3D Printing of Cases



In order to support the entire internal structure and use the ESP32's Bluetooth serial communication, I decided to design the protective and containment covers for the entire circuit. I will make the STL and g.code files available below so that you can print the cases; in my case, I used the Creality Ender 3 printer; the photo above shows the "exploded view" of my equipment.
Creation of the Electrical/electronic Circuit


CAUTION: Here you have access to the electronic circuit I created for this project. Follow exactly what I describe, as the programming will govern all inputs and outputs used on the ESP32 microcontroller. The first image shows no connectivity via the JST connector, while the second image reveals the use of the 6-way JST connector's inputs and outputs... although you may notice that I only use 4 ways...
What I'm telling you is that FOLLOW THIS ENTIRE SCHEMATIC AND NOTHING CAN GO WRONG - I know that such equipment has its costs, and I'm not someone who's in trouble and will make you waste your money on something useless.
Creation of Sensors - RPM Hall Effect
.jpeg)


.jpeg)

Due to the inspection points of agricultural machinery, I decided to make some observations. I noticed right away that the frames where the shafts that rotate the pulleys go have a spacing from the bearing base to the pulley coupling of about 50 mm. Based on this information, I knew where my limit would be (45 mm total height). Based on this height, I developed the Hall sensor head... and I'm making available all the parts I printed on my 3D printer.
The Hall sensor is flexible and moldable to the height by tilting, similar to a joystick system; this guarantees me malleable heights and better reception of the distance and recognition of the neodymium magnet placed on the shaft between the bearing and the pulley.
I know... my design is very amateurish and without any finishing, but I will improve it, I swear!!!
To adjust the tilt, simply turn the bottom cover of the sensor and tilt it to where you want the inspection magnet to be.
important detail: when you are going to unify all the parts... I used epoxy adhesive-based glue, or epoxy glue... remember the rules of fitting and geometry, the cover I mentioned previously, MUST be placed before the sensor head, otherwise... nothing will work as it should...
The fixing style I used, knowing that all the parts are metallic, from the base of the bearings of the agricultural machines; was through magnetic fixing, with the help of 4 neodymium magnets.
Creation of Sensors - Temperature Sensor
.jpeg)


.jpeg)
.jpeg)

For the practical and minimalist design of the DALLAS Ds18b20 temperature sensor, I made a protector for the sensor via 3D printing; the entire circuit was made (OBSERVE THE DIAGRAM TO MAKE THE EFFECTIVE CONNECTION OF THE ELECTRONIC COMPONENTS TO THE SENSOR).
I will be making the print file for this part available.
NOTE: For a completely plausible sensor attachment, you must run the 3 wires before soldering the 4.7K resistor inside the 3D printed structure, otherwise everything will go wrong.
For the sensor to have effective contact, place 3 neodymium magnets flush with the base of the 3D printed case. To ensure effective heat transfer from the part under analysis to the temperature sensor, I used a piece of sanded aluminum (to remove the protective varnish) that I cut from a Pepsi-Cola can.
prioritize the 120º angle for fixing the magnets, fixing them with epoxy glue 1 by one.
Downloads
ESP32 Programming
.jpeg)

If you've followed everything I've written and explained so far, you'll certainly be successful programming your ESP32. One important observation I should make is that you can program before or after installing the ESP32 in the ESP-32 module. However, I preferred to program before creating the peripherals and was successful—that's up to you. But one detail... the ESP-32 module I created doesn't allow reprogramming because there are no openings or slots for USB programming... I'm sorry... you'll lose the ESP32, but you'll gain a fantastic simultaneous inspection device
ONE DETAIL: All the wires were soldered directly to the ESP32. I know... terrible.
the entire schedule is available below:
#include <OneWire.h>
#include <DallasTemperature.h>
#include "BluetoothSerial.h"
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED)
#error Bluetooth não está habilitado! Verifique sua configuração do ESP32.
#endif
// Pinos
#define SENSOR_RPM_PIN 15
#define ONE_WIRE_BUS 4
// Setup dos sensores
OneWire oneWire(ONE_WIRE_BUS);
DallasTemperature sensors(&oneWire);
// Bluetooth
BluetoothSerial SerialBT;
// Variáveis RPM
volatile unsigned long pulseCount = 0;
unsigned long lastMillis = 0;
float RPM = 0;
// Intervalo de leitura (10 segundos)
const unsigned long interval = 10000;
// Interrupção para contar pulsos
void IRAM_ATTR countPulse() {
pulseCount++;
}
void setup() {
Serial.begin(115200);
SerialBT.begin("T02 - Master Operador"); // Nome do dispositivo Bluetooth
Serial.println("Bluetooth iniciado. Emparelhe com 'Master Operador'");
pinMode(SENSOR_RPM_PIN, INPUT_PULLUP);
attachInterrupt(digitalPinToInterrupt(SENSOR_RPM_PIN), countPulse, RISING);
sensors.begin();
}
void loop() {
unsigned long currentMillis = millis();
if (currentMillis - lastMillis >= interval) {
noInterrupts();
unsigned long count = pulseCount;
pulseCount = 0;
interrupts();
RPM = (count * (60.0 / (interval / 1000.0))); // Ajuste do intervalo
lastMillis = currentMillis;
sensors.requestTemperatures();
float tempC = sensors.getTempCByIndex(0);
String data = "RPM: " + String(RPM) + " | Temperatura: " + String(tempC) + " °C";
Serial.println(data);
SerialBT.println(data);
}
delay(100); // Pequeno delay para não travar o loop
}
Tests and Data Obtained.






Now, on your smartphone, install Kai Morich's Serial Bluetooth Terminal 1.49 (many thanks to the developer!
Open the terminal, turn on the device using the switch, and connect until the "Master Operator" message is connected. Observe the data computation... The programming I used reads data every 5 seconds. You can change it if you want, but I'm concerned about data refresh and the accuracy of the responsive circuits...
After turning on my data transmitter... and pairing it with the application, it was time to connect them to the machine I need to inspect, of course... with my equipment properly calibrated by the company, where there are no discrepancies in the inspections... I took the real test if my equipment would work for something and after that I calculated the deviations and the results were.......
Fantastic, as you can see in the photos, for the RPM sensor, the reading with the equipment I use reached 140 RPM, while mine, developed with a KY-003 Hall sensor, registered 144 RPM; that is, an error of 2.85%. While the temperature sensor... my thermometer registered around 18°C and my sensor DALLAS Ds18b20 identified a temperature of 17.69°C, with an error of 1.72%.
So... I was successful, thank God!!!!