====== 2020-05-28 - USB power relay ====== for some time now i use 4k LCD as a monitor in a living room (3D printer camera preview, music player, movies, internet, etc...). since old laptop that is connected to it has fans, i hibernate it whenever it is not in active use, to reduce noise-pollution (especially important at night time!). when i do so, LCD is out of signal, but still displays "waiting for input" window, bouncing back and forth the screen for 5 more minutes, before deciding to power off itself. this was super annoying when you go to sleep and just hibernated laptop. i just ended up turning on and off LCD manually each time PC was turned of or off. looked like a great place for automation, and since it is [[wp>covid-19]] time -- there was extra time for such details! this is how [[https://github.com/el-bart/mini/tree/master/usb_power_relay|USB power relay]] project has started. ===== electronics ===== the important part was to get parts that i already have at home. this was early in into a pandemic, so i wanted to minimize risk and keep traveling/ordering things to a bare minimum. the idea was simple -- use 5V relay, power from USB port of a laptop. if laptop hibernates, power is lost and relay disconnects LCD power cable. when it gets back on, relay re-connects the power and LCD is back on. {{:blog:2020:05:28:usb_power_relay.png?400|PCB concept}} old power supply cord and a random universal PCB from a closed + a relay and diode... and we're good to go! :) {{:blog:2020:05:28:low_img_20200413_220130.jpg?400|mounted on a cable}} {{:blog:2020:05:28:low_img_20200413_214440.jpg?400|insulation of wires}} {{:blog:2020:05:28:low_img_20200413_214440.jpg?400|USB cable}} {{:blog:2020:05:28:low_img_20200413_213648.jpg?400|the board}} ===== enclosure ===== ... or the killer app for 3D printing! :) quick model in [[wp>OpenSCAD]], and we're good! {{:blog:2020:05:28:usb_power_relay_box.png?600|OpenSCAD enclosure model}} {{:blog:2020:05:28:low_img_20200415_112021.jpg?400|opened enclosure}} {{:blog:2020:05:28:low_img_20200415_112032.jpg?400|closed enclosure}} ===== tadam! ===== and we're basically done! :) {{:blog:2020:05:28:low_img_20200415_204135.jpg?400|final product}} after connecting to the laptop, it all worked like a charm! :) the device happily works for well over a month now. hail the new, home automation! ;)