All posts by mtrobregado2014

Secure Internet Of Things Humidifier

Secure IOT Humidifier System
Device Connection to WiFi Network

This project features the Texas Instruments SimpleLink™ Wi-Fi® CC3220SF LaunchPad™ with Integrated Security Features as shown below.

Overall Project Features:

  1. Easy connection to CC3220SF Launchpad using SimpleLink™ Wi-Fi® Starter application.
  2. Direct connection to CC3220SF Launchpad set as Access Point.
  3. Easy access to CC3220SF Launchpad using its internal web server.
  4. Demonstrates reading Sensors Booster Pack BME280 humidity and temperature.
  5. Demonstrates setting of desired humidity. If desired humidity is greater than actual humidity, the humidifier will turn on.
  6. Neopixel Ring RGB Led Lights Show upon internet connection.

Hardware Block Diagram:

Secure IOT Humidifier HW Block Diagram
Enter a caption

CC3220SF Launchpad connection to Sensors Booster Pack:

The I2C pins of Sensors Booster Pack is in conflict with the TDO and TDI of CC3220SF Launchpad. Set CC3220SF Launchpad SOP Jumper to 001, to change from 4-wire JTAG Connection to 2-wire JTAG Connection. Remove the CC3200SF Launchpad I2C jumper connection to on-board sensors.

IMG_1130mod1

Overall Pin Compatibility:

pin compatibility

Project Photos:

IMG_1140
NeoPixel Ring 16 RGB Leds
IMG_1132
SeedStudio Grove Water Atomization
IMG_1138
Ultrasonic Transducer Disc
IMG_1135
MSP430FR5969 Launchpad and CC3220SF Launchpad

Program: TI CC3220SF IOT Humidifier

Note: See, program link README.md for instructions.

Program Details:

The program firmware and internal web pages are modified version of the CC3220SF Launchpad Out of Box Demo.

Provisioning Process:

  1. When there is no network profile previously saved at TI CC3220SF Launchpad it will start the provisioning process. If the TI CC3220SF Launchpad is connected to your PC you can see the output at Tera Term that provisioning has been started.teraterm1
  2. Open SimpleLink™ Wi-Fi® Starter application and set your WiFi Network Details.IMG_1128
  3. After successful provisioning your device IP address will be shown.

teraterm2

 

Internal Web Pages:

index
index.html
demo
demo.html
status
settings.html Status Tab
profiles
settings.html Profiles Tab
device
settings.html Device Tab
network
settings.html Network Tab

Project Demo:

 

 

Advertisements

TI CC2640R2F BLE Keyboard

TI CC2640R2F BLE Keyboard
Bluetooth Low Energy Connection to Smart Phone

This project features the Texas Instruments SimpleLink Bluetooth Low Energy CC2640R2F Launchpad interfaced to a USB Keyboard to function as a BLE Keyboard. 

The reference for this project is based from the Bluetooth SMART Keyboard Reference Design which uses a BLE CC2650 board interfaced to Mini Keyboard.

BLE CC2640R2F was used instead since it is able to support BLE 5 Long Range and High Data Rate feature. For a BLE Keyboard application the BLE 5 Long Range feature is desirable. Imagine able to type at your Laptop through BLE Connection at a distance of 400 meters. However, at the moment there is no Personal Computer or Smart Phone that supports BLE 5 Long Range Feature. If that time comes when there are Personal Computers and Smart Phones that are able to support BLE 5 Long Range Feature, then the BLE CC2640R2F Long Range Feature can be enabled through software so this project can become a “TI CC2640R2F Long Range BLE Keyboard”.

Interfacing the USB Keyboard to TI CC2640R2F Launchpad:

I used a Logitech K120 USB Keyboard to interface with TI CC2640R2F Launchpad. I dismantle the Logitech K120 USB Keyboard and remove the USB cable connected to the Keyboard motherboard.

The next step is trace the top and bottom keyboard matrix. The top keyboard matrix has 8 pads connected to the board and. The bottom keyboard matrix has 18 pads connected to the board. For this project at the moment I only aim to output Keyboard Letters and Numbers, which you can see at the Keyboard Matrix Table below are highlighted in green.

Keyboard Matrix
Keyboard Matrix

Then ribbon cable is soldered to the pads of the motherboard. Only half of the pad is in contact with the keyboard matrix. To solder the ribbon cable to the pad, the black conductive material on the pad needs to be scraped off first.

