element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Arduino
  • Products
  • More
Arduino
Blog [Dynamic Living-Room Lights] The Infineon RGB LED Shield Review
  • Blog
  • Forum
  • Documents
  • Events
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Arduino requires membership for participation - click to join
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: ipv1
  • Date Created: 23 Dec 2014 2:32 PM Date Created
  • Views 680 views
  • Likes 4 likes
  • Comments 8 comments
  • internet_mood
  • iot_ip
  • iot_holidaylights
  • holiday_mood
Related
Recommended

[Dynamic Living-Room Lights] The Infineon RGB LED Shield Review

ipv1
ipv1
23 Dec 2014

  • List of related posts
  • Prelude
  • LED Driver?
  • What is the XMC1202?
  • The RGB LED Shield
    • Understanding the commands
  • Tests

List of related posts

 

  • [Dynamic Living-room Lights] Description
  • [Dynamic Living-room Lights] Simple System Design
  • [Dynamic Living-Room Lights] The YUN review - When the Penguin Met The Arduino.

 

Prelude

LED stands for Light Emitting Diode and it is a Semiconductor Device which when forward biased, produces light. The LED is predicted to replace all light bulbs etc since it consumes less power and offers a more compact product. The heat produced is also less at the same brightness compared to other sources. But unlike traditional bulbs, the LED cannot be simply plugged into a wall socket. It runs on a lower voltage and in order to elongate its life AND do some brightness control etc, we need a circuit which is called an LED drivers. This document is a review of the Infineon LED driver Shield which can be controlled by an arduino and is useful for a lot of projects.

 

 

LED Driver?

Just like a normal diode, we can plot the current and voltage characteristics of LED. I googled it and came up with the following.

 

image

http://www.electronics.dit.ie/staff/tscarff/DT089_Physical_Computing_1/LEDS/LED_Characteristics.gif

 

It is easily seen that after a certain voltage, as the voltage is increased, the current increases drastically. Larger current equal to a larger brightness change..This can also cause heat dissipation by

 

P = R x (I^2) = V x I

 

which means I can blow up my LED quite easily. I need a way to control the current through the LED and keep the current at a constant value. So how can I do that? The simplest way I have been making constant current sources has been the LM317 and the circuit looks like...

 

image

 

The 1.25 is due to the internal reference but I wont go into the details because the problem here is that this circuit is based on a linear regulator and is not very efficient nor does it offer digital control.

So how else can I control the current? The simple answer is PWM.

 

PWM Stands for Pulse Width Modulation and simply put, we switch the LED ON and OFF really quickly for a variable duration of time. The longer we switch it on, the longer the current flows and larger the average current and brighter the LED. Take a look at the image below.

 

image

(http://www.electronics-tutorials.ws/diode/diode44.gif)

 

So my arduino can do that by default. There are PWM modules in built right? So whats wrong with that? Well you can switch the LED ON and OFF using the Arduino and you could probably do it using say a 555 in an astable mode too. I have used this circuit for some time now where I need variable brightness of the LEDs

image

For a circuit explanation see the video below

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

 

The problem with using the 555 is the switching speed. The slower the switching, the more prone to flicker in the LED. The second problem which is common with the arduino switcher is that we have no way of knowing what current is being drawn. Remember we need a constant current and if say one of the LEDs is shorted out, then we have no way of knowing about it and it might even damage the MOSFET. Yikes!

 

The solution is adding a small resistor say 1 Ohm in series with the LED and then use an Op-AMP to monitor the voltage across it. By Ohms law, if there is a drop of 1 volt across the resistor then there must be 1 amp flowing through it! We can read it using an analog pin and then do that for every LED strip and then... aawwwhh. Thats a lot of work!

 

The LED driver shield simplifies this process.

 

What is the XMC1202?

The XMC1202 is an ARM Cortex-M0 based micro-controller which has a dimming control peripheral for LED lighting applications, known as the Brightness and Colour Control Unit (BCCU). It contains 3 independent dimming engines and 9 independent Pulse Density Modulated (PDM) channels. 1 dimming engine and 6 channels are used in this shield.

 

What!?

 

Its an ARM Cortex-M0 core with some dedicate for control of LEDS and ADCs to measure the currents like I said before. The block diagram of the Chips is given below.

image

Whats the BCCU?

Take a look at this...

image

This is a slide from http://www.infineonic.org/download/index.php?act=down&id=4166 and is a presentation on the BCCU itself. The point here is that the ADC needs to sample current at the right time and needs to be fast enough. The XMC1202 can do a lot more as well but for people who just want to control the LEDs using an arduino, Infineon put the chip on a circuit, write a firmware on the processor and made it an I2C slave.

 

If you want to program the XMC1202 there is great tutorial by shabaz sir at

RGB LED Shield from Infineon - Getting Started Guide

 

The RGB LED Shield

 

The RGB shield has the XMC1202 IC as well as the required circuitry to drive LED successfully. The circuit looks like...

 

image

Not much to talk about here. Its the same circuit I have discussed and the DMX section is something not mounted nor reviewed. What we can discuss is that the shield uses only 4 pins from the arduino which are voltage, GND, I2C_SCL and I2C_SDA and I can even drive this using my BusPirate. There is some ready code for the shield and I have attached the example code below.

 

Understanding the commands

The user guide has a long table of commands that can be used to control the shield and the LEDs attached. We will take a look at a subset of the commands and how to use them. In order to send these commands to the shield we can write our own functions but the demo code has ready functions. These are essentially running the I2C peripheral on the Arduino so I will use them directly. There are a number of reasons why I want to do this.

 

Firstly, these are tested functions so it will reduce my prototying time. Secondly, I will probably wrap these functions in other functions which will have a more simplistic interface. In the days of C based network programming, I was taught to write these wrapper functions to reduce complexity but it has a second advantage. If I decide to change my platform to say a Launchpad, then I will write my own I2C driving code in Code Composer and wrap it with the same function as my arduino code. That way I dont need to modify my calling code and the transition becomes simpler. This is standard practice when writing protocols and I picked it up when I wrote my first MODBus Client on an 8051. Now I do this most of the time since I will change the platform at will depending upon the cost of the final product I am building and this means my code is reusable across products. image

 

OK Back to the Commands. The first command is intensity which is intensity...

 

image

Simply put, the intensity is a 12 bit value which can be changed by calling ..

 

image

This is simple enough... so what else?

 

 

Peak Current Control.

This is important when you know your LEDs cannot handle more than a specific current. The system is as follows and is explained as well.

 

image

 

This is means I can set the max current by...

image

Another parameter is the Walk Time which is used to smoothly change the colour intensities. The intensities change linearly over time. Take a look.

 

image

 

The last thing I want to highlight is the dimming level. We discussed intensity but...

 

"The dimming engine in the XMC1202 microcontroller on-board the RGB LED Shield performs dimming along a pseudo-exponential curve so that the change appears natural to the human eye. This compensates for the eye’s logarithmic sensitivity to light." ... "The brightness value of a channel and therefore the brightness of the connected LED string, is the product of the intensity of the respective channel and the dimming level divided by 4096.

The dimming engine which controls the dimming level is separate from the BCCU channels. This enables the RGB LED shield to control the colour of the LED strings separately from the lamp brightness. The brightness level of the lamp can stay the same while its colour changes. Changes in brightness do not affect the colour of the lamp either."

 

FROM THE USER MANUAL...

 

Simply put, intensity and dimming are associated with changing the color without changing the brightness of the RGB LED and vice versa. Pretty neat! I encourage you to explore this concept to actually see the effect in practice.

 

There are some commands to read the values as well but I won't need them unless I am facing some color problems.

 

 

Tests

I did some basic tests with the shield but I need to do a lot more to report something. I am using this in my project which will be submitted soon and you can judge if the shield does a good job or not.

 

I will link up more associated posts here as I get them done. For now enjoy the holidays.

 

Cheers,

IP

Attachments:
Arduino_Getting_Started_Examples.zip
  • Sign in to reply

Top Comments

  • shabaz
    shabaz over 8 years ago +1
    Hi Inderpreet, This is a great in-depth investigation about what goes on inside the Infineon device! Excellent stuff!
  • clem57
    clem57 over 8 years ago +1
    Great explanation even to us Noob's. Thanks for your help. Clem
  • peteroakes
    peteroakes over 8 years ago in reply to ipv1 +1
    you should help yourself to a copy of the library I created, makes life a little simpler, its here if you have not seen it already http://www.element14.com/community/groups/arduino/blog/2014/12/15/byob…
  • peteroakes
    peteroakes over 8 years ago in reply to ipv1

    you should help yourself to a copy of the library I created, makes life a little simpler, its here if you have not seen it already

    http://www.element14.com/community/groups/arduino/blog/2014/12/15/byob-party-3-infineon-library-available

     

    I will be adding to it over time as I come up with more features, if you want to add to it, please do and re-share

     

    Peter

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 8 years ago in reply to DAB

    Thanks DAB sir,

    The controller is actually quite competent on controlling LEDs and if you configure the led currents right, the color reproduction is quite accurate. I am converting the whole thing into an arduino library so it becomes easier to use and I will try to get better LEDs to experiment with.

     

    The ones I have have some issue with the red color production plus I am still having a hard time with the turn off times. I.e. speed of switching. This is attributed to the inductors and once this challenge is over I am going to replace the drive circuit with my own concoction. It works in spice and I am hopeful it will work in real life. I just don't want to blow up anything before the challenge ends.


    Cheers,

    Ip

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • ipv1
    ipv1 over 8 years ago in reply to peteroakes

    Thank you Peter sir. I guess its a manual error since all the commands in the above post are screenshots image

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • clem57
    clem57 over 8 years ago

    Great explanation even to us Noob's. Thanks for your help.

     

    Clem

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • shabaz
    shabaz over 8 years ago

    Hi Inderpreet,

     

    This is a great in-depth investigation about what goes on inside the Infineon device!

    Excellent stuff!

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube