Introduction
This project details how to connect Opto-Isolated Relay Board to an AVR development board
Looking for the AVR source code? Here you go RelayControllerSource and with an RS232 terminal session RelayControllerSource2
What is needed
Hardware | Description |
---|---|
Atmel AVR Microcontroller Development System This kit was kindly provided to me by the friendly people over at http://www.btinternet.com/~e2one/avrbrd/ |
|
8×24 LCD Display Details of how to wire up a 8×24 display to the development board can be found at http://www.btinternet.com/~e2one/avrbrd/ (see the 8×24 LCD Project). If you use a smaller display then you will have to modifying the code to suit. |
|
Relay board Opto-Isolated Relay Board, includes 4 channels for remote control of Mains appliances and circuits. Ideal for home control and industrial applications. Each channel is controlled by a TTL input and can easily be controlled by a microcontroller or control system. et-opto_relay4_manual.pdf |
|
Relay cable Cable to wire the AVR board to the relay board |
So, to wire a suitable cable to connect the relay board to the 'LCD' connector on the 2313 board, the following mapping can be used
2313 LCD Connector | 6 Pin IDC |
---|---|
1 | Vcc |
3 | Out0 - PB2 |
5 | Out1 - PB3 |
12 | Out2 - PB4 |
13 | Out3 - PB7 |
8 | Gnd |
The relay board itself requires a DC supply in the region of 12V. When running the relay board from the 2313 dev board, the easiest way to get 12V for the relay board is to leech 12V from the little two pin molex (marked 'DCIN') that is beside the DC power jack connector on the 2313 board (as shown in the picture at the top of this page).
The Software
As the ATMEL AT90S2313 only has 2k of code space the demo version of BASCOM can be used without hitting any of its restrictions.