Skip to content
Stefan Lenz edited this page Jun 19, 2024 · 8 revisions

The Software

This is a minimal app to be used as key for the Copenhagen Wheel

The app finds the characteristic string of a wheel and then sends the passcode. With this a connection is established and the wheel is unlocked. After the unlock the ESP32 can be switched off and the wheel continues to run. There is a default timeout of the wheel of 10 minutes for a disconnect. If the bike is parked for this time, the key has to be used again. If the bike is in motion, no key action is needed.

To make the app working the right passcode has to be found. Run the app once and then find the right passcode. Recompile it with the right passcode and you have a key for your wheel.

The software is mostly identical with the original repo at https://github.com/subparpedestrian/cphw-esp32

Currently I have only added a few lines of code that make the builtin LED blink three times after unlocking the wheel.

The Hardware

Currently only ESP32 BLE capable boards are supported. I used a Wemos Lolin32 board to build a key. The board is small and has the charging logic for a Lithium Ion battery on board. This is optional of course, a normal battery is enough.

Another solution would be the Wemos D1 ESP32 boards. They have an Arduino UNO form factor and can be used with a 9V battery.

Both solutions also work with a power bar.

Wemos Lolin32

The board is quite small and fits in a little box. This is how the key looks like in the end:

The Key

(The image on the key is the logo of the Audi IT Software Development Centre, where I work).

The material you need for this would be

  • A Wemos Lolin32 board
  • A small switch or push button
  • A 3.7 volt Lithium Ion battery.
  • A case big enough for the board

Material

To build the key, first cut two wholes in the box. One big enough for the switch and one to plug in the USB connector. This is used to charge the board and to upload new software.

The Switch

Next cut the power lead from the battery, solder the switch in and pack everything in the box. Plug in the controller.

Packing

Keen observers will see on this picture, that the polarity of the battery is reversed. This is only because the batteries come in two variants. Some have ground on the right lead, others on the left lead. The battery that fit best in the box had the wrong polarity for the Wemos board so I changed it. Have a close look on battery polarities if you build this.

After testing, you can close the box and you are done.

If you do not want to use a battery, simply us a CR2032 battery and a battery holder. In this case, the leads go directly to the VP and GND pins of the board.

Wemos D1 R1 ESP32

These boards have a UNO form factor. They can be powered with a standard power bar. Alternatively a 9V battery can be used. The key is a bit bigger but works just as well.

The advantage of the UNO board would be to add more peripherals, like for example a display.

Clone this wiki locally