A Simple Arduino Leostick Relay Control Module
Some of the sites I work with a quite remote and connected by very long
wireless links which occassionally need resetting. The site fortunately has a
working SMS modem to provide out of band control, but we still needed a device
to turn the Wimax router off for 10 senconds and restore power. Also due to
very limited power options a device powered from USB and connected via USB
was very attractive. Hence this project.
Total bill of parts was less than AU$100
The project requirements were:
- simple construction
- fast construction
- reasonable cost
- USB powered
- USB controlled
- reliable
The final design used:
The sketch (LeostickSerialSw.ino):
- Initialises the input pins and configures them for output - pins 0 and 1 control the relay the others drive LEDs on the LeoStick.
- Initialises the serial port for debugging
- The loop:
- Reads a simple command language from the serial port and sets
the ports depending on the command
The command language consists of:
-
1
pin - turn a pin on
-
0
pin - turn a pin off
-
p
pin delay - turn a pin on then wait delay and turn it off
Files:
- LeostickSerialSw.ino Arduino sketch to implement the relay controller
- blink.pl An example perl program to communicate with the LeostickSerialSw on ucom0
- uleo.tar.gz A driver for accessing the Leostick on older versions of FreeBSD
Links:
- Arduino - Programming software and environment for board
- Leostick - Compact, low cost Arduino Leonardo compatible board
Back to Electronics / Blog:
OddsAndEnds: An Occassional Blog by a Specialising Non-Specialist / Twitter: @MauriceDCastro