I picked up a couple of these project boxes to enclose my esp8266 and a DHT11. I'm trying to figure how what's the common practice for running a power cable into the box.
For example, I can drill a hole large enough to fit the head of the micro-usb cable through it, but since the head is wider than the actual cable, if you tug of the cable it'll pull the esp8266 again the side of the box and eventually the cable will unplug and fall out of the box.
Professionally made equipment doesn't have this problem and it looks like they have some kind of rubber sleeve that's attached to the case and cable to secure everything.
I found things like rubber grommets but I'm wondering if there are other thing people will typically use.
That all depends on the environment. Out in the weather/rain.snow, wind/dust, then sealing glands sized to exactly fit the wire are required.
Inside a warm room, just holes to fit what ever. Subject to lots of movement and wire pulling, use grommets specifically designed for the wire size.
What will you USE to box for?
A grommet is a common way of dealing with this but it does not normally provide strain relief.
It would be wise to clamp the cable to something inside the box so that if the cable gets pulled the force will not pass to the connector and the ESP8266.
Paul_KD7HB:
That all depends on the environment. Out in the weather/rain.snow, wind/dust, then sealing glands sized to exactly fit the wire are required.
Inside a warm room, just holes to fit what ever. Subject to lots of movement and wire pulling, use grommets specifically designed for the wire size.
What will you USE to box for?
Paul
It'll be indoors. They are intended to be temp/humidity sensors throughout the house.
Thanks everyone for the quick replies. All of these ideas sounds great and give me enough to think about what I want to do. I like the zip tie idea. The waterproof grommet is probably overkill for the indoor use, but seems to offer a cleaner exterior aesthetic than the basic rubber grommet.
In one project I cut holes in the box and mounted my Arduino Uno so I could plug a USB or barrel-power plug directly into the board. I don't know if that's possible with the ESP.
You could also look for a panel-mount USB cable or panel-mount USB connector.
If the boxes are being deployed throughout the house, why are you using the USB connector?
This seems to be a semi permanent installation - and would benefit from a directly soldered power supply.
I suspect these boxes are being tucked away all over the house in dark corners - ideally never to be seen again, and the initial problem was cable/connector access & sealing.
You can still use the wall-wart, just cut the plug off and solder it to the board.
Use reputable plug packs, or you may not realise they’re an RF noise source, or a fire hazard until too late.