Monday, December 28, 2015

Direct AC LED Driver

Direct AC LED driver or AC-AC driver is getting very popular in the solid-state-lighting world.  Starting with Seoul Semiconductor with its AC LED and then apply the same technology with conventional LED but better efficiency.  Now Seoul Semiconductor even have the solution that works very well with Triac dimmer.

AC drive for LED is actually quite simple but care must be taken into consideration when configure the LED strings.  It is not quite  straight forward as compared to the SSL with AC-DC power supply.  You need to make sure the power loss at the switching IC as little as possible else the IC will shut down due to over temperature.  Some IC has the feature of lowering the regulated current output but that will affect the brightness output as well, which is not good.  Figure 1 shows the AC drive block diagram.


Figure 1. AC Drive Block Diagram

From the diagram, each channel current is regulated using the current sense, some IC only requires one resistor to set the current.  The control circuit will turn on the channel in stages by tracking the incoming AC voltage input.  Figure 2 shows when the channel been turned on.


Figure 2. Channel On-Off Sequence

From figure 2, as the AC voltage increases the control circuit will turn on the respective channel when the AC voltage is higher than the total VF LED string.  First it will turn on channel #1, then off channel #1 and turn on channel #2, turn off channel #2 and turn on channel #3, and so on.  By doing this the Current phase and Voltage phase are almost the same phase that the Power Factor obtain will be close to 1.  You don't have to worry about the Total Harmonic Distortion (THD) as well since there is no high frequency switching.  No worry on the EMC test on the SSL if you decided to perform the test.  

Disadvantage is that you may need more LED compared to the conventional AC-DC power supply.  The Lumen-per-Watt (Lm/W) also will be lower as well but still in an acceptable range looking at this less complexity design.  Another disadvantage is that the complete SSL PCB is non-isolated, all the conducted area is non-isolated.  If the SSL product is designed with plastic casing then it shouldn't be an issue.  In other words, if you decide to use this driving technique you need to isolate the design mechanically.  

Monday, January 5, 2015

STM8S Low Power Feature - Active Halt Mode

I had been using Microchip micro-controller from its 8-bit series up to 32-bit series.  Recently I have
the opportunity to use ST Micro 8-bit micro-controller STM8S series.  It has similar feature as Microchip, not all, but almost similar.  Good thing is that it has a CAN (Control Area Network) Bus hardware module for such as a small MCU and furthermore its pricing is as low as 12F or 16F Microchip.  

For this article, I would like share on the low power management feature which I think quite cool. Some MCU has different sleep modes such as Idle, Sleep, Deep Sleep, Deep-deep Sleep (or dead, maybe not waking up at all....just joking).  STM8S has the feature known as "Active-Halt-Mode".  At a glance, I thought Halt Mode consumes lower power but actually Active-Halt-Mode is much much lower.  During this mode, you could even turn off the internal voltage regulator, clock oscillator, peripheral, power to internal flash memory, etc....hmmm, maybe can consider "Dead" :)  The only way to wake up the MCU is via external I/O interrupt or a timer known as "Auto-Wake-Up (AWU)".  Before entering the Active-Halt-Mode, the AWU is enabled prior going into Halt Mode.  User has the option to select the time interval for the MCU to wake up and do something.  User has the option to wake up, service the AWU interrupt, then back to sleep or back to main then back to halt mode.  During Active-Halt-Mode with all turning off, one could achieve around 66 micro-Amp.  

In the next time, I will share some of the code on how the Active-Halt-Mode is written in the IAR C-compiler...free version, of course :)


Saturday, October 26, 2013

Li-Fi

I guess we all have heard of Wi-Fi or also known as Wireless Local Area Network (WLAN) as defined by Wi-Fi Alliance where the communication protocol is based on IEEE 802.11standards.  

Now comes a new term called "Li-Fi" where it uses light as a medium to transmit data.  It had been demonstrated at the University of Edinburgh where the Li-Fi technology was used  to stream high definition video.  It uses light as medium instead of electromagnetic waves.