IMG_1058
Keyboard Motherboard Top Side
IMG_1057
Keyboard Motherboard Bottom Side
IMG_1061
Keyboard Motherboard with ribbon cable soldered to the pads
IMG_1062
Assembling the Keyboard with the Ribbon Cable

Overall Pin Compatibility:

TI CC2640R2F LP Pin Compatibility

Keyboard Interfaced to CC2640R2F Launchpad:

IMG_1104
Enter a caption

The TI CC2640R2F Launchpad is powered using Power Bank.

Program: TI CC2640R2F BLE Keyboard

Note: See, program link README.md for instructions.

Program Details:

Using the Key Matrix Data I was able to generate Key Scanning codes from the Bluetooth SMART Keyboard Reference DesignThe Key Scanning Codes are for BLE CC2650. I then port the code to work for HID Emu Kbd Example Program from CC2640R2F SDK Version 1.30.

I used a Iphone 4s for testing because there was some issue pairing with my Windows 10 Laptop. Using LE LightBlue App, I was able to see the BLE Services.

The key pressed from the BLE Keyboard can be seen at the Iphone 4s Notes App.

TI CC2640R2F Play Buzzer Tunes

CC2640R2 SensorTag2
Bluetooth Low Energy Connection to Smart Phone

This project shows how to play buzzer tunes through Bluetooth Low Energy Connection. I used my earlier blog project “TI CC2640R2F SensorTag“, and added playing buzzer tunes functionality. 

Project Hardware Requirements:

  1. TI CC2640R2F Launchpad.
  2. TI Educational BoosterPack MKII.
  3. TI BLE USB Dongle or TI CC2650 Launchpad with Host Test Program.

Program: TI CC2640R2F SensorTag

I added code files sensortag_playtunes.c, sensortag_playtune.h and pitches.h to TI CC2640R2F SensorTag CCS Project.

TI CC2640R2F SensorTag Play Buzzer Tunes:

Buzzer Tunes Credits to:

  • Dung Dang for the Happy Birthday Buzzer Tunes.
  • Dipto Pratyaksa for the Mario Brothers Main Theme and Underworld Tunes.

TI CC2640R2F SensorTag

TI CC2640R2F SensorTag
Bluetooth Low Energy Connection to Smart Phone

This project features the Texas Instruments SimpleLink Bluetooth Low Energy CC2640R2F Launchpad with SensorTag and Key Fob codes ported from BLE Stack 2.2.1.. 

Bluetooth Low Energy Services:

  1. Device Information Service.
  2. Link Loss Service.
  3. Immediate Alert Service.
  4. Tx Power Service.
  5. Accelerometer Service.
  6. Battery Service.
  7. Simple Keys Service.
  8. TI Sensortag 2.0 I/O Service.
  9. TI Sensortag 2.0 Register Service.

Note: Texas Instruments Sensors BoosterPack Plug-In Module will be later on added to this project to have full SensorTag Functionality.

Project Hardware Requirements:

  1. TI CC2640R2F Launchpad.
  2. TI Educational BoosterPack MKII.
  3. TI BLE USB Dongle or TI CC2650 Launchpad with Host Test Program.

Project Software Requirements.

  1. Simplelink CC2640R2 SDK: BLE-STACK V3.0.1 (Support for CC2640R2F)
  2. BLE-STACK V2.2.1 (Support for CC2640/CC2650/CC1350)
  3. TI Code Composer Studio 7.0.
  4. TI SmartRF Flash Programmer 2.
  5. TI BLE Device Monitor.
  6. SensorTag App.

Hardware Setup:

IMG_0809
TI Educational BoosterPack MKII connected to TI CC2640R2F Launchpad

Overall Pin Compatibility:

Overall Pin Compatibility 2

TI CC2640R2F Blogs:

5 need to know facts about the new SimpleLink™ Bluetooth low energy CC2640R2F wireless MCU

How does Bluetooth® 5 increase the achievable range of a Bluetooth low energy connection?

Program: TI CC2640R2F SensorTag

Note: Using SmartRF Flash Programmer 2, you can program the app and stack hex files to your device setup. See, program link README.md for instructions.

Program Details:

The TI CC2640R2F SensorTag Program, are made up of SensorTag and Key Fob codes from BLE Stack 2.2.1 ported to CC2640R2F SDK simple peripheral.

See, CC2640R2 SDK Porting Guide, to learn how to port codes from BLE Stack 2.2.1 to CC2640R2 SDK simple peripheral example programs.

TI SensorTag App:

Note: As of this Blog Post Publishing , the SensorTag App crashes when going to Sensor View. However, the SensorTag App does not crash going to Services.

TI CC2640R2F SensorTag IO:

To activate TI CC2640R2F Launchpad IO, first set Config to “01”, to enable control by remote client. Then set Data to these below settings.

“00” – All IO’s set to OFF
“01” – Blue LED ON
“02” – Green LED ON
“03” – Both Blue and Green LED ON
“04” – Buzzer ON

TI CC2640R2F SensorTag SimpleKeys:

TI CC2640R2F Launchpad Button 1 and Button 2, presses are passed on the SimpleKeys BLE Service.

TI CC2640R2F SensorTag Immediate Alert:

Immediate Alert is triggered by setting Link Loss Alert Level to either “01” or “02”. Then set Immediate Alert to “01” for Low Alert or “02” for High Alert.

TI CC2640R2F SensorTag Link Loss Alert:

Set the Link Loss Alert Level to either “01” or “02”. Then remove link to Bluetooth Device. In this case, I removed the TI BLE USB Dongle. When connection timeout is reached, Link Loss Alert is triggered.

Tiva Connected Launchpad and Fuel Tank MKII Battery Booster Pack BMS

14218423_1131403620254446_417162451_n

Introduction:

I was planning to buy the original Fuel Tank Booster Pack, but for whatever reason it became not available to purchase. Several months pass by and still it is still not available to purchase. I felt dissapointed, with the thought of not being able buy the original Fuel Tank Booster Pack and be able to use it for future TI Launchpad based projects, since the the original Fuel Tank Booster Pack have been been featured at Project blogs and youtube videos. However good news came from a TI Engineer last July 2016 who announced that TI would release 2 new Booster Packs, and one of the Booster Pack is the new Fuel Tank MKII Battery Booster Pack.

The Fuel Tank MKII Battery Booster Pack is pin compatible with the Tiva Connected Launchpad Booster Pack 1 and Booster Pack 2 connector. For this simple project, I will connect the Fuel Tank MKII Battery Booster Pack to Booster Pack 2 connector of my Tiva Connected Launchpad. Tiva Connected Launchpad I2C2 will be used to communicate with the Fuel Tank MKII Battery Booster Pack.

One noticeable difference of Fuel Tank MKII Battery Booster Pack from the original Booster Pack is the addition of a mechanical Switch S1, that enables you to fully disconnect the battery from the onboard circuitry.

Key Features:

  • 3.7 Volts 1200-mAh lithium polymer battery.
  • Onboard bq27441 fuel (gas) gauge.
  • Onboard bq24250 lithium polymer charger.
  • USB charging with indicator LED.
  • Works with TI Launchpad development kits.

Hardware Block Diagram:

Tiva Connected Launchpad and Fuel Tank MKII Battery Booster PackHardware Setup:

TivaCLPFuelTankpic1
Fuel Tank MKII Battery Booster Pack connected to Tiva Connected Launchpad Booster Pack 2 connector
TivaCLPFuelTankpic2
Under Side picture of the setup showing the Lithium Ion battery connected to Fuel Tank MKII Battery Booster Pack

Overall Pin Compatibility:pin compatibility3

Tiva Connected Launchpad being powered by Fuel Tank MKII Battery Booster Pack:

Example Program run from Code Composer Studio:

Program: TivaC_boostxl_battpackmkii

Tera Term Output:s2

s3

s4

I plan to make this an IoT device by connecting a CC3100 SimpleLink WiFi Booster Pack to Booster Pack 1 connector of my Tiva Connected Launchpad.

Connect Tiva Connected Launchpad to Exosite Cloud using TI Simplelink WiFi CC3100

Connect Tiva Connected Launchpad to Exosite Cloud using TI Simplelink WiFi CC3100

Device Connection to Exosite Cloud

This project connects Tiva Connected Launchpad to Exosite Cloud using TI SimpleLink WiFi CC3100.

Features:

  1. Sends temperature data from Sensor Hub Booster Pack TMP006 Sensor to Exosite Cloud. The temperature data is displayed at a Exosite Dashboard Widget.
  2. Tiva Connected Launchpad on board led’s D2 and D3, are toggled on and off from Exosite Dashboard.
  3. Sends Tiva Connected Launchpad switch press count to Exosite cloud. The switch press count is displayed at a Exosite Dashboard Widget. Switch press count is limited to 15 only, for demoing purposes. The switch press count is reset to 0 after reaching the set limit of 15.
  4. Sends an email alert if Tiva Connected Launchpad on-board switch 1 press count have reached the set trigger level. This is set at Exosite Dashboard.

Hardware Block Diagram:

Hardware Block Diagram1

Hardware Setup:

IMG_0250
Sensor Hub BP connected to BP1 connector. CC3100 BP connected to BP2 connetor

Overall Pin Compatibility:

tivabp1sensorhub

tivabp2cc3100bp

bpchecker7
Using TI online Booster Pack Checker Tool

Exosite Cloud Overview:

onep_hierarchy_overview1
Photo Resource: http://docs.exosite.com/oneplatform

Exosite is a internet of things software as a service(Saas) company that provides a platform for Internet of Things.

Using the Exosite Platform, data from your device can be virtualized and represented graphically using Exosite Dashboard Widgets. Some Exosite Dashboard Widgets are Big Number Widget, Line Graph Widget, On/Off Switch Widget,  which all can be seen at the Exosite Dasboard screenshot below for this project.

Temperature data from my device is sent to Exosite Cloud and is being represented graphically at Exosite Dashboard, using Big Number Widget and Line Graph Widget.

exosite dashboard1

Note: More information about Exosite Services can be found at their website.

Exosite Dashboard

To display your data at a Exosite Dashboard Widget stored at a Dataport or Data Source named Sensor Hub BP Temp. Set it as Data Source for that Exosite Dashboard Widget. See, as shown above.

Exosite Terms:

  • CIK (Client Interface Key)
    • Device private key.
    • Generated when you make a new device at Exosite Portal Account.
  • Dataport
    • Data storage of time stamped values that can be written and read from.
  • Dataport Alias
    • Use to identify a Dataport.
  • Dataport Type
    • integer, float, string
    • For “string” type, the maximum size of a value that can be written is 64KB.

Tools to generate HTTP Requests to Exosite:

  1. curl command line tool.
  2. Exoline, a command line tool that works with Exosite Services.

Write to Exosite Dataport:

  • Using curl command line tool. Input below at Windows command prompt.
curl http://m2.exosite.com/onep:v1/stack/alias -H "X-Exosite-CIK: YOUR_CIK_HERE" -H "Accept: application/x-www-form-urlencoded; charset=utf-8" -d sensortemp=77"
  • Using Exoline. Input below at Windows command prompt.
exo write YOUR_CIK_HERE sensortemp --value=“77“
  • Using exosite write C API.

exosite_write(“sensortemp=77”, 13); 

Note: replace YOUR_CIK_HERE with your device CIK.

Read to Exosite Dataport:

  • Using curl command line tool. Input below at Windows command prompt.
curl http://m2.exosite.com/onep:v1/stack/alias?sensortemp -H "X-Exosite-CIK: YOUR_CIK_HERE" -H "Accept: application/x-www-form-urlencoded; charset=utf-8"
  • Using Exoline. Input below at Windows command prompt.
exo read YOUR_CIK_HERE sensortemp
  • Using exosite read C API.

char cbuffer[20];
uint16_t response_length = 0;
Read_status = exosite_read("sensortemp", cbuffer, 20, &response_length);

Note: replace YOUR_CIK_HERE with your device CIK.

Program Resources:

  1. TI Code Composer Studio 6.1.0.
  2. TI CC3100 SDK, SimpleLink API’s.
  3. Exosite C library for SimpleLink devices.
  4. Tivaware for Tiva Connected Launchpad.
  5. getting_started_with_wlan_station for Tiva Connected Launchpad + CC3100 BP.
  6. temperature_tmp006 example program for Tiva Connected Launchpad + Sensor Hub Booster Pack.

SPI communication between Tiva MCU and CC3100 BP:

  • SPI API’s are mapped to SimpleLink API’s.
    • spi_Open(), initializes the Tiva MCU SPI Peripheral and Interrupt to communicate with CC3100 BP.
    • spi_Open() is mapped to SimpleLink API sl_IfOpen().
    • sl_IfOpen(), is called within sl_Start().
    • sl_Start(), is called within your main function to start the SimpleLink device.

Basic steps to connect your device to Exosite:

  1. Initialize device.
  2. Connect device to WiFi Access Point using SimpleLink API’s.
  3. Create socket to Exosite using SimpleLink API’s.

