The Project board is for sharing projects based on Silicon Labs' component with other community members. View Projects Guidelines ›

Projects

    Publish
     
      • Electronic Label Wireless Transmission System

        yucheng | 01/30/2018 | 06:42 AM

        1. Project Summary:

        QR Codes are everywhere now, it appears on business cards, commodity packaging, electronic label, mobile payments, and so on.

        The goal of this project is developing an electronic label wireless transmission system by using the QR code. It use Python and Pyside to generate GUI frame, which responsible for encoding text strings into QR code, and sending the QR code image to cloud server, such as Amazon. A Python script application running on the cloud server, monitoring net port, once it receive QR code image, it will distribute the QR code image to EFM32GG11+WGM110. Running Micrium OS in EFM32GG11, control WGM110 via EXP interface, it will display the QR code image once receive it, also the decoded QR code text string will be displayed.

         

        2. Project Description:

        The figure below shows the target overview of the project.

        The GUI tool on the PC generates QR code image and sends the image to cloud server, the remote server receives and distribute QR code image, EFM32GG11 running Micrium OS can decode the QR code and show the content on the LCD. Also the EFM32GG11 can encode information string to QR code, and transfer the QR code image to cloud server, GUI will fetch the image from cloud server and decode the QR code.

        2.1 QR Code Introduction:

        QR code (Quick Response Code) is the trademark for a type of matrix barcode (or two-dimensional barcode) first designed for the automotive industry in Japan. It uses four standardized encoding modes (numeric, alphanumeric, byte/binary, and kanji) to efficiently store data; extensions may also be used.
        The symbol versions of QR Code range from Version 1 to Version 40. Each version has a different module configuration or number of modules. (The module refers to the black and white dots that make up QR Code.)
        "Module configuration" refers to the number of modules contained in a symbol, commencing with Version 1 (21 × 21 modules) up to Version 40 (177 × 177 modules). Each higher version number comprises 4 additional modules per side. 

        The resolution of the build-in LCD-TFT in the EFM32GG11 STK board is 128*128, and considering the pixel size is very small in the LCD, so will use each 4 pixels as 1 bit QR code to enhance the identification probability, and adopt Version 3 as the QR Code version for the project. The amount of data that can be stored in the QR code symbol be figured out below. For example, the version 3 (29*29) QR code can store total 77 alphanumeric character with L level ECC.

         

        2.2 QR Code Generator/Decoder GUI

        The GUI tool below which be developed with Python and Pyside, PyQRCode module be used for QR code encoder, and qrtools module be used for decoder.

        The tool can finish the encoding to convert URL/text into a QR Code image, and connect to remote cloud server for sending QR code image, also it has the ability to decode the QR code image fetched from the remote server.

        Below is the screenshot of the GUI tool. After inputting the text in the edit box and encoding it to QR code image, press "Upload" button will send the encoded QR code image to remote server.

        Also after receiving the QR code image from remote server, push "Decode" button will decode the image and show the decoded string.

         

        2.3 QR Code decode in MCU

        We use the EFM32GG11 STK and WGM110 Wi-Fi Expansion Kit for receiving QR code image, decoding QR code image, displaying QR code image and decoded text string.

        Some of the 3rd libraries are available on git for QR code image decoding, such as quirc (licensed under ISC) and qsantos (licensed under the GPL V3.0). What the library be used in the project is qsantos.

        Please refer to the figure below for the detailed flow chart of the QR code receiving and decoding on MCU.

         

        3. Demonstration

        The figures below demonstrate the project. The on board LED will blink during the QR code image receiving, after receiving done, it will display the QR code image immediately, and push Button 0/1 can switch the display mode.

        4. What we done in the project.

        The block diagram be illustrated in the section of "Project Description" is the finial target of the project, however, for the first step, we implemented the project followed the diagram below.
        The GUI tool is able to generate a QR code from a string, decode a QR code PNG file and show the content on PC. The EFM32GG11 STK and WIFI module act as an access port which can be connected by PC GUI tool. After creating the connection between PC GUI tool and EFM32GG11/WIFI module, GUI tool can send the encoded QR code image to the EFM32GG11, after receiving the QR code image, EFM32GG11 will decode the QR code and show the text string on the LCD screen.

         

        5. Lessons learned

        • QR code encoding/decoding in Python.
        • GUI Design with Python and Pyside.
        • Python Network communication.
        • Wi-Fi module transmission.
        • Micrium OS + Network.

         

        6. Next Steps

        The next steps for this project is involving the remote server into the project for QR code image distribution, and the electronic label wireless transmission system will become more flexibility.

         

        7. Source code

        The source code of the GUI tool and firmware be attached for reference.

      • How to create your own BLE Mobile App in 10 minutes

        Juan Benavides | 01/29/2018 | 10:43 PM

        Hackathon Project by Juan Benavides

         

         

        Introduction

        Have you ever wanted to get into mobile apps development but didn't have the time to learn other programming languages?

        In this blog I will show you how to create your own mobile app that connects to your Bluetooth Low Energy device.

        As part of a Hackathon project, I was interested in creating my own mobile app to connect to a Zigbee-based Light that doubles as a BLE Device. In other words, it is a Light that supports two protocols; Zigbee and BLE over the same radio.

        I wanted to support Android and iOS and I only had a background in Embedded Systems and a couple of days to get it done. So, after a quick Google search I was lucky to find a solution that only takes 10 minutes to develop (that's including the time spent installing the tools).

        The solution is called Evothings Studio and it offers a way to develop your mobile app using familiar web technologies such as HTML, CSS and JavaScript.

        One of the most amazing things is that the mobile app runs live on mobile devices while you develop and you can instantly see code changes on your apps.

        The process of developing the mobile app can be summarized as follows:

        1. Get a Bluetooth Device running.
        2. Install Evothings Tools in your PC and your phone.
        3. Select an example from the Evothings list of examples.
        4. Modify the example by using the UUIDs from your BLE Device. 
        5. Connect your phone to your BLE Device to control it.

         

         

        Step-by-step guide to reproduce the project

         

        Getting a Bluetooth Device running

        If you already have a BLE Device running, then the only thing you need to do in this step is make note of the following Unique Identifiers (UUID):

        • BLE Unique Service Indentifier: this is the UUID of the BLE Device Service you want to control (e.g. bae55b96-7d19-458d-970c-50613d801bc9).
        • BLE Characteristic Unique Identifier: this is the UUID of the BLE Device Characteristic you want to control (e.g. 76e137ac-b15f-49d7-9c4c-e278e6492ad9).

        If you don't have your BLE Device ready to go, then you can use the same one that I used from the Dynamic Multiprotocol (DMP) Light/Switch Demo. Click here and follow steps 1-5 to get it running.

        Once you get it running, open the Light Project in Simplicity Studio, open the file DynamicMultiprotocolDemoLightSoc.isc, select the Bluetooth GATT tab and make note of the BLE Unique Service Identifier and the BLE Characteristic Unique Identifier as illustrated in the image below:

        Figure 1
        Finding your BLE Device's UUIDs in Simplicity Studio

         

         

        Installing the Evothings Tools

        In this step you need to install both, the Evothings Studio application in your PC and the Evothings Mobile App in your phone. Click here to install the Evothings tools and verify that everything is operational by running their Hello World example.

         

         

        Select a Mobile App BLE example as a starting point

        Once you verified that you can run their Hello World example, locate the example Arduino101 LED On/Off BLE and click the button Copy as shown in Figure 2:

        Figure 2
        Selecting one of the BLE Examples as a starting point

         

         

        A window will be displayed for you to edit the project's name. You can call it dmp-light as shown in the following image:

        Figure 3
        Customizing the example with your own project name

         

         

        Modifying the Mobile App BLE example with your own UUIDs

        The next step is to edit the code. Select the tab MyApps in Evothings Studio to display your newly created example and click the button Edit and your text editor will open the folder where your example is located.

        First edit the file evothings.json and replace the property uuid with your own BLE Device Service UUID as shown in Figure 4:

        Figure 4
        Customizing the example with your own BLE device's service UUID

         

         

        Similarly, open the file index.html and replace the uuids in the functions to turn the LED On and Off, with your own BLE Device Characteristic UUID as shown in the image below:

        Figure 5
        Customizing the example with your own BLE device's characteristic UUID

         

         

        Finally, find out what's the advertised name of your BLE Device by scanning all the BLE devices within range from your phone as shown in Figure 6:

        Figure 6
        Scanning BLE devices within range from your phone

         

         

        Open the file index.html, locate the function app.connect and replace the advertised name of the BLE device with your own name as illustrated in Figure 7:

        Figure 7
        Customizing the example with your own BLE device name

         

         

        Connecting your new mobile app to your BLE device

        To connect to your BLE device you need to follow the same steps you made when trying their Hello World example; Start Evothings Workbench and under the Connect tab paste your Cloud Token and get a connect key using the GET KEY button. Launch Evothings Viewer on your phone, enter the connect key to hook up with your Workbench. On your computer, click the RUN button on your new DMP Light example in the Workbench.

        Now you can turn the Light On/Off from your phone as shown in the image below:

        Figure 8
        Your new mobile app

         

         

         

        Conclusion

        The Evothings Studio platform is a fast and easy way to develop mobile applications for Android and iOS while supporting one single code base through the use of the three most basic web technologies (HTML, JavaScript and CSS).

        For more information on how to deploy your mobile app to an app store check the following page: https://evothings.com/doc/build/build-overview.html

        For more information on how to get started developing your own Bluetooth Low Energy devices visit our website at: https://www.silabs.com/products/wireless/bluetooth

         

      • How to control a Zigbee-based Light with an Occupancy Sensor, Alexa and your Phone

        Juan Benavides | 01/22/2018 | 08:05 PM

        Hackathon project by Manasa Rao, Stephen To and Juan Benavides

         

         

        Introduction

        Would you like to learn an easy way to control a Zigbee-based Light with Alexa voice commands?

        Or how about controlling a Zigbee-based Light automatically with an Occupancy Sensor?

        Furthermore, how would you like to learn how to easily create your own Bluetooth mobile application to control a Zigbee-based Light and access the Internet?

        In this Hackathon project we demonstrate how to easily accomplish all of these cool features.

        Figure 1
        Project Presentation

         

         

        Background

        Silicon Labs released on November 2017 the new Dynamic Multiprotocol Software (DMP) for our Wireless Geckos. In summary, the DMP software enables the simultaneous operation of Zigbee and Bluetooh Low Energy (BLE) on a single radio chip.

        The best example to showcase this technology is by controlling and monitoring a Zigbee-based Light directly over Bluetooth with a smartphone mobile application. This example is actually available with the DMP SDK and our Hackathon project is based on it. 

         

         

         

        Project Overview

        The following image illustrates the scope of this blog:

        Project Overview
        Figure 2
        Project Block Diagram

         

        The Demo featured in this blog is based on the official DMP Light/Switch Demo that consists of two devices:

        Light: it runs Micrium OS to switch between Zigbee and Bluetooth on a single radio. 

        Switch: it supports Zigbee to provide wireless control of the Light.

        Click here to get started with this demo.

        In the original demo, users press a push button on the wireless Switch device, which in turn, sends a Zigbee Light Link (ZLL) command to toggle the Light On or Off.

        The Light device runs Micrium OS to switch between Zigbee and Bluetooth while sharing the same radio. This allows a mobile application to connect to the Light via Bluetooth.

        Users tap the mobile application to toggle the Light On/Off. 
        The Light device receives the Bluetooth notification and not only toggles the Light On/Off  but also updates the corresponding ZLL Cluster Attribute so the Switch remains in sync.

        This blog shows you how to add an Occupancy Sensor to the Switch device by connecting the Silicon Labs Optical Sensor Expansion Board (Si1133/Si1153) to the Switch's EXP Header (I2C).

        The Optical Sensor Expansion Board has a series of optical sensors to detect the presence of a person in the room. The occupancy sensor is used by the embedded application to control the light automatically. 

        Click here to see Stephen's blog on how to add this occupancy sensor to the DMP Light/Switch Demo.

        This blog is also going to show you how to control the Light with Alexa Voice Commands.

        To enable Alexa Voice Commands, we are also going to show you an easy way to create your own Bluetooth Mobile Application. This mobile application will use the smartphone as a gateway to access the Internet.

        Click here to see Juan's blog on how to create your own BLE mobile app to control the DMP Light/Switch Demo.

        Users will get to control the Light with Voice Commands and this blog will describe how to setup the system in Amazon Web Services (AWS).

        Click here to see Manasa's blog on how to add Alexa capabilities to the DMP Light/Switch Demo.

         

         

         

        Useful Links