1 SAE Formula Car Display and Data Acquisition System “SAEDAQ” Caleb Davison Phil Jacher George Kontos Advisor: Mr. Gutschlag 2 Overview Summary Measurement Strategies LabVIEW User Interface Microcontroller LCD Screen Wireless Chips 3 Overview Summary Measurement Strategies LabVIEW User Interface Microcontroller LCD Screen Wireless Chips 4 A Typical Car… 5 SAEDAQ Summary Society of Automotive Engineers Formula One racecar Data recording wheel speed engine rpm oil pressure oil temperature coolant temperature Data will be transmitted to the car’s dashboard and an off-track laptop 6 Previous Works Project has been attempted several times Never been able to coordinate with MEs Most recently last year with Justin Peters Using different MCU, upgraded wireless chips New dashboard design 7 High Level Block Diagram 8 Overview Summary Measurement Strategies LabVIEW User Interface Microcontroller LCD Screen Wireless Chips 9 Temperature and Pressure Temperature sensor (0-300 degrees Fahrenheit) x 2 Pressure sensor (0-100 psi) x 1 Requires supply voltage (12V) Outputs current (4-20mA) 10 Sensor Measurement Circuit From datasheet: ZLmax=(Vs-9.6)*50 Vs=12V from car battery, ZLmax =120 ohms Issue: at 20mA, A/D voltage will be only 2.4V Solution: Adjust A/D resolution (0-2.56V) VL ZL A/D 11 A/D Method - Temperature A/D Res (2.56/255) Volts Sensor Output (mA) uC Bit Number Temperature (Fahrenheit) 0.48 0.49 0.5 0.51 0.52 0.53 0.54 4.00 4.08 4.17 4.25 4.33 4.42 4.50 48 49 50 51 52 53 54 0.00 1.56 3.13 4.69 6.25 7.81 9.38 2.34 2.35 2.36 2.37 2.38 2.39 2.4 19.50 19.58 19.67 19.75 19.83 19.92 20.00 234 235 236 237 238 239 240 290.63 292.19 293.75 295.31 296.88 298.44 300.00 12 Linear Based Method Temperature vs. A/D Value 350 y = 1.5625x - 75 300 Temperature 250 200 150 100 50 0 0 50 100 150 200 250 Temp=(1.5625*A/D Value)-75 Attempt 1: Temp=((A/D Value*3)/2)-75 Attempt 2: Temp=((A/D Value*1563)/1000)-75 Solution: Look up table, use memory available 300 A/D Value 13 A/D Method - Pressure A/D Res (2.56/255) Sensor Output uC Bit Volts (mA) Number 0.48 4.00 0.49 4.08 0.5 4.17 0.51 4.25 0.52 4.33 0.53 4.42 0.54 4.50 2.34 2.35 2.36 2.37 2.38 2.39 2.4 19.50 19.58 19.67 19.75 19.83 19.92 20.00 Pressure (PSI) 48 0.00 49 0.52 50 1.04 51 1.56 52 2.08 53 2.60 54 3.12 234 235 236 237 238 239 240 96.87 97.40 97.92 98.44 98.96 99.48 100.00 14 Linear Based Method Pressure vs. A/D Value 120.00 y = 0.5208x - 25 Pressure (psi) 100.00 80.00 60.00 40.00 Temp=(0.5208*A/D Value)-25 Attempt 1: Temp=(A/D Value/2)-75 Solution: Look up table, use memory available 20.00 0.00 0 50 100 150 200 250 300 A/D Value 15 Engine RPM Measurement ACI Hall-effect current sensor TTL output Induced supply power Meets amperage range 16 Overview Summary Measurement Strategies LabVIEW User Interface Microcontroller LCD Screen Wireless Chips 17 LabVIEW Interfacing: Front Panel 18 LabVIEW Interfacing: Front Panel 19 LabVIEW Interfacing: Front Panel (cont.) RS232 communication protocol Complete control over settings Data logging feature 20 LabVIEW Interfacing: Front Panel (cont.) 21 LabVIEW Interfacing: Front Panel (cont.) Pressure and temperature updated in real time along with engine RPM and speed Warning lights indicate dangerous levels 22 LabVIEW Interfacing: Front Panel (cont.) 23 LabVIEW Interfacing: Front Panel (cont.) Data vs time displays operate independently 24 LabVIEW Interfacing: Parallel Computing 25 Overview Summary Sensors LabVIEW User Interface Microcontroller LCD Screen Wireless Chips 26 Microcontroller: Amtel ATmega 128 MCU 16 MHz clock 8 A/D converters Voltage regulator (5.5-15V) Dual UARTS Additional power and ground connectors 27 Programming Phases A/D Converter RS-232 Interface RPM Counter Touchscreen All Together 28 Programming Phases A/D Converter RS-232 Interface RPM Counter Touchscreen All Together 29 A/D Conversion Records oil pressure, oil temperature, and coolant temperature A/D inputs: 0-2.56V Sensor voltages: 0.48-2.4V Scaled into single byte value 30 A/D Conversion ADC clock machine cycle: 8us 1st conversion: 200us Normal conversions: 104us Three conversions: 312us Vin * 255 ADC Vref Vref = 2.56 V 31 Programming Phases A/D converter RS-232 Interface RPM Counter Touchscreen All Together 32 RS-232 Interfacing Previous experience with transmit/receive Stair step progress: Polling Interrupt driven Timer based 33 RS-232 Interfacing Hyper Terminal problems Incorrect Hyper Terminal settings ASCII Setup – echo typed characters locally Transmitting/Receiving settings: 9600 baud 8 data bits 1 stop bit 34 Example RS-232 Communication Receive key press from computer ASCII ‘F’ sent back to computer Hyper Terminal displays appropriate values 35 Example RS-232 Communication String based communication with timer Sends “1abcde” every 5 seconds Practical application 36 Programming Phases A/D Converter RS-232 Interface RPM Counter Touchscreen All Together 37 RPM Counter Example simulation Set up basic pulse counting program 100ms (10 Hz) sampling period Counts rising edges 30 Hz Pulse Input 38 RPM Counter Problems with 16-bit counter Had to use external interrupts Rising edge triggers interrupt Counter increments Inefficient 39 Programming Phases A/D Converter RS-232 Interface RPM Counter Touchscreen All Together 40 Touchscreen ASCII protocol CRC protocol Used XON/XOFF to simplify 41 XON/XOFF Communication 42 ASCII Protocol Set byte variable 1 to 0xFE Set IR word variable 0 to 0x02C9 0xD5 0xD6 0x30 0x31 0x46 0x45 ‘0’ ‘1’ ‘F’ ‘E’ 0x30 0x30 0x30 0x32 0x43 0x39 ‘0’ ‘0’ ‘0’ ‘2’ ‘C’ ‘9’ Opcode Internal RAM address Internal RAM value 43 Jump to Page Function Does not use the normal ASCII protocol Reads in hexadecimal format Jump to page 0x103: 0xA0 0x02 Command 0x01 0x03 0x5A Page # MSB Page # LSB checksum Opcode Internal RAM address Internal RAM value 44 Calculating the Checksum Value 0xA0 0x02 Command 0x01 0x03 0x5A Page # MSB Page # LSB checksum X=0xA0+0x02+0x01+0x03=0xA6 The sums of the LSB must be 0xNN00 0x100-0xA6=0x5A 45 Programming Phases A/D Converter RS-232 Interface RPM Counter Touchscreen All Together 46 All Together 47 Software Flowchart 48 Overview Summary Sensors LabVIEW User Interface Microcontroller LCD Screen Wireless Chips 49 Touchscreen Amulet Technologies GEMStudio µHTML 9600 Baud Resistive technology LCD GUI from 2010 Project 50 Touchscreen Design Numerical displays Warning indicators Inter-widget communication Multiple pages 51 Touchscreen Design 52 Touchscreen Widgets Function Buttons Calls a function when hit Numeric Fields Pulls the values from bytes in the Amulet’s internal RAM 53 Touchscreen Communications with microcontroller ASCII protocol CRC protocol Amulet as slave XON/XOFF protocol 54 Overview Summary Sensors LabVIEW Microcontroller LCD Screen Wireless Chips 55 Wireless Chips Chipcon CE2500M Voltage Regulator RS-232 Packets Infinite transmission 56 Wireless Chips 57 Aerocomm AC4790 58 Aerocomm Software 59 Future Work Noise suppression circuitry Enclosures Sampling rates Temperature, RPM, land speed Land speed calculation Support documentation 60 Schedule Week of: Caleb Phil George 12/5/2010 finalize parts list with mechanical engineers winter break order parts, research 1/23/2011 program temperature sensor research touchscreen software design interface for LabVIEW setup 1/30/2011 program pressure sensor work on example programs program LabVIEW for receiving data 2/6/2011 program wheel speed sensor work on design options for touchscreen GUI test LabVIEW for receiving data 2/13/2011 program displacement sensor design GUI for touch screen work on sensor circuitry 2/20/2011 program and combine modules design GUI for touch screen make sensor test bench 2/27/2011 program and combine modules finalize design and construct GUI make sensor test bench 3/6/2011 set up analog to digital converters work on communications with microcontroller work on LabVIEW datalogging 3/13/2011 spring break 3/20/2011 implement counters finalize GUI / communications with microcontroller work on LabVIEW datalogging 3/27/2011 program microcontroller to transmit data to LabVIEW finish all touchscreen elements. start on wireless finalize LabVIEW design and sensor circuitry 4/3/2011 interface all devices together. work on wireless devices 4/10/2011 interface all devices together. work on wireless devices 4/17/2011 work on wireless devices. documentation/finalization/final report/presentation 4/24/2011 documentation/finalization/final report/presentation 5/1/2011 61 Questions 62 Calculating Timer Value for Pulse Counter f OCnA 16 Mhz N 1 OCRnA 1 16Mhz 0.1 641 OCRnA OCRnA 24999 0h61A7 63