To use a proximity sensor and Arduino (or similar low cost board) to read the distance between the sensor and the flag and publish the readings expressed in mm via MQTT using WIFI connection.
2. Electrical Drawing
3. Arduino sketch - to manage reading from the sensor and publish information using MQTT
4. Calibration procedure
5. Reading range - 3 mm
6. Accuracy - 0.05 mm
7. Repeatability - 0.1 mm
8. Sensor to be oil resistant
As I'm getting a lot of question about the sensor itself. I was thinking about the Keyence EX-V or EG series (or similar sensor)
After more research Balluf Inductive distance sensors like BAW M12ME-UAC35C-S04G seams to be more suitable for the project.