BikeCamera Video Camera
![20181231_093441.jpg](/proxy/?url=https://content.instructables.com/F02/KI3J/JQAT0DH0/F02KI3JJQAT0DH0.jpg&filename=20181231_093441.jpg)
![BikeCamera video](/proxy/?url=https://content.instructables.com/F4A/YGF6/JQCO5PG5/F4AYGF6JQCO5PG5.jpg&filename=BikeCamera video)
![vid2018-12-30_143810.jpg](/proxy/?url=https://content.instructables.com/FZM/XI3Z/JQCOAVW8/FZMXI3ZJQCOAVW8.jpg&filename=vid2018-12-30_143810.jpg)
![20181229_132704cropped.jpg](/proxy/?url=https://content.instructables.com/FXD/SLWO/JQCO5BV3/FXDSLWOJQCO5BV3.jpg&filename=20181229_132704cropped.jpg)
![20181229_133036cropped.jpg](/proxy/?url=https://content.instructables.com/F6B/I7IL/JQCO5G0D/F6BI7ILJQCO5G0D.jpg&filename=20181229_133036cropped.jpg)
![vid2018-12-30_143355.jpg](/proxy/?url=https://content.instructables.com/FBZ/3XJV/JQCOAVKZ/FBZ3XJVJQCOAVKZ.jpg&filename=vid2018-12-30_143355.jpg)
![vid2018-12-30_143355_1.jpg](/proxy/?url=https://content.instructables.com/FPP/NC3I/JQCOAVME/FPPNC3IJQCOAVME.jpg&filename=vid2018-12-30_143355_1.jpg)
The BikeCamera is a video camera for your bike. I designed BikeCamera so that it is small, modular and easy to fit to your bicycle helmet or motorcycle helmet.
I decided to build my own video camera for cycling when I couldn't find a camera that could do all of the things I needed. Actually, I wasn't able to find a single camera that can do ANY of the things I wanted.
Your BikeCamera will give you excellent video quality, long battery life and very large storage for video files. You can also hide most of the components and keep a nice sleek-looking helmet.
The features of BikeCamera that I wanted are:
- Small enough to attach to outside or inside of a bike helmet
- Looks nicer than a Go Pro style action camera because most parts can be hidden
- Several hours battery life for long recording sessions
- Able to use very large memory cards.
- Fully configurable and controllable via a nice web interface
- Good quality video
- Windows file explorer and website download of video files
Have a look at this video to see what the BikeCamera can do.
NOTE about the video:
The sharpness of the video on YouTube is much worse than the real-life recording. BikeCamera video defaults to Full HD and looks very sharp. Car number plates and street signs are easy to read. On the other hand, the colours and brightness of the YouTube video are fairly accurate.
Some snapshots:
You can easily read the license plate of the Porsche. VROOMM!
![](/proxy/?url=https://content.instructables.com/FBZ/3XJV/JQCOAVKZ/FBZ3XJVJQCOAVKZ.jpg?auto=webp&fit=bounds&frame=1&height=620&width=620)
![](/proxy/?url=https://content.instructables.com/FPP/NC3I/JQCOAVME/FPPNC3IJQCOAVME.jpg?auto=webp&fit=bounds&frame=1&height=620&width=620)
Configuration Options
![20181230_100527.jpg](/proxy/?url=https://content.instructables.com/FJV/IPS4/JQ6YLD1E/FJVIPS4JQ6YLD1E.jpg&filename=20181230_100527.jpg)
![20181230_100902.jpg](/proxy/?url=https://content.instructables.com/FB1/XKRV/JQ6YLD1K/FB1XKRVJQ6YLD1K.jpg&filename=20181230_100902.jpg)
The BikeCamera is modular and can be as simple or as complex as you like. The descriptions here are for the absolute minimum configuration and the most complex configuration.
You can choose any configuration in between minimal and maximal. Your camera could have push buttons but not LEDs. Use a real time clock but not a LiPo battery. etc. None of the maximal configuration extras rely on any of the other changes. Pick and choose the features that suit your needs.
Minimal configuration features
- The best option for non-technical users.
- The BikeCamera records high quality video
- Does not need any controls other than your smart device.
- Controls and configuration are right on your screen.
Pros:
- Plug and play
- No soldering
- The least technical option to set up
Cons:
- You must have a smart device to operate the camera
- BikeCamera does not show recording status on LEDs but does show status on your smart device.
- If the BikeCamerais started away from WiFi, the time and date will be wrong
- It may be difficult to find a power bank the right size and shape to fit into the helmet
Maximal configuration features
- Does not need a smart device for operation, but still connects to one if you prefer.
- Uses a push button with LED indication to start and stop recording
- Uses a push button with LED indication to perform reset and shutdown operations
- Has a Real Time Clock to ensure date and time are accurate. See Real Time Clock below to see why this is more important than you might think.
- Battery shape and size is more convenient to fit into a helmet
Pros:
- Operation is controlled using push buttons
- Status is shown using LEDs
- Most likely to be a more compact installation
- Camera will remember the time and date regardless of circumstances
- The Pi can be made (almost) completely waterproof
Cons:
- Soldering is required
- There are a few more parts to buy
- Getting it wrong may break your Pi.
What You Need
![pizeroW.jpg](/proxy/?url=https://content.instructables.com/FPE/WIHY/JQCO7XGW/FPEWIHYJQCO7XGW.jpg&filename=pizeroW.jpg)
These are the essential parts you need for any configuration
I have put links here so that you can see what these parts and tools look like. You do not need to buy any of this gear from Amazon. I didn't. Shop around and find the best prices. I don't make any money if you buy the parts using these links.
Parts
Get yourself:
- A Raspberry Pi Zero W
- A micro SD memory card.
See card sizing section below.
- A Raspberry Pi camera module with wide angle lens.
See selecting a camera section below.
- A 30cm Raspberry Pi camera module cable for Pi Zero.
- 2 Amp (suitable for tablets) USB charger
- A micro USB cable for charging the battery
- Velcro strip for attaching parts to your helmet
I'm assuming you already have:
A helmet Perhaps a bicycle helmet or maybe a motorcycle helmet. Or my favourite: Both.
Tools
Unfortunately, the first three are required for ANY Pi Zero project. Sorry.
- A monitor with mini HDMI cable
- Keyboard and mouse
- Micro USB OTG hub
- A WiFi connection with internet access
- A micro USB cable for powering the Pi
- Scissors for cutting velcro tape
Highly recommended:
- Heat gun, hair dryer or some other way of shrinking the heatshrink tubing.
Options
For a Minimal configuration
Minimal configuration parts:
Minimal configuration highly recommended:
- Clear heatshrink, 30mm diameter
- A short micro USB cable with right-angle ends in a convenient configuration for your installation
For a Maximal configuration
Maximal configuration parts:
- A LiPo 1S 3.7V battery pack.
See battery sizing section below.
- A USB charging module
- Pushbuttons Micro Momentary Tactile Switch 6 x 6 x 4mm
- LEDs
- 2k2 resistors
- RTC module
- Header pins
- Connectors Micro JST PH 1.25mm pitch 2 pin pair male female
- Connectors JST 2.54mm pitch 2 pin pair male and female
- Clear heatshrink, 30mm diameter
- Other heatshrink as required
Maximal configuration tools:
Basic electronics tools such as
- Soldering iron and solder
- Wire cutters
Battery Sizing
![20181231_123022.jpg](/proxy/?url=https://content.instructables.com/F70/011V/JQAT1ZJV/F70011VJQAT1ZJV.jpg&filename=20181231_123022.jpg)
You need to size your battery based on how many hours you want to record between re-charges. I like long pushbike rides, around 4 or 5 hours long. This means I need a large capacity battery to ensure the camera records for the whole ride. If you commute to work and it's 15 minutes each way, then a much smaller battery will be fine.
Battery life table
Use this table to work out what size battery storage you need
WARNING: USB battery bank storage numbers are highly misleading. In my experience, if you divide the advertised rating by 10 you get a realistic mAh rating. Seriously. I have no idea where they get their capacity rating numbers.
Calculating battery life
If you want to calculate battery life for some other application, you do it like this:
- BikeCamera draws 300mA of current
- Work out the recording time you need
- Add a safety factor of 40% (1.4x)
- Multiply everything together
Examples:
Recording time needed is 1 hour
Battery size is (300 * 1 * 1.4) = 420mAh
Use a battery pack with 420mAh or more
For my rides, I want 5 hours of recording
My battery size is (300 * 5 * 1.4) = 2100mAh
I use a 2000mAh LiPo battery pack
Memory Sizing
![](/proxy/?url=https://content.instructables.com/F7T/CS1J/JQCO7XGY/F7TCS1JJQCO7XGY.jpg?auto=webp&frame=1&width=320)
Storing lots of high-definition video needs a big memory card.
Memory usage depends on the camera resolution you select, but memory is fairly cheap. Most people will want to buy a larger memory card instead of reducing the quality of the recording. Once the memory card has reached capacity, the oldest file is deleted, which makes space for a new one to be recorded. So, it becomes a circular recording system. The memory card will always be packed full of your latest recordings.
Default resolution is 1080P standard definition. Using this resolution, this table shows how many hours of recording will safely fit on a memory card:
The Pi Zero uses Micro SD cards. I use a 128GB card with no issues in my BikeCamera. Some 256GB cards are reported to work in the Pi Zero, but they are not yet widely available and I haven't tried one.
I always use SanDisk cards. They're one of the more pricey brands, but they always work.
For those geeks wanting to know how to calculate the approximate video storage length:
- For 1080P (SD or HD) the Pi records at the maximum rate of 17M bits per second
- 3600 seconds per hour * 17Mbps = 61200M bits per hour
- 61200 / (8 bits per byte * 1024 MB per GB) = 7.5GB per hour
- 128GB card gives (128 / 7.5) = 17 hours of recording
Real Time Clock
![](/proxy/?url=https://content.instructables.com/F1Z/22U4/JQCO7YUB/F1Z22U4JQCO7YUB.jpg?auto=webp&frame=1&width=320)
Deciding about the Real Time Clock (RTC)
BikeCamera uses a Real Time Clock (RTC) module to store the time and date when it is powered down. The Pi has no way of storing the time and date on its own. Under normal circumstances, the Pi sets the time and date using a system called Network Time Protocol (or NTP). The Pi contacts a NTP server on the internet every time it is powered up.
This works fine for most Pi applications because the Pi will be powered up with some type of network access. For this project however, NTP is unlikely to work reliably. The BikeCamera can easily be powered up away from home where there is no internet access.
Say you are on a ride and you decide to stop somewhere for an hour and have a leisurely lunch. You don't want your BikeCamera using up your battery, so you shut it down. Without a RTC the date and time on the pi will be wrong. Not wrong by a little way, either. The time and date will be complete rubbish.
For normal day to day riding, having inaccurate time and date is an inconvenience. But in the case of an accident or other important event it is very important that the time stamp on the recording is 100% accurate.
This is why, for most users, I strongly recommend installing a RTC.
So, for users of the minimal configuration: If you need the time and date to be accurate on your BikeCamera you MUST be within range of your WiFi when you power up the camera.
Choosing a Camera Module
![20181202_193852.jpg](/proxy/?url=https://content.instructables.com/FJN/02UE/JQ6YLD06/FJN02UEJQ6YLD06.jpg&filename=20181202_193852.jpg)
I recommend that you use the camera module detailed in the parts list, but you do have options.
For the BikeCamera, the camera module needs to be:
- Wide angle. The standard Pi camera modules are fairly narrow view.
- It must work for day and night.
- I will usually have well lit streets, so extreme low light sensitivity is not necessary.
- Clarity is important. I want to be able to read street signs and license plates.
There are several other camera modules available that are made for Raspberry Pi. You can use any of them without modification to the project, but be aware of the compromises.
Some camera modules may be advertised for Pi 3, Pi Zero etc. The camera modules can all be connected to any model of Raspberry Pi. The only difference is that the cable for the Pi Zero W is smaller on the end that connects to the Pi. The connectors on the camera module end are all identical.
Camera Cable
![20181202_194329.jpg](/proxy/?url=https://content.instructables.com/F67/49KT/JQ6YLD0X/F6749KTJQ6YLD0X.jpg&filename=20181202_194329.jpg)
Warning: Be careful with the camera connector on the Pi! I have found this connector to be very fragile (i.e. I broke two of them). Once the camera is connected to the Pi, I highly recommend the following: If the cable must be disconnected, disconnect the cable at the camera end and never the Pi end. The connector on the camera module is larger and harder to break.
Let's start by connecting the long camera cable to the camera module. The module comes with a short camera cable already attached. The camera cable is the flat cable coming out of the module. The connector for that cable has a white part and a grey part. The grey part clamps the cable in place. The clamp slides a small way out, directly outwards in the direction of the cable.
Use something with a fine point, like a small screwdriver, to gently push the clamp towards the flat cable. The clamp will only move two millimetres or so. Any more and it will break. You should be fine, just take your time and don't force it. The old camera cable should now slide out without any force.
Slide the new cable into the connector. The metal contacts on the cable should face down, pointing in the opposite direction to the lens. Gently push the clamp back into place.
OK, now that you have practised with the bigger connector, it's time to try the Pi's small one. The procedure is exactly the same. Slide the clamp outwards with your small screwdriver (or whatever). This smaller clamp only moves about 1mm, not 2mm, so be careful.
Slide the cable all the way into the connector and slide the clamp back into place.
That wasn't so bad, was it?
Installing Raspbian
![](/proxy/?url=https://content.instructables.com/FTY/FLEJ/JQCO6I1U/FTYFLEJJQCO6I1U.png?auto=webp&fit=bounds&frame=1&height=100&width=100)
Raspbian is the Raspberry Pi operating system that we will be using for our BikeCamera.
Download the raspbian image from the Raspberry Pi official website. Download the "Full" version including the recommended software. At the time I am writing this, the latest version is Raspbian Stretch is:
- Version:November 2018
- Release date:2018-11-13
- Kernel version:4.14
https://www.raspberrypi.org/downloads/raspbian/
This is a big download, getting close to 2GB. If your internet connection is like mine, be prepared to be patient.
Follow the official instructions for installing the operating system onto your micro SD card. https://www.raspberrypi.org/documentation/install...
Pi Zero Configuration
![raspbian_desktop_configuration.png](/proxy/?url=https://content.instructables.com/F67/42RV/JQCO81PB/F6742RVJQCO81PB.png&filename=raspbian_desktop_configuration.png)
It's time to power up your Pi Zero.
Insert your prepared Micro SD card into the socket on the Pi. Connect your mouse and keyboard to your OTG hub. Connect the OTG hub to your Pi. Use the micro USB socket on the Pi labelled "USB", not the one labelled "PWR". Connect your monitor to the mini HDMI socket on the Pi. Finally, connect your Pi to a USB charger with a micro USB cable. Use the micro USB socket labelled "PWR", not the one labelled "USB".
First, the Pi will boot quickly and say that it has just re-sized the file system, then it will reboot. When the Pi has rebooted, it will go into desktop mode and open a configuration window. Follow the prompts to configure WiFi network and password and your location information. There is no need to change the password for your Pi Zero. Just click "Next" when this option appears.
The Pi will update all of its software which can take a while. After the updates, the Pi needs to reboot.
When the Pi is running again, open the desktop menu and head to preferences > raspberry pi configuration. On the second (interfaces) tab ensure the camera interface and the I2C interfaces are enabled.
Save the changes and reboot. Again.
Install the BikeCamera Software
![terminal.png](/proxy/?url=https://content.instructables.com/FY4/7LBT/JQCO84T2/FY47LBTJQCO84T2.png&filename=terminal.png)
Open a terminal window. It's the icon thingy up the top with a "T" and a ">". For those of you who haven't used terminal before, don't worry, this is easy. There's only one command to type, and here it is:
wget -q https://git.io/fpOh4 -O /tmp/bci && bash /tmp/bci
This command downloads and runs an installation script that does everything for you. Well, almost.
You need to confirm that the default hostname "bikecamera" is OK. Hostnames are a networking thing. The only time using "bikecamera" is not ok is if there is another "bikecamera" on the network. If there are two, they fight. And both of them lose. If there's a risk that your BikeCamera may one day meet another one on the same network, then change the hostname. Or just change it because you want to.
At the end of the installation, the script will give you two IP addresses. These are important. You need these to access your BikeCamera with a web browser, so write them down. Or otherwise ask Siri to take a note or something.
Allow the BikeCamera to reboot, and you're done installing software. If there are no warnings and everything is looking fine, shutdown your BikeCamera.
Now would be a good time to disconnect your monitor, OTG hub and power. Leave the camera module plugged in to the pi.
And next:
For people using the minimal configuration, you can now proceed to the waterproofing section.
For maximal extras, keep on reading.
Installing the Real Time Clock (RTC)
![20181118_094347.jpg](/proxy/?url=https://content.instructables.com/FIL/XQRW/JQ6YLCYF/FILXQRWJQ6YLCYF.jpg&filename=20181118_094347.jpg)
![BikeCamera maximal 20181228_bb.png](/proxy/?url=https://content.instructables.com/FGL/IFBU/JQ6YLCAT/FGLIFBUJQ6YLCAT.png&filename=BikeCamera maximal 20181228_bb.png)
![Image.jpg](/proxy/?url=https://content.instructables.com/FFC/OSPC/JQ6YLD3N/FFCOSPCJQ6YLD3N.jpg&filename=Image.jpg)
I connected the RTC to the Pi by soldering five header pins into the Pi. The pin connections of the Real Time Clock are aligned to match the pin connections on the Pi.
The pins you need are pins 01, 03, 05, 07 and 09. (Pin 07 is unused, but it will help mechanically support the RTC module.) Before installation, I insulated the RTC module with heatshrink. This is necessary to stop the RTC module circuity shorting out on the SD card holder shell.
You can now simply plug the RTC module onto the header pins.
I decided to make things a little bit more solid by unsoldering the header socket from the RTC and directly soldering the module onto the header pins. This is not necessary.
LED Installation
![](/proxy/?url=https://content.instructables.com/F8V/P655/JQ6YLD3I/F8VP655JQ6YLD3I.png?auto=webp&fit=bounds&frame=1&height=620&width=620)
The BikeCamera can have two LEDs fitted. One shows the recording status. The other shows whether a reset or a shutdown mode is about to be executed.
Any LED with standard leads can be used. You choose the colour and size that suits you.
Solder the resistor to the LED anode.
Solder the LEDs and resistors into the Pi GPIO connections as shown.
I have chosen the GPIO connections so that the resistor and LED fit comfortably onto the board. Leave a couple of millimetres clearance between the bottom of the components and the board. This will allow you to bend the components flat to the board after insulating with heat shrink.
Heat shrink the LED and resistor. Bend the LED and resistor flat to the board, towards the centre of the board.
Pushbutton Installation
![BikeCamera maximal 20181228_bb.png](/proxy/?url=https://content.instructables.com/FGL/IFBU/JQ6YLCAT/FGLIFBUJQ6YLCAT.png&filename=BikeCamera maximal 20181228_bb.png)
![20180403_190206.jpg](/proxy/?url=https://content.instructables.com/FXC/JE8U/JQ6YLCWL/FXCJE8UJQ6YLCWL.jpg&filename=20180403_190206.jpg)
The push buttons are quite easy to fit. Use the type micro momentary tactile, size 6mm x 6mm. You can choose the height of the push button to suit you. I used buttons with an actuator 8mm high. To be honest, this was a bit too tall. Perhaps use 4mm or so.
You'll see that there are two sides of the button which have leads coming out. Cut off the two leads on one side of the button. Cut as close to the side of the button's case as you can.
insert the other two button leads directly into the GPIO connections as shown. The pins on the button are just slightly wider than the hole spacing on the Pi. You have to push the button down with a bit of pressure, but the fit is pretty good. Solder, and you're done.
LiPo Battery and Charger
![20190101_123705.png](/proxy/?url=https://content.instructables.com/FOH/JW3F/JQCO8JFX/FOHJW3FJQCO8JFX.png&filename=20190101_123705.png)
To use a LiPo battery, you need a board that can simultaneously:
- Charge the LiPo safely
- Supply power to the Pi without over-discharging the battery
- When a battery is not connected, supply power to the Pi through the USB charging port
Not all USB LiPo modules can do this. I found that the modules intended for USB power banks seem to work for this application. (That's why BikeCamera can use a USB power bank instead of a LiPo system.)
Instead of wiring the battery directly to the charging board, I recommend having an in-line plug and socket. This allows you to isolate the battery easily. You should always isolate the battery if the BikeCamera will not be used for a long period of time to avoid any circuitry draining the battery. Completely draining LiPo batteries will permanently damage them.
The plug and socket also allows you to swap batteries quickly. This may be useful if you need recording over several days without the ability to recharge. You can simply take several charged batteries with you and swap to a fresh battery when you need one.
I used JST 2.54mm pitch 2 pin connectors. Sometimes the battery will come with one of these JST connectors already installed. If not, then install the female end of a JST connector to the battery. This will involve stripping the battery leads and soldering the leads to the JST connector.
Try to secure the battery leads mechanically so that the leads can survive being pulled without breaking.
Warning: Be very careful to avoid shorting the battery leads. If you're lucky, shorting out the leads will only cause severe damage to the LiPo battery. If you're unlucky, the battery may catch on fire. Do not take any chances. Only cut and strip the insulation from one battery lead at a time. (Don't cut both leads at once!) That way it is impossible to short the battery leads together.
GPIO Power Connection
![20181230_100840.jpg](/proxy/?url=https://content.instructables.com/F5R/YU0C/JQ6YLD1I/F5RYU0CJQ6YLD1I.jpg&filename=20181230_100840.jpg)
I used micro JST connectors for supplying power to my BikeCamera. The power is supplied directly to the GPIO pins, so the Pi no longer needs power through micro USB. The advantage of this is that the wiring is much smaller and more compact than using USB. The USB cable is rather thick and doesn't bend easily into place. And the USB connectors themselves are quite large, which means that you need to allow extra room to allow them to fit into your helmet.
The specific connectors I used are micro JST PH 1.25mm pitch 2 pin connectors.
First, get the male micro JST connector and solder it to the Pi. The positive (red) wire goes to pin 2 on the Pi. the negative wire (black) goes to pin 6.
Solder the female end of the micro JST connector to the outgoing pins of the LiPo charging board.
This step depends on the design of your charging board. For my board, I needed to unsolder and remove the outgoing USB type A socket from the battery charging board. Your board may have pad connectors for outgoing power. If you're using the USB connector pads, the outgoing power is the two outside pads. If you're not sure which pin is positive and which is negative, check HERE.
Waterproofing
![20181230_100905.jpg](/proxy/?url=https://content.instructables.com/F54/O8CR/JQ6YLD29/F54O8CRJQ6YLD29.jpg&filename=20181230_100905.jpg)
Disclosure time.
While this section is called waterproofing, you will not be able to go swimming with your BikeCamera. But calling this section "water resisting" didn't sound right. Waterproofing. Maybe "Trying to keep water out" would have been better.
The best way I found to protect everything was to encapsulate all of the individual parts in heatshrink tube. It's best to use clear heatshrink so you can still see LEDs, read labels and just have everything look prettier.
If you have any sense, you'll use some type of heat-resistant gloves while you shrink the tube. I've been doing stupid things so long I'm now quite comfortable without gloves. Things don't look too warm in the video, but they are. You shouldn't believe everything you see on YouTube.
Waterproofing the Pi
![20181118_101522.jpg](/proxy/?url=https://content.instructables.com/FPL/WEM2/JQ6YLCZ2/FPLWEM2JQ6YLCZ2.jpg&filename=20181118_101522.jpg)
![Heatshrink waterproofing BikeCamera](/proxy/?url=https://content.instructables.com/FCN/DFQB/JQCO42CS/FCNDFQBJQCO42CS.jpg&filename=Heatshrink waterproofing BikeCamera)
Use 30mm clear heatshrink tubing for waterproofing your Pi.
Cut the heatshrink tube so that it is approximately 15mm longer than the Pi. If you're using a USB connector to power your pi, try to slip the tubing over the Pi with the connector inserted. This will greatly help waterproof your pi.
Get your heat gun and heat the tubing evenly on all sides. There's no need to rush this step. Try to heat gradually so things are more under control. Now for the hot bit. When the tube has shrunk sufficiently, press the ends of the tube together so that they are flat. These flattened ends stick reasonably well to each other and form quite a good waterproof seal. Any wires or cables will be neatly sealed in place too.
If you have added buttons to your BikeCamera, test to see if the buttons still operate through the heat shrink. I found in most cases that they work fine. If they do not, then gently re heat the tubing above the buttons. Pinch on the tubing and try to stretch it and stand it up taller above the buttons. This always solved any problems I had.
If you need to use the micro USB socket for charging and you weren't able to cover your connector with the tubing, now is the time to cut away the tubing covering the USB power connector. Use a small craft knife or similar to cut a neat hole. I show this process in the video.
Waterproofing Your Camera Module
![20181118_150136.jpg](/proxy/?url=https://content.instructables.com/FF0/ZPGV/JQ6YLCZB/FF0ZPGVJQ6YLCZB.jpg&filename=20181118_150136.jpg)
Cut a piece of 30mm heatshrink tubing that is approximately 20mm longer than the module.
Cut a hole in the tubing for the lens. This hole needs to be about the same diameter as the lens. I used the lens cap to mark the hole. FYI, while the rest of the tubing will shrink, this hole will stretch significantly.
I placed a scrap of wood inside the tube while I was cutting the hole to make sure I didn't cut through both sides of the tube.
As with the Pi, seal the ends by pressing them flat while the tube is cooling. At the same time, tidy the tubing around the lens to make the seal as effective as possible. Yes, I know this would be much easier if you have three or four hands. Just make it up as you go along.
Waterproofing Your Charging Board
![](/proxy/?url=https://content.instructables.com/FDL/GPOO/JQ6YLCZN/FDLGPOOJQ6YLCZN.jpg?auto=webp&fit=bounds&frame=1&height=620&width=620)
You don't need this step of you are using a power bank.
For this board, cut the tubing 15mm longer than the board at one end only. The other end of the tubing should be flush with the end of the board, leaving the USB connectors exposed.
Gently heat the tubing and flatten the end to seal as per the other modules.
BikeCamera Operation
![SS Video settings PC.jpg](/proxy/?url=https://content.instructables.com/FDY/81O8/JQ6YLC42/FDY81O8JQ6YLC42.jpg&filename=SS Video settings PC.jpg)
![Screenshot_20181230-104846_Chrome.jpg](/proxy/?url=https://content.instructables.com/F4G/42E4/JQ6YLD2B/F4G42E4JQ6YLD2B.jpg&filename=Screenshot_20181230-104846_Chrome.jpg)
Of course, you've charged your battery by now, right? Me neither.
Plug the USB cable into your charging socket and your battery into the Pi. Your BikeCamera should power up happily.
Your helmet has a website!
Not everyone can say that. I have made sure the website is mobile friendly. That's because few people have their PC accessible while they're riding their bike. If you do happen to have your PC with you, the website looks nice on your device too.
There are two ways you can access the BikeCamera's website.
1: The BikeCamera on your WiFi
To access the BikeCamera website, type your BikeCamera's address into a browser. You did take note of the address when the software was installing, right? If you didn't then connect to the BikeCamera's own WiFi as per the instructions below. The camera's address is shown on the System page.
2: Use the built-in WiFi hotspot
Your BikeCamera not only had it's own website, it also has its own WiFi network. You need this if you are away from your home WiFi and need to connect to the BikeCamera . To access the BikeCamera's WiFi hotspot, simply go to your device's WiFi settings and connect to the BikeCamera's hotspot. By default, the network name (SSID) will be "bikecamera_bc". If you changed the BikeCamera's hostname during the software installation then the network SSID will have the new hostname instead of "bikecamera". The password for the WiFi hotspot is "ChangeMe". You can change both the SSID and the password later if you want. On this hotspot network the BikeCamera's address is always 10.1.1.1 Type this address into your browser to connect.
Website login
The BikeCamera's website also requires a login. Sorry for all the logins, but it is necessary to protect your video files if you connect your BikeCamera to a work or a public WiFi. The login username is "admin" and the password is "secret". You can change these later if you want.
Using the Bikecamera Website Pages
![Screenshot_20181230-104846_Chrome.jpg](/proxy/?url=https://content.instructables.com/F4G/42E4/JQ6YLD2B/F4G42E4JQ6YLD2B.jpg&filename=Screenshot_20181230-104846_Chrome.jpg)
The next few sections describe how to use the BikeCamera web interface. I'll cover each page separately.
Video settings web page
Before you start recording for the first time, it's a good idea to check the video quality and rotation.
Video quality defaults to 1080P standard definition. The quality is very good and records flawlessly. It is possible to increase the quality to 1080P high definition. The resolution is better, but i have found that sometimes the Pi can't quite keep up and the video will hesitate momentarily every couple of minutes. If storing many hours of video is important to you then you can reduce the video quality. This will make the video files smaller and more files will fit on the card. Be aware that you will lose some detail. It will be harder to read street signs and license plate details etc.
The rotation setting you choose depends on how you mount your camera into your helmet. If the camera cable comes out of the module on the bottom, leave this setting on 0 degrees. If, like my bicycle helmet, the cable comes out the top, set rotation to 180 degrees. You can also choose to rotate 90 degrees or 270 degrees.
Start and stop recording
This bit is, thankfully, very simple. The controls to start and stop recording are at the top of the video settings page. For those minimal setup folks, you need to use these buttons to control your BikeCamera. The people with push buttons can use the pushbuttons or the controls. The power to choose is yours! When you finish your ride and you have stopped recording, you should leave the BikeCamera powered On and the charger connected. The video processing step explains why.
The Storage section lets you choose how long each video file is and how much spare space needs to be left on the SD card. There's no need to change these settings under normal circumstances.
Use the Overlay section to enable or disable displaying of the date and time on the recorded video. Choose a font size that works for you.
Advanced video settings is for people who want to get technical. It's better NOT to touch these settings in case you break something. However, for those who are more adventurous:
The BikeCamera software uses a Python module called PiCamera. The function of all of the advanced settings are described in the PiCamera documentation. The PiCamera documentation is here: https://picamera.readthedocs.io
How Video Processing Works
The Raspberry Pi's camera system is fairly basic in some ways.
The Pi can only record video in a raw format called h264. This format is unplayable on most media players, so following recording, the video must be processed into something more user-friendly. This processing stage takes a lot of processing power. The little Pi Zero is not able to handle recording and processing simultaneously. The processor gets so overloaded that the video recording function becomes erratic and the Pi can freeze completely.
To avoid this, the BikeCamera does not process video while it is recording. It simply stores the raw video files. Processing starts once recording is turned off. Each video file is processed in turn, starting from the oldest file and working through to the newest.
The video processing is processor-intensive and takes quite a long time on the Pi Zero. It takes almost as long to process the files as it did to record them in the first place. So, for a 1 hour recording, it will take a bit less than 1 hour to process. So, once you are finished recording, it's best leave your BikeCamera powered on and plugged into a charger. That way you will have an SD card full of lovely processed video that you can download and watch.
Your BikeCamera saves all processed video files in .mp4 video format.
Managing Video Files
![SS video files PC.jpg](/proxy/?url=https://content.instructables.com/FUT/R5S7/JQ6YLC0R/FUTR5S7JQ6YLC0R.jpg&filename=SS video files PC.jpg)
![Screenshot_20181230-104905_Chrome.jpg](/proxy/?url=https://content.instructables.com/F1E/3GOR/JQ6YLD2D/F1E3GORJQ6YLD2D.jpg&filename=Screenshot_20181230-104905_Chrome.jpg)
There are two ways you can access your recorded video files.
Video files web page
The video page displays each file as a link. If you left-click the link the video file will play in the browser. To save the file onto your device, right-click and save the file. You can only access one file at a time using this method. This method is slightly slower than the Windows file explorer method but it can be used on both PCs and smartphone devices.
Windows explorer
You can access all of your video files at once using windows file explorer. Open windows file explorer and type in: file:\\nnn.nnn.nnn.nnn where the 'nnn's are the IP address of your BikeCamera. Now you can access the video files like any other file on your PC. This method is slightly faster than the web page method.
Notes:
For people who have a Linux/Unix PC or an Apple PC, you can plug the SD card into your machine and read the video files directly. Windows PCs cannot do this. Raspbian configures the SD card in a format that Windows cannot read.
The Pi Zero is only a baby PC and is a bit slow transferring files. Please be patient with your BikeCamera. It really is trying its best.
Wifi Network Configuration
![SS wifi config PC.jpg](/proxy/?url=https://content.instructables.com/F7Q/GU2D/JQ6YLC7D/F7QGU2DJQ6YLC7D.jpg&filename=SS wifi config PC.jpg)
![Screenshot_20181230-104929_Chrome.jpg](/proxy/?url=https://content.instructables.com/FRH/508S/JQ6YLD2E/FRH508SJQ6YLD2E.jpg&filename=Screenshot_20181230-104929_Chrome.jpg)
Use the Wifi networks page to connect the BikeCamera to WiFi networks.
This page will take a couple of seconds to load, rather than instantly like the other pages. The BikeCamera scans for available WiFi networks before displaying the options. The WiFi network you configured during setup will already be configured on this page. If you want to join another network, key in the password for your selected network and click connect.
Your BikeCamera will remember the password and will automatically re-connect to any wireless network to which you have previously connected. The order in which BikeCamera will try to connect is to try the first network you configured, then the second and so on. To change this order, delete networks and add them in the order you want BikeCamera to connect.
WiFi Hotspot Web Page
![SS wifi hotspot PC.jpg](/proxy/?url=https://content.instructables.com/FTJ/Q0EY/JQ6YLCAR/FTJQ0EYJQ6YLCAR.jpg&filename=SS wifi hotspot PC.jpg)
![Screenshot_20181230-104953_Chrome.jpg](/proxy/?url=https://content.instructables.com/F0H/US7Y/JQ6YLD2G/F0HUS7YJQ6YLD2G.jpg&filename=Screenshot_20181230-104953_Chrome.jpg)
Use this page to modify settings for your BikeCamera's hotspot.
For most people, changing the network name (SSID) and password is about as adventurous as you should get. Your BikeCamera will choose sensible values for the advanced settings at installation time.
The advanced settings it chooses are based mainly on your location. Playing with the advanced settings can easily result in your BikeCamera broadcasting on illegal frequencies in your country or even trying to wreck the internet. (It probably won't wreck the internet, but it might try)
BikeCamera Web Page Login
![SS bikecamera login PC.jpg](/proxy/?url=https://content.instructables.com/FL5/KLGR/JQ6YLC0O/FL5KLGRJQ6YLC0O.jpg&filename=SS bikecamera login PC.jpg)
![Screenshot_20181230-105000_Chrome.jpg](/proxy/?url=https://content.instructables.com/F2J/AB6D/JQ6YLD2H/F2JAB6DJQ6YLD2H.jpg&filename=Screenshot_20181230-105000_Chrome.jpg)
Use this page to change the login to your BikeCamera's website. This is the password that is "secret" by default.
System Page
![SS system PC.jpg](/proxy/?url=https://content.instructables.com/FMZ/ZXQ5/JQ6YLC0Q/FMZZXQ5JQ6YLC0Q.jpg&filename=SS system PC.jpg)
![InkedScreenshot_20181230-105015_Chrome_LI.jpg](/proxy/?url=https://content.instructables.com/FPP/V9ZQ/JQCO4YUS/FPPV9ZQJQCO4YUS.jpg&filename=InkedScreenshot_20181230-105015_Chrome_LI.jpg)
The system page gives you information about:
Current WiFi client connection details. You can see which wifi network your BikeCamera is connected and its current IP address.
How your BikeCamera is performing. The screen shows SD card capacity, CPU load and memory usage.
Note: The SD card usage will normally be quite high, but the status bar graph should still be shown in green. If the usage is showing yellow or red, then head to Video settings > Storage and increase the "SD card keep free" setting. If you max out the setting and still can't get a green bar, things should be OK. It probably just means you have a really big memory card.
Controls to reboot and shutdown the BikeCamera. See the "Shutting down and resetting" section for a full description about when it is best to reset and when to shutdown your BikeCamera.
Shutting Down, Resetting and Charging
Shutdown and reset
You can use controls on the System page or use the power pushbutton to reset and shutdown the BikeCamera.
Charging
My usual routine is to leave my BikeCamera powered on all the time. I simply plug in the charging cable and leave it turned on. This allows the BikeCamera to process all of the video that it has recorded. It also allows me to access the web interface and the recorded files.
I only power down the BikeCamera if I'm not going to use it for two or three days. I usually just leave my BikeCamera on charge all the time, so it's ready to go whenever I need it.
I have found that it is a bad idea to charge the battery while the Pi is connected and shut down. Some chargers output a flickering voltage when they are lightly loaded. This does not seem to be enough to make the Pi boot, but some mechanical hardware in the camera keeps flicking on and off. This is a really bad idea because the camera hardware will soon wear out with this kind of abuse. So when you are charging the BikeCamera, make sure that either:
- The Pi remains running OR
- The power to the Pi is unplugged from the battery.
Before a ride
I have found that the BikeCamera can be a bit prone to locking up if it is left running for several days. So to avoid lockups while I am riding, if the BikeCamera has been left running, I always reboot the BikeCamera before I start to ride. This minimises the chance of the BikeCamera freezing while I am riding.
Pushbuttons and LEDs
Power pushbutton and LED
The Power LED will be lit whenever the Pi has booted up. The Power pushbutton has three functions:
Reset. If the power button is held down for at least 1 seconds and then released, the BikeCamera will perform a reset. When in the Reset mode, the Power LED will flash slowly.
Shutdown. If the power button is held down for at least 6 seconds and then released, the BikeCamera will shut down. When in Shutdown mode, the Power LED will flash fast.
Factory reset. If the power button is held down for at least 15 seconds and then released, the BikeCamera will perform a factory reset. When in Shutdown mode, the Power LED will flash very fast.
Recording pushbutton and LED
The recording LED will be lit whenever the camera is ready to record video.
Press the button once to start recording. The LED will flash when the BikeCamera is recording video.
Press the button again to stop recording. The LED will stay lit.
Bicycle Helmet Mounting
![20181229_133036cropped.jpg](/proxy/?url=https://content.instructables.com/F6B/I7IL/JQCO5G0D/F6BI7ILJQCO5G0D.jpg&filename=20181229_133036cropped.jpg)
![20181229_133029cropped.jpg](/proxy/?url=https://content.instructables.com/FPH/9BMH/JQCO5G0B/FPH9BMHJQCO5G0B.jpg&filename=20181229_133029cropped.jpg)
![20181229_132709cropped.jpg](/proxy/?url=https://content.instructables.com/FQZ/IFW5/JQCO5G0H/FQZIFW5JQCO5G0H.jpg&filename=20181229_132709cropped.jpg)
![20181229_132741cropped.jpg](/proxy/?url=https://content.instructables.com/FAZ/WYS5/JQCO596S/FAZWYS5JQCO596S.jpg&filename=20181229_132741cropped.jpg)
![20181229_132856.jpg](/proxy/?url=https://content.instructables.com/F7T/MR8X/JQ6YLD17/F7TMR8XJQ6YLD17.jpg&filename=20181229_132856.jpg)
![20181229_132927.jpg](/proxy/?url=https://content.instructables.com/F8C/W3SH/JQ6YLD18/F8CW3SHJQ6YLD18.jpg&filename=20181229_132927.jpg)
![20181229_132840.jpg](/proxy/?url=https://content.instructables.com/FBD/HQ47/JQ6YLD16/FBDHQ47JQ6YLD16.jpg&filename=20181229_132840.jpg)
![20181229_132704cropped.jpg](/proxy/?url=https://content.instructables.com/FXD/SLWO/JQCO5BV3/FXDSLWOJQCO5BV3.jpg&filename=20181229_132704cropped.jpg)
![20181229_132823cropped.jpg](/proxy/?url=https://content.instructables.com/F75/8LVR/JQCO5BUX/F758LVRJQCO5BUX.jpg&filename=20181229_132823cropped.jpg)
![20181229_132800cropped.jpg](/proxy/?url=https://content.instructables.com/F16/YZSE/JQCO5BUZ/F16YZSEJQCO5BUZ.jpg&filename=20181229_132800cropped.jpg)
Self-adhesive Velcro is your friend.
I attached everything to my helmet with Velcro. Using Velcro rather than glue has many advantages:
- All parts can be removed from the helmet easily. For instance, if it is really going to pour rain, you can easily remove all parts from your helmet.
- The parts can be re-positioned for comfort or convenience.
- The Velcro is easily strong enough to mount even the heaviest components like the battery.
You can see from the photos that I was able to fit all components on the inside of the helmet. Apart from the camera of course. It's necessary to mount that on the outside. If you can't fit the components on the inside there's nothing wrong with mounting on the outside of the helmet. It just doesn't look as pretty.
For people using a minimal setup, it can be difficult to mount the power bank on the helmet. If you are lucky, you can find one that is a good shape for fitting to the helmet. If you can't, you may have to leave the power bank in your pocket and run a long USB cable from the power bank to the BikeCamera charging port.
Is it safe to mount parts on the inside of the helmet?
I think that mounting the BikeCamera components on the inside of the helmet will reduce the safety of the helmet to some degree. The cushioning between your head and the outside impact is still there, but the objects on the inside may apply the inside forces to a smaller area of your skull. So long as the cushioning is still there, I'm comfortable that the safety of the helmet is OK. If you are concerned about this, then mount the BikeCamera components on the outside of the helmet.
Motorcycle Helmet Mounting
I have not mounted the BikeCamera inside a motorcycle helmet, but it should be easy to do.
Most modern helmets have a recess next to the rider's ears for mounting Bluetooth speakers. This recess is usually covered by a removable pad. So, remove the pad and use this space for mounting your BikeCamera.
I would probably choose to mount the camera module inside the helmet so that it can record through the visor. This position would also keep the camera module completely dry. Providing you remember to shut your visor.
Enjoy Your BikeCamera
Hopefully your BikeCamera can help you if you have a fall or entertain you if you stay upright.
Or both.
If both, remember to post to YouTube fails for everyone to enjoy ;)