10 ms·
Show HN: Raspberry Pi garage door opener
- zaabis 6y agoGarage door opener using raspberry pi and web technologies. Features: - Web interface with multiple user accounts. - React/Material UI front end. - NodeJS backend with registration/login flows.
- theamk 6y ago.. all data stored on SD card and lost during one of power outages / if someone bumps the cable / if it gets too hot in the summer
- zaabis 6y agoOptional Firebase integration is a potential feature ;)
- ThePowerOfFuet 6y agoSo much for this: > Works locally only, via WLAN (it's a feature, not a bug!)
- zaabis 6y agoYeap, the opposite of all the IoT solutions. This can be again an optional feature, preferred for security
- GordonS 6y agoNot sure this actually happens. In practice. A friend works at an oil company, and they have dozens of rpis deployed on offshore rigs, and in land rigs in the middle east. They are working in pretty harsh conditions, with high salinity, sand in the air, high vibrations, very low temps, very high temps... and yet over the 6 years they have been running, not 1 has had a fault. All use SD cards, and they haven't been glued in or secured in any way. At this point, the RPi SD-card fault thing is becoming a meme.
- kavalg 6y agoNot my experience with commodity SD card, power supply and stock settings of Raspbian. They must be using some "secret sauce" to make them run 6 years without outages. I would suspect some industrial grade SD card (SLC or at least AMLC), high quality power supply (e.g. UPS with surge protection) and also some way to limit writes on the SD-card.
- GordonS 6y agoThey are running stock Raspbian. For SD cards, they are using a mix of SanDisk, Kingston and others - consumer versions. They are indeed using UPS', and the workloads naturally have a low write load.
- soylentcola 6y agoThat's nuts. I had to replace some old Cisco media players that we used as digital schedule boards outside of ~20 classrooms. The Cisco players were quite old and only needed to load a webpage that pulled schedule info from elsewhere and displayed it in the proper format. I decided to do this with RPi and went through several revisions as I learned/relearned a lot about Linux. The first version was built on full Raspbian and added a basic server listening on some port or another so I could remotely reboot the things by clicking links on a simple website I put together. That build would usually crap out after a few months and the Pis would stop booting fully from the Sandisk MicroSD cards. Most recent rev was built from the "Lite" version of Raspbian as I was looking to stay slim and have less stuff to update/run in the background/cause issues with the basic operation of a device that only needed to boot, load Chromium, and open a webpage defined in the startup script. Those have been a lot more stable (no more reimaging a card here and there every month or two) but they still occasionally crap out and a reimage is the only option (maybe once every 6-8 months). This is in an air conditioned building with stable power, wired LAN connection, and fast SD cards. I can't imagine they would be even this reliable running all the time in any sort of "hostile" environment or even using wireless networking. I looked into network boot but didn't really have the time or resources to set it all up on the school's network.
- 6y ago
- diffeomorphism 6y agoYou can use a usb stick instead. Are these particularly "hot summer" sensitive?
- jgaudette 6y agoCool! I did something similar and it was a fun little project.
- zaabis 6y agoYeap, started as a small project, then grew and added proper front end with user signup/login flows. user roles admin/non-admin. Built progressive web app. And planning to add more elements. Camera for live streaming etc. Do you have a repo to share?
- duxup 6y agoI recently replaced my physical garage door buttons with arcade push buttons (my kids love it) and I was thinking...."this box could hold a pi".
- metaphor 6y agoI really hope there wasn't any intent for the image to be remotely representative of actual required hardware...because if this isn't an uninsurable garage electrical fire hazard just waiting to happen, I don't know what is.
- zaabis 6y agoCan you elaborate?
- dkdk8283 6y agoCheck the todo to start: > Add laser beam switches with reflector (stops & reverses the door when interrupted, for safety reasons) Garage doors also have torque limits. If there’s an obstruction (such as a person) the door stops or reverses direction.
- zaabis 6y agoThe UI is built with that in mind. - User has to keep pressing UP/DOWN buttons in order the door to work. - If connection is lost door stops. - If there are both actions door stops. - If there are hardware actions and phone actions door stops. The beams are also considered as a feature.
- dkdk8283 6y agoSince it’s WLAN the door can operated outside line of sight. Door should reverse, otherwise someone could get pinned. I don’t have small children so I’m not personally worried, but I do question if the deviation from standard automatic door UX is a good decision.
- sq_ 6y agoThis definitely seems like one of those situations where following what the industry has been doing with regards to system behaviors is the best way to go. Garage door manufacturers have probably seen it all at this point, and I imagine just about every behavior has a tragic story (and probably a big lawsuit) behind its being implemented.
- simlan 6y agoReally cool. How do you trigger the opening ? Just via the pwa upon entering Wi-Fi range ?
- zaabis 6y agoYeap exactly.
- melvinroest 6y agoRelated to "what raspberry pi projects can I start?" For people that are interested in raspberry pi projects. I compiled a list, mostly for myself, but if it is semi-useful for anyone else, I'd consider that a win. I scoured HN and searched on YouTube, Google and thought of my own ideas to find the rpi projects that fascinated me. https://docs.google.com/document/d/1xT6-vN4sFnRLMOdj9wC4_ESWIXbCcSA4Xo0iqJv_j0k/edit?usp=sharing https://docs.google.com/document/d/1xT6-vN4sFnRLMOdj9wC4_ESW... I'll put this project on there as well under the category "smart home". While the concerns are justified, such as insurance issues and fire hazards, I find it a cool use of what one can do with cheap hardware.
- dirktheman 6y agoIt's a cool project, but for these kind of things I'd rather use a Shelly1. Runs locally, can easily be flashed with Tasmota firmware and it connects to my Home Assistant instance. This thing has never failed me and it's only $15, way cheaper than a Pi (keep the RBPi as your Home Assistant server!)
- zaabis 6y agoThanks for sharing! Will try it out ;)
- bonzini 6y agoOr an ESP8266, using MQTT to "press" buttons on a standard garage door remote control through a relay module. I uploaded mine here: https://imgur.com/a/l2wt40w https://imgur.com/a/l2wt40w (green and blue are ground and 5V, gray and white are the pulses to the relays).
- sgt 6y agoThis is great. Question - why did you use the relays and not just the GPIO pins on the ESP to short circuit the contact on the remote for a brief moment?
- jstanley 6y agoYou can't use GPIO pins to short 2 contacts together. The best you can do is apply voltage to the contacts (which might be workable, depending on how the remote is designed). To short the contacts you need either a relay or a transistor.
- zeusly 6y agoAs someone who has built products with a Raspberry Pi, I'm not sure I would bet on a WIFI connection. I can almost guarantee you that you will sit in your car and scream bloody murder because the WIFI ist not connecting. My products had to work with a lot of other networks around and were built on a Model 3 B, maybe it has improved since then. Sadly I can't point you into the direction of solutions because we just switched to Ethernet.
- zaabis 6y agolatest ones seem much more stable. No issues so far. v >= 3b+
- TaylorAlexander 6y agoSome kind of LoRa radio would do well. This 433 mhz one would have long range with a bidirectional link. https://www.adafruit.com/product/3179 https://www.adafruit.com/product/3179
- woutr_be 6y agoVery cool project, I've been wanting to do something with my Raspberry Pi as well. I mainly wanted to focus on turning my AC units on and off. I assume I'll need some sort of IR transmitter, and possibly a receiver to understand the signals the remote is sending.
- soylentcola 6y agoIf they use IR remotes, I imagine you could plug in a network connected Pi with a USB IR blaster next to each AC unit. Then stick the IR emitter LED on the little window where the IR receiver is on the AC unit. Then it's just a matter of capturing the remote codes and setting up a way to remotely command a given Pi to send that pattern of pulses out of its IR emitter. edit: I just did a quick search and Sparkfun sell WiFi IR blaster boards for $20. I'd imagine you could find cheaper ones on Aliexpress or other places where you typically find cheap electronics. This would probably be simpler to set up versus a Pi with less things to break since it's not booting a "full" general purpose OS. https://www.sparkfun.com/products/15031 https://www.sparkfun.com/products/15031
- isbjorn16 6y agoI can't speak to the quality of this yet, but I just bought https://www.amazon.com/gp/product/B016D5L5KE/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1 https://www.amazon.com/gp/product/B016D5L5KE/ref=ppx_yo_dt_b... kit to dork around with myself. It comes with an IR transmitter and a whole host of other stuff to play with. That said, I do love adafruit and sparkfun for most purchases. My bank account doesn't, but I certainly do.
- soylentcola 6y agoOh, nice! I hadn't thought to look for multi-part kits like that but the next time I am looking for a sensor or emitter or whatever, I might check some of these kits if only because "more stuff!!" I am the same with Adafruit et al. Their stuff is tested, easier to exchange/return if broken, often ship quickly since it's domestic to the US, etc. But when I need a bunch of something I tend to order more direct/bulk. My early LED strip projects were fine with a meter or two of "Neopixels" but when I wanted many many meters for bigger stuff, it was time to order reels from Ali Express. Shipping was slower, but even if I paid an extra $20 for fast shipping, it was much, much less than ordering from Adafruit. I just had to be aware that some of this stuff may not work and returning will be next to impossible. Luckily I had no issues.
- paddlesteamer 6y agoVery nice! I only have one question: I see there are pull-up resistors connected to push buttons. Aren't there built-in pullups on RPi GPIOs? Maybe you can enable them and use fewer elements on the breadboard.
- drtse4 6y agoCan confirm that the internal pull up/down are there and most libraries can enable them (alternatively this can be done manually via terminal after each restart).
- nexuist 6y agoMight as well show off my own attempt from high school :) https://github.com/Nexuist/Doorman https://github.com/Nexuist/Doorman https://github.com/Nexuist/Doorman-Remote https://github.com/Nexuist/Doorman-Remote
- zaabis 6y agoNice, thanks for adding them
- las_balas_tres 6y agoDon't commercial garage door openers have safety mechanisms to cut out the motor if there is a blockage. e.q. if someone gets caught under the door they won't get killed by the motor still trying to close the door but will rather cut out
- zaabis 6y agoThey do, check the comments the UI has some protection already built in. The rest are feature requests.
- gruturo 6y agoCool project. I built a couple myself (albeit not with a Pi, but with some Wemos D1) and can share a few lessons learned. First of all, safeties. I was lucky to add my work to existing motorized garage doors - which already came with enough sensors, but since you are providing everything including the motor, these should be in from the very start, or in any accident you'd be held liable. Actually you may even be held liable if someone implements it from your github repo and then has an accident. I know you have a disclaimer, but I wouldn't rule out being sued. You want a sensor which detects any anomalous power draw in the motor and immediately cuts off power. Something as simple as an ACS712 (follow guides for reading an inductive load though!) which is a couple bucks (or less if you buy a bucket from China). The motor may come with built in safeties if it's meant for a garage, but this is something I'd still consider. You will want not only a sensor but also a couple emergency buttons on both sides of the door which instantly stop all movement. While you're there, activating a couple very visible flashing LEDs for a few seconds before you start any movement is also a good safety precaution. You have 2 relays which could due to a bug or other unexpected circumstance be energized at the same time - Depending on the motor this could cause a fire, or fry your relay board/Pi. I would use one relay with its NO contact going to the DOWN motor pin, and the NC going to the UP motor pin, and connect it in series with the other relay which cuts all power. This way it's not possible to energize both in any case (beware: even abruptly switching directions may ruin a motor - always cut power first, THEN toggle direction, THEN provide power again) Happy to discuss a few more points if you feel like.
- rootusrootus 6y agoAs someone who owns a normal Liftmaster garage door opener that malfunctioned last week and destroyed the door because it didn't adequately sense that the door was blocked, I have to say I don't think I'd want to homebrew my own opener. Especially not with kids in the house.
- sgt 6y agoCool. I have been thinking about this myself recently, and I had a different approach in mind. If you already have a remote (which I suppose is mostly the case with garage doors), why not integrate with the remote directly? I.e. clone an additional remote, then integrate with the buttons from a micro-controller to open/close. In addition, have some kind of way of detecting whether the door is open or closed, so I suppose the remote can be placed near the motor. That way you can also easily integrate into your house's alarm system later on if need be, as it's most likely linked to your remote.
- nirav72 6y agoOne of my first projects with the gen 1 raspberry pi in 2013 was controlling my garage door opener by pulsing a optocoupler and that could be triggered via a simple http endpoint that would run a out script It worked well , but didn't quite pass the WAF. So switched to a commercial product that had a mobile app. (zwave/Samsung smart things)
- buescher 6y agoI'm not going to point out the big things wrong with this project, because someone might think "oh, if I just fix those things I'm good". I will say I think it's the worst garage door opener project I've seen on hackernews yet. Nothing wrong with messing around with motors in the workshop but the author of this one should keep his project away from other human beings. Probably pets too. Here's the CPSC page on garage door openers: https://www.cpsc.gov/Regulations-Laws--Standards/Voluntary-Standards/Topics/Garage-Door-OperatorsGate-Operators https://www.cpsc.gov/Regulations-Laws--Standards/Voluntary-S... The pdf "Update of Automatic Garage Door and Garage Door Openers Entrapment Incidents. October 7, 2003" is a good introduction to the real, not internet-smart-guy-hypothetical, hazards of automatic door operation. It includes a summary of every entrapment incident found by the CPSC from 1982-2003. The UL standard for openers UL325 is incorporated more or less verbatim into the mandatory standard 16 CFR Part 1211: https://www.law.cornell.edu/cfr/text/16/part-1211/subpart-A https://www.law.cornell.edu/cfr/text/16/part-1211/subpart-A Have fun. This is the standard that an opener that retails for $99 on sale in the US has been engineered to meet. European and other international standards differ in particulars but are quite similar. No, you will not accidentally meet real-world safety standards with your project by dint of your sterling virtue, high intelligence, wisdom in the ways of the world, and impeccable engineering skills. Nor will you do so by adding a couple more features. Safety is the result of deliberate processes.
- kahlonel 6y agoCalm down, please. It's "experimental". No sane person is actually going to use this.
- gambiting 6y ago>>No sane person is actually going to use this. What makes you so sure?? I see people using such "experimental" devices all the time. Unless you tell someone explicitly why it's a bad idea they won't know.
- beervirus 6y agoYeah I thought this was going to be a page about controlling an existing garage door opener via a Raspberry Pi. This is nuts.
- rootusrootus 6y agoI want to say cool project, because I love home automation and have done a fair bit in my own home (though mostly just lights...). But having recently experienced a failure with my own garage door opener that destroyed the door and could have seriously injured a person, I think I'd be reluctant to completely homebrew my own solution.
- exabrial 6y agoThis is lacking some very critical safety systems such as breakbeam detection (someone walks into the path of a closing door), endstops (the system unexpectedly travels to the end of the track), torque/motor stall monitoring (aka crushing someone to death), and door speed monitor (the door starts moving faster than the motors are moving it)
- rubatuga 6y agoExactly, I was looking at the schematic and my jaw dropped when I saw it was connected directly to a mains motor.
- linsomniac 6y agoIs there anywhere you can get hardware that can interface with HomeLink as a receiver, like to signal an opener like this, or to trigger smart home actions like turn on the lights?
- blackfawn 6y agoI'd recommend driving a FET or two to connect at the push button(s) (i.e. GPIO is "pushing the button") rather than the relay board to drive the motor. Not only is jumping the switch(es) more simple, you also stay on the low voltage side of things and any safeties built in would still be present. ETA: by push buttons, I mean the "normal" garage door buttons that would open and close the door (typically on a wall in the garage.) these typically use some low power, e.g. 12-20V. And the safeties the manufacturer would have built in would still work as it'd be as if you were pressing the manufacturer's open/close button, but remotely.
- rtkwe 6y agoThere's no safeties built in according to their schematic they're directly spinning the motor at full speed with no current monitoring or feedback to the actual position of the door.
- blackfawn 6y agoExactly. What I'm saying is they should NOT be driving the motor directly like they've drawn up but instead, they should be "pressing the button via GPIO" on the real door opener attached to the garage wall.
- catchmeifyoucan 6y agoAn easier way to achieve this using a raspberry pi would be to simply have the pi press the right button on the garage remote. I took a pass at this a few years ago. Compared to messing with larger electronics, it’s a much easier setup. https://www.heyraviteja.com/post/weekend-projects/open-garage/ https://www.heyraviteja.com/post/weekend-projects/open-garag...
- rtkwe 6y agoThere are direct hookups on the back of basically every garage door opener for connecting wall switches you could use too to make it even simpler.
- catchmeifyoucan 6y agoWould you need extra electrical components? The cool thing with the garage remote approach is that you don’t need any extra electronics, just plain microcontroller.
- ianlevesque 6y agoJust a simple relay between the contacts.
- deleted 6y ago[deleted]
- deleted 6y ago[deleted]
- scurth 6y agoI love these types of projects. It is not rocket science, nor anyhow complicated to solve and from security standpoint way better than any off the shelf solution. Think about it: you grant access to a random company, with people working there you do not know, security standards out of your control, and if they decide to change the product you simply have to deal with it. I did a similar solution a while ago, documented all the steps to replicate such setup: https://www.sascha-curth.de/projekte/004_Garagentor.html https://www.sascha-curth.de/projekte/004_Garagentor.html I wrote it in german, but chrome/google translate is tested for English, Spanish and Portuguese. And comments/remarks are welcome via github issues.