The ZeroCam NoIR is a tiny camera for the Raspberry Pi Zero that does not have an infrared filter. This kind of camera is more suitable for recording in low light compared to a regular camera. Because of that, it is ideal for recording wildlife in the night time. Or as part of a home security system. Furthermore, it can record even in complete darkness, with the help of an infrared lamp.
If you want to get an all-in-one bundle, check out this camera kit that combines infrared LEDs with a fisheye lens:
First, in order to use the ZeroCam, you need to enable the camera interface of the Raspberry Pi. To do that, type in a terminal:
Next, the menu below appear. In there, select option 5 – ‘Interfacing Options’:
Then select the first option to enable the camera interface:
Raspbian already has some libraries to enable you to use the camera module. To capture a picture and save it as image.jpg:
raspistill -o image.jpg
To take a 10 seconds video and save it to video.h264 file:
raspivid -o video.h264 -t 10000
For full documentation of the camera module, see the official guide.
Here is an example of how this camera works in normal light. The plant pots are originally blue. However, with a NoIR camera, the colors are a bit desaturated:
Finally, below it’s the same picture. Only this time it’s in complete darkness, illuminated by an infrared LED. Additionally, I used the exposure setting, and set it to ‘night’.
If you don’t have a Raspberry Pi Zero, but a Raspberry Pi 2 or 3, you can still connect the ZeroCam. For that you need an adapter. In my future posts, I will show how to use this camera to create a streaming server and to create security system with a PIR sensor.
Connect the HC-SR04 to Orange Pi
The HC-SR04 is a cheap and easy to use sensor, used to measure distance with ultrasound. It can be used in many projects where you trigger an action based on an object or person entering an area, like an “alarm”, as I showed in my previous post. Also, you often see this sensor as part of more interesting projects such as robots, like this one.
In my previous IoT project on the Orange Pi I showed how to read a DHT22 or a DHT11 temperature and humidity sensor. That project involved connecting the sensor to the GPIO pins and writing C code to read the sensor. In this example I will show you how do the same, but using Python code instead.
Store sensor data with SQLite
Very often as part of an Orange Pi or Raspberry Pi project involving sensors, it is useful to store the sensor data in some kind of way or another. A good way to store the data is in a database that you can manage and query. SQLite is a popular embedded database management system. SQLite comes in the form of a C library. Due to it’s low footprint on resources, it fits well with a device such as a Raspberry Pi or the Orange Pi.
Connect the ultrasonic sensor to the Orange Pi
In this tutorial we will learn how to connect a HC-SR04 ultrasonic range sensor to the Orange Pi. This sensor measures distance from the sensor to an object by using ultrasounds. This is similar to how animal echolocation works, for example bats navigating in total darkness. Also, it’s how the submarine’s sonar detects objects under the sea.
Connect the sensor to the Pi
Time for some physical computing on the Orange Pi Plus 2e! We will connect a temperature and humidity sensor to the Orange Pi and write and compile a C code snippet to display the sensor readings. Additionally, you will learn about the GPIO pins.