Project

# Title Team Members TA Documents Sponsor
53 Driver Adaptive Automatic Side Mirror
Anthony Montalto
Bohan Ren
Joshua Rio
Zhuoer Zhang
# Rider-Adaptive Automatic Bicycle Mirror

Team Members:

- Bohan Ren (bren6)
- Joshua Rio (rio5)
- Anthony Montalto (amont43)
# Problem

Bicycle mirrors typically need to be manually adjusted according to the rider’s seating position and riding posture. However, when different riders use the same bicycle, when the seat height changes, or when the rider changes riding posture, the position of the rider’s head and eyes may also change. Once the rider’s viewing position changes, the previously adjusted mirror angle may no longer provide the intended rearward field of view.

This problem is especially important on a bicycle because frequently turning the head to check traffic behind can be inconvenient and may reduce the rider’s awareness of the road ahead. Existing bicycle mirrors usually remain at a fixed angle and require manual readjustment when the rider’s viewing position changes.

Our goal is to design a compact bicycle-mounted automatic mirror system. The system will estimate the rider’s current head position and automatically adjust the mirror based on that position, allowing the rider to maintain an appropriate rearward view after changing posture.

# Solution

We plan to design a rider-adaptive bicycle mirror system whose primary function is to automatically adjust the mirror angle based on changes in the rider’s head position.

The system will use only **one front-facing monocular camera mounted on the bicycle** to measure the rider’s head position.

After the camera detects the rider’s face:

- The horizontal position of the face center in the image will be used to estimate left-right displacement along the X axis.
- The vertical position of the face center in the image will be used to estimate up-down displacement along the Y axis.
- The apparent size of the face in the image will be used, after calibration, to estimate forward-backward distance along the Z axis.

The system will use a single monocular camera to estimate the approximate X, Y, and Z position of the rider’s head.

The initial prototype assumes that the rider is facing forward and maintaining a normal riding posture during measurement.

The estimated head position will be used to approximately determine the rider’s eye position. The control system will then combine the estimated eye position, the known mirror mounting position, and a predefined rear viewing region to calculate the required horizontal and vertical mirror target angles.

The bicycle mirror will be mounted on a compact two-axis motorized mechanism, with two motors independently controlling horizontal and vertical mirror movement.

Position sensors will be installed on the mirror axes. The microcontroller will read the current mirror position and control the motors to move the mirror to the calculated target position. This avoids accumulated error that could result from relying only on motor operating time.

The main prototype will use a **button-activated adjustment process**. After the rider changes posture or head position, pressing the adjustment button will cause the system to measure the current head position, estimate the eye position, calculate the target mirror angles, and automatically adjust the mirror.

After the adjustment is completed, the mirror will remain at its current position until the rider presses the adjustment button again.

# Solution Components

## Head Position Estimation Subsystem

The system will use a front-facing monocular camera mounted on the bicycle to detect the rider’s face and estimate the approximate position of the rider’s head.

The horizontal coordinate of the face center will be used to estimate left-right movement along the X axis, while the vertical coordinate of the face center will be used to estimate up-down movement along the Y axis.

The forward-backward distance along the Z axis will be estimated using the apparent size of the face in the image. Before use, the system will be calibrated by recording the apparent face size at several known distances and establishing a mapping between image face size and head distance.

Because the project uses a button-activated process, the system can capture multiple frames after the rider presses the button and average the measurements to reduce single-frame detection error.

Proposed components:

- Raspberry Pi Camera Module 3
- Raspberry Pi 5 or a similar embedded image-processing platform

This subsystem will output the rider’s approximate:

- X position
- Y position
- Z position

and send the results to the main control system.

## Controller and Mirror Geometry Subsystem

This subsystem is responsible for receiving the rider’s head-position data and calculating the horizontal and vertical angles that the mirror should reach.

The system will calculate the mirror orientation based on:

- The estimated position of the rider’s eyes
- The fixed mounting position of the mirror
- A predefined rear viewing position

Proposed components:

- STM32G474RET6 microcontroller
- Adjustment button
- Programming/debug interface
- Communication interface between the Raspberry Pi and STM32

After the rider presses the adjustment button, the Raspberry Pi will complete the head-position estimation and send the X, Y, and Z data to the STM32.

The STM32 will then calculate the target mirror angles and control the mirror motors to complete the adjustment.

## Motorized Mirror Actuation and Feedback Subsystem

The mirror will be mounted on a compact two-axis motorized mechanism.

Two small geared DC motors will be responsible for:

- Horizontal angle adjustment
- Vertical angle adjustment

Proposed components:

- Two compact geared DC motors
- Two DRV8876 motor-driver ICs
- Two AS5600 magnetic angle sensors
- Permanent magnets coupled to the two mirror axes
- Custom two-axis bicycle mirror mounting mechanism

The STM32 will drive the two motors using PWM and direction-control signals.

The AS5600 sensors will measure the current positions of the two mirror axes. The STM32 will compare the current mirror position with the target position and continue controlling the motors until the mirror reaches the desired position.

After the adjustment is completed, the motors will stop and the mirror will remain fixed until the next button-triggered adjustment.

The DRV8876 provides basic current limiting and protection, so motor protection will not be treated as a separate subsystem and will instead be integrated into the motor-driver design.

## Power and Custom PCB Subsystem

We will design a custom PCB that integrates the main control, motor-driver, and power functions of the system.

The PCB will include:

- STM32G474RET6 microcontroller
- Two DRV8876 motor-driver circuits
- Two AS5600 mirror-position feedback interfaces
- Raspberry Pi communication interface
- Adjustment-button input
- Programming/debug interface
- Motor and sensor connectors
- Power-conversion and filtering circuitry
- Necessary protection circuitry and test points

The system will be powered by a rechargeable battery mounted on the bicycle.

Proposed components:

- Rechargeable battery pack
- TPS54302 buck converter
- TLV75533PDBVR voltage regulator
- Input filtering and decoupling capacitors
- Basic input-protection circuitry

# Criterion For Success

The project will be considered successful if the following goals are achieved:

- A single front-facing monocular camera can consistently detect the face of a forward-facing rider and obtain the horizontal position, vertical position, and apparent size of the face in the image.
- The system can use the same monocular camera to estimate the rider’s X, Y, and approximate Z head position without requiring an additional distance sensor or second camera.
- After calibration, the system can distinguish at least three different forward-backward head positions using the apparent face size in the image.
- After the rider changes posture or head position and presses the adjustment button, the system can calculate new horizontal and vertical target mirror positions based on the updated head position.
- After the adjustment button is pressed, the bicycle-mounted mirror can automatically complete both horizontal and vertical adjustment.
- After adjustment is completed, the mirror remains at its current position until the rider presses the adjustment button again.
- A clearly visible verification object, such as a red LED light or colored marker, will be placed at a fixed location behind the bicycle. For at least three different rider positions or normal riding postures, the rider must be able to fully see the fixed object in the mirror after each automatic adjustment.
- From the same calibrated rider position, the system will perform **10 repeated automatic adjustments**. After every adjustment, the rider must be able to fully see the same fixed verification object behind the bicycle in the mirror.
- The camera, motorized mirror, custom PCB, and battery can be mounted securely and compactly on the bicycle without interfering with the rider’s normal seating position or normal bicycle steering.
- The system can operate from a rechargeable battery mounted on the bicycle, while the custom PCB provides motor driving, power conversion, mirror-position feedback, and system control.

LED Cube

Michael Lin, Raymond Yeh

LED Cube

Featured Project

LED technology is more advanced and much more efficient than traditional incandescent light bulbs and as such our team decided we wanted to build a device related to LEDs. An LED cube is inherently aesthetically pleasing and ours will be capable of displaying 3D animations and lighting patterns with much increased complexity compared to any 2D display of comparable resolution. Environmental interaction will also be able to control the various lighting effects on the cube. Although our plan is for a visually pleasing cube, our implementation can easily be adapted for more practical applications such as displaying 3D models.