Skip to content

ENG 00 Welcome

Hien TRAN-QUANG edited this page May 10, 2019 · 3 revisions

The project

For motorcycle rallies of the French Road Rally Championship (CFRR), or for my own rides, I used until now a paper-based roadbook reader. An electric version with a remote control let me go forward or backward the lines of the roadbook to navigate.

There's an electronic device , based on e-paper, but the price and the fact that for what I know it is intended only for CFRR rallies do not allow other use for my own trips nor reuse the reader to read ebooks.

For my needs to create roadbooks, I started to code a site to generate instructions.

Then came the moment to develop the "hard" part of the roadbook system : the reader. So, to stand out from other products, I will integrate an adjustable odometer, a speedometer and average speed calculator. All-in-one !

Specifications

The initial idea is to mount a Raspberry Pi on the bike, to have a digital roadbook reader. By means of a remote control with buttons, it can move forward or back lines of the roadbook, and we can reset the integrated trip on the screen. But how to build this object?

Constraints

Let's start with the screen. Paper roadbooks is the equivalent of a 7 inch screen. Ebook readers are also about 7 inches wide. The price is quite cheap for that screen size and one who need a few things bigger can get an 8 or 10 inches. So let's keep the 7 inches. Regarding connections, simpler is beter, so HDMI: no GPIO blocked on the Rpi, no driver too peculiar to get. Regarding the brightness, my heart goes to a very bright screen, to be readable even in direct sunlight. That is 800cd / m2 minimum. Fortunately, I found a reference that offers this (see below, for the first prototype I did with a second-hand screen less bright than I replaced quickly)

Now on the Raspberry Pi. There are several models of the Raspberry Pi. I will not go into detail but here is why I took the Rpi Zero W:

  • The form factor: barely the size of a metro ticket

  • Wifi / bluetooth for development: I can connect remotely to correct bugs. A Rpi Zero v1.3 without wifi may have been enough, but you can only buy one at a time. And the wifi is used to connect, setup the beast and transfer files (since version 2).

  • It is sold headerless, that is without soldered connection pins. For a final realization, it is convenient to weld only the necessary.

  • It is equipped with the USB OTG: while the other series of RPi can only be master, the RPi can be slave and emulate a keyboard, a mouse, a network device or ... a USB key. The idea is to be able to connect the RpiRoadbook on the computer to transfer the files, but to hide the program of the driver to avoid false manipulations.

  • I'm going to add a real time clock module (RTC). In rally, it is useful to know the time, to avoid penalties at checkpoints.

  • I will program everything in Python3. This is what seems to me the simplest for development: no compilation, lots of modules, accessibility for those who would like to modify my program.

The accessories (remote control and wheel sensor) are common: to be able to move in the menus of the RpiRoadbook and to measure distance traveled and speed.

A last essential point and a little technical: the embedded system. Rally events often last well over 12 hours: start at 8 am, end at 1 am the next day. Battery operation is therefore not feasible given the screen consumption. The RpiRoadbook is plugged onto the battery of the bike. When I shut off the engine, the power will also cut and the Raspberry Pi does not like that much. Indeed, with the default operating system (Raspbian), a shutdown procedure is necessary to avoid the corruption of files on the memory card (backup of some files used by the system for the next boot, etc.). It would not be very practical if the system broke down in the middle of a race day.

One solution is to have a power supply (or UPS / UPS) that will keep a little power while turning off the Rpi. It is necessary to detect the cut, send a signal to the Rpi to tell him to go out, time the extinction, etc. A real pain in th A** ... One solution is to make the system read-only, so there is no file to save. The memory card is not changed. Startup can always take place. This will however have constraints including the GUI, but I will come back to this point in the post on the framebuffer.

Finally, by positioning myself in the perspective of an embedded system, I can hope for a quick start of my application, by loading in memory only the features that I will need: I aim for an optimization to 10 seconds between the ignition and the roadbook selection screen, instead of 30 to 40 seconds for the Raspbian GUI. Another advantage is that the system heats up less, since it only does what is asked of it. We'll see how I do that with Buildroot.

The choice of components

Here is the list of components needed for the building the RpiRoadbook:

  • 7-inch screen, HDMI: several choices. The cheapest, a non-touch back camera monitor at 40 €. The brightest: New Haven Sunlight readable touch at 120 € (without VAT). For my first prototype, I found a used Adafruit. If you need a larger display, you can still plug it into your TV, but it's less convenient on a bike!

  • Rpi Zero W: 20 € at Kubii Essential kit without memory card, or 27 € with a 4GB card. (+ 5 € of port). I had a 2GB hanging in a drawer.

  • A short HDMI-MiniHDMI cable (0.50m): 1 € on Ebay or Aliexpress. There are angled versions used for drone cameras, at 11 € on Amazon

  • 5 buttons remote control: a chinese one at 5 € on ebay. I had looked for a KTM commodo with Chinese hat, but at 150 € the spare part, a little too much. In addition, simple push buttons to replace the switch buttons (2 €/5). Another possibility is to use the Trailtech remote control (with 3 buttons, 32 € + 5 € of port) with a reversing switch with 2 positions type Touratech (37 € + shipping).

  • RTC clock module DS3231: 6 € / 3

  • 12V to 5V step-down regulator: 4 € on Amazon

  • wheel sensor: I already had one with my Striker. Otherwise, it is about 20 € on Louis.de (+ 5 € of port)

  • waterproof connectors, for disassembly. I chose JST JWPF at home to reuse the sensors and power of my Striker. But any waterproof connector would do well: 6 poles for the remote control, 2 for the power supply, 2 for the wheel sensor.

  • wire, thermo sheath for connections, some resistors of 10KOhm, a strip test plate (from 10 to 20 € depending on what you have)

  • [To be completed for the case when it is done: PVC + plexi plate + RAM ball (10 €)]

An total estimate of ... 120-130 € for a cheap version, and 200 € for a Deluxe version! And some time left and some dexterity !

Edit of 13/11/2018: Regarding the memory card, one can have a card with greater capacity. Indeed, a flash card is given for 100,000 write cycles per block. Beyond that limit, risk of error appears. But I will save the distance traveled quite often, every 100 meters. Flash cards have a process to avoid this: the "wear leveling". The principle is not to write in the same place the file that you want modified / saved. It works well if there is space available, it gives more time before having to go back to writing on one block. I had a 2GB lying around, but if you have a card of greater capacity, use it.