Target
Register hits and trigger a signal
- Difficulty
- Easy
- Time
- One hour
- Cost
- About €10
The TSOP4840 receiver detects shots from the replica, and an LED signals each hit. Three digital outputs can control external indicators or mechanisms through suitable driver circuits. The serial monitor shows one line per hit.
- Counts hits and measures the replica's actual rate of fire
- Three digital outputs for indicator or actuator circuits
- Pins and pulse length in the first lines of the sketch
What you need
| Qty | Part |
|---|---|
| 1 | Arduino Nano (ATmega328P) |
| 1 | TSOP4840 infrared receiverthe 40 kHz version |
| 1 | 100 Ω resistor + 4.7 µF capacitor |
| 1 | 5 mm red LED + 330 Ω resistor |
| 1 | Normally open push button |
Wiring
| Pin | Signal |
|---|---|
| D2 | TSOP4840 output |
| D5 | Hit LED |
| D6, D7, D8 | Outputs pulse on each hit; duration is set in the sketch |
| D4 | Reset button |
