13
Auto Headphones April 25, 2014; 1:00pm; Colorado School of Mines Electrical Engineering Department Taylor Ray Adriana Johnson EENG 383 Microcomputers Final Project

EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

  • Upload
    others

  • View
    3

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Auto Headphones

April 25, 2014; 1:00pm; Colorado School of Mines

Electrical Engineering Department

Taylor Ray

Adriana Johnson

EENG 383 Microcomputers Final Project

Page 2: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Project Overview • Design:

o Play/Pause when headphones are taken on/off

o Volume control with two push buttons for volume up and down

o Both done with simulation key presses in Windows Media Player

• Purpose/Goal: o Studio tool for sound engineers can use this tool

o User friendly- know volume levels and playing/paused at all times

o Saves time and energy

Page 3: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Design • Overall System

o Arduino Leonardo

o Headphones

• Subsystem One o IR Receiver

o IR Transmitter

• Subsystem Two o Two Volume buttons

• Subsystem Three o LCD Screen

Page 4: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

The Arduino Leonardo • Strengths of Design:

o Simpler coding process over the HCS12 microcontroller

o More compact design

o Easy hardware compatibility

o Uses digital outputs

o Can simulate a keyboard

http://arduino.cc/en/Main/arduinoBoardLeonardo

Page 5: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Break Beam Sensor • IR Receiver TSOP48

• Detects signal, pulls OUT low (pause)

• IR output: o Port C7

o Pin 13

o Timer 4

• IR Transmitter

• Software based LED

• Allows for compact design

• Robust Design

• Saves on cost

• 38kHz signal

http://inside.mines.edu/~whoff/courses/EENG383/lab/tsop4838.pdf

http://inside.mines.edu/~whoff/courses/EENG383/lab/tsal6200.pdf

Page 6: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Push Buttons • Two buttons

o Volume Up

o Volume Down

• State 1: Reads zero volts, when not pushed

• State 2: Reads voltage (across resistor), when pushed

Page 7: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Timing Diagram • Headphones

• Button press is 20.0 ms

Page 8: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

LCD Display • Liquid Crystal Display (LCD)

• Describes: volume, play, and pause

• Trimpot for LCD contrast

• 4 data pins used – save on Arduino

Pins

Page 9: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Timing Diagram • LCD Screen

Page 10: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Software • Arduino Leonardo is recognized by computer as a peripheral

device o Uses USB HID Protocol to send keystrokes, just like a typical keyboard.

• Programmed with Arduino software

• Windows media key presses being simulated

o Play: Ctrl P

o Pause: Ctrl P

o Volume up: F9

o Volume down: F8

Page 11: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Pseudo Code Setup():

Initialize Pins for input or output

Turn on LCD and Initialize by prompting user to “Place Headphones on head to begin playing”

Set state of headphones to not playing (state = 0)

Initialize volume to reasonable level

Loop():

If IR receiver indicates headphones are on person’s head (from break beam IR sensor)

If state = 1 (playing)

Do nothing

If state = 0 (paused)

Start playing and reinitialize the volume by sending simulated keypress to computer

If IR receiver indicated headphones are not on person’s head (from break beam IR sensor)

If state = 1 (playing)

Pause music by setting state to 0 and sending simulated keypress to computer

If state = 0 (paused)

Do nothing

If Pushbutton_up is pressed

Debouncing software

Send simulated keypress to computer signaling volume up

If Pushbutton_down is pressed

Debouncing software

Send simulated keypress to computer signaling volume down

Display volume level and whether playing or paused on the LCD screen using Arduino LCD Library

Page 12: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Results and the Future • Overall result:

o The break beam sensor captured when the user took the headphones off or put them on

o The pin was pulled low and indicated that headphones were put on

o A pressed push button simulates key press to change volume

o The LCD relates the actions that are happening

o Simple, robust design that is compact enough to fit in headphones

• Could improve design by: o Internalize cables and break beam sensor

o Add next/previous song

• This would make a great product for Audio Engineers or

general consumers

Page 13: EENG 383 Microcomputers Final Project - Today at Minesinside.mines.edu/~whoff/courses/EENG383/projects/2014spring/Johnson_Ray.pdfEENG 383 Microcomputers Final Project . Project Overview

Comments and Questions