Next up in my Arduino Nerf sentry gun build, enclosures for the electronics. I’m using two Arduino microcontrollers, and each one has a shield and set of ScrewShields for wiring. I decided to use two Arduinos because the 7-Segment shield and MotorShield each consume a lot of pins. It would be possible to reroute some of those and adjust the libraries and code, but I’m running out of time. I’m bringing this project to Maker Faire next weekend, and I’d rather avoid explaining things to the TSA, so it needs to be in a box for shipping pretty soon!
I’ll post a full system diagram soon, but here’s the quick version: Primary Arduino reads PING))) sensor distance data, drives the 7-Segment shield for display, triggers the relay firing circuit, and sends commands to the secondary Arduino. The secondary Arduino drives the MotorShield to sweep the gun left and right, reads the two bump switches to know when to change direction, and listens to the primary Arduino to know when to stop rotating when a target has been acquired.
For the primary Arduino enclosure, I started with a cast aluminum project box. It has a few holes in it from a previous project, but that’s alright, consider it ventilation. I marked and drilled holes for screwing the Arduino in place, as well as three large holes on the side for wiring, USB access and power plug access. Standoffs would have been nice, especially if I’d tapped screw holes for them, but I went low-tech and used adhesive rubber bumpers to hold the board away from the case.
Once I’d screwed the Arduino in place with some 4/40 screws and nuts, I stacked on the 7-Segment shield and a ScrewShield for wiring (full disclosure, I’m one of the WingShield Industries guys who makes the ScrewShield). I also mounted the relay circuit board to the inside wall of the case. I ran all the wiring through the hole, and can now mount it onto the gun’s stand.
In the Maker Shed: