Académique Documents
Professionnel Documents
Culture Documents
Featured Applications
• Smart Plugs Or Power Strips
• Building And Home Monitoring
• Home Appliances And White Goods
• Energy Awareness Related Products
Enclosure
Relay LED
Status RGB
LED
Manual
ON/OFF
UART / I2C
24
40 MHz Switch
Connector
32 kHz
Config
switch
CC3200
Wi- Fi
120/240V
Relay
SPI Flash
8Mbit Op -Amp
2.4
Metrology
I2C WAC
connection UCC28910
110/240V
to 3V supply
Reset Switch
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 1
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com
An IMPORTANT NOTICE at the end of this TI reference design addresses authorized use, intellectual property matters and other
important disclaimers and information.
2 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com System Description
1 System Description
1.1 Introduction
Increasingly, applications require Wi-Fi-enabled energy measurement and control, particularly in end
products such as smart plugs and smart receptacles, and in general application spaces such as home
appliances, smart grid, and building automation. This guide offers a form-factor reference design and
application software for the CC3200 Smart Plug, while also addressing application requirements in
connected applications.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 3
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
System Description www.ti.com
Enclosure
Relay LED
Status RGB
LED
Manual
ON/OFF
UART / I2C
24
40 MHz Switch
Connector
32 kHz
Config
switch
CC3200
Wi- Fi
120/240V
Relay
SPI Flash
8Mbit Op -Amp
2.4
Metrology
I2C WAC
connection UCC28910
110/240V
to 3V supply
Reset Switch
4 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Circuit Design and Component Selection
3.3 V
L-in
AC-DC -3.3 V
N-in
L-in
RELAY LATCH
L-out
CC3200
N-in
N-out RSHUNT LED
Low-pass INA
ADC1
Filter (LM324)
2.2 Features
• Mechanical relay to switch loads up to 15 A
• 110- / 230-V, 50- / 60-Hz operation
• Very low quiescent current
• Multi-color LED indication for various states
• Voltage, current, frequency, power, and power factor monitoring
• 2.4-GHz Wi-Fi support for remote monitoring and administration
• Cloud support for controlling multiple CC3200_Smart_Plugs from one interface
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 5
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Circuit Design and Component Selection www.ti.com
SMBJ100A-TR
LIN
4
C40
B1
10 OHM 100pF T1 15MQ040N
2
MB6S
+
SPP1UL10R0JLF D7 D5
3 2 1 8 2 1
R71
1
R70
1
1.5K C43
-
R23
D8 2 6 C41 C42
6.8K 1 2 820uF 2K
10UF 0.1uf
1
BAV21W-FDITR-ND
3
2
NEUTRAL_IN
1
2
R24
D9
2
5 7
100K
GND_S
R68
1
0.0 OHM
U4 GND
GND_S
1 8
120 OHM
GND1 DRAIN TRANSFORMER
R69
2 XFRM_750314752
GND2
3 6
GND3 VDD -3.3V_T
4 5 C2 C3 R1
R20 IPX VS
D10 100UF 0.1uf 2K
UCC28910D R22 GND_S
30K
6.8K R19 1 2
2.7K C33
L10
10UF SK310A-TP
10UH
1 2
CBC3225T100MR
The converter is based on the UCC28910D power MOSFET with integrated voltage sensor. The 110-V /
230-V AC is converted to a corresponding DC voltage using the bridge rectifier B1 and the following filter
consisting of C34, L2, and C44. The transformer and the UCC IC switch this DC to generate the required
3.3 V and -3.3 V.
REL_STATE
REL_CTRL
R13
Q1 1.0K
DMG2305UX
R14
K1 10K
RES 0603
LOUT 3 1
3 1
R72
Q2
33 OHM
2N7002.
D6
1N4007
LIN_REL4 2
4 2
Relay
RELAY_HF3FA
GND
The relay used here is capable of working from 3-V DC, and the coil is driven using a PMOS due to the
limited drive capability of the CC3200. To preserve the states of the relay during the CC3200 hibernate or
RESET, a latch is formed by using another NMOS transistor. The relay can be turned ON and OFF by
high-going or low-going pulses at the gate of transistor Q3. The relay control is driven by a GPIO from the
CC3200.
6 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Circuit Design and Component Selection
2.3.3 Metrology
The metrology section consists of two parts: one part is the sensing section, which is used to sense the
voltage and the current; the other part is a differential- to single-ended converter to drive the ADCs on the
CC3200.
Metrology Analog Filters
R5
F1 R2 R3 R4
LIN LIN_REL 1K VSENSEP
RES 0603
470K 470K 470K
FUSE 15A R32 C5
RES 0603 RES 0603 RES 0603
RES 0603 R7 0.1uf
2.2K
S20K275
R31 2.2M OHM
RES 0603 C6
RES 0603 150pf
R6 2.2M OHM
GND_S C7
R34 R8 0.1uf
NEUTRAL_IN VSENSEN
0.0 OHM 1K
RES 0603 RES 0603
GND_S
GPIO_FREQ_DET
R30
2 1
220K OHM
JP3 RES 0603
L3 R9
ISENSEP
FREQ_DET
BLM21BD121SN1D 1K
C8
2
RES 0603
RSHUNT1 0.1uf
D3
12
C9
4m SMAJ5.0CA
150pf
1
C10
L4 R10 GND 0.1uf
NEUTRAL_OUT ISENSEN
BLM21BD121SN1D 1K RES 0603
Figure 5 shows the sensing of the voltage and current taken by the load. The input voltage is attenuated
using the multiple 470-Kohm and the 2.2-K resistor, which is further filtered using the single-pole RC filter
formed by the 1-K, 0.1-µF, and the 150-pF capacitor. Similarly, the current is converted to voltage using
the 4-mill-ohm resistor and then filtered using the RC filter and ferrite bead. The D3 limits the peak-to-peak
swing of this voltage. The differential voltage is then fed to the LM324-based instrumentation amplifier.
VCC
U1C Metrology Section -3.3V_T
R88
ISENSEN 10 -3.3V
R49 R50 0.0 OHM
8 C49 JP8
9 0.1uf 2 1
10K 10K
LMV324M RES 0603 RES 0603
U1A
4
V+
R58 6 -3.3V
11
2.0K
LMV324M
U1D
C57
ISENSEP 12 1000pF
14 R36 R51 R54 R55
13 C52 VCC
10K 10K 10K 10K 0.1uf
RES 0603 RES 0603 RES 0603 RES 0603
LMV324M
GND
R56 R52 R40 R39
GND
10K RES 6.8K OHM RES 12K OHM RES 22K OHM
VCC
RES 0603 R53
C55 C54 C53
U7C
RES 5.1K OHM 100UF 100UF 100UF
VSENSEN 10
8 R35 R37
C50
9 0.1uf
10K 10K
LMV324M RES 0603 RES 0603 U7A GND GND GND
GND
4
R44
V+
R45 6 -3.3V
11
68.0K
RES 0603 LMV324M C56
U7D
1000pF
VSENSEP 12
14 R33 R38 R41 R42
13
10K 10K 10K 10K C51
RES 0603 RES 0603 RES 0603 RES 0603 0.1uf
LMV324M GND
R43
The LM324 is used here as an instrumentation amplifier and also a differential- to single-ended conversion
to drive the inputs of the ADC. No output filter exists at the last stage, but a simple RC filter with 100 Ohm
and 1µF is recommended to be connected in the next version of the board.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 7
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Circuit Design and Component Selection www.ti.com
P1 P2
CC_TMS 1 CC_TX 1
CC_TCK 2 CC_RX_HRD 2
CC_TDO 3 VCC 3
CC_TDI 4 SOP2 4
5 5
5PinHeader 5PinHeader
GND GND
CC_RX_HRD
The JTAG connector can be used to debug the firmware using an external debugger. The UART header
programs the serial flash connected to the CC3200.
SMART VCC
R18
1 2
DTSM-3-RA 100K OHM
SC_AP_WPS
GND GPIO17
JP7
VCC 2 1 WAC
R92
GPIO28
100K OHM
The push-button S1 sets the CC3200 device to smartconfig mode. The blue LED will flash at a fast rate
when the device enters the smartconfig state.
R15
220K OHM RESET
R29
CC_RESET 1 2
1K OHM DTSM-3-RA
C37
0.22uF
GND
GND
The push-button “RESET” resets the CC3200 device at any instance. This action is typically required
during the development phase for updating the application code and service packs.
8 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
R17
100K OHM ON/OFF
R62
1 2
REL_ON_OFF
1K OHM DTSM-3-RA
C1
0.1uF
GND
GND
The push-button “ON / OFF” toggles the state of the relay, which controls the connected appliance. The
signal from the switch is used as an input by the CC3200 to control the relay.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 9
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
Enclosure
Relay LED
ARM Wi- Fi
M3 NWP
Reset switch Power Supply
3.3 V Manual
ADC On / Off
Internet
10 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
3.2.1 Assumptions
3.2.1.1 Hardware
• Main supply ground is isolated from Metrology hardware
• The CC3200 ADC input dynamic range is between 0 to 1.46 V
• The voltage and current sense analog input to CC3200 ADC has bias voltage of ~0.72 V
• The voltage and current sense analog signals having dynamic range between 0 to 1.46 V centered at
~0.72 V
• CC3200 supports parallel DMA for ADC channels
• A dedicated GPIO is present to generate a Wh pulse when 1 Wh energy is consumed
• The accuracy and characteristics of ADC channels are identical
• The ADC supports 10 ENOB (Effective Number Of Bits) accuracy
• The low-pass filters at ADC inputs must have same time constants
• The current and voltage channels are 180 degrees out of phase at ADC input
3.2.1.2 Software
• The voltage and current channels scaling factor is determined by accurate calibration by using known
load and supply
• The voltage and current channel bias cannot be less than 0.5 V
• The supply AC frequency cannot be out of range between 40 Hz to 70 Hz
• The supply AC voltage cannot be out of range between 10 V to 300 V
• The ADC code word range from 0 to 4095 (12 bits)
• The ADC max voltage is 1.46666 V and corresponds to code word 4095
• The ADC sampling frequency is 62.5 KHz
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 11
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
12 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
3.2.3.3 Filtering
The presence of instantaneous high-frequency noise or harmonics in ADC channels must be removed
digitally from the channels after sampling by using a basic low-pass filter.
The 5th order FIR filter with 300 Hz cutoff frequency can eliminate high-frequency noise in the channel.
The 64:1 decimation also acts as a low-pass filter and helps remove high-frequency noise.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 13
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
Sample
count
å v(n) ´ i(n)
n =1
PACT = K p ´
Sample count
(2)
Kp = Scaling factor for power (Kv × Ki)
Apparent Power (Papt):
PAPT = VRMS gIRMS
(3)
Reactive Power (Preact):
PAPT 2 = PACT 2 + PREACT 2
(4)
Active Energy (Eact):
E ACT = å PACT
n =1
(5)
Accumulation of power every sec gives energy consumed until the last second.
14 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
if
0.72 V ADC full scale 0.72 V ADC full scale
R1 R5 offset range = 1.46 V offset range = 1.46 V
and
0V 0V
R3 R4 R6 R 7 C M R R d e p e n d s o n m a tch
All resistors: +1% metal film All resistors: ±1% metal film
Figure 14. Vsense and Isense Dynamic Range Conversion Hardware Logic
GPIO_RELAY_ON
1 K
From CC3101
GPIO = HIGH
1 K
GPIO ± 3.3 V Turn on
330
GPIO=HiZ (TriState)
High imp
Maintain relay state
GPIO = LOW
GPIO ± 0 V Turn on
1.5 K
BC547
1 K
Ckt
GND
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 15
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
+3.3 V
GPIO_RELAY_EN
From CC3101
VSENSE_CURRENT
To CC3101 ADC CH0 CC3101R
Engine area
VSENSE_VOLTAGE
To CC3101 ADC CH2
The Input Vsense and Isense analog signal at ADC input as shown in Figure 17 (50-Hz Supply)
1.465 V
(ADC FSR)
Offset
F = 50 Hz (India)
0V
T = 20 ms
62.5*20 =
1250 samples per second
(per channel)
Neutral out
Current channel K2 u I t offset2 DMA_DONE_IRQ
For continuous real-time samples collection, DMA is configured in ping-and-pong buffer transfer mode.
16 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
Pins 57 and 59 of CC3200 are muxed to ADC channel 0 and 2 respectively. In software, these two pins
are configured as the ADC input.
The ADC channel 0 and corresponding DMA channel 14 collect analog Voltage samples; the ADC
channel 2 and corresponding DMA channel 16 are used to collect analog current samples. The sampling
frequency is 62.5 KHz, and signal processing algorithm is using 64:1 decimation (explained in detail in
next chapter). To keep buffer handling and signal processing algorithm simple, the DMA ping-and-pong
buffer collection is selected as a multiple of 64, which is 640 samples (10.24 ms). Every 10.24 ms, once
the voltage channel and current's channels DMA interrupts trigger, the M4 collects the 640 samples in the
ping buffer, and the DMA continues to collect immediate samples into the pong buffer. The voltage
channel interrupt number is 30 and Current channel interrupt number is 32 in ARM M4 processor vector
table.
The configured ADC timer enables time stamps in each ADC sample. The raw ADC samples from DMA o
/ p buffer would be 32 bits having MSB 18-bits time stamp (time stamp counter is 17 bit + 1 dummy bit)
and LSB 14 bits for ADC (12-bit ADC + 2LSB dummy bits). The 12-bit ADC samples are extracted from
32-bit samples as 12bit_adc_sample = (32bit_adc_sample >> 2) and 0 × FFF.
In M4 ADC DMA interrupt handler (in both the V-channel and I-channel handler), source of interrupt (ADC
DMA channel source) is cleared as soon as interrupt is serviced to service interrupt for next ping/pong
DMA done interrupt. The ping-or-pong source of DMA-done interrupt must be identified before processing
ADC samples. Re-enable the ping-or-pong source after processing the samples.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 17
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
FIR filter
(10 filtered samples)
100 samples
collected?
(1.024 sec)
Code word to analog
voltage conversation
(10 filtered samples) Generate 1.024 process
Re-Enable ping / pong
software interrupt
buffer and return
3.2.6.1.1 Decimation
The 640 samples in 10.24 ms are oversampled for metrology application, so we can utilize these samples
to improve the ENOB of the ADC.
The decimation improves the ENOB and quantization noise of ADC. The 64:1 decimation is used by
summing 64 ADC samples (26) and right shifting this sum by 3 bits, which improves ENOB by 3 bits. This
decimation results in a 13-bit ADC (15 code words) with 1000 samples per 1.024 sec, instead of the
original 10-bit ADC (12 code words) with 64000 samples per 1.024 sec.
Decimated_adc_sample = (Σ 64 ADC samples >> 3)
Decimated_adc_sample is the 15-bit code word
18 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 19
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
Figure 21. Voltage Channel Decimated and Filtered Figure 22. Current Channel Decimated and Filtered
Samples Samples
Figure 23. Filtered Voltage and Current Samples on top of Each Other with No Phase Difference After
Filtering
20 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 21
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
In the 1.024-sec process, RMS value will be computed from raw voltage and current mean square values.
The raw value is scaled by 20 bits.
å v(n) ´ i(n)
n =1
PACT = K p ´
Sample count
(7)
Raw_True_Power = (Σ(1000 Voltage filtered samples – Voltage DC offset) × (1000 Current filtered
samples – Currrent DC offset)) / 1000
In 1.024-sec process, the true power value will be computed from the raw power value. The raw value is
scaled by 20 bits.
22 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
Remove ADC noise power from Power value, the noise power is product of Rms_Voltage_channel_noise
and Rms_ Current _channel_noise.
True_Power = True_Power – Noise_Power
3.2.6.2.1.3 Frequency
The Zero_crossing_count and Total_samples_per_integral_cycles per 1.024 sec is provided by the 100th
interrupt of the 10.24-ms process. In 1.024 sec, 1000 filtered samples are present, in which only
Total_samples_per_integral_cycles samples are present in a complete integral number of cycles. The
difference will give residual samples in 1.024 sec, which is required to find the residual accurate
frequency.
Number_of_Residual_Samples = 1000 - Total_samples_per_integral_cycles (in 1.024 sec)
The accurate number of samples per one complete cycle is computed by using Zero_crossing_count and
Total_samples_per_integral_cycles, which is required to compute the residual accurate frequency.
Num_Samples_per_cycle = (Total_samples_per_integral_cycles/Zero_crossing_count) × 2
In one cycle, 2 zero crossings will be detected. Num_Samples_per_cycle is averaged over 2 samples
(1.024-sec samples) for better accuracy.
The Frequency can be computed as below, which is computed by using 1.024 sec so it is necessary to
convert frequency into 1-sec measuring interval.
• Frequency = (Zero_crossing_count/2 + Number_Residual_Samples/Num_Samples_per_cycle)/1.024
• Integral number of cycles per sec: Number of integral cycles per seconds is necessary to compute
accurate DC offset, it can be done by using Frequency of supply voltage.
• Total_Number_of_Cycles_per_1.024sec_in_float = 1000 / Num_Samples_per_cycle
• Total_integral_cycles_per_1.024sec = (int) Total_Number_of_Cycles_per_1.024sec_in_float
• Residual_samples = (int) ((Total_Number_of_Cycles_per_1.024sec_in_float -
Total_integral_cycles_per_1.024sec) × Num_Samples_per_cycle + 0.5)
The Total samples in integral cycles in 1.024 sec used for DC computation is as below
• Total_samples_in_integral_cycles_per_1.024sec = 1000 - Residual_samples
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 23
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
24 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
Plug in Smart
Plug
Compute
SmartConfig Yes Request
Metrology data
Initiated configuration
every 1 second
No
Receive
Connect to configuration
saved profile
Advertise
mDNS name
Save
configuration
Create TCP
server
Accept client
connection
No
Activate exosite
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 25
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
Smartplug Reset –
Initialize UART, 100 ms
Enter main function
timer and WDT
Set up Pinmux and GPIO for Set up Smartplug task for data
Smartplug switches and broad cast, error detection, and
RGB LEDSs system recovery
26 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
The periodic 1-sec CC3200_Smart_Plug task triggers the Exosite and Android send task to broadcast
metrology parameters into user. The below flow chart explains this periodic functionality.
Figure 28. Flow of Periodic Triggers to Send the Data to the Cloud (Exosite) and Mobile App
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 27
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
28 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
The packet Android app would receive 0 × 7A, 0 × 01, 0 × 88, 0 × 13, 0 × 00, and so on. The same rule
would apply for packets received from Android.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 29
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
Table 6. Warning Message for Over Energy and Power Consumption Threshold
BYTE 0–1 2 3 4 5–8
DATA 0 × 7A08 Over Energy (kWh) Over Power (W) Metrology module Timestamp
consumption consumption error
FORMAT U16 U8 U8 U8 U32
RESOLUTION 1 1 1 1 1
NOTE: Table validity bit indicates whether the table is currently active or not.
30 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
If write is successful, then the app can enable a secured Exosite connection (Table 22) to validate the
certificate.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 31
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
NOTE: The user modification of the current state of relay will supersede the value of the schedule
table configuration in the CC3200 Smart Plug. The schedule-table-validity bit will be cleared
upon a change in state of Relay by this message.
Table 13. Packet to Set Energy and Power Threshold for Warning
BYTE 0–1 2–5 6–9
USE 0 × A702 Energy threshold value (KWh) Power threshold Value (W)
FORMAT U16 U32 U32
RESOLUTION 1 0.0001 (data × 10000) 0.001(data × 1000)
Table 19. Packet to Request Device Information (Device On / Off and Power-Save Mode)
BYTE 0–1
USE 0 × A780
32 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
NOTE: Send non-zero values for effective use of schedule table in CC3200 Smart Plug, if all values
are zero (wakeup, leave, return, sleep = 0) then CC3200 Smart Plug will not use schedule
table.
The checksum is just XOR of all the bytes of certificate (4-N bytes) – during this large data transfer (more
than 1KB), the Android app can change the update rate of the CC3200 Smart Plug to the maximum value
to give full bandwidth to this operation. The CC3200 Smart Plug closes the Exosite socket while updating
this certificate. The certificate must be in binary format (.der) before it can be sent to the Smart Plug.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 33
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
Table 25. Packet to Update Average Energy at Hourly Frequency (Update Rate 1 Hour)
DATA AVERAGE ENERGY (KWH)
ALIAS “enr_avg”
FORMAT float
Table 26. Packet to Update Device Information (Relay and PS Mode Info)
POWER SAVING ENERGY POWER
DEVICE TURNED UPDATE
DATA MODE ENABLE THRESHOLD THRESHOLD
OFF / ON (0 / 1) INTERVAL IN SEC
DISABLE (0 / 1) VALUE (KWH) VALUE (W)
ALIAS “control” “powmode” “reportint” "enthld" “powthld”
FORMAT integer Integer Integer float float
Display: data in dash board, user must clear warning messages in cloud
Display: data in dash board, user must clear warning messages in cloud
34 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
Display: all data in dash board and time zone of CC3200 Smart Plug
In HTTP content body the string looks like the following:
Schedule = 0630, 0815, 1900, 2300,….,2300, 002130, 01 (configuration for weekdays + Saturday +
Sunday (3) days)
NOTE: The table validity bit indicates whether the table is currently active or not.
Exosite will set “command = 1” when any of the following have changed by the user via the cloud:
• schedule
• powmode
• reportint
• powthld
• repthld
CC3200 Smart Plug sends data "command = 0" in order to notify Exosite that it received the updated
schedule and other settings.
NOTE: If device status “control” modifies the current state of relay, then it will override the schedule
table configuration in the CC3200 Smart Plug. The schedule table validity bit will be cleared
upon a change in state of Relay by this message.
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 35
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Embedded Software System www.ti.com
If “command = 1”, read all messages from Exosite server (indicates Exosite updated schedule or other
settings for the CC3200 Smart Plug). Once the schedule is received, the CC3200 Smart Plug sends
“command = 0” (Table 30)
This message is separate and stored in the “schedule” data source and is to be read if “command = 1”. If
read based on “command = 1”, CC3200 Smart Plug should set “command = 0”.
NOTE: Note: Send non-zero values for effective use of schedule table in CC3200 Smart Plug. If all
values are zero (wakeup, leave, return, sleep = 0), then the CC3200 Smart Plug will not use
the schedule table.
36 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Embedded Software System
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 37
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Flows of the CC3200 Smart Plug Design www.ti.com
Plug In
Init Device
(GPIO, SPI, NWP Compute Metrology
/ Metrology FE) data every 1 second
Smart
Config
Request
Receive
Connect to saved profile
Save
Create TCP
Advertise
Accept
Client
Client Data
Receive/Send
Exosite
server
Y
N Exosite Data
Activate Receive/Send
Figure 33. Flow Diagram for the CC3200 Smart Plug Embedded Code
38 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com Flows of the CC3200 Smart Plug Design
Get default
User manually try to
register device
status from
Cannot
Notify user
Got cloud contact cloud
No device is not (A breakdown)
confirmation? (A/B breakdown) registered
Yes
Notify user
Get data Get data
Loses connection Loses connection that connection
from cloud (A/B breakdown)
from local (C breakdown) is lost
Figure 34. Flow of the CC3200 Smart Plug from the Android App Perspective
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 39
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
Test Results www.ti.com
5 Test Results
As shown in the application demo, the functionality of the CC3200 Smart Plug has been tested
successfully. Figure 35 shows a graph of the device's energy-reading accuracy. Energy-reading accuracy
shows errors below 5% across a wide dynamic range, making the CC3200 Smart Plug demo kit suitable
for many applications.
6 Design Files
6.1 Schematics
To download the schematics for each board, please see the design files at http://www.ti.com/tool/TIDC-
CC3200SMARTPLUG.
40 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide TIDU983 – July 2015
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
www.ti.com About the Author
TIDU983 – July 2015 SimpleLink™ Wi-Fi® CC3200 Smart Plug Design Guide 41
Submit Documentation Feedback
Copyright © 2015, Texas Instruments Incorporated
IMPORTANT NOTICE FOR TI REFERENCE DESIGNS
Texas Instruments Incorporated ("TI") reference designs are solely intended to assist designers (“Buyers”) who are developing systems that
incorporate TI semiconductor products (also referred to herein as “components”). Buyer understands and agrees that Buyer remains
responsible for using its independent analysis, evaluation and judgment in designing Buyer’s systems and products.
TI reference designs have been created using standard laboratory conditions and engineering practices. TI has not conducted any
testing other than that specifically described in the published documentation for a particular reference design. TI may make
corrections, enhancements, improvements and other changes to its reference designs.
Buyers are authorized to use TI reference designs with the TI component(s) identified in each particular reference design and to modify the
reference design in the development of their end products. HOWEVER, NO OTHER LICENSE, EXPRESS OR IMPLIED, BY ESTOPPEL
OR OTHERWISE TO ANY OTHER TI INTELLECTUAL PROPERTY RIGHT, AND NO LICENSE TO ANY THIRD PARTY TECHNOLOGY
OR INTELLECTUAL PROPERTY RIGHT, IS GRANTED HEREIN, including but not limited to any patent right, copyright, mask work right,
or other intellectual property right relating to any combination, machine, or process in which TI components or services are used.
Information published by TI regarding third-party products or services does not constitute a license to use such products or services, or a
warranty or endorsement thereof. Use of such information may require a license from a third party under the patents or other intellectual
property of the third party, or a license from TI under the patents or other intellectual property of TI.
TI REFERENCE DESIGNS ARE PROVIDED "AS IS". TI MAKES NO WARRANTIES OR REPRESENTATIONS WITH REGARD TO THE
REFERENCE DESIGNS OR USE OF THE REFERENCE DESIGNS, EXPRESS, IMPLIED OR STATUTORY, INCLUDING ACCURACY OR
COMPLETENESS. TI DISCLAIMS ANY WARRANTY OF TITLE AND ANY IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT, QUIET POSSESSION, AND NON-INFRINGEMENT OF ANY THIRD PARTY
INTELLECTUAL PROPERTY RIGHTS WITH REGARD TO TI REFERENCE DESIGNS OR USE THEREOF. TI SHALL NOT BE LIABLE
FOR AND SHALL NOT DEFEND OR INDEMNIFY BUYERS AGAINST ANY THIRD PARTY INFRINGEMENT CLAIM THAT RELATES TO
OR IS BASED ON A COMBINATION OF COMPONENTS PROVIDED IN A TI REFERENCE DESIGN. IN NO EVENT SHALL TI BE
LIABLE FOR ANY ACTUAL, SPECIAL, INCIDENTAL, CONSEQUENTIAL OR INDIRECT DAMAGES, HOWEVER CAUSED, ON ANY
THEORY OF LIABILITY AND WHETHER OR NOT TI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, ARISING IN
ANY WAY OUT OF TI REFERENCE DESIGNS OR BUYER’S USE OF TI REFERENCE DESIGNS.
TI reserves the right to make corrections, enhancements, improvements and other changes to its semiconductor products and services per
JESD46, latest issue, and to discontinue any product or service per JESD48, latest issue. Buyers should obtain the latest relevant
information before placing orders and should verify that such information is current and complete. All semiconductor products are sold
subject to TI’s terms and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its components to the specifications applicable at the time of sale, in accordance with the warranty in TI’s terms
and conditions of sale of semiconductor products. Testing and other quality control techniques for TI components are used to the extent TI
deems necessary to support this warranty. Except where mandated by applicable law, testing of all parameters of each component is not
necessarily performed.
TI assumes no liability for applications assistance or the design of Buyers’ products. Buyers are responsible for their products and
applications using TI components. To minimize the risks associated with Buyers’ products and applications, Buyers should provide
adequate design and operating safeguards.
Reproduction of significant portions of TI information in TI data books, data sheets or reference designs is permissible only if reproduction is
without alteration and is accompanied by all associated warranties, conditions, limitations, and notices. TI is not responsible or liable for
such altered documentation. Information of third parties may be subject to additional restrictions.
Buyer acknowledges and agrees that it is solely responsible for compliance with all legal, regulatory and safety-related requirements
concerning its products, and any use of TI components in its applications, notwithstanding any applications-related information or support
that may be provided by TI. Buyer represents and agrees that it has all the necessary expertise to create and implement safeguards that
anticipate dangerous failures, monitor failures and their consequences, lessen the likelihood of dangerous failures and take appropriate
remedial actions. Buyer will fully indemnify TI and its representatives against any damages arising out of the use of any TI components in
Buyer’s safety-critical applications.
In some cases, TI components may be promoted specifically to facilitate safety-related applications. With such components, TI’s goal is to
help enable customers to design and create their own end-product solutions that meet applicable functional safety standards and
requirements. Nonetheless, such components are subject to these terms.
No TI components are authorized for use in FDA Class III (or similar life-critical medical equipment) unless authorized officers of the parties
have executed an agreement specifically governing such use.
Only those TI components that TI has specifically designated as military grade or “enhanced plastic” are designed and intended for use in
military/aerospace applications or environments. Buyer acknowledges and agrees that any military or aerospace use of TI components that
have not been so designated is solely at Buyer's risk, and Buyer is solely responsible for compliance with all legal and regulatory
requirements in connection with such use.
TI has specifically designated certain components as meeting ISO/TS16949 requirements, mainly for automotive use. In any case of use of
non-designated products, TI will not be responsible for any failure to meet ISO/TS16949.IMPORTANT NOTICE
Mailing Address: Texas Instruments, Post Office Box 655303, Dallas, Texas 75265
Copyright © 2015, Texas Instruments Incorporated