Share My Creation Garage Door Opener (with source code)

Hi all:

*** ADDED Project with B4XPages working on B4A and B4J. See post #15

Not sure if this is the rigth place, or if I should publish it in Examples, @Erel, feel free to move.
The code is not perfect, but it works.
Most of code is copied/pasted/modified from forums, so this app is made by the forum people.

Attached a B4A and a B4R app. You will need an ESP8266 and a remote.
The ESP8266 sends a FCM message to the B4A app when someone rings the bell.
From the B4A app, you can send a mqtt message to the ESP to close the contacts of a remote to open a garage door.
You can send the mqtt message from the app or from a widget.

The schema is something like this. I open two garage doors and a pedestrian door, so it can be simplified with just a remote.
*** WARNING ***
I get the ring bell signal from a 220v doorbell, so I use a 220v relay. You don't have to do this if you don't know what you're doing, it's dangerous.
You can avoid the relay and get the doorbell signal input from an open/close contact, or even omit this part if you just want to open the door instead.
*******************

Schema:
schema.jpg


So you need to open your remote, and try to close the button contacts. If your door opens, it will work
1579182805422.png


Feel free to improve it and share!!

Some things you could add:
- Loggin and log in a database when someone open the door
- Check the GPS position before opening with the widget, to avoid open the door when you are far away by mistake
- You can see the images from your webcam with a webview
- Send a picture taken when someone press the doorbell with the FCM notification.
It would be great using this project from @miker2069 instead of ESP8266 to get the picture an open the door.

Installed:

1579189365880.png
installed.jpg


 

Attachments

  • B4ARemoteGarageDoor.zip
    95.3 KB · Views: 586
  • B4RRemoteGarageDoor.zip
    5.9 KB · Views: 472
Last edited:

José J. Aguilar

Expert
Licensed User
Thanks a lot Peter.
I really have no idea about Arduino or electronics, so when I made the question in the forum about the hardware I would need, I was surprised this can be done with just a small and cheap ESP8266.
So it's funny I haven't seen more projects like this here, and I post my project just to show newbies like me how easy could it be.

 

miker2069

Active Member
Licensed User
Longtime User
this is great :) - I did something very similar a couple years ago (not in B4R but just plain arduino ide and a blynk app). I'm actually in the process of converting it to B4R and B4A/B4i). As a suggestion, you could also use a PNP transistor as a switch to close the button on the remote (you can then eliminate the clicking sound of the relay all together). Also, you can get eliminate the coin battery and power the remote directly from the esp8266 3.3v pin and ground,

I love the "swipe out" feature of your app - that's so cool, great work!
 

miker2069

Active Member
Licensed User
Longtime User
Thanks @miker2069 !!



It's a great idea!!


I have no idea about this, I have something more to study 🙃

I hope to play soon with your project with the ESP32.
Yes - specially a PNP transistor (as Peter pointed out there are other types NPNs, MOSFET). Without getting into the nitty gritty details (youtube has some great videos on the topic), when "activated", PNP transistors effectively act the same way as a button (it shorts two wires) by driving the GPIO pin from the ESP low. NPNs can't really simulate a "short" in the way you would need it to mimic the short created by a button push - I learned this the hard way :)
 

miker2069

Active Member
Licensed User
Longtime User
What is the "swipe" feature you used at the end of the video called specifically? Honestly that was equally as cool. I'd like to go read more about it.
 

José J. Aguilar

Expert
Licensed User
What is the "swipe" feature you used at the end of the video called specifically? Honestly that was equally as cool. I'd like to go read more about it.
Hum... I think you're talking about the widget.
The swipe is not really done in my app. If you see, I press the home button, so I go to the launcher. I swipe two screens of my launcher and then I use the widget of my app.
 

miker2069

Active Member
Licensed User
Longtime User
So I could even avoid using the relay's module, if I understand rigth?
Yes, the PNP would replace the relay to the remote, you'd (obviously) keep the relay to the 220v door belay). Relays are still mechanical devices that will eventually where out (it would be a while but they still have moving parts that will wear out). Plus relays are much slower than transistors. You just need a PNP (like a bc547) and a 1K resistor . I'll try and draw something up to show what I used to wire up my remote.
 

miker2069

Active Member
Licensed User
Longtime User
Hum... I think you're talking about the widget.
The swipe is not really done in my app. If you see, I press the home button, so I go to the launcher. I swipe two screens of my launcher and then I use the widget of my app.
Ahh gotcha - thanks!
 
Top