The latest version of this article is now on the documentation wiki.
The USB Infrared Toy contains a self-test that’s not documented in the original how-to. The self-test is used to detect dead hardware after manufacturing.
To use the self-test, open a terminal program to the USB IR Toy’s serial port and type ‘t’ or ‘T’. If the test is successful the IR Toy will respond ‘V101’, where 101 is the firmware version.
If the test fails, it responds FAIn where n is an ASCII representation of a binary error code. That boils down to this:
- FAI1 – IR receiver error (error bit 0)
- FAI2 – IR LED error (error bit 1)
- FAI3 – both errors (error bits 0 & 1)
Error and self-test details follow the break.
The self-test is intended to be a quick way for Seeed to weed out bad IR Toys before shipping. Here’s the self-test in the code, you can follow along with the links below.
The self-test verifies the PIC microcontroller operation – does it connect to a PC and enumerate properly. If so, the crystal (Q1) and caps (C5,6), USB caps (C3), reset resistor and diode (R1, D1), and USB jack (J1) are probably stuck on the board properly.
Second, it tests the IR receiver. The receiver has an internal pull-up resistor that should hold the attached PIC pin high (1). If it doesn’t, there could be an active remote control in the area, or a problem with the receiver (RX) or power filter (C4, R3).
Finally, the self-test starts the PIC PWM at 38kHz and tests the IR LED. The 38kHz IR light should activate the receiver, and the connected PIC pin should now be low (0). If the PIC pin is still high, there could be a problem with the IR LED, current limiting resistor (R4), transistor (T1), or transistor base resistor (R5). This test will also fail if there’s nothing to reflect the IR light back to the receiver, try pointing it at a sheet of white paper to verify any failures.
If the test was successful, the indicator LED (I) lights for confirmation and inspection. The IR transmitter stays active so it can be checked with a digital camera.
There was a bug in the first preorder of USB IR Toys. Despite a backwards LEDs, the self-test still passed. We’re guessing that enough current leaked though the IR LED to blink it dimly despite being backwards. We’re not sure how to test for this. The self-test is designed to verify that parts function when they’re placed correctly.