The Internet of Things technology has been developing rapidly in recent years, bringing great convenience to daily life. This article elaborates a solution of the remote monitoring system for intelligent water heater based on Ayla IoT platform. An Ayla module is adopted to connect Ayla cloud services with microcontroller of intelligent water heater. An iOS APP is designed by using Model-View-Controller framework and asynchronous socket technology and provides users an effective way to operate and monitor the intelligent water heater. Moreover, this article presents two methods to verify the accuracy and real-time performance of data transmission in this system. Module can get control commands from mobile client or Ayla cloud services and transmit them to MCU by SPI-bus. The control commands in MCU are sent to traditional water heater ultimately. In this way, users can control the traditional water heater in mobile client and the remote control has been realized. Figure 4. WN-N-BM-09 Moreover, there are two indicator lamps in Ayla module which are Ready-Led and Link-Led, The indicator lamp Ready-Led will be bright if the device operates normally. Only if the device connects to the internet successfully, the indicator lamp Link-Led will be bright.
Software Design of SystemThe software design of this system consists of three parts: traditional water heater, Ayla module and APP. The program of traditional water heater is designed by manufacturer. This article focuses on the program design of Ayla module and iOS APP.
Software Design of Traditional Water HeaterThe core of the traditional water heater is microcontroller STM32F103VBT6 that has been encapsulated inside the traditional water heater. Its program is designed by manufacturer and it is not the focus of this article. Traditional water heater can be monitored and controlled by Ayla module through serial communication. Ayla module sends control commands to traditional water heater using serial interface. Then, traditional water heater performs control commands.
Software Design of Ayla ModuleProgram of Ayla module includes MCU program and wireless module program. The program in wireless module which is provided by Ayla Networks can be automatically upgraded through Over the Air Technology (OTA). We concentrate on the design of MCU program in this article. The program of MCU is designed to realize data interaction between SPI interface of wireless module and serial interface of traditional water heater. The control commands from SPI interface is converted to serial communication format according to serial communication protocol. In this way, traditional water heater can be controlled.The microcontroller of Ayla Module is STM32F100RBT6B. Figure 5 is the flow chart of MCU. After Ayla Module starts working, MCU completes system initialization first and the timer whose timing period is 1s goes off. Then, MCU waits for interrupt event occurrence. If interrupt event occurs, the MCU runs the corresponding interrupt routine.Architecture diagram of this system is shown in F...