The technology behind the Li-Fi is basically using Orthogonal Frequency Division Multiplexing or also known as OFDM with a little modification.  With this technology one able to split the data stream into thousand of parallel streams with using multiple carrier frequencies to modulate the light sources in order to achieve high throughput transmission.

You can imagine with the light source around us such as light bulb, tube light, street light, etc. able to transmit data.  When ever there is light one able to transmit and receive data.  I will investigate into this technology further and maybe build some working prototype. 


Tuesday, August 20, 2013

ARDUINO!

I came across an open source development board known as "Arduino".  What does it difference from other 
Arduino UNO R3
open source board such as Beagle Board and Raspberry Pi?  Does it able to run Linux, Android, Win OS, etc.?  For those who first encounter Arduino may have the same questions like I do. 

Arduino is very popular in US and Europe especially for hacker where you want a quick hardware to do a simple or even a little more complicated control.  It is completely open source where the hardware schematic and its firmware library is available from Arduino website (http://www.arduino.cc).  You can download the Arduino development environment from their website as well; C compiler is provided free-of-charge.  There is no license or code limitation for compiler.  

There are many version of Arduino boards depending on which application you would like to design.  The one shown on photo is the Arduino UNO R3 which I think one of the most purchased. I downloaded the hardware schematic (http://arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf) from Arduino website and after going through the schematic, the designer is using two Atmel ATMega micro-controller on board.  The ATMega16U2 is a USB micro-controller where it is programmed to be USB-to-UART converter.  The other ATMega328 is the main micro-controller for Arduino UNO.  The firmware you wrote will be flashed into the ATMega328 which you click on the upload button.  There are other version Arduino boards that only used one micro-controller and this will reduce the board size and suitable for portable application.

It doesn't stop there!  There are daughter boards or also known as Arduino Shields where it is designed as an added companion to a Arduino board.  Some of the example of Arduino Shields are GSM Shields, Ethernet Shields, Motor Shield, etc.  

Just ordered the Arduino UNO R3 board and waiting for delivery.  Once I tried out the board, I will write more on the experience.

Sunday, July 28, 2013

Medical Electronics For Chronic Illness

Chronic illness is defined as a person that has a disease more than three months such as cancer, arthritis,diabetes, HIV/AIDS, etc.  According to World Health Organization (WHO) the mortality rate in the world due to chronic illness was reported to be 60% of all death.  This rate was reported in 2005 this mean that the rate in year 2013 will be higher based of our pollution rate and all.  In US alone the 70% death rate is due chronic illnesses such as heart disease, cancers, stroke, chronic respiratory disease, diabetes, Alzheimer's disease, mental illness and kidney diseases.  90% of the seniors have at least one chronic disease. 

The mortality rates can be reduces tremendously if we could have early detection and response to be sent to
the respective health institutions.  With our modern technology this can be done easily especially using embedded technology coupled with communication technology (Bluetooth, GSM, etc.).  Different type of sensors can be attached to a person body and the sensors are constantly monitoring the person. All the sensors' reading are sent to a base station located at home via wireless such as Bluetooth, etc. The reading will be transmitted to a remote location (hospital, health institution, etc.) via GPRS network, internet, etc.  There are many ways to send the sensors' reading to a remote location.  One of the method is to transmit the data via GPRS network and for those location where wireless data network is unavailable, Power-Line-Carrier (PLC) can be used to transmit the data.  PLC considered a full proof method of transmitting the data to remote location as power grid is available even though at some remote area. With this method, the infrastructure costs is much more cost effective; as long as power grid is available the communication to remote location is possible.  One only need the PLC transceiver to do so.   Power-Line-Carrier is very interesting topic and there are many types of protocol for PLC.  Next, I will cover some of the PLC technologies.

Tuesday, July 16, 2013

Smart Light Bulb

I guess we all are familiar with smart home automation with smart appliances where your refrigerator could
tell you supply shortages inside the fridge and smart enough to produce grocery list for you.  Who will think even a small light bulb is also smart?  Well, it is coming soon and most lighting manufacturers are making their lighting products smarter.  It will be much more easier to do so with the use of light-emitting-diode or LED technology.  Solid State Lighting (SSL) has come a long way and it has been a privilege for me to witness the evolution of its development till now. 
The traditional Edison bulb requires no additional circuitry to burn the tungsten.  In fact, the hotter its get the better its illumination.  Unlike the Edison bulb, LED requires DC current to operate and the cooler its get the better its illumination; the direct opposite of incandescent lamp. 

How do we operate the SSL on AC power line?  Simple!  We need an AC to DC power supply squeeze into a tiny housing.  The LED driver chipset has improved over time and now even the designer includes a single stage power factor correction internally that makes the power factor as close as possible to 1; most of the time measurement will shows around 0.95~0.99.  Not only that but overall bill-of-materials also been reduced in order to reduce the driver printed circuit board (PCB) size to reduce the overall system costs.  How about AC LED?  Are this LED really operate on AC?  No!  Diode is always a Diode. Thomas Edison discovered the principle of diode during its light bulb discovery but he is not aware of its application until later.  There are several ways to operate the LED on direct AC line.  One of the technique is to use high voltage VF (forward voltage) LED, as high as possible, in order to reduce the power loss from the additional voltages.  One can use a current source either at the front- or back-end; there is advantage and disadvantage by doing so.  This is a straight forward technique without any control and monitoring that may affect the power factor and system efficiency.  By putting intelligent into this technique, one could monitor the AC line and switch a string of LED accordingly to make sure the Current Phase and Voltage Phase are aligned; high power factor.  As the AC goes up and down, different array of LED will be switched on / off.  One drawback of this technique is more LEDs are required in order to achieve the same brightness compared to conventional AC-DC driver and linear AC LED.  Other techniques are existed......soon to be discovered.

Now, we have the power supply smart enough, what else can do to make the light bulb smarter?  Communication? YES! By adding communication to it one will be able to communicate with the light bulb and tell it what to do or how is it doing?  I stop here for now as the rest is trade secret :).  I leave it to the reader to imagine what else he/she could put into his/her light bulb. 

Monday, July 8, 2013

Using Microchip MCU Timer 1/3/5 Module with Gate Control

Previously, I covered the Timer 0 module which is much easier to use and configure.  Timer 1, 3, or 5 module is more complicated and lots more to configure as it provides more features.  

Timer 1/3/5 Module Block Diagram

Timer 1/3/5 module is quite similar to Timer 0 except it is a 16-bit timer and an additional Gate Control input feature.  What is Gate Control?  Timer 1/3/5 module can be configured to count freely or disabled/enabled counter via Gate circuitry.  The Gate circuitry can be driven from multiple sources selected via TxGSS<1:0> bits in TxGCON register (refer to block diagram upper corner top left).  They are,

Timer 1/3/5 Gate Pin
If TxG gate pin is selected as the source, an external source will be used to enable/disable the count.  

Timer 2/4/6 Match to PR2/4/6
The free counter Timer 2/4/6 register will increment until it matches with user set value in the PR2/4/6 register (Period Register).  When match happens the Timer 2/4/6 will reset to zero on the next increment and a low-to-high pulse will be asserted to the Timer 1/3/5 Gate circuitry.

For example, user set the PR2 = AA55h.  Assume Timer 2 counts from 00h, once Timer 2 match the preset PR2 value AA55h, the comparator in the Timer 2 module will generates a match signal which will be used to assert the Timer 1/3/5 Gate module circuitry if this source is selected.

Comparator Output sync_CxOUT
Comparator module output (sync_CxOut) can be selected as one of the Gate circuitry source.  When the comparator condition is met, sync_CxOut will be asserted to Timer 1/3/5 Gate circuitry.  The asserted signal will be latched on the falling edge of clock source whereas the timer increment is latched on the rising edge of clock source in order to prevent from race condition.

Unlike Timer 0, Time 1/3/5 is a 16-bit timer where the timer value is accessed through TMRxH and TMRxL.  Writing to TMRxH or TMRxL will update the timer.  One can choose either internal or external clock source.  When internal clock source is chosen the timer increment on every instruction clock cycle compared to external clock source where the timer increment on every rising edge of clock input to the TxCKI pin.  Some Microchip MCU do support secondary low-power 32.768 kHz clock oscillator which is normally used for real time clock.