Build your own robot car with the Raspberry Pi!

Build your own robot car with the Raspberry Pi!

The selection of camera models that can be connected to the CSI connector of the Jetson Nano is still very limited. Because only the current Raspberry Pi camera V2.1 with the Sony chipset “IMX219” runs on the Jetson Nano. Many cheap models or the first Raspberry Pi camera with the OV5647 chip are not currently supported by the operating system. This quickly leads to the question of whether there is a wide-angle camera with the IMX219 chipset. I could not find a camera and so I had to order the camera module with wide angle lens separately and rebuild an already existing Raspberry Pi camera.

I would like to connect a wide angle camera to the Nano as I use the Jetson Nano on my donkey car and thus can record much more information about what is happening directly in front of the car.

Convert CSI camera to wide angle

For this you need a normal Raspberry Pi camera. Actually only the circuit board on which the camera is mounted. This is because the normal camera without a wide-angle lens has to be removed and the camera module with the wide-angle lens has to be placed
on the board that has thus become free. This actually works very well, as the new camera module already has a corresponding adhesive pad on the back.

The following picture shows the PCB of the Raspberry Pi camera version 2.1 in the middle, to the left the normal optics and to the right of the PCB the camera module with the wide angle optics.

Jetson Nano Weitwinkel Kamera

Jetson Nano Weitwinkel Kamera

Once assembled, the Raspberry Pi camera module looks as shown below. In my opinion, the adhesive pad on the back of the camera module could be a bit stronger / thicker so that it sticks better to the board.

Jetson Nano Weitwinkel Kamera montiert

Jetson Nano Weitwinkel Kamera montiert

The following picture shows the mounted camera on my Donkey Car.

Jetson Nano Weitwinkel Kamera montiert Donkey Car

Jetson Nano Weitwinkel Kamera montiert Donkey Car

If you don’t want to make your own camera, you can also buy a finished wide-angle camera on Amazon. The purchase link as usual below to the model I have tested myself.

Loading ...

Putting the camera into operation

After the conversion comes the exciting question whether the camera still works. The camera is connected to the Jetson Nano via a CSI cable. After the camera is connected, it should be displayed as device video0 with the following command Please execute the following command in the terminal window.

Command: ls /dev/video0

If a device video0 is displayed then the camera should work.

Testing camera:

If the camera really works you can only tell if you see a picture. Here you can find a small program to watch the live video stream
from the probably best site on the Internet jetsonhacks.com around the NVIDIA Jetson family.

The program and explanation is available on GitHub.

URL: https://github.com/JetsonHacksNano/CSI-Camera

Use the following command to download the repository to the Jetson Nano board

Command: git clone https://github.com/JetsonHacksNano/CSI-Camera.git

After the repository has been cloned onto the Jetson Nano it can continue. In the “CSI-Camera” folder of the repositories a small Python program is included that shows
a live image from the camera. Use the following command to start the program in the CSI-Camera folder. Please make sure that you are logged into the graphical module directly on a monitor under the Ubuntu desktop. Otherwise, no image can be displayed, e.g. via a remote SSH connection

Command: python simple_camera.py

A picture should now be displayed. If not and the Jetson Nano crashes then something is wrong with the power supply. More about power supply in the following section.

The picture is a bit noisy, because I didn’t have a better light in the office at the time of taking the picture. But generally the picture looks very good.

Waveshare Jetson Nano camera wide angle 160

Waveshare Jetson Nano camera wide angle 160

Jetson Nano power supply

The Jetson Nano is somewhat more demanding than the Raspberry Pi in terms of power supply. A strong power supply unit should be used here.

Note – Problems in the power supply:

If the program simple_camera.py is running, the power consumption of the Jetson Nano increases significantly and my standard mobile phone charger reaches its limits. That means the nano just crashes.

Solution of the problems in the power supply:

A power supply with 5V and 5A connected via the leftmost plug (the socket) has solved the problem of crashes when starting the program “simple_camera.py”. The power supply delivers enough power to keep the Nano from crashing as soon as more computing power is required. For the power supply via the left socket to work, a small jumper must be set behind the connector.

However, a powerful mobile phone charger with approx. 3.5 A connected via the micro USB interface also works.

Summary

The Waveshare camera and my camera conversion both work very well on the Nano. For stationary operation I now have a stable platform to work with. Also the training of the neural network for the Donkey Car with the extra strong 5V / 5A power supply works without problems. Besides the Donkey Car, I would like to try out projects like Yolo on the Jetson Nano and experiment a little with object recognition.

(Visited 1,251 times, 1 visits today)