Did you get it working?
My distance sensor gives an error when the max
Distance is reached. I.e nothing blocking it for 5 meters or so. In some arduino sketches this is implemented wrong and it tells you 0 distance.
Does it work when you put something close?
I did! Just today actually. I had to make some changes to your wiring, no idea why. I’ll try to post a wiring diagram tomorrow when I’m in front of a proper PC. Can’t do MSPaint on a laptop’s trackpad.
The short response is that I had to wire the distance sensor’s VCC to 3V3. That got the distance sensor working in the web UI. Then I couldn’t get the relay to trigger so I had to poke around with a voltmeter to find 5V relative to ground because Vin off the NodeMCU was giving me like 1.6 or 3V, don’t remember which. I could see the relay light turn red but it wasn’t triggering the relay itself until I found a 5V pin to connect it to. I figured that meant I was getting the signal to turn on but didn’t have enough voltage to cause the electromagnet inside to switch.
Not sure why my experience was different than yours–I followed all your links for purchasing the parts. Thanks again for all your help. I really don’t think I would have completed it without you.
By the way, anyone messing around with relays for the first time who doesn’t own a multimeter will be glad to know you can hear the relay click if it’s working.
Thanks for the thought. Turns out the wiring diagram above that I followed was not working in my case but I found a different pin off the NodeMCU that worked when I moved the distance sensor’s VCC to it.
it the first time i’m doing this kind of project and I’m probably doing something wrong. the esp8266 exactly fits the breadboard. I don’t extra holes to add the sensor, buzzer or relay. Any chance you can post more close up pictures or videos? really appreciate your help here
Here’s how my wiring differed from OP’s. Two changes highlighted in yellow. Not sure why mine wouldn’t work until I made these changes. (edit: @swbradshaw did some research and it’s because I have the v3 board instead of his v2)
I had the same problem so I used two breadboards side by side, highlighted here with red/green boxes in MSPaint. I’ll snug them up together (reconfigure so as to eliminate the space between the boards under the NodeMCU) for cosmetic reasons before I mount it in my garage. Sorry for bad pic, took it last night for a different purpose.
Ignore the tortilla on the carpet.
@rufusmccoot @drorengel I figured out why you are having different results than me. My write-up/diagram was based on the NodeMCU 1.0 (v2) board. I just realized, the AliExpress link I originally used was to the NodeMCU v3 board ( a newer revision). This newer v3 revision is wider and doesn’t fit on a the mini-breadboard. Also, as you have discovered, the 5V power is on a different pin. More explanation on the differences are here. I went ahead and corrected the AliExpress link, and noted that my instructions are for v2 revision. I apologize for the mix-up!
Figured it was something like that. Thanks again for all your help buddy.
@rufusmccoot @swbradshaw thanks a lot for your help. I also now use two breadboards side by side. I’m trying to flash open garage 1.0.5 bin and can’t see the AP in the wifi list after restart. Is there anyway to debug it? I used different bauds and versions and I still can’t see the AP in the list. The LED is blinking (not constantly)
I’m just starting out on garage door automation. Why do you use a distance meter to measure if the door is open instead of a reed switch like is common with other door open/closed sensors?
I also want to point out that after I flashed the firmware, I don’t have other components connected to esp8266 chip so I only boot NodeMCU without any other parts (distance sensor, relay etc’) connected. maybe is it the problem?
Connect the distance sensor - otherwise it will not work.
This topic is specifically about the OpenGarage hardware. I’d rather keep it focused on that rather than pros/cons for different types of hardware (distance sensor vs reed switch). I’m sure there are opinions on both. I’m not trying to be mean - I’m just trying to keep discussion on topic. I will say two reasons I like the distance sensor is 1) Install is quicker since everything is contained in one unit - I don’t need to attach a set of wires to a reed switch that is then mounted on the outside of the door. and 2) The distance sensor allows you to detect if a vehicle is present when the door is closed. This is an additional sensor in Home Assistant that you wouldn’t know from a reed switch.
Not trying to derail the focus of the thread, but would it be possible to just use the sensor component of this project (without the relay)? Does the relay need to be there also because the HCSR04 operates at 5V while the esp operates at 3.3v? Or how does the level-shifting take place?
@marksev1 I didn’t need to use a level shifter; I connected it to the NodeMCU +5V via VCC pin. Relay isn’t needed for the project - you just won’t be able to control the garage door. That said - perhaps ESPEasy would be a better firmware to use?
I believe the VCC on the esp is 5v
You need to at least have the distance sensor connected or it will reboot cycle. Try both @swbradshaw’s connections and mine–both diagrams above. I had the same problem until I switched to my layout (depends on your version of the NodeMCU board).
You don’t have to have the relay or buzzer connected for it to boot and get configured to your WiFi settings, just the distance sensor.
swbradshaw, Thank you for the work you have done. I too have set up a nodeMCU with the rayshobbygithub sorce code 1.0.5 (read up more on it features here)-> https://github.com/OpenGarage/OpenGarage-Firmware/blob/master/docs/OGManual.pdf And its working great on its own web interface and in HomeAssistant. Still working on how to make notifications work if I leave my door open after dark. Anyone got this working?
I do have a question on your “cover platform for OpenGarage”. What size is the icon/gif file you used for the Honda and Lexus badges? Trying to get a Chevy badge and BMW to show up, but think I need to resize them.
@dfrosty I’m using the following configuration for an alert to notify me if the garage is open for more than 15 minutes (then 30, then 60). Your use-case for notifications at night isn’t the same, though.
alert: honda_garage_alert: name: Honda Garage is open entity_id: cover.honda state: 'open' skip_first: True repeat: - 15 - 30 - 60 notifiers: - notifygroup
My gifs are 128x128.