Group 1 - UCF EECS

Download Report

Transcript Group 1 - UCF EECS

Knight Bright
Group #1:
Robin Adams
Nathan Doran
Tyler Hemp-Hansen
Shaun Sontos
What is “Knight Bright”?
• Knight Bright is a 2-dimensional, 100 (10x10) pixel
tabletop interactive LED (RGB) gaming system.
• The primary motivation behind this project is to
develop a fun, easy to use, user-programmable
interactive tabletop.
Specifications and Requirements
Dimensions
20” x 20” x 6”
Weight
Less than 20 lb.
Resolution
10 x 10
Color Depth
8-bit minimum color pallet
Communication
Wireless to Device (range < 10 m)
Memory
Must store at least 3 on-board games
(approximately 30KB)
Power
< 200 W
Project Goals
• Use a (secondary) MCU to control an array of LEDs via LED PWM drivers
• Transmit the output of an IR sensor circuit into a (secondary) MCU
• Establish serial communication protocol that enables reliable
communication between MCUs
• Successfully integrate Bluetooth capabilities into the project
• Develop an mobile peripheral application
• Successfully integrate user programmable and memory expansion
capability
• Develop a host
programming GUI
environment
Games
Game Programming
• Desktop programmer GUI can make games and
upload them to the board
– Simplified C compiler
• Program stored as files on a SD card. Each character
represents a assembly command or modifier
specific to this application
– Large storage space for many programs
Board Programmer
Compiler
Parser
Input
Program
Lexical
Analyzer
Lexeme
List
Symbol
Table
Code
Generator
Output
Machine
Code
Machine Code Output
Knight Bright Simulator
Simulator to test games
without hardware
Critical for development
while assembling and
debugging the hardware
Microcontroller
• ATmega328P
• 3 Microcontrollers
– Primary microcontroller – Fetches and executes
instructions from the program file on the SD card.
Directs actions to the other microcontrollers.
– Display microcontroller – Executes commands
related to LEDs and graphics
– Input microcontroller – Addresses and monitors IR
sensors. Reports current status back to primary
microcontroller
LED Requirements
• Diffused common cathode LED bulbs
• Maximum driving current of 30 mA
per bulb
• LED Control Techniques
– PWM (S/W or H/W)
• Total of 300 LED lines must be sinked
• Ultimately, a dedicated LED driver IC
was used to drive the LED PWM
5mm Common Anode
Diffused RGB LED
Selecting the LED Driver
Model Name
TLC5941
TLC5940
STP16CP05MT
R
100 mA
PCA9922
Current
supply(max)
Voltage supply
(input)
Voltage supply
(out, all channels)
Communication
Data Transfer rate
Channels
Cost
Features
(or lack thereof)
80 mA
3 to 5.5 V
60 mA (< 3.6 V)
120 mA (> 3.6 V)
3 to 5.5 V
3 to 5.5 V
3.3 to 5.5 V
17 V
17 V
20 V
6V
Serial (TTL)
30 MHz
16
$1.80/per unit
• PWM
• 12-bit Grayscaling
• 6-bit Dot
Correction
Serial (TTL)
30 MHz
16
$2.21/per unit
• PWM
• 12-bit Grayscaling
• 6-bit Dot
Correction
(EEPROM
storable)
Serial (TTL)
30 MHz
16
$4.32/per unit
• No H/W PWM
Serial (TTL)
25 MHz
8
$0.49/per unit
• No H/W PWM
60 mA
TLC5941/5940
•
TLC5941 (TI LED driver)
– Low cost
– Ease of use
– Proliferated software support
– EEPROM not necessary
TLC5941 LED Driver
16 channels
80 mA current supply(max)
30 MHz data transfer rate
12-bit Grayscale PWM
6-bit DOT Correction
Human eye only requires
~50-60 Hz, and ~33% duty
cycle for smooth pulses.
212 = 4096 levels
LED Driver Control
…
…
Driver 6
Driver 5
• Each TLC5941 IC
Driver 4
Driver 3
drives 5 RGB LEDs.
Driver 2
Driver 1
• All TLC5941 ICs access
their respective LED
5V
lines on the board
horizontally.
• The reference base
for this 5 LED row
addressing scheme 1413121110 9 8 7 6 5 4 3
2
1
begins at the bottom
right corner.
LED Driver (TLC5941)
0
Led Driver Addressing
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
LED
Driver
MODE,
SIN,
SCLK,
BLANK,
GSCLK
All Common
to MCU
5:32 Decoder selects
20 Addresses(0 – 19)
to XLAT pins
5:32 Decoder
A4
Driver
MCU
A3
A2
A1
A0
PCB and Wood Frame Layout
2 Layer Frame Layout
• Top Layer: IR circuits
• Bottom Layer: Four
(5x5) Pixel Circuit
Corner sections, PCB,
and PSU
Top Layer
100 Pixel Circuits
Bottom Layer
Corner sections,
PCB, and PSU
Sensor Cell Design
• General requirements
– Each sensor must detect an object in front of the cell to
provide input to the device
– Each Cell must contain a RGB LED to provide output
• Primary Considerations
– An intelligent design approach must be used to minimize
the number of microcontroller pins needed for user
interfacing
– The group should also utilize cost efficient methods to
meet the requirements
Sensor Array Design
Row Select
Sensor
circuit
Sensor
circuit
Column Select
&
Sensor
circuit
&
&
Sensor
circuit
&
Return to MCU
Sensor Circuit Design
QED123 IR Light Emitting
Diode
QSD123 IR (NPN)
PHOTOTRANSISTOR
λ
880nm
Daylight Filter
Material
GaAs
Material
Package type
T-1 ¾ (5mm lens
diameter)
Package Type: T-1 ¾ (5mm lens
diameter)
Emission
angle
16°
Reception
angle
24°
Output power High
Sensitivity
High
Matched
photo-sensor
Matched
Emitter:
QED12X
QSD123
Silicon
Sensor Circuit Design
74HCT08 Quad 2-input AND Gate
Philips Semiconductor
High-speed Si-gate CMOS device
Package
DP14
Propagation delay
6ns
𝑽𝒄𝒄
𝑽𝒊𝑯𝒊
𝑽𝒊𝑳𝒐
2 to 6 V
0 to Vcc – 1.5 V (Typical 1.6V)
0.8 (Typical 1.2)
𝑽𝒐
𝑰𝒊𝒎𝒂𝒙 = 𝑰𝒐𝒎𝒂𝒙
Vcc (Typical 4.4V)
20mA
Pixel Circuit Design
• Innovative Solutions
– Move Row/Column
pull down resistors to
Decoder output
– Voltage divider
– Jump output ‘A’ to
input to ‘B’ for 3 input
gate
– Diode added to return
line to prevent back
feeding into and gates
Wireless Method
• For use with an mobile device, the most prevalent
methods are Bluetooth and Wi-Fi
• Other wireless technologies were tossed out because
of the added cost of an adapter to the mobile device
Technology
Bluetooth
Wi-Fi
Range
20m
150m
Power Consumption ~99mW
~594mW
Data Rate
300Kbps
~30Mbps
Cost
$15.95
$30.10
• In the end, Wi-Fi is simply overkill for the application
Bluetooth Module: RN42-XV
Manufacture
Roving Networks
Price
$20.95
Supply Voltage
3.0 – 3.6 V
Default
Serial Port
Bluetooth Profile Profile(SPP)
Pins
20 pins (only 5 of
which will be
used)
Speed
9600 Baud
Mobile Application
Platform:
• Android has a familiar
environment with Java
Eclipse
• Vast libraries, specifically
one for Bluetooth usage
• Open source and many
support tutorials and
explanations
• Easy drag and drop style
GUI creator
Features:
• The user is able to select
what program is running
on Knight Bright
• For certain programs the
App will be used as a
controller
• Text input from the App to
the device
• Grid for one to one
control
Mobile Application (Protocol)
Text
Controller
Grid
Program
Select
Hello
World!
Up (#u)
Row/Col
TicTacToe
($0)
(del)Hello
World!
Down (#d)
00
Battleship
($1)
Left (#l)
01
Tetris ($2)
Right (#r)
02
…
Select (#s)
03… etc
…
Mobile Application
(Use Case Diagram)
User
Access Menu
Connect Device
include
include
include
include
include
Touch Grid
Text Input
Controller Input
Connect to
Existing Pair
Exit Applicaion
Scan for New
Device
Disconnect
Select Prgram
Mobile Application
(Class Diagram)
«send()»
Activity
Grid
«extends»
-100 Buttons : Button
+send()
«extends»
Controller
«extends»
«extends»
Text Input
«goToText()»
-sendButton : Button
-inputText : ListView
-outputText : EditText
+send()
-Up : ImageButton
-Down : ImageButton
-Left : ImageButton
-Right : ImageButton
-Select : Button
+send()
Main
-Grid : Button
-Con : Button
-Text : Button
-Menu : Button
-connect : Button
+goToGrid()
+goToCon()
+goToText()
+getState()
+connect()
«goToCon()»
«send()»
«goToGrid()»
«send()»
BluetoothChatService
-myAdapter : BluetoothAdapter
-myState : int
-myAccept
-myConnect
-myConnected
+setState()
+getState()
+connect()
+connected()
+stop()
+write(in out : byte)
Power Consumption
Component
Component
Max Current
(mA)
Number present
Power
Power Consumed
consumption per (W)
device (mW)
Microcontroller
9
2
45
0.09
Led Driver
----------
19
2456
46.66
Bluetooth Device
30
1
150
0.15
Decoders
----------
3
TBD
TBD
USB
21
2
105
.21
RGB LED
60
100
300
30.00
IR Emitter
20
100
100
10.00
IR Detector
20
100
100
10.00
And Gate
----------
100
500
50.00
Total Calculated
147.11
Actual
20
TDK-Lambda LS200-5
Power Supply Type
Input voltage
Input Frequency
Output voltage
Max current
Typical Efficiency
Enclosed fan
Overvoltage protection
Overcurrent protection
Over Temperature Protection
Size
Cost
Switching
85 – 263 VAC
47-63 Hz
5 VDC
40 A
72- 75 %
Yes
5.75 – 6.75 VDC
105% nominal peak
Yes
7.8 x 3.9 x 1.6”
$49.52
Note: Careful component selection lead to a need for only 1 voltage
regulation device for the Bluetooth chip (.05 x 1.7 = .085 Watts)
Testing
• By designing isolated
regions the board was
able to be tested one
quarter at a time
• A ‘change of state’
test program was
generated which
included all basic
colors and a response
to positive return
Budget
Part
Price
Quantity
Total
Microcontroller
$1.62
3
$4.86
TLC5941
$1.80
19
$34.20
RN-42(one with breakout)
$21.50
2
$43.00
Power Supply
$49.52
1
$49.52
Resistors
$0.01
1000
$10.00
Diodes
$0.03
100
$3.00
Decoders (4:16)
$1.52
4
$6.08
AND Gates
$0.26
100
$26.00
IR Detectors
$0.43
100
$43.00
IR Emitters
$0.35
100
$35.00
RGB Light Emitting Diodes
$0.24
150
$35.00
PCB
$83.00
1
$83.00
Construction Supplies
$55.00
-----
$55
Wire
$5.00 / 100 ft
1000 ft
$50
Total
$477.66
Distribution of Work
Project
Firmware, Compiler, game logic,
GUI
Robin
Tyler
X
X
X
Sensor Cell Design
X
Sensor Cell Production
X
PCB Design
Memory Expansion Integration
X
X
X
X
Soldering
Device Construction
Shaun
X
Android App Development
Bluetooth
Nathan
X
X
X
X
X
Questions?