Even though the Arduino will hide inside the Nerfgun, it’s still a good idea to make it removable, in case we want to reprogram it. I just used some left over prototyping board and soldered some female pin header onto it so the Arduino can slide right in. Then we can solder all the wires of the components to the female pin headers.
All Connections to the Arduino
|Servo||Dataline (yellow or orange)||D5|
|LED||Long leg + Resistor||D9|
|GND + 10 kOhm Resistor||GND|
We need to connect a minimum of 13 wires to the Arduino with a common ground. I chose to make 14 and soldered to GND wires, one that goes up to all the other components and one that goes directly to the USB cable.
This is also a good step to hot glue the USB cable. To make it easy we can just use the groove of the handle and feed the cable through. We apply a descent amount of hot melt adhesive to the cable to hold it in position. The socket will not be glued to the gun, this way it’s easier to get access to the wiring and the Arduino.