Introduction

This project details how to connect Opto-Isolated Relay Board to an AVR development board

[#Beginning of Shooting Data Section]
Nikon COOLPIX3100
Focal Length: 5.8mm
White Balance: Auto
Digital Zoom Ratio: 1.00
2005/02/27 15:14:05
Exposure Mode: Programmed Auto
AF Mode: AF-S
Saturation comp: 0
JPEG (8-bit) Normal
Metering Mode: Multi-Pattern
Tone Comp: Auto
Sharpening: Auto
Image Size:  640 x 480
1/60.1 sec - F/2.8
Flash Sync Mode: Red Eye Reduction
Noise Reduction: OFF
Color
Exposure Comp.: 0 EV
ConverterLens: None
Sensitivity: Auto
...

Looking for the AVR source code? Here you go RelayControllerSource and with an RS232 terminal session RelayControllerSource2

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
relaycable.jpg Relay cable
Cable to wire the AVR board to the relay board

Schematic for the AVR board does not align with the actual hardware.

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 Connector6 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.