DIY Wireless Battery Powered IP Camera (Door Camera)

Ambition

I wanted a camera mounted by my front door so I could see who is at the door. There are plenty of solutions for this both off-the-shelf and DIY but I couldn’t find anything that fitted my 3 main requirements:

  1. To be completely wireless, no hard wired power.
  2. To be viewable at any time, not just when someone rings the doorbell.
  3. To not cost a fortune (i.e. a Ring doorbell).

I did find the odd cheap off-the-shelf option such as the Digoo SB-XYZ Video Doorbell but based on the reviews I’d seen I wasn’t convinced this would be a good option. I decided to go down the DIY route.

Concept

The big issue to overcome was power. The idea that I had was to only power up the camera when it was needed i.e:

  1. When someone is at the door.
  2. When I want to view the feed.

I have no need to record all the time.

I could have gone down the route of the doorbell press enabling the power but this wouldn’t allow for condition 2.

What I settled on eventually was to power and de-power the unit remotely using 433mhz RF.

First Attempt

My first attempt used a Raspberry Pi Zero with a camera plugged in. The issue with this setup is that (for this purpose) the Raspberry Pi takes way too long to boot up. By the time I’d have any access to the camera the person at the door would have gone.

Working Model

After a lot of tinkering I now have a working model. It works like this:

Step 1
Someone presses the doorbell (a Xiaomi Button).

Step 2
The button press is picked up by Home Assistant and an automation is fired.

Firstly the Xiaomi Gateway plays a doorbell tune (lets keep some tradition).

Then the automation script turns a Pilight Switch to on which in turn sends out a 433mhz signal using an RF transmitter (plugged into the RPi running Hass). The automation scripts then waits…

Step 3
The RF signal is picked up by an RF Decoder within the camera setup. At the time the RF signal is sent this is the only device consuming any power and it has a very low standby current.

Step 4
The RF Decoder raises one of it’s data pins to high, this raises the gate of a MOSFET to high which allows power to flow through to the camera setup.

Note: In the images I am using a Pololu Power Control Board instead of a MOSFET, this is a bit overkill but at the time I didn’t have a MOSFET to hand.

Step 5
The camera setup consists of a Wemos D1 Mini and an ArduCAM Mini.

Using a modified version of this sketch the Wemos boots up, connects to the WiFi and then to my MQTT server.

As soon as it’s connected it sends an MQTT message to Hass which in turn triggers an MQTT Binary Sensor to turn on, this indicates that the camera is powered up and ready to go. The whole process so far only takes around 2-3 seconds (this is fastest if a static IP is used as DHCP slows things down).

Step 6
Now that the binary sensor is on, Hass knows the camera is ready and the automation script continues.

The next step is to capture a snapshot of what the camera is seeing (who’s at the door). This is done via a Shell Command which performs a wget on the URL that serves up a static image from the camera. The saved image is stored on the Hass server.

Step 7
We have what we want now so we power down the camera.

This is achieved by switching the pilight switch to off which in turn sends out an RF signal to the RF decoder. The RF decoders data pin is sent low which triggers the MOSFET to cut power to the Wemos and ArduCAM.

The last step in the power down sequence is that when the Wemos originally connected to the MQTT server it set a LWT / Last Will and Testament Message, this is essentially a message that the MQTT server holds on to until the client disconnects (for whatever reason). The powering down of the Wemos causes this LWT to be sent and the binary sensor that indicates the camera is operational is set to off.

Step 8
The image that is saved is “connected” to Hass using the Local File Camera Component. This is a simple way to serve the image over the internet using the Camera Proxy method of Home Assistants RESTful API.

Allowing the image to be viewed over the internet is a requirement of the next step.

Step 9
Finally the automation script sends out an iOS notification. This notification contains the URL for the camera proxy serving the image we just took. This allows the image to be displayed in the notification.

Notes

All in all the whole process from doorbell press to photo notification being delieverd takes around 10 seconds (not too shabby).

