So far our hoop will just light up all the time. Using an IR sensor and IR LED we can make the NeoPixels light up whenever we score.
The IR LED pulses out IR light (940nm wavelength) at 38KHz, same as an IR remote. The IR receiver will pick up the signal as long as it can 'see' the LED. When the basketball goes through the hoop, the sensor will say it can't see the LED any more because its blocked - thats how we know it's time to light up the LEDs.
This diagram uses the Gemma v2 but you can also use the Gemma M0 with the exact same wiring!
Step One:
Solder a red wire to the 5V pin on the IR sensor. Solder a black wire to the Ground pin on the temperature sensor. Solder a yellow wire to the Data pin on the temperature sensor. Finally cover these connections with heat shrink tubing.Step Two:
Solder a black wire to the Ground lead on the LED. The ground lead is the shorter one. Next solder a yellow wire to the longer lead on the LED. Put a small bit of heat shrink tubing on both of the connections. Also put some heat shrink tubing over the LED to narrow its beam.Step Three:
Solder the black Ground wires from both the IR Sensor and IR LED to the Ground pad on the Gemma. Solder the yellow data wire that leads from the LED to D0 on the Gemma. Solder the red 5V pin on the IR sensor to the Vout pin on the Gemma. Finally solder the yellow data cable from the IR sensor to D2 on the Gemma.Text editor powered by tinymce.