Inter-robot communication may facilitate interesting cooperative behaviors. The Pololu Zumo robot platform has no inter-robot communication facility as-designed. I am interested in repurposing the IR proximity sensors and the IR illuminators to receive and send serial data.
The following are a collection of my notes as I work through the project.
The IR receive example included with the Zumo seems very hand built and doesn’t include instructions for sending data. Instead, I am using the Arduino-IRremote library that I found in the Arduino IDE library manager dialog. IRremote library includes both send and receive capabilities.
Configuration
Configuring IRremote library requires several steps:
- Choosing a timer: The 32u4 processor on the Zumo includes four timers. The proximity sensors use timer3 as written by Pololu, so I have configured IRremote library to do the same.
- Sensor pins: Front Proximity (pin 22), Left Proximity (pin 20), Right Proximity (4). Make sure the jumpers on the front sensor daughterboard are set to the outboard position to enable the proximity sensors.
- IR Sensor Emitter Control (pin 11)
To accomplish these points, I edited the board configuration file in the IRremote library installation folder. I un-commented the timer3 configuration in the 32U4 board definition and commented out timer4. I also edited the OCA3 pin setting to match the setting in the Pololu Zumo code base from their GitHub site.
Testing
The IRremoteInfo example prints out the current configuration settings to validate that the changes to the board configuration actually entered the compiled configuration. I checked these settings matched the intended configurations bulleted above.
Receiving IR Signal
Seems to work. My Apple TV remote seems to send NEC signals.
Sending IR Signals
Not yet configured.
Software-IR-Serial
I’m working on merging SoftwareSerial and IRRemote to provide a low-bandwidth serial IR link on a SquareWear.
Open Questions:
Which timers are available on 32u4 and which are unused on Zumo?
Which PWM available on 32u4 and unused on Zumo.
Should I bother with trying to use interrupt driven timing at all or just write a bit-banged version first?
Pin Assignments:
- IR TX – pin 3 – Hooked to IR LED through resistor.
- IR RX – pin 11 – Hooked to 38kHz receiver.
IR TX
Looks good on the logic analyzer. Changed out the sending with PWM enable.
Maybe try a different PWM to avoid stepping on Timer0 and the IR RX code?
IR RX
IR Decmodulator seems to receive IR TX, but recv always reads zeros.
Could be related to the sending PWM crushing the interrupt mask for the receiver code?
Resources: