Anda di halaman 1dari 20

Micromouse

Infrared and Gyroscopic Sensors

Notes on Project 1

H-Bridge Logic Level

Pin 16 (Vss) sets the Logic Level


Voltage

i.e. The Input pins expect that voltage to


be considered HIGH

The Nucleo can only output 3.3V from


DigitalOut pins, so we set Logic Level
to 3.3V
Vs is voltage going to motors

We want this to be as large as possible

Powering the Nucleo

Nucleos Vin needs 5V


Nucleos GND needs to be grounded
USB vs. External Power Jumper

Uploading Code to the Nucleo

SWD Connectors

6 Pins (We use 4 of them)

SWCLK, GND, SWDIO, NRST

MCU has specific pins that support SWD

Communication protocol for ARM chips


Can interact with and manipulate memory in MCU (Upload/Debug)

PA_13 = SWCLK, PA_14 = SWDIO


Reset and GND

Please put female jumpers back in the box when youre done

Transistors

Bipolar Junction Transistors

Consists of 3 doped silicon regions

NPN or PNP

Current controlled device


Can act like a switch
3 Terminals

Collector, Emitter, Base

NPN -- Not Pointing IN

NPN vs PNP

On when base
current is LOW

On when base
current is HIGH

MOSFETs

Metal Oxide Semiconductor Field Effect Transistor


Voltage controlled device
Like BJT, comes in two flavors

N-Channel, P-Channel

N-MOS vs P-MOS

On when gate
voltage is LOW

On when gate
voltage is HIGH

BJT vs MOSFET
BJT

Current controlled
Can turn on at lower voltages
Cheaper
Good for low-current devices

LEDs

MOSFET

Voltage controlled
(Theoretically) Draws no current at the
gate
Can switch much larger loads
Good for high-power switching

Motors

Infrared Sensors

Infrared LEDs

LEDs that emit light in the infrared range (typ. 800-950nm wavelength)
Emission Angle

Want a narrow emission angle


Maximize signal amplitude
Minimize peripheral vision

Wavelength

Must match wavelength of the reciever

IR Emitter Operation

Phototransistors

NPN Transistors that use light instead of a base


current
Wavelength-specific

We choose phototransistor specific to IR wavelengths

Have to ensure that wavelength matches emitter in the


pair

IR Sensing Pair
IR Emitter

SFH 4545

950nm Wavelength
Narrow emission angle

Note: Anode (positive lead) is the shorter


lead

Phototransistor

TEFT4300

Matched for 940nm wavelength light

Note: Collector (positive lead) is the


shorter lead

Gyroscope

Gyroscope

Measure angular velocity

Digital Gyro

Degrees/second (dps)
Communicate to MCU via SPI/I2C/etc.
Less noise
Easier to use

Analog Gyro

Analog voltage output can be read by MCU


Potentially more accurate
Cheaper

Project 2

Goal: Finish the hardware!

Solder on IR Sensors and Gyroscope


Write test code to verify they are working
Bad News: More soldering
Good News: By the end of this project, you will have built a complete
Micromouse!

Anda mungkin juga menyukai