I outlined a desire to build an ultrasonic sensor for the garage to tell me if I’ve brought in the compost bin or not, so I decided to obsess over this for a little while, and we’re finally done!
I had a few requirements for this:
Somewhat professional looking finish
Weatherproof casing (The garage shifts humidity a lot!)
Custom PCB
Non-USB-C power
JST XH connectors
I first started ordering the parts, designing the layout in EasyEDA, and breadboarding the solution. I went with an M5Stamp C3U, and an HS-SR04 sensor from Digikey. A JST XH/Dupont connector kit and nicely sized project box from Amazon, and a the DC barrel jack and adapter from Aliexpress. While waiting for components I designed the layout as below and started drawing up the PCB design:
I wired the thing on the breadboard using a modified USB cable as a pseudo bench power supply, knowing I was aiming for powering this using a 5V1A DC power adapter. And surprisingly, it worked first try! So with that in mind, I finalized my PCB design and placed my JLCPCB order - With a total cost of less than $5 Canadian I had 5 copies of my PCB coming to me.
EasyEDA made things really simple with the autorouting feature for the connections, and a few weeks later these beauties showed up. They probably would have came sooner but sometimes Canadian customs takes it’s time. I got to work soldering the components on board, getting my connectors attached, and testing things out. It was a big relief knowing my design was functional!
From there I spent some time cutting the project box to get the external connectors to fit, and other than having to 3D print a few parts to stabilize the ultrasonic sensor in the case, it was pretty straight forward!
One final thing left is to mount it in the garage and get automations setup, but overall I’m very happy with the results of this small project. It taught me a lot about PCB design, basic circuit design, soldering, connectors, external power to ESP32 devices, CAD software, and probably a bunch of other stuff I’m forgetting. Did I need to custom design a PCB and all that jazz for this? Absolutely not. But it was fun.
I do wish my finish was better on the final product, but overall I can’t complain too much - It’s leaps and bounds above my basement automation box, and I think my only limitation was my tools available.