I can also trigger the camera to turn on simply by toggling the pilight switch. The camera also provides streaming MJPEG video which can be viewed in Hass.

In my setup the camera is mounted inside the front door pointing out through the doors window. It’s fixed with sticky pads until I find a better solution.

The lens that comes with the ArduCAM is more telephoto than wide-angle. Luckily you can pick up alternative wide angle lenses pretty cheaply.

Currently I have 3 AAA batteries powering the setup. In theory these should last a long time but I’ve only had the setup running for a week now so time will tell. I have ordered a Lipo battery which will be a better fit for this project.

I could save on more space by taking out the mini breadboards and soldering everything together.

I’m also hoping to re-case the project as the box I am using at the moment isn’t the prettiest thing.

Wiring Diagram:

14 Likes

nice diy how cost total Project?
how long battery takes?

1 Like

Good question…

Total: £42.45

Extra:

I didn’t add these in the cost either because the cost is neglegable or you may already have them.

  • Wires
  • Resistor
  • MOSFET
  • Sticky Fixers
  • RF Transmitter

Not sure how long the battery lasts yet. The system is on for about 6 seconds at a time and consumes around 200-250mah. The battery (when it arrives) is 1,300mah so in theory it should last for quite a while. I’ll post back here after it’s run for a while.

3 Likes

Very nice, thanks for sharing!

I suppose your 2nd requirement is not achieved? As you only see the live feed when someone presses the doorbell ?

PS. You can get the box from RS components its cheaper, quicker and free delivery.

Hi @bachoo786,

Not at all. I can see the feed simply by switching the pilight switch in the front end. I can keep the camera on for as long as I want and then switch it off again when I’m done. The ArduCAM setup supports MJPEG streaming.

Ooo, I’ve not heard of RF Components. Do you have a link? A Google seach gave me lots of possible sites.

Ah that’s great.

I have to do this project now as I want a wireless camera for my kid stuck to her cot without any wires dangling around.

The link is https://uk.rs-online.com/mobile/c/enclosures-storage-material-handling/enclosures/ they have been around a while now dealing with electrical and electronic items and their products are great with free next day delivery on any item.

Also you mentioned the system consumes 200-250mah for 6 seconds and the batteries are 1300mah does that mean you can run the system from a maximum of 36-40 seconds before the batteries die out?

Could you please provide the schematic for the system i.e. connections etc and the modified sketch for wemos d1 mini?

Thanks.

My typo may have confused the matter. The Wemos consumes 250mA, not 250mAh.

Using a battery life calculator it should run for about 3.5 hours. In 6 seconds chucks this would be 2,100 runs. I think however there are a lot of factors that would mean this figure is grossly overestimated. Time will tell.

I’ll have a look at a wiring diagram and sketch…

Here’s the modified sketch: https://gist.github.com/Dullage/43826c51cc3c00058a8218c107411ccd.

I’ll see if I can knock up a wiring diagram…

2 Likes

UPDATE: I’m having issues with power.

I think the alkaline AAA batteries are dropping below the voltage required to drive the setup. They’re probably one of the worst choices to power this and I expect the lipo setup will be more stable. I’ll report back once I have the new battery in place.

1 Like

An easy and cheap upgrade could be Ni-MH, as they have a flat discharge rate. If you have a voltage regulator in place you can swap 3x1,5 alkaline with 4x1,2 Ni-MH

Cheers @namadori, that’s not a bad shout.

You’re welcome :grinning:

I found that the “flashlight enthusiast” community makes a lot of battery discharge test. See for example this site, with an interactive comparison chart and, for every battery brand, discharge curves at different power consumption:

http://lygte-info.dk/review/batteries2012/CommonAAcomparator.php

1 Like

Did you sort the battery issue out then?

