Skip to content

dentinger/IOTwaterpump

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

IOTwaterpump

Arduino (ESP8266) controlled water pump

Overview

This code controls a small 12V water pump via an Arduino based ESP8266.

The ESP8266 will register itself on a wireless network and then the pump can be interfaced via simple URL of http://pump.local/ by any device also on the same network.

Network Configuration

The WiFiManager library handles the network setup. When first uploaded to the Arduino, the Arduino will create it's own access point that is named uniquely as: Pump Thing (+ last 2 HEX digits of mac address). To configure your WiFi details, switch your wireless connection the above access point and then provide your access point credentials. These will be store in durable memory.

WebServer Configuration

Using the ESP8266WebServer library, the web server is very easily configured using callback functions.

First define a server.

ESP8266WebServer server(80);

Then define routes that the server should respond to and their callbacks.

  server.on("/", handleRoot);
  server.on("/pump", handlePump);
  server.onNotFound(handleNotFound);

The callbacks just need to be accessible when compiling.

Arduino libraries

This uses the following Arduino Libraries.

  • ESP8266WiFi - ESP8266 Core WiFi Library
  • ESP8266mDNS - Simple ESP8266 Multicast DNS for .local urls
  • ESP8266WebServer - Local WebServer used to serve the configuration portal
  • WiFiManager - WiFi Configuration Magic
  • DNSServer - Local DNS Server used for redirecting all requests to the configuration portal

Hardware BOM

The POC of this was built with the following BOM

Usefull Links

Releases

No releases published

Packages

No packages published

Languages