Introduction: Smart Bike

About: Student at Howest Kortrijk

I made a smart bike and or smart bike appliance where you have an esp32 with sensors that takes sensor data during your bike rides.

Supplies

a breadboard or 2.

wires of any kind to connect your component.


// Raspi side

Raspberry pi

Raspberry GPIO extension board

LCD

potentio

buzzer (I used an active one)

// ESP32 side

ESP32

DHT11 temp and humidity sensor

hall sensor (I used a hamlin hall sensor)

LDR (light dependent resistor)

GPS Module (neo6mv2)

OLED display

2 x 10k resistors

A powerbank or battery's with a usb port so you can supply the esp32 on the go


Do note that whilst most of these things are somewhat affordable the price of raspberry pi's has gone up a lot.

for the main components you can find links and prices in the Bill of Materials below. Breadboards and wires are not in there since that's open to personal preference you might not even need a breadboard if you find another way to connect it all.

Step 1: Make the Circuit

this here is the circuit both the esp32 and the raspi. do note that you don't have to have these 2 together it's merely so you can see them both. you can connect everything directly to the raspi or have it on a breadboard just make sure you connect to the correct pins. (for the LCD check the class in the repository called LCD to make sure all the pins are correctly connected).

both of the resistors should be 10k Ohm.

Step 2: Make the Database

When the app.py code is running you should be able to see if everything is working correctly and that the database is getting data. This would be whenever you first have the code running and are sending it data via the esp32. first things first make sure you have it on the side of the esp32 if so then check the app.py and then ofcourse your database.

Step 3: Get the Code and Alter What's Needed

This here is what our code folder will look like.

the app.py is the file that should be running here.

it will catch the data from our esp32 so make sure your esp has the arduino code uploaded before anything else.

As you can see in the last Image we have our IP's. This is the only thing you'll have to edit in the code so don't worry. First things first when you run the app.py code you should see your IP of the raspi displayed on your LCD. this should show both the static and wifi IP. The wifi IP is what you'll be wanting to replace the IP in our Arduino with. Above that you'll need to make sure the esp32 is connected to the same wifi so enter the ssid of your wifi and the password under that.

As for the raspberry pi you will have to make sure it's on the same network. In short connect to your raspberry pi through ssh in whatever way you'd like then open the terminal and do the following: type "sudo nano /etc/wpa_supplicant/wpa_supplicant.conf" here you will find your wifi info so add whatever network you're wanting to connect to. The priority here is lower for a higher priority so it will first try to connect to 1 then 2 and so forth.

if you're using vnc or other things you can just go to wifi and make sure your Raspi is connected to it.


Code Repo

Step 4: Case

For my case that holds my esp and it's sensors I made a simple 3 print in which to hold it. here I make use of a small breadboard to keep it all in place.

As you might have seen in the final picture up top I ended up using the plastic of a U shape paper folder to cover the top with and put my lcd and ldr between.

Feel free to look for other case Ideas and or to make your own.

I'd actually suggest not using my 3d print as it ended up being a bit too small. You can keep the general same thing just make sure you have enough space for it all.


Step 5: Have Fun With It

try it out have some fun gathering data and displaying the various route's you do. If there's anything you'd like to add feel free to do so and if you've got any questions about my project feel free to contact me.

If you are interested feel free to give the file below a read as it includes the process of making this project that I went through.