During winter cycling, it’s common to bundle up in thick clothing, wearing hats and scarves tightly.
For example, like this.
While this keeps you warm, it raises safety concerns – it becomes inconvenient to look back to see if there are vehicles or pedestrians approaching. If a car is accelerating and you happen to be turning, that could be disastrous.
Is it possible to install a video rearview mirror on a bicycle? This way, you can know everything happening behind you without turning around.
A foreigner named Alex Eames did just that. He jokingly referred to himself in winter as looking like a “mountain sparrow” wearing a balaclava and a bicycle helmet.
One day, while he was out, a car almost hit him. Fortunately, they both stopped in time, but they were already very close.
Initially, he bought a small mirror, but it didn’t work well. So, he thought of combining a camera and a display, which would allow him to see the traffic situation in real-time and also serve as a dashcam.
He first looked at some products on Amazon, but they were either unsuitable or too expensive (over £200). His main requirement was to be able to understand the situations in front and behind him (mainly behind). He had no need for GPS features; at most, he hoped to capture amusing moments like wild rabbits passing by.
What about a Raspberry Pi-based project?
Before reinventing the wheel, it’s a good idea to see what others have already done.
There is a great implementation of a “dual-camera dashcam” at (http://pidashcam.blogspot.com), which uses a Raspberry Pi II, a Pi camera, and a USB camera.
It looks fantastic, but Alex Eames didn’t want to use GPS at this stage; he just needed a screen to view the situation behind him in real-time and wanted to use some parts he had already bought.
Two years ago, he spent £20 on eBay for a Keidei 3.5-inch HDMI screen, which can connect to the Raspberry Pi via HDMI. It also has resistive touch.
Back of the 3.5-inch KeDei screen
Front of the 3.5-inch touch Kedei screen (with HDMI interface)
“If I want to pursue better results, I could upgrade the display for a higher resolution. Then, I could use a brand new Pi 3A+, with a Pi camera in front, and a Pi Zero W with a camera in the back,” Alex Eames said.
In testing
The front Raspberry Pi will connect wirelessly to the rear Pi Zero W.
Both Raspberry Pis will be set to run automatically after booting. The rear Pi Zero W will transmit its video to port 8090. Then the front Pi will grab the video stream and display it, which can be done using VLC. This way, he can see what’s behind him on the screen.
Bicycle equipped with Raspberry Pi rearview mirror
So, what’s the crucial trick to achieve this? It can be done with just one command, which is:
raspivid -o – -t 0 | tee test_video.h264 |
cvlc -v stream:///dev/stdin
–sout ‘#standard{access=http,mux=ts,dest=:8090}’ :demux=h264
Video effect demonstration
If you have a habit of winter cycling, why not make a video rearview mirror for yourself? If you have any technical questions, feel free to message me on the “IoT Outpost” public account.
Related materials from: Raspi.tv