Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 49

CyberSens-EDU: An Embedded

Systems Platform for IoT Education


Part 2
CyberSens-EDU: what we have learned?

• CyberSens hardware platform and pin map


• Multitasks and Multi-blinks
• Timer and environment sensor (Si7021)
Purpose for this section

• Power supply, Battery, recharge (MCP73831), Fuel gauge (MAX17048),


and monitoring
• Onboard display (SSD1306) and third party libraries
CyberSens-EDU:
Schematics
• Designed using a free-version
Eagle PCB Software by
Autodesk, Inc.
https://www.autodesk.com/products
/eagle/free-download
• Two-layer PCB
CyberSens-EDU: Digital Outputs

• Multi-Blinks and Multitasks


• REDLED: GPIO28
• GREENLED: GPIO07-
DEVSTATUS
• BLUELED: GPIO06-
COMSTATUS
CyberSens-EDU:
Digital Outputs
• CC3200 LaunchPad
Pin Maps for Energia
Development
• REDLED 🡪 (GPIO28) 🡪
19
• GREENLED 🡪 (GPIO07)
🡪8
• BLUELED 🡪 (GPIO06) 🡪
5
CyberSens-EDU: Hardware
Configuration
• Please set the jumpers (solid
blue; gridded ones can be
ignored) as shown in the figure.
• Use ribbon wires (6) to connect
from CC3200 LauchPad to
CyberSens-EDU device. %V,
GND, RST, RX, TX, and TCK-
SOP2.
• Connect Micro Servo (SG92R):
Yellow cable to CyberSens-EDU
JP3-PWM Pin; Orange cable to
LaunchPad 5V, and Brown cable
to LaunchPad GND
Ref: TPS73233 and TPS73218 Datasheet
http://www.ti.com/lit/ds/symlink/tps732.pdf

Power Supply and Voltage Regulator


• Power Supply for 3.3V and 1.8V
Ref: TPS73233 and TPS73218 Datasheet
http://www.ti.com/lit/ds/symlink/tps732.pdf

Power Supply and Voltage Regulator


• TPS732xx Capacitor-Free, NMOS, 250-mA Low-Dropout Regulator With
Reverse Current Protection
• Stable with No Output Capacitor or Any Value or Type of Capacitor
• Input Voltage Range: 1.7 V to 5.5 V
• Ultralow Dropout (LDO) Voltage: 40 mV Typical at 250 mA
• Excellent Load Transient Response—With or Without that is nearly constant
over all values of output Optional Output Capacitor
• NMOS Topology Provides Low Reverse Leakage Current
• Low Noise: 30 μVRMS Typical (10 kHz to 100 kHz)
• 0.5% Initial Accuracy
• 1% Overall Accuracy (Line, Load, and Temperature)
• Less Than 1-μA Maximum IQ in Shutdown Mode
• Thermal Shutdown and Specified Min and Max Current Limit Protection
Ref: TPS73233 and TPS73218 Datasheet
http://www.ti.com/lit/ds/symlink/tps732.pdf

Power Supply and Voltage Regulator


• TPS732xx Capacitor-Free, NMOS, 250-mA Low-Dropout Regulator
With Reverse Current Protection
• Typical Application Circuit for Fixed-Voltage Versions
Ref: TPS73233 and TPS73218 Datasheet
http://www.ti.com/lit/ds/symlink/tps732.pdf

Power Supply and Voltage Regulator


• TPS732xx Capacitor-Free, NMOS, 250-mA Low-Dropout Regulator
With Reverse Current Protection
• External capacitors
• Although an input capacitor is not required for stability, it is good analog design practice
to connect a 0.1-μF to 1-μF, low ESR capacitor across the input supply near the regulator.
This capacitor counteracts reactive input sources and improves transient response, noise
rejection, and ripple rejection. A higher-value capacitor may be necessary if large, fast
rise-time load transients are anticipated or the device is located several inches from the
power source.
• The TPS732 does not require an output capacitor for stability and has maximum phase
margin with no capacitor. It is designed to be stable for all available types and values of
capacitors. In applications where multiple low ESR capacitors are in parallel, ringing may
occur when the product of COUT and total ESR drops below 50 nΩF. Total ESR includes all
parasitic resistances, including capacitor ESR and board, socket, and solder joint
resistance. In most applications, the sum of capacitor ESR and trace resistance meets this
requirement.
Ref: TPS73233 and TPS73218 Datasheet
http://www.ti.com/lit/ds/symlink/tps732.pdf

Power Supply and Voltage Regulator


• TPS732xx Capacitor-Free, NMOS, 250-mA Low-Dropout Regulator
With Reverse Current Protection
• Footprint
Battery, Recharge, and Fuel Gauge
• Battery Charger – MCP73831

Ref: MCP73831 Datasheet


https://cdn.sparkfun.com/assets/learn_tutorials/6/9/5/MCP738312.pdf
MCP73381 - Miniature Single-Cell, Fully Integrated Li-Ion,
Li-Polymer Charge Management Controllers
• Linear Charge Management • Selectable End-of-Charge Control:
Controller: • 5%, 7.5%, 10%, or 20%
• Integrated Pass Transistor
• Integrated Current Sense
• Charge Status Output
• Reverse Discharge Protection • Tri-State Output - MCP73831
• Open-Drain Output - MCP73832
• High Accuracy Preset Voltage
Regulation: + 0.75% • Automatic Power-Down
• Four Voltage Regulation Options: • Thermal Regulation
• 4.20V, 4.35V, 4.40V, 4.50V
• Temperature Range: -40°C to +85°C
• Programmable Charge Current:
• 15 mA to 500 mA
• Packaging:
• 8-Lead, 2 mm x 3 mm DFN
• Selectable Preconditioning:
• 5-Lead, SOT-23
• 10%, 20%, 40%, or Disable
MCP73381 - Miniature Single-Cell, Fully Integrated Li-Ion,
Li-Polymer Charge Management Controllers
• CURRENT REGULATION SET
(PROG):
MCP73381 - Miniature Single-Cell, Fully Integrated Li-Ion,
Li-Polymer Charge Management Controllers
• APPLICATIONS
• External capacitors
• V_BAT to V_SS: > 4.7 µF
• Output: 4.7 µF ceramic, tantalum,
or aluminum capacitor
MCP73381 - Miniature Single-Cell, Fully Integrated Li-Ion,
Li-Polymer Charge Management Controllers
• PCB Layout
• Battery pack placed closed to
V_BAT and V_SS
• Heat sink
MCP73381 - Miniature Single-Cell, Fully Integrated Li-Ion,
Li-Polymer Charge Management Controllers
• Foot Print
MCP73381 - Miniature Single-Cell, Fully Integrated Li-Ion,
Li-Polymer Charge Management Controllers
• Foot Print
Battery, Recharge, and Fuel Gauge
• Battery Charger – MAX17048

Ref: MAX17048 Datasheet


https://datasheets.maximintegrated.com/en/ds/MAX17048-MAX17049.pdf
MAX17048: 3μA 1-CellFuel Gauge with ModelGauge
• Features and Benefits • Features and Benefits
• MAX17048: 1 Cell, MAX17049: 2 Cells • Reports Charge and Discharge Rate
• Precision ±7.5mV/Cell Voltage • Battery-Insertion Debounce
Measurement
• Best of 16 Samples to Estimate Initial SOC
• ModelGauge Algorithm
• Provides Accurate State-of-Charge
• Programmable Reset for Battery Swap
• Compensates for Temperature/Load Variation • 2.28V to 3.48V Range
• Does Not Accumulate Errors, Unlike Coulomb • Configurable Alert Indicator
Counters • Low SOC
• Eliminates Learning
• 1% Change in SOC
• Eliminates Current-Sense Resistor
• Battery Undervoltage/Overvoltage
• Ultra-Low Quiescent Current
• VRESET Alert
• 3μA Hibernate, 23μA Active
• Fuel Gauges in Hibernate Mode • I2C Interface
• Automatically Enters and Exits Hibernate Mode • 8-Bit OTP ID Register
MAX17048: 3μA 1-CellFuel Gauge with ModelGauge
• Simple Fuel-Gauge Circuit • Electrical Characteristics
Diagram
MAX17048: 3μA 1-CellFuel Gauge with ModelGauge
• ModelGauge Theory of • Battery Voltage and State-Of-Charge
Operation • One SOC can have many values of VCELL,
so VCELL cannot uniquely determine SOC.
• Error accumulates over time in
such systems (typically 0.5%–2%
per day)
MAX17048: 3μA 1-CellFuel Gauge with ModelGauge
• Access Register

• Quick-Start generates a first


estimate of OCV and SOC
based on the immediate cell
voltage. Use with caution
• EnSleep enables sleep mode.
• HibStat indicates when the IC
is in hibernate mode
MAX17048: 3μA 1-CellFuel Gauge with ModelGauge
• I2C Bus
• Slave Address: 7-bit 0x6C
• Bit Transfer: on SCL clock cycle
• Bus Idle: SCL and SDA on HIGH
• START and STOP Conditions
• Acknowledge Bits
• Data Order: MSb first
• Read/Write Bit
• Basic Transaction Formats
Access SOC, V_CELL and Settings using MAX17048 Library
• MAX17048 Class
• Provide major functions of the
chip, but not all functions
• ATHD: (empty alert threshold) sets
the SOC threshold, where an
interrupt is generated on the ALRT
pin and can be programmed from
1% up to 32%. The value is (32 -
ATHD)% (e.g., 00000b → 32%,
00001b → 31%, 00010b → 30%,
11111b → 1%). The POR (Power-
On-Rest) value of ATHD is 0x1C, or
4%. The alert only occurs on a
falling edge past this threshold.
Access SOC, V_CELL and Settings using MAX17048 Library
• MAX17048 Class
• Example
• Using a byte to save each of
SOC and V_CELL
SSD1306-based On-Board Text/Graphic Display
• Monochrome 0.96” 128x64 OLED graphic display.

Ref: https://learn.adafruit.com/monochrome-oled-breakouts

Ref: SSD1306 Datasheet


https://cdn-shop.adafruit.com/datasheets/SSD1306.pdf
Ref: https://learn.adafruit.com/monochrome-oled-breakouts

SSD1306-based On-Board Text/Graphic Display


• A simple tutorial on YouTube:

https://www.youtube.com/watch?v=mggDYVzS-Xs
SSD1306: a single-chip CMOS OLED/PLED driver with controller
for organic / polymer light emitting diode dot-matrix graphic
display system
• Features: • Features:
• Resolution: 128 x 64 dot matrix panel • Pin selectable MCU Interfaces:
• 8-bit 6800/8080-series parallel interface
• Power supply
• 3 /4 wire Serial Peripheral Interface
• VDD = 1.65V to 3.3V for IC logic
• I2C Interface
• VCC = 7V to 15V for Panel driving
• Screen saving continuous scrolling function
• For matrix display in both horizontal and vertical direction
• OLED driving output voltage, 15V • RAM write synchronization signal
maximum
• Programmable Frame Rate and
• Segment maximum source current: 100uA Multiplexing Ratio
• Common maximum sink current: 15mA
• Row Re-mapping and Column Re-mapping
• 256 step contrast brightness current
control
• On-Chip Oscillator
• Chip layout for COG & COF
• Embedded 128 x 64 bit SRAM display
buffer • Wide range of operating temperature: -
40°C to 85°C
SSD1306: a single-chip CMOS OLED/PLED driver with controller
for organic / polymer light emitting diode dot-matrix graphic
display system
• Diagram:
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• To install a third-party library, create a directory called libraries within
your sketchbook directory. Sketchbook: Energia environment uses the
concept of a sketchbook: a standard place to store your programs (or
sketches). The sketches in your sketchbook can be opened from the
File > Sketchbook menu or from the Open button on the toolbar. The
first time you run Energia, it will automatically create a directory for
your sketchbook. You can view or change the location of the
sketchbook location from with the Preferences dialog. More
information can be found:
http://energia.nu/Guide_Environment.html
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Suggestions:
• From Energia IDE, open File 🡪 Preferences
• Copy Sketchbook location
• Open File Explorer and go to Sketchbook location
• Find the “libraries”; create one if not exist
• Upzip “Adafruit-GFX-Library-master” into the “libraries” folder
• Make sure in the “libraries” folder, there is a folder named as “Adafruit-GFX-Library-master”
• Close Energia IDE and then, reopen it.
• Load and Run “ssd1306_CyberSensEDU.ino” (however, you can place the folder of
“ssd1306_CyberSensEDU” at any place)
• If the compiling process has an error, please check the follows:
• Check whether the CC3200 driver has been installed or not
• Check a serial port to connect the CC3200 device has been established
• Select: Tools 🡪 Board 🡪 LaunchPad w/ 3200 (80MHz)
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Libraries include:

• Major Functions:
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Initialize SSD_1306:

• Draw a single pixel


https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Draw lines:
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Draw Rectangular:

• Fill Rectangles:
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Draw Multiple Circles:

• Fill a white circle, 10 pixel radius :


https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Draw Round Rectangular:

• Fill Round Rectangular:


https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Draw Triangle:

• Fill Triangle :
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Draw the first ~12 characters in the font:

• Draw scrolling text:


https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Text Display:
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Miniature Bitmap Display:

• Bitmaps & Code:


https://learn.adafruit.com/steampunk-cameo-necklace/bitmaps-and-code
• Use Photoshop or another imaging program to create two cameo profile pics and turn
them into bitmaps (.bmp). They should be monologue and 128x64 pixels. Notice I had my
images each facing another direction.
• Download LCD Image Converter and run.
• Choose New Image and create a name. Then hit enter.
• Now choose Image and Import. Select the file.
• Now choose Options and Conversion, then Prepare. The following should be checked:
Type: Monochrome, Threshold Dither, Main Scan Direction: Left to Right, Line Scan
Direction: Forward
• Now select Image. Make sure Select to Rows is checked. 8-Bit and Little Endian.
• Hit OK, then File, Convert. Name the file. Now do the same process for your other file.
The completed files will contain a series of code that you need to cut and paste into the
project code to replace the files I provided. It will look something like this, only longer.
Note that you don't need the beginning name, just the brackets and what is contained
within them
https://learn.adafruit.com/monochrome-oled-breakouts/arduino-library-and-examples

Using Adafruit GFX library: a third party library


• Bitmap Icon and “Animation”:
Onboard Display: Battery Fuel Gauge and WiFi
Strength
• Class Assignment 6: ClassAssign_TimeBatteryGauge
• Display WiFi Radio strength, current time, and Battery Fuel
gauge on the SSD1306 LED screen
• Access the internet time when device is power on or reset
(write access code in setup())
• Create timer and determine an appropriate interval to
reflash the display; don’t miss any number of second
change
• Three Wifi strength bars showing better than -55dB, -75dB,
and -85dB
• Five Fuel gauge bars showing battery charging capacity
better than 90%, 70%, 50%, 30% and 10%
Onboard Display: Battery Fuel Gauge and WiFi
Strength
• Class Assignment 6: ClassAssign_TimeBatteryGauge
• Network Time Protocol (NTP) : The Network Time Protocol
(NTP) is a networking protocol for clock synchronization
between computer systems over packet-switched, variable-
latency data networks.
https://en.wikipedia.org/wiki/Network_Time_Protocol
• Send an NTP request to the time server at the given
address; Implementations send and receive timestamps
 using the User Datagram Protocol (UDP) on port number
 123.
• NIST Internet Time Servers: https://tf.nist.gov/tf-cgi/servers.cgi
Onboard Display: Battery Fuel Gauge and WiFi
Strength
• Class Assignment 6: ClassAssign_TimeBatteryGauge
Onboard Display: Battery Fuel Gauge and WiFi
Strength
• Class Assignment 6: ClassAssign_TimeBatteryGauge
Onboard Display: Battery Fuel Gauge and WiFi
Strength
• Class Assignment 6: ClassAssign_TimeBatteryGauge
• Wifi radio strength

You might also like