I am using this https://www.aliexpress.com/item/DC3V-3-3V-3-7V-4-2V-5V-12V-2A-Relay-Mini-Remote-Switch-Rx-only/32716351632.html?spm=a2g0s.9042311.0.0.YzkqBg the 3V one but my alkaline batteries are dead within a day.

The quiescent current is 7ma i.e. for the RF receiver to be actively looking for its RF code from a transmitter. I am using 2x AA Energizer Eco-Advanded but having no luck whatsoever.

I haven’t got a camera set up, its only a few LEDs which are battery powered i.e. 2x AA.

I am thinking of using what you used for your setup i.e. https://www.aliexpress.com/item/433mhz-RF-Receiver-Learning-Code-Decoder-Module-433-mhz-Wireless-4-Channel-output-Diy-kit-For/32815156404.html?spm=a2g0s.9042311.0.0.GRSxC3

I will need your help on how I should be connecting all this up using your setup. I need a diagram please?

Well on Monday I swapped out the 3 alkaline AAA’s for a 1,300mah LiPo battery. So far so good but time will tell…

I did try one of those RF switches before, unfortunately I received a dud (or maybe I fried it). Maybe I’ll have another look at the one in the link you sent, the concept is great.

In terms of connections simply provide power and ground to the RF unit and then I used D0 to my power controller (I’m using a Pololu Power Control Board but I think a logic level MOSFET should work). D0 goes high and low as you turn the RF unit on and off, this pulls the power control pin on the Pololu board high and low which in turn controls the power to the Wemos and camera.

I use the RF receiver in toggle mode; send a signal to turn on and later send the same signal to turn off.

The RF unit I’m using only works with the EV1527 (I think most like this are the same), unfortunately sending of this protocol isn’t supported by Pilight but I am still able to use Pilight to control the board by sending in raw mode (which is supported by HA). I didn’t have any EV1527 transmitters to copy the signal from but luckily I managed to find an example raw code in a support forum somewhere :stuck_out_tongue:.

I hope this helps.

I was thinking your RF unit is better in terms of battery as its quiescent current is 5ma or less and the RF unit that I am using is 7ma.

Sorry for my novice but can I just ask why do you need the Pololu Power Control Board? I thought the Wemos needs 5V to power it which you are already providing from the battery?

And finally did you get the 1300mah LiPo battery from aliexpress? I suppose it is rechargeable?
I would go for http://uk.rs-online.com/web/p/speciality-size-rechargeable-batteries/8801551/ as it is 2600mah i.e. twice more then 1300mah which is better.

Also I just calculated the amount of hours your battery would die out i.e. the 1300mah LiPo one and if your RF unit uses quiescent current of 5ma then thats about 182hours which is 7.5 days, so expect next Monday for it to go down.

That’s the theory but I never quite trust the ratings on Ali Express descriptions. Time will tell I suppose

The power control board simply switches the power to the Wemos (and Camera) on and off. That way, when the the RF unit is toggled off the power to everything else is completely shut off. From what I understand you couldn’t power the Wemos and Camera directly from my RF unit due to the current.

Yup, I got a flat Lithium Polymer so that it would fit in my case: https://www.aliexpress.com/item/Liter-energy-battery-3-7V-1300mAh-lithium-polymer-battery-503759-navigator-MP3-GPS-universal-rechargeable-battery/32680533403.html?spm=a2g0s.9042311.0.0.eqpd7Y.

If the run time isn’t too brilliant then I might go for an 18650 cell with a higher capacity. We’ll see.

I am banking on the 5ma being an overestimate but we’ll see!

1 Like

UPDATE: So the battery died last night. Just under a weeks worth of usage out of a 1,300mah battery with 1 or 2 photos taken each day.

I need to find a bigger battery, maybe a few 18650 cells? It would be nice to get a months charge out of it.

1 Like

The 6,600mah one of these looks like it would do the job: https://shop.pimoroni.com/products/lithium-ion-battery-pack

Still, I’d like to find a cheaper solution if possible. I will continue the search…

1 Like