Preet's Relay Controller Project

From Embedded Systems Learning Academy
Revision as of 19:14, 19 September 2012 by Preet (talk | contribs) (Created page with "<font color="red"> This article is under construction. You may have found it because you're lucky but it's not linked anywhere, and is not complete. </font> == Overview == T...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This article is under construction. You may have found it because you're lucky but it's not linked anywhere, and is not complete.

Overview

The motivation of this project is to control a re-usable relay board over the network (or even over the internet).



Features

Web-based Controls

The relay controller exposes its interface over a TCP/IP connection. It provides a simple, human readable command-line interface. This command-line interface is encapsulated in a web GUI* that provides simpler controls to an end-user. The idea is that a person without any knowledge of the controller should be able to interact with the system.

Logs

There are several forms of logs that get saved in the file system accessible by FAT* library. The controller software saves the log in the on-board 1Mb SPI flash memory. This provides capability to save data without relying on an external SD card.

Hourly Sensor Logs

Every hour, temperature and light sensor value is logged into a file in the format:
Timestamp, Temperature in Fahrenheit, Light Percent 9/16/2014, 76.25, 10

Nightly Relay Logs

Every night, a log message saves the number of minutes the relays were ON in a 24-hour period.

Debugging Logs

Debugging and informational logs also get saved on demand or if the log-buffer becomes full. This can open the gate for long-term testing and debugging to ensure that the board is operating as expected.



Implementation

Hardware

In the hardware level, SJ-One Board is used with an RN-XV Wifi module. The wifi module is a simple UART based TCP/IP solution. The software initializes the wifi module, sets up a TCP/IP port to listen to, and simply waits for data or command from UART and responds back to the command.

Embedded Software

FreeRTOS template project was used to provide the software framework. This software framework was extended by adding more command-line handlers.

Front-End Web

While the relay controller software can interact with a command-line interface, a web page encapsulates command with simple buttons. This provides a non-technical person the capability to control the system.



Testing

The testing was performed manually by verifying the command and expected output. The steps were:

  • Program the software
  • Test each command through UART interface
  • Test each command through Wifi interface



Conclusion

A very low powered relay system was developed that has capability to be controlled over the Internet. This solution is a completely encapsulated system that can be controlled by a USB/UART interface, or over a TCP/IP interface.