exosite_write() and exosite_read() key facts:

  • Calls exosite_pal API which internally calls SimpleLink API sl_Socket(), that creates socket to Exosite.
  • Calls exosite_pal API which internally calls SimpleLink API sl_Send(), that sends data to an open TCP Socket.
  • Calls exosite_pal API which internally calls SimpleLink API sl_Close(), that closes socket to Exosite.

exosite_pal(Physical Application Layer) API’s:

  • Part of Exosite C Library for SimpleLink Devices.
  • Calls SimpleLink API’s.

Program Flowchart:

Presentation Flowchart1

 

Slide2

Program: wlan_station_exosite_write_read

Tera Term Output:

TeraTermExosite1

TeraTermExosite2

Tiva Connected Launchpad Led On/Off, from Exosite Dashboard:

 

Send switch press count to Exosite Dashboard:

Links to Resources:

  1. TI Code Composer Studio
  2. TI Tiva Connected Launchpad
  3. TI SimpleLink WiFi CC3100 BP
  4. TI Sensor Hub BP
  5. Exosite Documentation

Texas Instruments Booster Pack Checker Tool

bpchecker1

Texas Instruments recently release a online Booster Pack Checker Tool. The tool shows pin compatibility between Texas Instruments Launchpad and Booster Packs.

Without using the Booster Pack Checker Tool, to ensure that a TI Launchpad is pin compatible with Booster Pack, you would need to compare the pin outs using their board datasheets. Which would take some time and is for some a strenuous task to do. What I would do, before I connect a Booster Pack to my TI Launchpad, is that I would make pin out tables at Microsoft Excel . See, sample pin out tables below. The highlighted green table cells below indicates pin compatibility between Tiva Connected Launchpad Booster Pack 2 Interface Connector and CC3100 Booster Pack.

TivaBP2CC3100

Using the Booster Pack checker tool prevents unnecessary buying of Booster Packs that was thought to be initially compatible with their TI Launchpad. In some cases the TI Launchpad was damaged by interfacing to a Booster Pack that is not pin compatible.

The reason for Booster Packs to be not compatible with a specific TI Launchpad, is that many Booster Packs are designed for MSP430 Launchpad, since MSP430 Launchpad is one of the first TI Launchpad released in the market. These Booster Packs compatible with MSP430 Launchpad became not pin compatible with succeeding TI Launchpad, like TI Tiva Launchpad. However, you can interface a TI Launchpad to a not pin compatible Booster Pack by re-wiring the  pin connections using a protoboard.

Here below are some features of the TI Booster Pack Checker Tool.

  1. Shows incompatible Booster Packs. bpchecker2
  2. Shows pin compatibility status.bpchecker3
  3. For TI Launchpad with 2 Booster Pack Connectors,  there is a option to switch to either TI Launchpad Booster Pack Connector, for checking Booster Pack pin compatibility.bpchecker4
  4. You can check pin compatibility of stacking multiple Booster Packs to a TI Launchpad.bpchecker5

Some things to consider using the TI Booster Pack Checker Tool.

  1. Although, the TI Booster Pack Checker tool can indicate that several Booster Packs are stackable to a TI Launchpad, it does not show power requirements of each Booster Pack. Successful designs begin with adequate power. So, before interfacing multiple Booster Packs to a TI Launchpad, you need to make sure that they have adequate power.
  2. Although, the TI Booster Pack Checker tool can show pin compatibility of a TI Launchpad pin to a Booster Pack pin, you still need to check a TI Launchpad pin default function. MCU’s GPIO’s have multiple alternate function. Some MCU GPIO’s defaults as NMI or Non-Maskable Interrupt. For these MCU GPIO’s that defaults as NMI, you would need to re-configure that GPIO pin, to your desired alternate GPIO function using a code.

Using the TI Booster Pack Checker tool, I have confirmed that my Sensor Hub Booster Pack is pin compatible to Booster Pack 1 connector of my Tiva Connected Launchpad and my CC3100 Booster Pack is pin compatible to Booster Pack 2 connector of my Tiva Connected Launchpad.

bpchecker6

With my pin compatible, Tiva Connected Launchpad + Sensor Hub Booster Pack + CC3100 Booster Pack, I can send sensor data through WiFi, to a Cloud Service Provider like Exosite.

IMG_0250

See, project at the link below.

CONNECT TIVA CONNECTED LAUNCHPAD TO EXOSITE CLOUD USING TI SIMPLELINK WIFI CC3100