ESP32 Automated Irrigation Control System Project - PART 2 - Water Meter Implementation

Описание к видео ESP32 Automated Irrigation Control System Project - PART 2 - Water Meter Implementation

Were back in part two of the series continuing with the creation of a library that further supports hardware for the project and publishing it. This time it will be the water meter which uses a combination reed switch and magnet to generate a pulse for measurement.


Understanding how this works means that I don't actually need the meter but can produce my own meter emulator to make this project easier. In its simplest form, a contact with two wires should get me out the gates.


I start off with my usual library creation with a getVersion, but in addition to it, an interrupt that checks to see if the switch was closed and notifies accordingly. Dirty but effective for testing. With this working I can expand upon the arguments with more parameters to provide more context as to what it means when the switch closes as well as some functions that provide some basic readouts.


Now with a readout of both gallons and liters, touching the wires shows the increment as specified in the object creation. This number is stored in memory but now we need the final feature and that s the ability to store the information to a file. For this spiffs will be employed.


With spifffs a new function to initialize the file system is created, this is complimented with services to update that file for each event to align the mechanical value on the meter with that in the file itself. Final testing of this is done by pulling power.


To test this all out a small project board is used with a DC motor and a few batteries along with a POT to generate this signal on a reed switch with a magnet to emulate the meter for software testing.

5 Wire Motorized Ball valve
https://amzn.to/3Tr81yf

Buck Converter
https://amzn.to/3n1WZ6o

Power Transformer 120vac
https://amzn.to/3Jsqg1I

Water Meter
https://amzn.to/42mNRd1

AC/DC Converter
https://amzn.to/3mY6OCx

DPDT Relay
https://amzn.to/3lluL6d

2.4G WiFi Antenna for FPV TX Antenna with RP-SMA Female Cable Dipole Whip
https://amzn.to/3FvAhtI

HiLetgo ILI9341 2.8" SPI TFT LCD Display Touch Panel 240X320 with PCB 5V/3.3V STM32
https://amzn.to/3TqgW3e

Knurled Insert Nuts - 50Pcs M4 x 6mm Length x 6.4mm OD Female
https://amzn.to/3JiCObY

I2C TWI Serial LCD 2004 20x4 Display Module with I2C Interface Adapter Blue Backlight
https://amzn.to/3lmS6oa

HiLetgo ESP-WROOM-32 ESP32 ESP-32S Development Board
https://amzn.to/3Fv4KZ5

Screw Terminal Block Breakout Module Board for ESP32-DevKitC
https://amzn.to/3yLGr5q

2Pin Panel Mount 13mm Waterproof Power Connector IP67
https://amzn.to/3n1DDhH

SP13 6pin Waterproof Aviation Cable Connectors Plug Socket IP67
https://amzn.to/3n3cR8H

360 Degree Rotary Encoder Module KY-040 Brick Sensor
https://amzn.to/3ljdPgD

KUOYUH Circuit Breaker 91 Series 50VDC 125/250VAC (1A-2A) (2.0A)
https://amzn.to/3YQZ42l

5PCS Green AC/DC12-24V LED Indicator Lights
https://amzn.to/3YXiLWl

3pcs PCF8575 IO Expander Board Module I2C to 16IO IIC I2C I/O Extension
https://amzn.to/40f9jhZ

4pcs 2A 5V Charge Discharge Integrated Module 3.7V/4.2V PCB Board Module for 18650 Lithium Battery
https://amzn.to/3yTPkK1

10pcs AMS1117-3.3 DC-DC Step-Down Power Module AMS1117-3.3V Buck Module LDO 800MA
https://amzn.to/3n3JYti


#esp32 #platformio #arduinoide #automation #maker

Комментарии

Информация по комментариям в разработке