Home Projects Shop Learn About Contact Blog

Infrared Gun Board: How to Assemble

Click Here for pdf assembly instructons.
Step by step instructions are posted below.

IR Gun Schematic

If you do not have a pre-programmed ATtiny24 microprocessor, which is included in the kit, please download this hex file:
IR Gun Software Hex File

The source code for this project is available here:
IR Gun Software Source Code File


Included in Kit
  • 1 ATtiny 24.Atmel microcontroller (pre-programmed)
  • 1 1.0 uF ceramic capacitor
  • 2 IR LED lights
  • 3 27 Ohm Resistors
  • 1 Speaker
  • 1 Battery Holder
  • Pushbutton
Required Tools:
  • Solder Iron
  • Small Wire Cutters
Recommended Tools:
  • Needle Nose Pliers
  • Small Vise or PCB holder with rubber pads
  • Magnified Lamp
Required Materials(Not Included in Kit):
  • Solder

Electronic Assembly Instructions

IR Gun Parts Placement

Note that D2, D3 and R4 are optional. These components produce a visible red light flash when the trigger is pressed and may not be visible in some enclosures.

Step 1
Components can be soldered to the PCB in any order but may be easier as follows:

- D3 on the back of the board.

- D2 on the front of the board.

- R1, R2 and R4.

- C1

- Socket for U1: Be careful to put the notch nearest the diodes as shown on the silkscreen.
While this has no effect on the circuit, you will be less likely to insert U1 in the wrong direction later.
Step 2:

-D1 Install the IR LED with the long lead nearest R1 as shown. Leave enough lead length to be able to bend D1 over the edge of the board.

Step 3:

-SP1 Install the small speaker on the opposite end of the board as D1. The leads are short so be careful to only bend a little on the ends. Leave enough lead length for the speaker to fit over the edge of the board. It does not matter which lead is soldered into each of the holes.

Step 4:

- Pushbutton Cut the 12 inch wire that comes in the kit in half. Strip about 1/8 inch of insulation from each end of the two wires. Solder one end of each wire to the lugs of the pushbutton as shown.
Step 5:

- Battery Holder: There are two types of battery holder. They both hook up the same electrically. The long skinny type will fit into the ½ inch PVC while the shorter type is attached to the outside of the PVC. Solder the battery holder wires as shown. Be careful that the red and black wires are in the correct positions. Solder the pushbutton leads as shown. The wires can go in either position as the switch has no polarity.

IR Gun with short battery holder.

IR Gun with long battery holder
Step 6:

-U1: Insert U1 into the 14 pin socket. Make sure that the notch in U1 is in the same position as the notch in the socket and silkscreen. The electronics assembly is now complete.

You can insert two AAA batteries in the battery holder to test the device. As soon as the batteries are connected, the speaker will produce a deedle-deedle sound.

Next press the pushbutton (trigger) and you should hear a shooting sound effect. If you have a target available, you can point the IR LED at the target and press the trigger. If the target responds, then all is well.

Mechanical Assembly

The IR gun electronics can be installed into a variety of packages from toy guns to simple boxes. For a simple PVC pipe design, click here.


Operation of the IR Gun is very simple. Just point the IR LED at a target and press the trigger pushbutton.

Each gun has an ID code that has a value of 0 through 15. The ID can be set manually as follows:

-Hold down the trigger while inserting the batteries. A “BeeBoop” sound will be heard while the trigger is pressed.
-Release the trigger. The “BeeBoop” sound will stop. You now have 5 seconds to enter the ID number.
-Press and release the trigger for the number of times as the desired ID number.
-Wait for 5 seconds with the trigger released.
-The gun will beep the ID number. Count the beeps to determine the ID.

Note: The micro controller goes into sleep mode when the trigger is not pressed in order to maximize battery life. However, if the unit is not going to be used for an extended period, the batteries should be removed from the battery holder in case they should leak.

IR Gun Parts List

Quantity Schematic
Description Picture
1 U1 ATTINY24. Atmel microcontroller.
1 C1 1.0 uF ceramic Capacitor
Everlight IR333C/H0/L10
Lite-On Inc LTL-709E
3 R1, R2, R3 27 Ohm Resistor
Stackpole Electronics CF14JT27R0
1 SP1 Speaker
Kobitone 254-EMB15-RO
1 P1, P2 Battery Holder
Eagle Plastic Devices 122-0421-GR
Eagle Plastic Devices 12BH425-GR

1 P4, P5 Pushbutton
E-Switch PS1024ARED


How to Solder


How to Read Resistor Values


This work is licensed under a Creative Commons Attribution 4.0 International License