How the idea come
I developed this IrTransceiver because I have many micro controller automation projects (as swimming pool pump controller, electric motor PF corrector, garden light intensity and schedule controller etc) which by size imposed and/or by the fact that are galvanic connected to mains don't allow a embedded terminal but still I wanted to be able to read internal measured values and to change parameters.
I tried to find a cheap interface, reliable, small, wireless and electric noise proof to connect this devices occasionally or permanently to a terminal.
In what consists the solution
For the application, this IrTransceiver is like a black box, with a I2C interface and a set of commands for sending or receiving data on request. Besides sending/receiving data I implemented a set of other useful commands.
The IrTransceivers connects one to each other by infrared, data and commands being sent both ways completely transparent for the microcontrollers.
When transfers are ready, bots sender and beneficiary of data are informed in polling or by hardware interrupts.
Basic configuration and basic operation
The basic configuration consists of a master micro controller connected by I2C to a master IrTransceiver which will be wireless linked to a slave microcontroller connected by I2C to a slave IrTransceiver.
Once given a command by master micro controller, let's say to send a data stream of 32 bytes over Infra Red connection to the slave controller, the master IrTransceiver contacts the slave IrTransceiver by Infra Red.
The protocol of communication between the 2 IrTransceivers is transparrent to both microcontrollers, but is bulletproof reliable and data is sent and verifyed at destination by IrTransceiver being packed with a 16bit CRC checksum.
After safely receiving the data stream the slave IrTransceiver informs the slave microcontroller of it's availability. This is done by setting a specific flag in STATUS register, or/and by hardware interrupt.
The slave microcontroller then reads the data stream through I2C. The master IrTransceiver is informed about data being received by slave IrTransceiver and about it being read. It informs the master microcontroller of data delivery by setting a specific bit in STATUS register or/and by hardware interrupt.
Network capabilities
The IrTransceivers can be assigned with an internal address for the IR network. One network consist of one master with address 0 and 1 up to 31 slaves, being assigned with addresses from 1 to 31.
Each data or command transfer is initiated by master and is dedicated to one specific IR peer.
Data integrity
I build this transceiver for industrial control so the integrity of data sent and received was a must.
Transceivers pack every stream bay 16bit CRC and confirm data transfer only when it's integrity is verified.
Because I2C communication doesn't have a data integrity check, a 8bit CRC checksum can be optionally set for all transfers over I2C between microcontroller and IrTransceiver.
This ensures that any data transfers between microcontrollers through this interface is undistorted.
Size
PCB size of IrTransceiver is 35x29mm. On short size a 6pin header is present.
Thea header pins are +5V, GND, SCL, SDA, /INT, /RESET.
One side is equipped with the IR receiver and transmitter and must be visually in contact with other transceiver/s.
Distance
I tested the connection inside, it is working perfect at 10m which was more than I expected.
Due to wall reflections in one 5mx5m room it works doesn't matter of the direction the transmitter/receiver is aimed.
Interferrence
Being a Infra Red connection it doesn't interfere with any radio communication as GSM or wireless radio remotes, and what is the most important is imune to electric noise made by big electric motors or relays or whatever.
Being a custom protocol it cannot interfere with domestic IR remotes as TV, VCR etc remotes.
Speed
The goal of this project was reliability and data integrity and then the speed. The communication between IrTransceivers works at 2400bps. Due to CRC, protocol headers, acknowledges, retries the real data speed transfer varies. The best in good aim position between transceivers is about 1800bps.
It is not intended to transfer photo or video streams, but critical industrial data and parameters.
I use this IrTransceiver since 2013 when it was operational.
More about I2C protocol between microcontroller and IrTransceiver here:
http://cmorariu.wix.com/projects#!irtransceiver/jazaz