Lectura Mcirosmouse

20
Micromouse Infrared and Gyroscopic Sensors

description

la lectura de un micromouse en el entorno de programación

Transcript of Lectura Mcirosmouse

Page 1: Lectura Mcirosmouse

MicromouseInfrared and Gyroscopic Sensors

Page 2: Lectura Mcirosmouse

Notes on Project 1

Page 3: Lectura Mcirosmouse

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

Page 4: Lectura Mcirosmouse

Powering the Nucleo

● Nucleo’s Vin needs 5V● Nucleo’s GND needs to be grounded● USB vs. External Power Jumper

Page 5: Lectura Mcirosmouse

Uploading Code to the Nucleo

● SWD Connectors○ Communication protocol for ARM chips○ Can interact with and manipulate memory in MCU (Upload/Debug)

● 6 Pins (We use 4 of them)○ SWCLK, GND, SWDIO, NRST

● MCU has specific pins that support SWD○ PA_13 = SWCLK, PA_14 = SWDIO○ Reset and GND

● Please put female jumpers back in the box when you’re done

Page 6: Lectura Mcirosmouse

Transistors

Page 7: Lectura Mcirosmouse

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”

Page 8: Lectura Mcirosmouse

NPN vs PNP

On when base current is HIGH

On when base current is LOW

Page 9: Lectura Mcirosmouse

MOSFETs

● Metal Oxide Semiconductor Field Effect Transistor● Voltage controlled device● Like BJT, comes in two flavors

○ N-Channel, P-Channel

Page 10: Lectura Mcirosmouse

N-MOS vs P-MOS

On when gate voltage is HIGH

On when gate voltage is LOW

Page 11: Lectura Mcirosmouse

BJT vs MOSFET

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

○ LEDs

● Voltage controlled● (Theoretically) Draws no current at the

gate● Can switch much larger loads● Good for high-power switching

○ Motors

BJT MOSFET

Page 12: Lectura Mcirosmouse

Infrared Sensors

Page 13: Lectura Mcirosmouse

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

Page 14: Lectura Mcirosmouse

IR Emitter Operation

Page 15: Lectura Mcirosmouse

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

Page 16: Lectura Mcirosmouse

IR Sensing Pair

● SFH 4545○ 950nm Wavelength○ Narrow emission angle

● Note: Anode (positive lead) is the shorter lead

● TEFT4300○ Matched for 940nm wavelength light

● Note: Collector (positive lead) is the shorter lead

IR Emitter Phototransistor

Page 17: Lectura Mcirosmouse

Gyroscope

Page 18: Lectura Mcirosmouse

Gyroscope

● Measure angular velocity○ Degrees/second (dps)

● Digital Gyro○ 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

Page 19: Lectura Mcirosmouse

Project 2

Page 20: Lectura Mcirosmouse

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!