this project use ESP32 controlling stepper motor. The motor drive fish feeder mechanism.
to determine the number of motor turns/time and number of repeated /day.
the ESP32 is connected to the local WiFi. It will subscribe to MQTT broker and will receive
a command from the broker. the Command will have the number of turns/time and number of repeats /day.
the commands will be send from HTML(WebPage) file to the MQTT broker using the internet.
the webpage will receive the motor status ( Running , Stop). and also a time stamp for when the motor stoped and the next run time from the ESP32 and display the information in the WebPage.
the ESP32 also connected to a LCD display. The LCD will display the same information that displayed on the WebPage.
the following is the steps to use this project
I- follow the instruction in the build instructions.
II- add the fish food in the funnel
III- prepare the ESP32
1- download the FishTankHackDay_copy.ino
2- before you upload the file you have to change the following with your
information
A- your WiFi ( line 26)
B- your Password (Line 27)
C- your MQTT broker (line 28)
D- your TOPIC_COMMAND (line 31)
use the same name in the HTML file
“client.publish(“TOPIC_COMMAND”,payload;
4- upload file to your ESP32
5- in first you may not connected. the status in the LCD will display “starting”
6- push the reset switch (see No 3 in the electronicsholder2.jpg )
7- the status in the LCD will display “WiFi connected” then will display “waiting”
8- now the ESP32 ready to receive command fro the WebPage (HTML file)
IV- prepare the HTML file
1- download the FishTankHackdayHTML.txt
2- change the TOPIC_COMMAND to be the same as the sketch for the ESP32
3- change the file to HTML format
4- open the file in any browser .
5- inter the number of turns and the number of repeats/ day and click send
6- the command will go to the ESP32 and it will turn the motor on and send the feed back to the webpage and display the information in the LCD.
Please notice if the motor run in reverse you have to commented the following in the sketch
const int stepSequence[4][4] = {
{1, 0, 0, 1},
{0, 1, 0, 1},
{0, 1, 1, 0},
{1, 0, 1, 0}
};
and use this
const int stepSequence[4][4] = {
{1, 0, 1, 0},
{0, 1, 1, 0},
{0, 1, 0, 1},
{1, 0, 0, 1}
};