It began by reading an article from from Dr. Ian Walker (http://www.sciencedirect.com/science/article/pii/S0001457506001540) about the passing distance of cars when overtaking bicycles. He found out that when he was wearing a helmet, cars passed closer and when wearing a wig (to appear as a woman) cars kept more distance. I found this very interesting and thought about testing something similar. I didn’t plan to test the helmet effect (or the wig!). I was more interested in passing distances due to different bike types. But first I needed a distance metering setup with the following characteristics:
- portable: The device should be small enough to fit on a backpack, so that it is easy to use on different bikes
- autonomous: Of course it would help to run on battery for a fairly long time. But even more important is that it runs by itself without trouble.
- good measurement accuracy: This is very important of course. The more the better.
- as invisible as possible: Of course the specimens shouldn’t be distracted by a strange device and act normal.
I started to play around with a Raspberry Pi and its GPIO controls about a year ago so I was not totally new to electronics. But for this project, an Arduino micro controller had some advantages over the Raspberry Pi. Really nice about simple micro controllers is that they don’t need to boot as long as micro computers and are much simpler to use with sensors. So I decided to start with an Arduino. I had a cheap (SainSmart) range meter already but the measurements were not very consistent. So I searched for something more advanced. I learned that MaxBotix produce very reliable devices so I ordered a LV-MaxSonar-EZ1 from the UK (it is extremely difficult to find special parts like that in Norway). It arrived quickly and I was surprised how small it was. But testing it with the Arduino gave very stable result. So a good choice I guess.
But then there is another problem: The Arduino alone can not save data. However, the Raspberry Pi can.. So I hooked up the Arduino to the Pi and copy-paste-wrote a terrible Python script (I am new to this funny language) to save the data to the SD card. It worked pretty well after some adjustments. Then I attached the whole setup to a piece of wood and build a little holder from some IKEA spare parts to hold the distance meters. So it looked like this:
The battery is a 12k mAh power bank and can power the full setup for a full day probably. I used an old phone to connect to the Pi via USB and SSH. The phone was used to start the recording script and actually displayed the measured distances an the screen.
So next challenge was to get it portable. I chose a quick and easy version for now: an ice cream box covers most of the electronics and the whole thing was attached to an old CamelBag backpack:
There is definitely room for improvement. Especially when it comes to point 4. But this is just a first try. Ready to go for a first test ride!