The following diagram is the basic functional block diagram of the Cosmos: Intrusion Sensor device. The device comprises of four main components the ESP8266-12E wifi module, 5v power supply for the device, and 5v to 3.3v Regulator. The intrusion sensor when triggered communicates the values with the centralized controller, which then relays the corresponding message to the devices configured on receiving the notification.
EAGLE, which stands for Easily Applicable Graphical Layout Editor is a scriptable Electronic Design Automation (EDA) software application with schematic capture, printed circuit board (PCB) layout, auto-router and computer-aided manufacturing (CAM) features. This particular software seemed the best for the project for schematic and PCB design since it has an inbuilt schematic editor for circuit diagrams. EAGLE has been used because it not only gives an easy to use interface but also has several open source libraries available for our purpose. These libraries include that for the ESP8266, the LM1117 5v to 3.3v Regulator and in future for other components and parts that may be required. After finalizing the Gerber file layout to be used for printing the PCB via an online PCB manufacturer PCBPOWER.
MQTT which stands for MQ Telemetry Transport is a lightweight publish/subscribe, straightforward messaging protocol. This protocol is specially designed for constrained devices and low-bandwidth with high latency and unreliable network. So, the design principles are to minimise network bandwidth, and device resource requirements whilst also attempting to ascertain the reliability and some level of acknowledgment of delivery. As per our research, MQTT is by far the most competitive solution out there for a machine to machine (M2M) or Internet of Things (IoT) application. COSMOS revolves around the core idea of having a single interface with multiple sensor nodes and utility devices connected to it. It was found necessary to find a protocol that sits over the standard TCP/IP protocol to standardize the solution, while at the same time account for the unreliable networks and provide message transport with low- latency.
The ESP8266 12E has the below schematic which consists of 9 GPIO pins for input and output of data values from and to the sensors. It has a Tx pin for transmission of data values and Rx pin for Receiving the data values. The VCC pin is for voltage input, which must be 3.3 volts. It should be noted that any voltage above 3.3 volts increases the risk of burning down the chip. The ESP8266 also has the limitation of working with just 2.4 GHz of network, any 5 GHz connection would not work.
Referring back to figure above, connections for the Rx and Tx of the Arduino board to the Tx and Rx of the ESP8266 via the pins 4 and 3 of the SV1 female header are made, and is seen in figure 30. Connections to the pin 1 to the GND of the Arduino and pin 2 to the VCC (+5v) of the Arduino. Once the connections are made, and the next step is to select the tools command in the Arduino IDE and the different configuration as per Table 3, shown below
One of the most common problem encountered while uploading the code to ESP8266 12-E is the espcomm_uploaded_mem failed. Several reasons were identified after carrying out the tests in multiple iterations
Following one or more of the following solutions should help resolve the problem.