My HC-SR04 sensor box
thingiverse
My HC-SR04 Sensor Box I designed this box that will house a HC-SR04 ultrasonic sensor, an Arduino Nano, a MP1584EN adjustable 3A bucking power supply, a Songle SRD-05VDC-SL-C relay, a 5mm LED, and 2 two-pole PCB screw terminals. The sketch and schematic are included. My goal was to create an ultrasonic eye that I can install into a packaging machine with 24-volt DC power supply and a NO dry contact signal. I tried to make it look industrial, even though I am using hobby-grade components. Industrial-grade ultrasonic sensors cost upwards of $500.00, but I think I can mimic their operation for about $10.00. The HC-SR04 looks suspiciously similar in the $500.00 units. There is a box, a lid, and a door. It measures 60mm x 60mm x 30mm when assembled, with a through hole in the middle for an 8-32 screw that holds the lid on and provides a mounting point. I have two different doors; one has a 15mm access hole where you can program the Nano, and the other door has a 6mm hole just big enough for a small four-conductor cable to pass through. I also designed a set of eyes or focusing rings that are sleeves that slide over the transmitter and receiver round housings, trying to extend them a little. I am trying to narrow the cone or funnel shape of the sensing area, making it more focused instead of fanning out so much, like a spotlight rather than a floodlight. The HC-SR04 will slide into two holes where you need to straighten out the four little pins. The wiring will hold it in place, but it will be loose; add a blob of silicone to keep it secure. The relay will fit upside down into its pocket with five pins sticking up. The 5mm LED is press-fit into its hole, which is tight. The MP1584EN slides into its channels over the Nano, and both are held in place by little locking tabs. The Arduino relay circuit I used comes from here: https://www.instructables.com/id/Arduino-Relay-Circuit/. The four-pole terminal fits into its pocket with wires soldered to the pins on the bottom side. All of these components should hold themselves in position; if you're nervous about them moving, add a drop of super glue to each one. I like these little PCB screw terminals, KF301-2P, which have locking tabs so you can lock them together and form longer terminal strips, with a 5mm pitch. I soldered wires to the PCB terminals and ran the wires where they needed to go. I wanted to be able to pre-wire this up and drop the components into the housing. The four screw terminals are wiring connections to the outside world, to the packaging machine: 24-volt DC power supply and ground, and two wires for a NO dry contact signal. If you need a NC contact, choose the NC terminal on the relay instead of the NO terminal like I did. The sensing range is set to 48 inches, and I have an off-delay timer set to four seconds in the sketch. I considered adding two pots to make these values variable but ran out of room in the housing so went with preset four feet and four seconds. If you need to change it, get your laptop and program the Nano; distance is set on line 20 and the off delay time on line 23. Components: 1 Arduino Nano 1 HC-SR04 sensor 1 MP1584EN power supply 1 Songle SRD-05VDC-SL-C relay 1 BC548 transistor 1 1N4007 diode 1 LED 1 330 ohm resistor 1 2.2k ohm resistor 2 KF301-2P screw terminals 1 8-32 x 1 ½ inch screw, nut, washer Printed in PLA with .2 layer and 25% infill
With this file you will be able to print My HC-SR04 sensor box with your 3D printer. Click on the button and save the file on your computer to work, edit or customize your design. You can also find more 3D designs for printers on My HC-SR04 sensor box.