Enable Javascript


Last Arduino/ESP8266 project (click to open)

User Rating: 5 / 5

Star ActiveStar ActiveStar ActiveStar ActiveStar Active
 

Article Index


What is simpleHomeSwitch?
This is simpleHomeSwitch:

  • A very cheap and easy solution for your Home Automation over the Internet and (W)LAN with a WebSocket capable Web Browser (HTML5).
  • A Mesh Nodes ad-hoc network with a lot off IoT modules.
  • Each Node may, independently of the other Nodes, automatically run commands that are stored in a private Node SPIFF-simpleDatabase.
  • We use only a Web Browser to create and modify the database command records.
  • Each Node test once per minute the record(s) if a automatic action is needed.
  • There are eleven modes available, one manual and ten automatic on varied data:
    0:Manual, 1:Time, 2:Lux, 3:Temp, 4:sunRise, 5:sunSet, 6:Sun, 7:Day, 8:Night, 9:Timer, 10:TimeTemp.
  • With a Web Browser we can overrule, pause or stop the automatic functions.
    (pause: reset on 04:00am, stop: wait for revoked)
  • Use the simpleHomeSwitch template to create a new Node (open as a Arduino example).
  • Included simpleHomeSwitch functions and options:
    (use the Arduino compiler directives to switch options ON/OFF)
    • simpleDB (a one table database with a fixed record length and a non fixed field length)
    • simpleNTP, simpleRTC (I2C) or simpleTime time with millis$ (13 digits UNIX time stamp)
    • simpleSunrise and simpleSunset (on your location)
    • simpleDST/Summertime (on your location)
    • simpleDS18B20 temperature (Dallas OneWire)
    • simpleBH1750 light (I2C)
    • simpleADS1115 Hi-Res ADC (4 to 16 A-ports, 16 bits resolution, I2C)
    • simpleThermistor (with Steinhart-Hart model equation to get the right A,B and C values)
    • simpleStepperMotorSteps (home/end detection, turn +/- steps, adjustable speed and steps/rotation)
    • simpleStepperMotorDegrees (home detection, turn to degree<n>, usable with a potentiometer)
    • simplePublish (replacement for the old NHS (Not)AtHome module).
      (This function is capable to send pre-defined commands to other Nodes, just like with a Web Browser)
    • KaKu (CoCo) 433MHz radio transmitter (light and other wireless switches)
    • Button bridges (wired to remote control buttons)
    • Sonoff modules (relays and sensors) I use Sonoff as:
      • Sonoff-button Publish (Not)AtHome and combined with front/back night lighting (mode: 8, Night on sunSet/sunRise times).
      • kitchen boiler switch with multi temperatures on time X,Y,Z. 
  • A Node can ask another Node for values such as time, temperature, light intensity or whatever is available.
  • You can add your own functions and or commands.
  • Web Browser(s) and Nodes can
      - set: D-pin LOW/HIGH or pinMode INPUT/OUTPUT/INPUT_PULLUP
      - get: D-pin LOW/HIGH or A-pin values
    on another Node.

The problem with my previous NewHomeSwitch project
A ESP8266 Wi-Fi Server is limited to maximal four simultaneous connections, and sometimes old connections are still registered. One server with maximal two IoT Slaves and a Web Browser Slave is possible. No problem there is a painlessMesh library from BlackEdder ;-) it is perfect to solve the connection problem. But... a ESP8266 Wi-Fi Mesh Network, or actually more an wireless ad-hoc network, can't connect to a Local Wi-Fi Home Network. So, first log in on a Node with WebSocket and then, only local, communicate through a Web Browser. That is still tricky, limited, and not my thing.

My solution
A combination of three different communication protocols (red: the Node ID)

  1. (IoT WS) WebSocket Server <-> Web Browser WebSocket Client (browsers WB).
    + SoftwareSerial (115200 baud) HC-05 Serial Bluetooth Master.
    (or: wired SoftwareSerial to IoT 00)

    The WebSocket Server works in Wi-Fi modes with:
     - WLAN HTML5 Browser Client(s).
     - Internet HTML5 Browser Client(s).
    The WebSocket Server must have a static IP.
  2. (IoT 00) SoftwareSerial (115200 baud) HC-05 Serial Bluetooth Slave.
    (or: wired SoftwareSerial to IoT WS)

    + Mesh Wi-Fi ad-hoc Network Node.
  3. (IoT 01-98) Mesh Wi-Fi ad-hoc Network Nodes .

It's looks complicated but is yet simple, very cheap and works fine.
All he Nodes, included WS and 00, can be equipped with your own functions and hardware.
Each Node may, independently of the other Nodes, automatically run commands that are stored in a private Node SPIFF-simpleDatabase. We use a Web Browser to create and modify this database records.

You can combine two, or more, Fritzing modules to one Node.
 - By example "My Sunscreen Mesh Node":

My Sunscreen is controlled with this Mesh Node on temperature and light intensity.
(example DOWN: >=21.5*C && >=360 LUX, UP: <21*C || <120 LUX. With anti Yo-Yo delay and bath weather UP).

Other Nodes may ask for the time, Temp and Lux.
It communicate over, Bluetooth or Wired, SoftwareSerial with the WebSocket Server Node WS. And, of course, with all the other Mesh Nodes in this wireless ad-hoc network.