EENG 383 Microcomputers Final Project Auto Headphones April 25, 2014; 1:00pm; Colorado School of Mines Electrical Engineering Department Taylor Ray Adriana Johnson 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 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 The Arduino Leonardo • Strengths of Design: o o o o o Simpler coding process over the HCS12 microcontroller More compact design Easy hardware compatibility Uses digital outputs Can simulate a keyboard http://arduino.cc/en/Main/arduinoBoardLeonardo 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 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 Timing Diagram • Headphones • Button press is 20.0 ms LCD Display • • • • Liquid Crystal Display (LCD) Describes: volume, play, and pause Trimpot for LCD contrast 4 data pins used – save on Arduino Pins Timing Diagram • LCD Screen 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 o o o Play: Ctrl P Pause: Ctrl P Volume up: F9 Volume down: F8 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 Results and the Future • Overall result: o o o o o The break beam sensor captured when the user took the headphones off or put them on The pin was pulled low and indicated that headphones were put on A pressed push button simulates key press to change volume The LCD relates the actions that are happening 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 Comments and Questions