# DIY Electric Bike

> A bicycle conversion combining a custom belt drive, CAD-designed mounts, and an ESP32 dashboard.

Canonical page: [DIY Electric Bike](<https://devanmetz.com/portfolio/diy-electric-bike/>)

Project date: 2022

Updated: 2026-10-15

Category: Mechanical & electrical

Status: Physical build

Tags: Fusion 360, 3D printing, ESP32, C++

- **My work:** Mechanical integration, printed mounts, and dashboard
- **Electronics:** ESP32 · VESC UART · TFT display
- **Files:** Fusion 360 assemblies, STL parts, and C++

- [Explore the build files](<https://github.com/DevanMetz/DIY-Mid-Drive-EBike>)

## In short

I converted a bicycle with a custom belt drive, printed mounts, and a dashboard that shows data from the motor controller. The build brings together mechanical design and electronics so I can see battery and riding data on the bike. The bicycle is assembled, while the dashboard software remains a prototype.

![A blue bicycle fitted with a custom motor mount, large rear pulley, belt drive, and electronics.](<https://devanmetz.com/_astro/ebike.2RbJRJf1_1fHioh.webp>)

The assembled bicycle conversion, showing the motor, belt drive, and frame-mounted electronics.

## What I built 

The bicycle in the photo is the assembled result of three connected pieces of work: fitting a belt-driven motor to the frame, making the mounts and pulley, and giving the electronics a readable display. I designed the mechanical assembly in Fusion 360, a computer-aided design (CAD) tool, and printed parts to fit the bike.

An ESP32, a small programmable computer, runs the dashboard. It reads the VESC motor controller over UART, a serial data connection, and shows battery voltage, power, speed, and distance.

The bike is assembled; the dashboard is still prototype firmware (the software running on the ESP32). The [public build files](<https://github.com/DevanMetz/DIY-Mid-Drive-EBike>) include the editable CAD, printable parts, code, and build photos.

## Mechanical assembly 

I used Fusion 360 to fit the motor, pulleys, and mounts around the bicycle frame and rear wheel. A belt connects the motor to a large rear pulley, with the electronics mounted on the frame.

### Printable parts 

The printable parts include:

-   The motor mount.
-   The rear pulley.
-   Two seat-tube clamp halves.

The CAD files also include a 180-tooth pulley revision. The editable assembly is useful for checking clearances or adapting the mounts to another frame.

## Electronics and live readings 

An ESP32 communicates with the VESC motor controller over UART. The display sketch (the program running on the ESP32) uses three code libraries:

-   **VescUart** reads controller data.
-   **TFT\_eSPI** drives the TFT, a thin-film-transistor display.
-   **FastLED** controls addressable lighting, where each light can be set separately.

### Measurements and lighting 

The display presents battery voltage, estimated electrical power, speed, distance, and amp-hours (a measure of electric charge used).

Power is calculated from input voltage and current. Speed and distance are calculated from controller RPM (revolutions per minute) and tachometer readings that track rotation using constants in the sketch.

The same firmware cycles colors on an eleven-pixel WS2812 LED strip while polling telemetry (regularly reading controller data) and updating the dashboard.

## Dashboard implementation notes 

The sketch communicates with the controller at 115,200 baud, the serial connection’s signaling rate. It updates individual regions of the TFT as the readings change.

### Checking the conversions 

The telemetry conversions are specific to this build. Motor pole count (the number of magnetic poles), wheel diameter, and pulley ratio (the relative sizes of the drive pulleys) affect the meaning of the reported RPM and distance.

The code includes hard-coded conversion factors (fixed numbers in the program), and some nearby comments describe different example values. Those constants need to be checked against the actual drivetrain before reusing the sketch.

## Build files 

| Folder | Contents |
| --- | --- |
| `CAD/Fusion360` | Editable components and the full bicycle assembly |
| `CAD/STL` | Motor mount, rear pulley, and seat-tube clamp exports in STL, a 3D-printable mesh format |
| `Code/VESCOM` | Dashboard sketch and display assets |
| `Pictures` | Assembled bike, CAD assembly, pulley, and dashboard photographs |

The CAD, printable parts, dashboard code, and build photos are in the [public repository](<https://github.com/DevanMetz/DIY-Mid-Drive-EBike>).

## Status and reuse 

The bicycle is assembled, and the dashboard remains prototype firmware. To adapt the build, start with the editable CAD and check the frame fit, belt alignment, mount strength, and telemetry constants for your components.

## FAQ

### How is the motor connected to the bike?

A belt connects the motor to a large rear pulley. The motor mount, rear pulley, and two seat-tube clamp halves are 3D-printed parts designed in Fusion 360.

### What does the e-bike dashboard show?

Battery voltage, estimated electrical power, speed, distance, and amp-hours. An ESP32 reads the VESC motor controller over UART at 115,200 baud and draws the readings on a TFT display.

### Are the build files available?

Yes. The public repository includes the editable Fusion 360 assembly, STL exports of the printed parts, the dashboard code, and build photos.

### Can I adapt the build to another bike?

Start with the editable CAD and check frame fit, belt alignment, and mount strength. The dashboard is prototype firmware, and its telemetry constants must be checked against your motor, wheel, and pulley ratio.

## Build photos

![Close-up of the blue bicycle frame, where a motor on a tan mount plate drives a black toothed belt, with a frame bag, yellow connectors, and wiring running down to a black electronics case.](<https://devanmetz.com/_astro/ebike-drive-closeup.zp_ATKIk_ZD05Ob.webp>)

A closer look at the motor mount, belt drive, and frame-mounted wiring.

![Black printed pulley mounted beside the rear wheel of a blue bicycle, with a toothed belt running around it.](<https://devanmetz.com/_astro/ebike-rear-pulley.f-gFyXDK_8nqUn.webp>)

The belt and large printed rear pulley on the assembled bicycle.

![CAD assembly of the bicycle conversion and drive components.](<https://devanmetz.com/_astro/ebike-cad.C1bIeNdi_HToTv.webp>)

The mechanical assembly in CAD, before everything has to fit on the real frame.

![ESP32-based display showing electric bicycle telemetry.](<https://devanmetz.com/_astro/ebike-dashboard.C2wAOlim_1ojST2.webp>)

The ESP32 dashboard prototype displays data from the motor controller.

## Build stories

- [One bike, three kinds of making](<https://devanmetz.com/blog/ebike-from-cad-to-dashboard/index.md>)

## Related reading

- [3D-Printed Rainbow Violin](<https://devanmetz.com/portfolio/printed-violin/index.md>)
- [From the Workbench](<https://devanmetz.com/portfolio/workshop-builds/index.md>)
- [Catan Organizers](<https://devanmetz.com/portfolio/catan-organizers/index.md>)
