s.m.a.r.t. (salient method for automated remote technology) jarrett gardner padmavalli vadali pooja...
TRANSCRIPT
S.M.A.R.T.(SALIENT METHOD for AUTOMATED REMOTE TECHNOLOGY)
JARRETT GARDNERPADMAVALLI VADALIPOOJA SHAHABHISHEK GAUR
The Plan – Home Automation
Lighting control Music Playback S.M.A.R.T. Remote Power management Predict the user’s needs Multi-hop wireless signal
Why S.M.A.R.T. Control music and home appliances from one easily
useable device Excessive amount of time creating individual playlists Let something else do your thinking for you Know your actual power usage for each appliance Be able to find your lost remote Competitors
Eaton – can only read the status of a device X10 & Insteon – extensive product line without
behavioral recording or suggestive use
Light Module – Hardware (PCB)
Light Module - Hardware Processor:
Atmega8 Board
Custom Board Architecture
8 bit micro Von Neumann Arch. 16 MIPS @ 16 MHz
8 KB Prog. Flash 1 KB SRAM
3 Timers 2 8 bit 1 16 bit
10bit ADC 8 channels
USART,TWI,SPI 23 I/O Lines Vin: 2.7-5.5 Volts
Light Module – Hardware (digital)
Digital Power:
¼ Watts Input Voltage: 10-36Vdc DC-DC efficiency: 82%
Clock Rates Xtal: 8 MHz A/D clock: 10 kHz
166 samples per 60Hz cycle
Light Module – Hardware (mains)
“Mains” Power Vin: 120 V @ 60Hz Max Current: 6 amps Fuse: 4 amps
Load Light Bulb: 40W-300W Load State: On/Off
100-0% Power in 10% increments
Light Module – Hardware (Mains)
Light Module – Hardware (Digital)
Light Module BoMQuantity Value Description Price Ext. Price
6 1UF CAP CER 1UF 50V X7R 10% 1206 $0.41 $2.46
1 100UF CAP TANTALUM 100UF 10V 10% SMD $1.25 $1.25
2 Mains TERM BLOCK PCB 2POS 5.0MM GREEN $0.36 $0.72
1 100uH CHOKE RF HI CURR 100UH 10% RAD $6.75 $6.75
1 800V TRIAC 16A 800V TO220AB $1.85 $1.85
2 160K RES 162K OHM 1W 1% 2512 SMD $0.39 $0.78
1 LTS6NP TRANSDUCER CURRENT CLOSE LOOP 6A $20.20 $20.20
2 Connector2x3 CONN HDR BRKWAY .100 06POS VERT $1.50 $3.00
1 ATMEGA8-Quad IC AVR MCU 8K 16MHZ 5V 32TQFP $3.55 $3.55
1 MAX232 IC DUAL EIA-232 DRVR/RCVR 16SOIC $0.75 $0.75
1 DB-9 CONN DSUB RCPT 9POS R/A PCB SLD $2.55 $2.55
1 PTK10 CONVERTER DC/DC 5V OUT 10 WATT $37.78 $37.78
1 PowerJack CONN POWER JACK 2.5MM PCB CIRC $0.38 $0.38
1 RS232 IC TXRX RS-232 3-5.5V 16-SOIC $1.48 $1.48
1 TMP35-37 IC SENSOR TEMP 2.7/5.5 8SOIC $1.35 $1.35
1 PCB Light Module PC Board $66.00
$150.85
Light Module - Software Timers
Timer0 (8bit) Clock:31.3kHz Controls triac “on” time ~96 micro seconds
Timer2 (8bit) Clock: 7.8kHz Delays triac fire from zero crossing ~0-8msec delay
Temperature 8 bit reading ever 6 seconds Convert 10bit hex Celsius reading to ASCII Farenheit
Power Sample current sensor 10k sps Calculate power and the average power over 15 minutes Detect zero crossing of mains uC must be able to process current every 100us
Lighting control via remote Dimmer (100%-0% in increments of 10%) On/Off
UART TX via uart buffer
dynamic buffer Interrupt driven
RX Data packet
0x01 start of packet 0x02 end of packet Remote requests current temperature via
0x01 0x03 0x2D 0x02 Packet start|Module ID|Command|Packet End
Light Module – Software
0x28 command start
0x29 command read
0x2A request average power
0x2B request average temperature
0x2C request immediate power
0x2D request immediate temperature
0x2E request current light percentage
0x2F set light percentage
0x30 request current zero
Light Module – Software (Flow)Power On
Setup: Stack
VariablesTriacUart
UartStackADC
Calibrate zero crossing
Start current measurements
Tasks(interrupt driven)
ADC UART Timers
Light Module – Soft. (Flow-ADC)ADC
Current reading?
Store Current Store temperatureyes no
Start current reading
RET
Counter overflow?
Start current read
Start temperature read
yes
no
Calc abs value of current in
reference to calibrated zero
Light Module – Soft. (Flow-ADC-2)Calculated value within
zero crossing margin
Accumulate power
no
RET
Is the triac timer running?
yes
yes
Increment zero counter
no Start triac timer
Zero counter 1?
Calculate power and store
yes
no
Accumulate average power
Accumulate average power
counter 0?no
Calculate average power and store
yes
Light Module – Soft. (Flow-Uart)TX_init
Set stack length
Set TX counter
Reset txWrite stack address
Write to TX stack
RETURN
Load txWrite address
Write byte to stack
Ctear txBusy
Tx_int
Reset txRead stack address
Set txBusy
Counter>0
Load counter
Load txRead address
Dec counter
Clear txBusy
Store counter
Load counter
Inc counter
Save counter
Counter == stack length?
no
Light Module – Soft. (Flow-Uart)
Inc address
Check for address overflow
Save address
RETURN
txBusy?
yes
jmp to tx_int
Read and Inc address
Store read address
transmit
RETURN
Light Module – Soft. (Flow-Timer)Timer2
(Started by zero crossing)
Load Wait State(controls triac
delay) to output compare
Start timer
RET
Output Compare Interrupt
Turn off timer2
Fire triac
Load Triac Pulse Length to timer
RET
Start Timer0
Timer0 OVF Interrupt
Turn off timer0
Turn off triac
RET
Light Module – Testing 1A Starting from PCB
Check short between Vcc and ground Solder uC and attempt to program Solder DC-DC and test voltages Solder max232 and DB-9 and test uart
Solder Mains Components Test for short between hot and neutral Test for short between hot and load Test for connections between mains and digital
side
Light Module – Testing 1B
Test Traic ON/OFF Initially fails to turn short hot and load
line Reconfigured with triac driver
Light Module – Testing 2
Test timer lengths in simulator and actual via oscilloscope
Light Module – Testing 3 Every Zero
Detection True Zero
Detection Triac fires at wrong time
Light Module – Testing 4
Light Module – Testing 5 Triac doesn’t
always turn off at zero crossing
Corrected code for TRIAC fire
Removed filtering on triac input Result: now triac
doesn’t always turn on
Remote – Hardware (PCB)
Remote - Hardware Processor:
Atmega128 Board
Custom Board Architecture
8 bit micro Von Neumann Arch. 16 MIPS at 16 Mhz
128K prog. Flash 4 Kbytes SRAM 64K Bytes External
Memory JTAG, SPI, TWI
Architecture Cont. 4 Timers 8 channel 10 bit ADC Dual Usarts 53 I/O ports Vin 2.7-5.5 Volts
Remote – Hardware Digital
Power: Full Power: 1.6 Watts LCD Off: ¼
Watt Input Voltage: 6-18V Controllable regulator
to turn LCD ON/OFF Clock Rates
Xtal: 8 MHz A/D clock: 62.5 kHz
Memory Internal 4KB External 128KB
User Control 1 slider 6 capacitive buttons 1 proximity sensor 4 tactile buttons
LCD 20 chars x 4 lines Backlight
Temperature 10mV/degrees C -55 to 150C
Remote – Hardware (Battery)
Remote – Hardware (Main)
Remote – Hardware (Touch)
Remote – Hardware (Buttons)
Remote – Hardware (LCD)
Remote – Hardware (NVRAM)
Remote BoMQuantity Value Description Price Ext. Price
1 10K TRIMPOT 10K OHM 3MM CERMET SMD $0.26 $0.26
4 doublethrow SWITCH TACT 6MM MOM SMT 150GF $0.55 $2.20
2 74HC245 IC OCT BUS XCVR TRI-ST 20-SSOP $0.60 $1.20
1 CD74ACT573M96 IC OCT TRANSP LATCH 3ST 20-SOIC $0.73 $0.73
1 MAX232 IC DUAL EIA-232 DRVR/RCVR 16SOIC $0.75 $0.75
2 Header2 CONN HEADR BRKWAY .100 02POS STR $0.84 $1.68
2 5V IC REG LDO 5.0V SOT-89-3 $0.92 $1.84
1 TMP35-37 IC SENSOR TEMP 2.7/5.5 8SOIC $1.35 $1.35
2 100uF CAPACITOR TANT 100UF 6.3V 20%SMD $1.40 $2.80
1 RS232 IC TXRX RS-232 3-5.5V 16-SOIC $1.48 $1.48
2 Connector2x3 CONN HDR BRKWAY .100 06POS VERT $1.50 $3.00
1 9V 1294K-ND $1.87 $1.87
1 5V IC REG LDO 300MA 5.0V 8-MSOP $2.08 $2.08
2 DB-9 CONN DSUB RCPT 9POS R/A PCB SLD $2.55 $5.10
1 Slider QT1106 WHEEL/SLIDER CHIP W/7KEYS $6.03 $6.03
1 128kx8 IC NONVOLATILE SRAM 128KX8 32DIP $13.29 $13.29
1 ATMEGA128 IC AVR MCU 128K 8MHZ 3V 64TQFP $15.05 $15.05
1 4x20 LCD MOD CHAR 4X20 Y/G TRANSFL $17.50 $17.50
1 PCB Remote PC Board $66.00 $66.00
$144.21
Remote - Software Xtal: 8 MHz
Timers Timer1 (8bit)
Clock:7.8kHz Reserved for Testing
Timer2 (8bit) Clock: 31 kHz Provides 40usec to 1.5 msec delay for writing to LCD
Timer3 (8bit) Clock: 7.8kHz Provides .5 second delay on screen refresh and processing of menu commands
ADC Clock: 62.5 kHz Temperature and Power: 1,250 sps
Temperature: converted to Fahrenheit (hex) converted to ascii in menu creation
Power: converted to Volts (hex) converted to ascii in menu creation
UART Raven TX via uart buffer
dynamic buffer Interrupt driven
RX Process Commands on full reception of packet Transmission Error:
Next command lost Restarts at end of next packet (0x02 – packet end)
Uart Debug TX and RX by polling Used for Testing purpose only
Remote – Software
Remote – Software (Function List)
0x40 command start 0x4E RESERVED
0x41 command read 0x4F RESERVED
0x42 RX_available_slaves 0x50 OpenWinamp
0x43 RX_temperature 0x51 CloseWinamp
0x44 rx_check_new_song 0x52 Play
0x45 rx_add_song 0x53 Pause
0x46 rx average power 0x54 Stop
0x47 rx average temperature 0x55 NextTrack
0x48 rx current power 0x56 PrevTrack
0x49 rx current temperature 0x57 Volume
0x4A rx current light state 0x58 GetSongPos
0x4B RESERVED 0x59 LoadSongPos
0x4C RESERVED 0x5A Song
0x4D RESERVED 0x5B BeepRemote
Remote – Software (States)Start
Turn LCD Off
Setup:Stack
VariablesPins
Uart RavenUart Debug
Uart Raven TX BufferUart Raven Command RX
Pin interruptsSplash screen
MenuLCD
Task Loop
Alternate Reading Temperature and
Power
Run Menu Function
Timer off?
no
Refresh LCD Screen
yesTasks
Turn on Global Interrupts
Process Menu Commands
(from pin interrupts)
Start Timer3
Remote – Soft. (Interrupts)
Interrupts
Button1 Button2 Button3 Button4 Timer2 Compare Timer1 OVF Uart Raven RX Uart Raven TX ADC Timer3 OVF
Quick Press:Menu Scroll Left
Long Press:Menu SubMenu
Up
Quick Press:Menu Scroll Right
Long Press:Menu SubMenu
Down
Quick Press:Fast Forward (SubMenu)
Long Press:Select
(SubMenu)
Quick Press:Rewind
(SubMenu)
Long Press:Deselect
(SubMenu)
RETI
TX Menu Display to LCD
Reserved for Testing
RX Command from Raven
Process Command
Transmit Date from Buffer
Temperature:Convert to
Fahrenheit and store
Power:Convert to Voltage
and Store
Stop Timer(Menu Refreshes if timer stopped)
Remote – Testing 1 Starting from PCB
Check short between Vcc and ground Test after soldering every main component
Solder uC and attempt to program Solder DC-DC and test voltages Solder max232 and DB-9 and test uart
Solder LCD & Voltage Regulator Initially blow first pin controlling LCD power
Switched to alternative pin Check pin connectivity Make cursor blink Write commands via uart
Remote – Testing 2 Solder NVRAM
Check pin connectivity Write and read value at random address Write and read external RAM via UART
Solder QPROX Check pin connectivity Observe Change line while touching
buttons QPROX fails – incorrect pin layout
Remote – Testing 3
Solder Tactile Buttons Short between Vcc and ground, changed
orientation Tested interrupts on button lines
No bouncing problems
Remote – Testing 4 Software Tests:
UART LCD NVRAM QPROX Buttons Coding LCD LCD Menus Building dynamic
content for LCD
Commands RX Commands TX Temperature
Readings Power Readings Song information
transfer from computer to remote
Clearing music from memory
Refreshing music
Computer Interface - Hardware Processor:
ATMEL86RF230 ATMEGA3290PV ATMEGA1284PV
Board: AVR Raven
Other Components: Computer
Costs: Raven Board $50
Computer Interface - Software
Python Packages:
time, threading, serial, string, sys, binascii, os, subprocess,winamp,mutagen
RS232 Polling Python code executes on complete packet
Song information gathered by mutagen Play, pause, stop, next track, previous track, create &
delete playlists and change volume via winamp package
Activate/disable locator beeper on remote
Computer Software - FlowStart
Find files music folder
Calculate CRC of Title
Get Each Songs Info:Title
AlbumArtistGenre
Sample ratelength
Wait
Wait
RX Packet?
Read Command
Process Command
Wait
no
yes
Command Refresh Music
Get Song Info
Counter>song array lenth?
TX CRC
Response New song?
Increment counter
Transmit Song
no
End
Computer Software – Function List0x10 OpenWinamp
0x11 CloseWinamp
0x12 Play
0x13 Pause
0x14 Stop
0x15 NextTrack
0x16 PrevTrack
0x17 Volume
0x18 GetSongPos
0x19 LoadSongPos
0x1A GetMusic
0x1B RX_music
0x1C Song
0x1D RESERVED
0x1E RESERVED
0x1F BeepRemote
0x20 func_new_song
0x21 func_old_song
Computer - Testing
Tested collecting of song information Connected two serial ports of the
computer together via null modem Tested transmission of new songs Tested transmission of a title’s crc Tested all commands on function list
Wireless AT86RF230 Transceiver: 2.4 GHz Radio
Transceiver for IEEE802.15.4/Zigbee Applications
Features: Ultra Low Power Consumption Current :20nA (sleep) 15.5mA/ 16.5mA (RX/TX) Voltage : 1.8V to 3.6V Easy to use Interface Low data rate (250kbps at 2.4GHz)
Special IEEE 802.15.4-2003 Hardware Support
FCS (Frame check sequence) Computation Clear Channel Assesment methods: Energy above threshold. Carrier sense ( Signal with modulation and
Spreading characteristics). Carrier sense with energy above threshold Automatic CSMA-CA (carrier-sense multiple-
access/collision-avoidance) Automatic Address Filtering
Pin Out Diagram
Microcontroller Interface
PB5
PB6
Pin22
Pin 20
Microcontroller Interface cont..
Comprises of a Slave SPI (serial port interface) used for Frame Buffer and Register Access.
And other Control Signals.
Signal Description of Microcontoller Interface cont… SEL SPI select signal, active low MOSI SPI data (master output slave input) signal MISO SPI data (master input slave output) signal SCLK SPI clock signal MAX : 7.5MHz CLKM AT86RF230 clock output MAX : 8MHZ IRQ AT86RF230 interrupt request signal SLP_TR - Sleep/Wakeup - TX start - Controls CLKM output -RST AT86RF230 reset signal, active low
TRX_OFF ---Sleep SLEEP ------Wakeup RX_ON----- Disable CLKM RX_ON_NOCLK --- Enables CLKM RX_ON_NOCLK ---Enables CLKM RX_AACK_ON_NOCLK--- Enables CLKM RX_AACK_ON ---- enables CLKM PLL_ON -------TX start TX_ARET_ON--- TX start
Sleep/Wake-up and Transmit Signal (SLP_TR)
Operating ModesBasic Operating Modes:
Basic Operating Modes
State transition timing P_ON - Power-on after VDD SLEEP – Sleep State TRX_OFF – Clock State PLL_ON – PLL State RX_ON and BUSY_RX – RX Listen and Receive State RX_ON_NOCLK – RX Listen State without CLKM BUSY_TX – Transmit State
Interrupt Handling
TX flow diagram
Flow diagram of ARET
Current Product Lighting control
Controls power to load in 10% increments Music Playback
Capable of simple winamp control Loading of music still in development
S.M.A.R.T. Remote LCD functional Menu functional S.M.A.R.T. functionality still in development Command structure functional Capacitive touchpad failed (incorrect pin layout)
Backup tactile buttons Multi-hop wireless signal
In development