Wireless Serial Camera

From rlab.org.uk
Jump to: navigation, search

Developing firmware for the wireless serial camera board that Ciseco developed for Gary Fletcher.

The RFµ uses the standard Arduino IDE and Adafruit provide a library to interface with the camera. We had the camera's RX and TX on pins 6 and 5 a mosfet cutting the camera's power on pin A1, and the PIR on pin 2 (one of the level change interrupt enabled pins).

The basic software is easy. The AVR sets up the camera, takes a picture, then streams it from the camera to the radio (via the hardware UART). UART is talking to the radio.


The main issue is the is no feedback from the radio if you are transmitting too fast. Trial and error suggests that transmuting 12 bytes (the radio packet size), then delaying 3 milliseconds gives the best performance at close range. To extent the radio's range you need to significantly reduce this rate.

The camera's don't seem to apply the resolution changes unless you have done a .getVersion() (And as per the documentation they need .reset() to apply).

Turning the camera's power off can trip the PIR. This could be solved in the electronics, but a simple time-out works.

Supporting multiple cameras with both reasonable data rates and reasonable latency on an unreliable connection proved the most troubling. Whilst dropped or out of order packets are rare and manageable (so long as you keep below the radios max transmit speed), you sometimes get a significant and variable delay between transition and reception. This meant we needed to mark the end of transmission to efficiently implement time slicing.

We found the radios reliable enough that we could just do a crc32 to drop the occasional invalid picture, without needing to implement any form of ACK or retransmission.


The cameras take 70mA to the RFµ's 30mA so buffering the picture to a SD-card and turning the camera as soon as possible could save power, especially at slower datarates as the number or range of the nodes goes up.



Personal tools