BikeCamera Video Camera

1,148

8

12

About: Keen on making anything that pops into my brain. No fixed interests. Pretty much everything interests me.

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!

Step 1: Configuration Options

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.

Step 2: What You Need

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:

  • A USB power power bank. See battery sizing section below.

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

Step 3: Battery Sizing

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

HoursBattery capacityUSB Power Bank physical size (estimated)
1420mAhSmall (Lipstick size)
2840mAh-
31260mAhMedium (1/2 smartphone size)
41680mAh-
52100mAhLarge (Smartphone size)

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

Step 4: Memory Sizing

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:

Memory card sizeApproximate hours of storage
16GB2 hours
32GB4 hours
64GB8 hours
128GB16 hours

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

Step 5: Real Time Clock

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.

Step 6: ​Choosing a Camera Module

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.

Step 7: Camera Cable

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?

Step 8: Installing Raspbian

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...

Step 9: Pi Zero Configuration

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.

Step 10: Install the BikeCamera Software

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.

Step 11: Installing the Real Time Clock (RTC)

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.

Step 12: LED Installation

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.

Step 13: Pushbutton Installation

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.

Step 14: LiPo Battery and Charger

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.

Step 15: GPIO Power Connection

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.

Step 16: Waterproofing

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.

Step 17: Waterproofing the Pi

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.

Step 18: Waterproofing Your Camera Module

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.

Step 19: Waterproofing Your Charging Board

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.

Step 20: BikeCamera Operation

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.

Step 21: Using the Bikecamera Website Pages

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

Step 22: 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.

Step 23: Managing Video Files

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.

Step 24: Wifi Network Configuration

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.

Step 25: WiFi Hotspot Web Page

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)

Step 26: BikeCamera Web Page Login

Use this page to change the login to your BikeCamera's website. This is the password that is "secret" by default.

Step 27: ​System Page

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.

Step 28: ​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.

Step 29: 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.

Step 30: Bicycle Helmet Mounting

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.

Step 31: ​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.

Step 32: 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 ;)

Ride safe.

Share

    Recommendations

    • Trash to Treasure

      Trash to Treasure
    • Tape Contest

      Tape Contest
    • Arduino Contest 2019

      Arduino Contest 2019

    12 Discussions

    0
    None
    Porris

    Question 3 months ago on Step 25

    I can access the camera to record via the ip address (192.168.1.xx) but I can't access via the hotspot. RPi WiFi shows as bikecamera_bc and I can log on to it but 10.1.1.1 in my browser results in Safari returning the error message "You Are Not Connected to the Internet, This page can't be displayed because your computer is currently offline." I've done a couple of reinstalls but still I can't get the camera via the hotspot. Any Ideas?

    3 answers
    0
    None
    njkengPorris

    Answer 2 months ago

    I have updated the software on GitHub. Can you please try reinstalling one more time? Let me know how you go.

    0
    None
    Porrisnjkeng

    Reply 8 weeks ago

    Same result I! I’m afraid. Did it work for you?

    0
    None
    njkengPorris

    Reply 8 weeks ago

    Mine works ok for Android and windows 10. I see you mentioned Safari. I will try to borrow an iPhone and see if I can get that to work too

    0
    None
    Porris

    Question 3 months ago on Step 29

    What's the best way to delete recorded video files from the SD card?

    1 answer
    1
    None
    njkengPorris

    Answer 3 months ago

    There's actually no need to delete files. When the card is getting low on space BikeCamera starts deleting the oldest file and replacing it with the newest one. That way you have your SD card full of the latest recordings.
    If for some reason you really want to clear all of the files, then access the card using Windows Explorer and delete the recordings as you would any other file.

    1
    None
    njkeng

    3 months ago

    The "O"s in the URL are capital "o" not zero. It's a bit of a pain when you can't copy and paste.

    1 answer
    0
    None
    Porrisnjkeng

    Reply 3 months ago

    Thanks, I realised that when I pasted it into a document. I thought I had deleted the comment.
    Almost everything works now. Very impressed with the camera and with the Website. Great instructable. Great response time too.

    0
    None
    Porris

    Question 3 months ago on Step 32

    Great project. Thanks for publishing. I was wondering if the camera could face backwards and be used with a small touchscreen as a rear view mirror.

    1 answer
    1
    None
    njkengPorris

    Answer 3 months ago

    I think this would be impractical. The only video screen technologies that I am aware of for the Pi use large amounts of power. The battery life would be terrible. Sorry.

    0
    None
    JamesM955

    3 months ago

    You've done a good job of this and it looks great but may I suggest you revise the power source. Lipo batteries can explode or catch fire after even moderate impacts - thats not something you want strapped to your head if you have an accident.

    1 reply
    1
    None
    njkengJamesM955

    Reply 3 months ago

    Thanks for your comment. It allows me to address this concern that several people will have. Using LiPo is absolutely not a problem. LiPo batteries only catch fire or explode under two circumstances: Being punctured or overheating. Overheating is not going to occur while you are riding. If your battery is punctured, you have much bigger problems than your battery. Your head would be the concern. Second, without exception, ALL power sources actually use LiPo batteries. USB power banks, go pro cameras, your phone all use LiPo. All of these have the same chance of catching fire. Using a LiPo cell is no more risk then using any other device for power. As you will know from experience of carrying the devices in your pocket all the time the risk of fire is so low as to be practically unheard of.
    You have probably heard about increased risks from LiPo with drones or RC planes and cars. These are special circumstances for several reasons. First, batteries are much more likely to be punctured from high speed crashes. Second, the batteries are generally much higher capacity and if a problem occurs you will get a bigger fire. Third, batteries are generally charged as fast as possible and push the temperature limits to do so. Fourth, often general purpose chargers are used and it's very easy to charge at the wrong (higher) voltage. None of these four things applies to the BikecCamera.