Home Automation using IOT – Concept and Working Model

Home Automation using IOT – Concept and Working Model

This note explains the concept of using IOT for home automation. The below diagram shows how home appliances are controlled using a web based control panel. There are three lights(LEDs), one fan and a temperature sensor in the model house. Lights and fan are driven by relay modules. Relays are driven by NodeMCU (ESP8266 based IOT module). The temperature sensor is connected to the nodeMCU directly. We have an IOT server, running MQTT broker and also the web based control panel. Using the control panel buttons, the user can turn on/turn off lights…continue reading →
Connecting a Relay Module with NodeMCU

Connecting a Relay Module with NodeMCU

In this note, let's see how to connect a relay module to a NodeMCU board. We use a relay module when we have to drive devices that use more current than NodeMCU board can supply.   Here's a list of things needed: Hardware NodeMCU v1.0 or v0.9 Relay module - I used a 5V DC 4 channel relay module Some jumper wires Software Arduino IDE (arduino.cc/Downloads) Arduino ESP8266-core (Steps for installation can be found in my other blog. Link Here) Step 1: How does the relay module work? The relay module is an electrical…continue reading →

Mosquitto MQTT Publish – Subscribe from PHP

Looking for the code to connect to Mosquitto broker from your PHP code ? Here's a simple example with step by step instructions. The complete functional code can be downloaded here. Before starting off, you need to have php, Mosquitto broker and Mosquitto library for php installed. If you need guidance on installing Mosquitto library for PHP, do refer my instructions here. The Basic PHP page Let’s start from a simple PHP web page. Our page has only two buttons - one to publish and one to subscribe. Below php file is saved…continue reading →

Mosquitto PHP library on RaspberryPi – Installation

To connect to Mosquitto MQTT broker from your PHP code, you need to have the Mosquitto PHP library module enabled on your server. This post explains steps to get the Mosquitto PHP library installed. These steps have been verified on Ubuntu desktop as well as on RaspberryPi (Raspbian Jessie), running Apache2 and PHP 5.4. You need to be connected to internet to complete these steps. Follow them in the order given. 1. sudo apt-get install php-pear 2. sudo apt-get install php5-dev 3. sudo apt-get install libmosquitto-dev 4. sudo pecl install Mosquitto-alpha NOTE: In…continue reading →
IOT Setup Using ESP8266 and HiveMQ Public MQTT

IOT Setup Using ESP8266 and HiveMQ Public MQTT

  This is a basic Internet of Things (IOT) project using a public MQTT server. I am doing two things here: Control an LED at my home from anywhere in the world, by simply publishing an “on” or “off” command in the browser. Read the temperature inside my room from the browser, wherever I go. Watch a video on NodeMCU and HiveMQ: Following components are used for this project: NodeMCU (an ESP8266 based SoC board), usually used for IOT projects A temperature sensor (LM35) Onboard LED on NodeMCU, that is connected to pin…continue reading →