Introduction: Self-service Bike Rental Station Notifier

About: Fan of new technologies. Wants to take part in the IoT revolution.

Hey there !

Ever wanted to have a little object that notifies how much free spots or bikes are remaining at your closest self-service bike station ?

You are at the right place to get started !

This tutorial will use the famous Arduino IDE.

Main steps covered:

- Hardware setup

- Fetching the data from the company offering the bike self-service (in this tutorial we will use “vLille” in France -

- Streaming this data to the WiFi chip (ESP8266)

- Blinking the leds according to the data received

Step 1: Hardware

The parts are pretty easy to hook-up.

The D1 mini board uses the famous ESP8266 microcontroller WiFi integrated chip for about 5$ only.

You can buy this board at lowest price on AliExpress.

This MCU (Microcontroller Unit) allows low consumption WiFi projects to run with great performance.

More info here:


- Plug in the DATA cable of the 2 led strip (WS2812) to the pin labelled "D1" on the board.

We will use this pin in the Arduino code (#define DATA_PIN 1).

- Plug in the 5V cable to the pin labelled "5V" on the board.

- Plug in the GROUND cable to the pin labelled "G" on the board.

Step 2: Software

Now comes the more "tricky" part.

This section can be divided in two:

1. The script that will fetch the data on the self-service bike rental website.

2. The Arduino code to progam your ESP-8266.

The source code can be found on my GitHub - code. Give it a star if you like it :)

1. Web scraping the data with Python

You can get the script I wrote in the "Python" folder.

This python program is simply there to give you an idea of how to webscrap the desired bike rental service.

As I already said, this tutorial covers the service vLille in France.

This tutorial assumes you know what MQTT protocol is. I used the HiveMQ online free MQTT broker ( to establish the connexions.

- Host:

- Port: 1883

The python program gets the information we want from hereand then sends it to the MQTT broker. You can visualize the upcoming data on this page. Make sure to subscribe to the topic "notifier" (defined in "").


- Python 3 or above (

Python extra libraries:

sudo pip install "package"

To run the program simply execute the

sudo python3

2. Programming the ESP-8266 (D1 Mini) with Arduino IDE


- Latest Arduino IDE (

- Arduino core for ESP8266 WiFi chip (

Make sure to follow the installation guide

- Libraries

- Select the board D1 mini as shown in the screenshot in Arduino "Tools".

You may now compile the code correctly.

- Power the board and you'll see a new WiFi network created (ESP_Self-service bike notifier).

- Connect to it.

- Go to if a web page does not open by itself.

- Select your personnal home WiFi network and enter the password.

- Confirm. Now the ESP will reboot and connect to YOUR personnal home network by itself (if you entered the correct information).

- Finally, run the python program that will send the data to the broker.

The ESP-8266 will then receive the upcoming data and light the LEDs accordingly !

Color code:

0 - the LED will be RED
> 0 && <=2 - the LED will be ORANGE
> 2 && <= 5 - the LED will be BLUE
> 5 - the LED will be GREEN

Step 3: Enjoy !

Thanks for following this tutorial.

Now you'll know instantly by looking at the color how many bikes and spots are available ! Good ride !

It is a big mix of many different "notions" so please be patient ;)

Also, keep in mind I wrote this tutorial very quickly...

BONUS: If you are interested in printing a little 3D case that fits perfectly, here is the file.

Have fun and feel free to send me feedback of what you did with this !

Green Electronics Contest 2016

Participated in the
Green Electronics Contest 2016

Make it Glow Contest 2016

Participated in the
Make it Glow Contest 2016