Hardware - Bicycle ABS System
This project was an ambitious project for my Engineering Science Capstone project (ENSC 440). The idea was to design an anti-lock braking system for a bicycle.
In our small group of students, we divided up our work into various parts. One student focused mainly on the hydraulic actuators for the bicycle's brakes; another student focussed mainly on the speed sensors for the bicycle's wheels that would indicate a lock-up.
Electronic Control Unit
|
I focussed on designing, building, and programming the electronic control unit (ECU) that would process the signals from the speed sensors and actuate the brakes to avoid a skid. The ECU was based around an Atmel AVR microcontroller. I used an open-source C library called AVR-libc that simplified interfacing the microcontroller's registers and peripherals. For instance, the AVR-libc library provided functions that helped with manipulating the MCU's onboard flash memory and configuring its pulse-width modulation (PWM) peripheral. |
LCD Display
We used an HD44780-based character-LCD. Our LCD has 20 columns and 2 rows. We used a shift register to interface with the LCD to save pins on our microcontroller.
With three buttons mounted below the screen, we were able to implement a fairly complex menu system that allowed users to view different trip statistics and configure ECU parameters. We were even able to use the Atmel microcontroller's PWM (pulse width modulation) peripheral to programmatically control the LCD display's backlight.Speed sensor
|
For the speed sensor, we placed small permanent magnets on the rim of the wheel and placed a pickup coil on the frame of the bicycle. As the wheel turned, the pickup magnets would pass by the stationary pickup coil, thereby inducing a voltage in the coil that we could detect. Knowing how many magnets we placed on the rim, along with the circumference of the wheel, we were able to estimate the speed of the bicycle by measuring the time between consecutive passes of the magnets by the pickup coil The result is a signal with positive and negative peaks as the magnet flies by the coil. To measure the speed of the bicycle using this method, we used a Schmitt trigger to convert our somewhat noisy analog signal from the coil into a clean signal with 5 V pulses whenever a magnet goes by. |
|
To the left is an oscilloscope screenshot showing the output of the pickup coil as the bicycle wheel was spinning. The peaks and valleys mark when a magnet passed by the pickup coil |
Hydraulics
|
To actuate the rear brakes of the bicycle, we attached a fuel pump and valve to the bicycle's existing hydraulic brake system. By turning on the pump or adjusting the valve, we were able to release the brake calipers while at the same time forcing the brake lever on the handlebars up. Both the pump and the valve were controlled by the ECU to release the brakes momentarily whenever the speed sensor detected the rear wheel had locked up. |
