B4R Question Necessary hardware to doorbell

Discussion in 'B4R Questions' started by José J. Aguilar, Feb 26, 2019.

  1. José J. Aguilar

    José J. Aguilar Well-Known Member Licensed User

    Hi everyone:

    No idea (yet) about Rpi, arduino, etc... but I'd love try something, and I'm reading tons of things.

    What I'd like to do in my job:
    1.- Someone rings the doorbell.
    2.- Something (arduino? raspberry?, ESPxxxx?) gets the signal and I send to some mobile phones a notify (MQTT or Firebase)
    3.- Click in the notification, my app opens, and then I click a button and send a signal to open the door.

    Later I'll try something more:
    1.- Someone rings the doorbell.
    2.- Something get the signal and send a signal to an old cellular to take a picture (mqtt I guess)
    3.- The picture is sent to my mobile phone with the notification than someone is ringing
    4.- I could send a voice message to the old cellular (with the walkie-talkie sample)...
    5.- I open the the door.

    First of all I was thinking in a raspberry, using the GPIO, using it as mqtt server, etc... but now I think it could be with cheaper hardware.
    I saw the "Using Firebase to send notifications..." and it looks it use a simple hardware.

    Obviously I don't need you tell me all the hardware I need (reles, ...), but almost the basic modules to buy a kit or something like that.
    Thanks for reading and for your suggestions.
  2. Cableguy

    Cableguy Expert Licensed User

    I would use a ESP32 connecting either by Wi-Fi (built-in) or GSM using a SIM900 module.
    ESP32 is powerfull enough to perform any of he tasks you mentioned and easily integratable and upgradable.
    ocalle and José J. Aguilar like this.
  3. f0raster0

    f0raster0 Active Member Licensed User

    I use an ESP8266 Lolin + Telegram for that.

    EDIT: I read now about taking a picture :) sorry.

    Edit2: I know a company using something like this:taking the picture and sending it to the cloud example here: https://www.roboremo.com/jpeg-camera--esp8266.html
    Last edited: Feb 26, 2019
    ocalle and José J. Aguilar like this.
  4. José J. Aguilar

    José J. Aguilar Well-Known Member Licensed User

    Thank you both!

    I will start to search some Esp board, breadboard, ...

    Not sure if I could make it work with B4X
  5. Cableguy

    Cableguy Expert Licensed User

    It's only a matter of having the lib for that camera, but there are other cameras, and I recall seeing a lib for one in the b4r forum
    f0raster0 likes this.
  6. Cableguy

    Cableguy Expert Licensed User

    Just don't buy the esp32 with camera piggyback... Seems that eve Arduino IDE has s hard time with those
    José J. Aguilar likes this.
  7. kolbe

    kolbe Active Member Licensed User

    Pi zero W plus a Pi camera. You can control the camera with B4J shell commands. Might want to look at MotionEyeOS for the pi.
    Cableguy and José J. Aguilar like this.
  8. José J. Aguilar

    José J. Aguilar Well-Known Member Licensed User

    Again, thank you guys!
    Probably I start just with the esp32 to play with it, I will see more pobilities later
  9. Beja

    Beja Expert Licensed User

    From what you said I guess what you need to use is:
    1. An old smartphone with gsm SIM card
    2. Arduino Uno
    3. Bluetooth module (HC05 or similar)
    4. A few glue components (resistors..etc)

    * Door bell (push button) and BT are connected to Uno.
    ** Uno sends button state to door smartphone
    *** well, you know the rest of the story.

    My 2 cents
  10. Cableguy

    Cableguy Expert Licensed User

    That solution implies 2 espérante power suplies, one for the phone and another for the électronics.
    All needed electronics can easily be powered by a single PSU and without the need of b4r + b4a coding, only b4r.
  11. warwound

    warwound Expert Licensed User

    Are you referring to the ESP32-CAM module?
    When this was first released it was only supported by the native Espressif IDF, it is however now supported by the Arduino IDE and a very comprehensive example sketch can be found HERE.
    Beja, Johan Hormaza and f0raster0 like this.
  12. Beja

    Beja Expert Licensed User

    You are right Cableguy, still depends on the complexity and requirements. May be some initial facial recognitions and conversation with visitors ... Etc are required . then b4a is more flexible and powerful, in terms of memory and processing.
  13. tigrot

    tigrot Well-Known Member Licensed User

    I have a wifi camera at the main gate, sending live images to a androin tablet. At the bell pushbutton there is a ESP32 which publishes a message to Firebase to connected smartphones. I can see the same movie on the smartphones everywhere they are. And see who is ringing.
    f0raster0 and Cableguy like this.
  14. Cableguy

    Cableguy Expert Licensed User

    Indeed, but as always, there's more than just one way to skin a cat!
    Beja and tigrot like this.
  15. Cableguy

    Cableguy Expert Licensed User

    These are the initial requirements, easily achieved under 20€, then the OP decided to add visuals by means of a camera (taking just still frames) and we are still under 35€...
    Then, the OP moves onto video, which is a completely different ball game hardware requirements wise, and we jump up to over 50€ solution... There are already commercial solutions at that price range...
    Last edited: Mar 9, 2019
    tigrot likes this.
  16. tigrot

    tigrot Well-Known Member Licensed User

  17. warwound

    warwound Expert Licensed User

    An ESP32-CAM board can do the lot for just £5.82!
    Admittedly it's video streaming performance is mediocre, sometimes working fine sometimes stalls and lags.
    I've added a PIR sensor to my ESP32-CAM, this wakes the ESP32-CAM when motion is detected.
    The ESP32-CAM wakes, takes a picture then connects to my network and uploads the picture (via a webSocket).
    While the ESP32-CAM is awake it'll send a new picture to my server every 10 seconds or so.
    After 60 seconds of no motion detected the ESP32-CAM goes into deep sleep mode, awaiting the next motion detection.
    All low cost stuff but works very well!
  18. José J. Aguilar

    José J. Aguilar Well-Known Member Licensed User

    Hi again, and thanks everyone for the answers. I haven't answer before because I wanted to have something more to say :)

    I've received an ESP8266 board:

    Tested successfully the button sample, and mqtt sample.
    Now I'm trying to test the FCM sample, sending the message when I press a button. I get the notify in my android from FCM console, but not from the B4J app, not from the B4R samples (get success messages in logs, but nothing in mobile). I'm making more test and I'll open a new thread when fall into despair :)

    I didn't explain my real needs in the first post. I'm not trying to build a doorbell from the top, but I want to implement it in a existing 220v doorbell existing in my job's warehouse.

    With the help of some workmate, I have this relay. (I've bought a cheap 220v doorbell to test)

    When I get 220v in one side, I get a closed contact on the other side, so I hope it works when my test of sending the message when pressing the button works. (of course, I'm aware of the danger of 220v AC current, I'll be cautious...)

    The next step will be to see what kind of signal opens the narrow door (you don't want to see the box where the cables are ...)

    I would love it. Probably when this is working, I'll make more test with a cam. BTW, yesterday I saw this:

    I'll keep you informed.
    Last edited: Mar 12, 2019
    f0raster0 and Cableguy like this.
  19. Cableguy

    Cableguy Expert Licensed User

    Be very careful! A tipical "basic" doorbell with electric latch uses a transformer to power up the needed circuitry!

    Take the time to take voltage measurements on all possible points and try to sketch up a basic wiring diagram of the existing circuit.
    I would be very surprised if you mesure anything over 24v at any "human interaction" points.
    KMatle, tigrot and José J. Aguilar like this.
  20. tigrot

    tigrot Well-Known Member Licensed User

    220V in door bell? It's quite dangerous, think of moisture... Use a power supply with a low voltage, like Cableguy wrote.
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice