Project

# Title Team Members TA Documents Sponsor
53 Driver Adaptive Automatic Side Mirror
Anthony Montalto
Bohan Ren
Joshua Rio
Zhuoer Zhang design_document2.pdf
proposal1.pdf
# 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.

Schnorr Protocol Key Fob

Michael Gamota, Vasav Nair, Pedro Ocampo

Featured Project

# Schnorr Identification Protocol Key Fob

Team Members:

- Michael Gamota (mgamota2)

- Vasav Nair (vasavbn2)

- Pedro Ocampo (pocamp3)

# Problem

Current car fobs are susceptible to different types of attacks. Rolling jam attacks are one of such attacks where an attacker jams and stores a valid "unlock" signal for later. Cars with passive keys/cards can be stolen using relay attacks. Since a car can be the most expensive item someone owns, it is unreasonable to allow people to steal them so discreetly by hacking the fob/lock combo.

# Solution

By leveraging public key cryptography, specifically the Schnorr identification protocol, it is possible to create a key fob which is not susceptible to either attack (rolling jam and relay) and also gives no information about the private key of the fob if the signal were to be intercepted.

# Solution Components

# Key Fob

## Subsystem 1

Random number generation - We will use a transistor circuit to generate random numbers. This is required by the Schnorr protocol to ensure security.

## Subsystem 2

Microcontroller - The MCU will run all the computation to calculate the messages. We will likely use an ATtiny MCU so we can use the Arduino IDE for programming. However, some group members have experience with the STM32 family so that is another option.

## Subsystem 3

Power - We plan on using either a 5V battery or 3.3V battery with a boost converter to power the fob.

## Subsystem 4

Wireless Communication - We plan on using the 315 MHz frequency band which is currently used by some car fobs. We will need a transmitter and receiver, since the protocol is interactive.

# Lock

## Subsystem 1

Random number generation - We will use a transistor circuit to generate random numbers. This is required by the Schnorr protocol to ensure security.

## Subsystem 2

Microcontroller - This MCU will also run all the computation to calculate the messages. We will likely use an ATtiny MCU so we can use the Arduino IDE for programming. However, some group members have experience with the STM32 family so that is another option. This MCU will need to have PWM output to control the lock.

## Subsystem 3

Linear Actuator - We plan on using a linear actuator as a deadbolt lock for demonstration purposes.

## Subsystem 4

Wireless Communication - We plan on using the 315 MHz frequency band which is currently used by some car fobs. We will need a transmitter and receiver, since the protocol is interactive.

## Subsystem 5

Power - This subsystem will also likely require 5V, but power sourcing is not an issue since this system would be connected to the car battery. During a demo I would be acceptable to have this plugged into a power supply or a barrel jack connector from an AC-DC converter.

# Criterion For Success

Describe high-level goals that your project needs to achieve to be effective. These goals need to be clearly testable and not subjective.

Our first criteria for success is a reasonably sized fob. There is some concern about the power storage and consumption of the fob.

The next criteria for success is communication between the fob and the lock. This will be the first milestone in our design. We will need to have a message sent from one MCU that is properly received by the other, we can determine this in the debug terminal.

Once we are sure that we can communicate between the fob and the lock, we will implement the Schnorr protocol on the two systems, where the fob will act as the prover and the lock as the verifier. If the Schnorr signature implementation is correct, then we will always be able to unlock the lock using the fob whose public key is associated with full privileges.

Project Videos