Close
0%
0%

Night vision camera raspberry pi

A night vision camera built with a raspberry pi zero w, night vision camera plus a 3.2" screen

Similar projects worth following

tl;dr

Well why wouldn’t you want a night vision camera. My first idea was to have a raspberry pi with a night vision camera but instead of a screen it would stream to a phone in one of these “virtual reality” headsets but I couldn’t find a setup that didn’t have too much lag.

I also didn’t want to make just another raspberry pi camera so that’s why I went with the night vision camera. What started as an “easy” project turned into a long list of problems to solve, that’s where the fun lies

Hardware

Hardware list

  • Raspberry pi zero W
  • Night vision IR raspberry pi camera
  • Xiaomi power bank board
  • 3x push buttons
  • Power switch
  • 1200 mAh lipo battery
  • ADS1115 analog I2C
  • 3.2″ touch screen
  • Aluminium enclosure
  • Female USB panel mount
  • Female micro USB panel mount
  • 3x 3mm LED’s
  • 3x 3mm LED panel mounts

Total cost £66.51

The power struggle

I thought this would be a relatively straight forward project untill I got into the details. One of the details was the power requirements. Its easy enough to power a raspberry pi but when you throw in a screen and the camera. What makes it even more difficult is that fact that the camera has 2 high power IR LED’s. While testing I tried a few power banks I had on hand. I found out that the raspberry pi, screen and camera were pulling about 1.5amp – 2amps with the IR LED’s on pull power.

I found that most power banks I had wern’t up for the task. I took a punt on Xaomi power bank board, It claimed to output 2amps. I tested the power bank when it arrived and sure enough I was able to support the Raspberry pi zero, screen, camera as well as the IR LED’s.

I was all set, Found a 1200 mAh lipo battery and give it an endurance test. With the IR LED’s on the whole time I was only managing 45 mins, This wasn’t terrible considering the whole setup was pulling 1.5amps. I went looking for a bigger battery and found a 2000mAh battery that was nice and slim, the problem with this battery was it couldn’t handle the high current draw from the power bank so I switched back to the 1200mAh battery. ideally I would use a Samsung 25r 18650 cell but there isn’t enough space. These battery’s are designed for high current draw and are often used in the vaping scene.

LED’s

I know what your thinking, why would you add LED’s to a night vision camera. The first LED I always add to a raspberry pi project is to break out the ACT LED, This is so that when you shutdown the pi you can see the 10 flashes that tell you it’s finished shutting down and its safe to turn off plus it doesn’t hurt to see the activity of the pi.

The other 2 LED’s I added were broken out from the power bank board, On the power bank board there are 4 LED’s to indicate the battery level while discharging and charging. I only broke out the 1st and last LED’s so I would know when that battery’s getting low and when it had finished charging.

Software struggle

Where do I start with the software. While I was waiting for my 3.2″ screen to come I was using a 5″ HDMI screen. I got the camera up and running using pi camera. It wasn’t until I received the 3.2″ screen that my first problem cropped up, You see the pi camera using a hack where is basically pipes the camera to the HDMI output so when I was using the 5″ HDMI screen it worked find but the 3.2″ screen didn’t show anything.

To solve this I turned to pygame, This wasn’t a problem since I would be building my interface with this. I found this code that grabbed the output from the camera and put it into a frame buffer that was then displayed in pygame. This was great because it allowed me to scale down the stream to fit the 3.2″ screen.

My next problem was how was I going to access the photos from the camera. I first thought about turning the pi zero w into an access point and viewing the photos in the web browser on my phone, This seamed clunky. I finally came up with the plan to use a removable usb flash drive and hard coding...

Read more »

  • No more hard coded flash drives and a unmount button

    facelessloser10/21/2017 at 18:26 0 comments

    So I finally got round to adding code so I can use any flash drive instead of hard coding in a set flash drive. Also added a un-mount on screen button with text to let you know if the drive is mounted or un-mounted. Also if a flash drive isn't mounted it will save the photos and videos to sd card.  Also added a on screen exit button so I can free up the 3rd button for a gif button in the future.

  • The long wait for parts

    facelessloser10/14/2017 at 15:28 0 comments

    So I've picked out a enclosure and buttons and a few other bits I will need for my project, They are on the slow boat from china. While I'm waiting I've been brainstorming about how I'm going to get the photos/videos off the camera . I was just saving the photos/video to the sd card but I can't access that physically once the project is complete. I came up with the idea of having a tiny (in physical size) usb drive sticking out with the USB panel mount. 

    I've changed my code and added a hard coded usb flash drive so it will first try and save the photo/video to the flash drive then if it cant find it it will save it to the sd card. The reason for the hard coding is i cant find a way to look up what ever drive I have installed then save to it, So I'm being lazy.

    The code is up on the github I've linked to in the post

View all 2 project logs

Enjoy this project?

Share

Discussions

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates