Saturday, March 16, 2013

High Efficiency LED Torch


High Efficiency LED Torch
THE high forward voltage of l.e.d.s is a challenge for efficient battery use. In the circuit shown in Fig.1a, a 74HC14 inverter is used to “double” the voltage of a 6V rechargeable ex-mobile-phone battery and drive a string of three 5mm l.e.d.s. The oscillator around IC1a and IC1b generates a square wave at about 2·8kHz, and its output is buffered by IC1c and IC1d used in parallel to maximise current to the doubler.
  
Booster
Using a 6V supply and with 1N4148 diodes in the rectifier, which comprises D1 and D2 plus capacitors C2 to C4, results in a rectified voltage of 9·6V having a 12mA output capability for a 24mA supply current – an electrical efficiency of over 80%. Using a 6·3V battery the output voltage is 10V and the available current increases to 16mA.
If Schottky diodes are used for D1 and D2, there is an increase in voltage of 100mV, resulting in a 20% increase in available current, to 19mA (6·3V supply), at similar efficiency, and a much brighter light. Using these diodes there might be benefit in increasing the oscillator frequency substantially. This is set by the values of R1 and C1.

At night, the torch casts a pool of white light two metres wide to a range of over 6m without a reflector, perfect to walk by. Side leakage is useful but seal the l.e.d.s at the rear as back-scatter is irritating. Nearby colours are vibrant compared with the gloomy monochrome of incandescent torches.

Pulsed Light
Anecdotal evidence suggests that a subjectively brighter light is obtained by low-frequency pulsing the l.e.d.s at currents higher than their continuous rating. There are two spare inverters, IC1e and IC1f, which can be wired as shown in Fig.1b. They provide variable-duty voltage pulses which directly drive a logic-level MOSFET and the string of three l.e.d.s, D7 to D9, via current limiting resistor R8.


With resistor R7 and potentiometer VR1 setting a total resistance of 3·9M , the frequency is 15Hz at 20% duty cycle. At 3mdistance from the subject the illumination appears  continuous, but closer in the flicker is very obvious, like a strobe. Negotiating confined spaces, e.g. a spiral staircase, by this light is a challenge as the walls move as you climb. The output voltage is about 10·8V with a 0·8V ripple at the pulse frequency. The output current is limited by the inefficiency of the doubler.
Increasing the frequency to 35Hz (R7 + VR1 = 1
·6M ) results in 35Hz, producing a good light, even to read by, though some flicker can still be seen as the duty cycle is 30%. Average current consumption is 21mA at 6·3V, with an l.e.d. current about 28mA.
To Conclude:-
In this application, 40106 or 74C14 CMOS chips are so markedly inferior to the 74HC14 that they are unsuitable. The published maximum voltage rating of an 74HC14 is 7·0V. The high initial voltage of a freshly charged battery may be tamed to within this limit by switching in a diode (e.g. 1N4001) until the terminal voltage has fallen somewhat.
By Mesfin Teshome

OVERVIEW ABOUT MICROCONTROLLERS


microcontroller is a small and low-cost computer built for the purpose of dealing with specific tasks, such as displaying information in a microwave LED or receiving information from a television’s remote control. Microcontrollers are mainly used in products that require a degree of control to be exerted by the user.
                        Microcontroller, what is microcontroller
                    
                         
               Microcontroller v/s microprocessor 
Microprocessors are used to execute big and generic applications, while a microcontroller will only be used to execute a single task within one application. Some of the benefits of microcontrollers include the following: 
·         Cost advantage: The biggest advantage of microcontrollers against larger microprocessors is that the design and hardware costs are much lesser and can be kept to a minimum. A microcontroller is cheap to replace, while microprocessors are ten times more expensive.

·         Lesser power usage: Microcontrollers are generally built using a technology known as Complementary Metal Oxide Semiconductor (CMOS). This technology is a competent fabrication system that uses less power and is more immune to power spikes than other techniques.

·         All-in-one: A microcontroller usually comprises of a CPU, ROM, RAM and I/O ports, built within it to execute a single and dedicated task. On the other hand, a microprocessor generally does not have a RAM, ROM or IO pins and generally uses its pins as a bus to interface to peripherals such as RAM, ROM, serial ports, digital and analog IO.

The term microprocessor and microcontroller have always been confused with each other. Both of them have been designed for real time application. They share many common features and at the same time they have significant differences. Both the IC’s i.e., the microprocessor and microcontroller cannot be distinguished by looking at them.  They are available in different version starting from 6 pin to as high as 80 to 100 pins or even higher depending on the features.

Difference between microprocessor and microcontroller
Microprocessor is an IC which has only the CPU inside them i.e. only the processing powers such as Intel’s Pentium 1,2,3,4, core 2 duo, i3, i5 etc. These microprocessors don’t have RAM, ROM, and other peripheral on the chip. A system designer has to add them externally to make them functional. Application of microprocessor includes Desktop PC’s, Laptops, notepads etc.

But this is not the case with Microcontrollers. Microcontroller has a CPU, in addition with a fixed amount of RAM, ROM and other peripherals all embedded on a single chip. At times it is also termed as a mini computer or a computer on a single chip. Today different manufacturers produce microcontrollers with a wide range of features available in different versions. Some manufacturers are ATMEL, Microchip, TI, Freescale, Philips, Motorola etc. 

Microcontrollers are designed to perform specific tasks. Specific means applications where the relationship of input and output is defined. Depending on the input, some processing needs to be done and output is delivered. For example, keyboards, mouse, washing machine, digicam, pendrive, remote, microwave, cars, bikes, telephone, mobiles, watches, etc. Since the applications are very specific, they need small resources like RAM, ROM, I/O ports etc and hence can be embedded on a single chip. This in turn reduces the size and the cost.

Microprocessor find applications where tasks are unspecific like developing software, games, websites, photo editing, creating documents etc. In such cases the relationship between input and output is not defined. They need high amount of resources like RAM, ROM, I/O ports etc. 
The clock speed of the Microprocessor is quite high as compared to the microcontroller. Whereas the microcontrollers operate from a few MHz to 30 to 50 MHz, today’s microprocessor operate above 1GHz as they perform complex tasks.

Comparing microcontroller and microprocessor in terms of cost is not justified. Undoubtedly a microcontroller is far cheaper than a microprocessor. However microcontroller cannot be used in place of microprocessor and using a microprocessor is not advised in place of a microcontroller as it makes the application quite costly. Microprocessor cannot be used stand alone. They need other peripherals like RAM, ROM, buffer, I/O ports etc and hence a system designed around a microprocessor is quite costly.                  

How does a Microcontroller work? 
Microcontroller has an input device in order to get the input and an output device (such as LED or LCD Display) to exhibit the final process. Let us look into the illustration of how a microcontroller works in a Television.

The Television has a remote control as an Input device and the TV screen as the output device. The signal sent from the remote control is captured by the microcontroller. The microcontroller controls the channel selection, the amplifier system and picture tube adjustments such as hue, brightness, contrast etc.


             General architecture of a microcontroller 
The architecture of a microcontroller depends on the application it is built for. For example, some designs include usage of more than one RAM, ROM and I/O functionality integrated into the package.


      The architecture of a typical microcontroller is complex and may include the following:
1.  A CPU, ranging from simple 4-bit to complex 64-bit processers.
2.  Peripherals such as timers, event counters and watchdog.
3.  RAM (volatile memory) for data storage. The data is stored in the form of registers, and the general-purpose registers store information that interacts with the arithmetic logical unit (ALU).
4.ROM, EPROM, EEPROM or flash memory for program and operating parameter storage.
5.  Programming capabilities.
6.  Serial input/output such as serial ports.
7.A clock generator for resonator, quartz timing crystal or RC circuit.
8. Analog-to-digital convertors.
9. Serial ports.
10. Data bus to carry information.
        
                  Features of microcontrollers 
 1.      Architectural features:
Most microcontrollers built today are based on the CISC (Complex Instruction Set Computer) platform. A typical CISC microcontroller has over 80 instructions and it is quite common for the instructions to all behave quite differently.
The main advantage of CISC architecture is that the instructions are macro-like, allowing the programmer to use one instruction in place of many simpler instructions.

2.     Advanced Memory features:
          a.    Electrically Erasable Programmable Read Only Memory (EEPROM):
Many microcontrollers use the economic EEPROM for smaller amount of memory that have frequently changeable data. This type of memory is relatively slow, and the number of erase/write cycles allowed in its lifetime is limited. 
          b.    FLASH (EPROM): 
Flash provides microcontrollers with a better solution than EEPROM for requirements of large amounts in non-volatile program memory. EPROM is faster and permits more erase/write cycles than EEPROM. 

3.      Power Management features  
A majority of microcontrollers usually support an operation of 3 - 5.5 V. As consumer goods become trendier, compact and lighter, the focus is on microcontrollers to ensure that products with less power usage are efficiently built and then used by end-users.

                       Applications
Microcontrollers are used in products that are controlled automatically.
The various products that make use of microcontrollers in our everyday life are given below:
1.    Home: Television, DVD player, Telephone, Fax machine, Cellular phones, Security systems, Camera, Sewing machine, Musical Instrument, Exercising machine, Video games, Computer, Microwave oven.  
2.       Office: Computers, Printers, Telephones, Fax machine, Security systems.
                 
                       History and Key Developments  
In 1975, Intel fabricated a chip (Intel 8048) with inbuilt RAM and ROM which was widely used in numerous applications. The microcontrollers had two variants namely EPROM which was erasable but expensive and PROM which could be programmed only once. In 1993, EEPROM memory was introduced in the microcontrollers which electrically erasable and at affordable price. Atmel used the Flash memory and launched the first microcontroller. After this, many companies fabricated microcontrollers with both type of memory.

The microcontroller became popular after Intel Corporation released an 8-bit version in 1981 called the 8051. Intel allowed other manufacturers to make alternate versions of the 8051, and this ensured that numerous versions of the 8051 entered the market. Some of these controllers had different speeds with multiple ROMs mounted on a single chip.

The family of 8051 microcontrollers signalled an electronic revolution with the end user reaping the benefits in technology and science.

As years passed by, microcontrollers have grown to offer much more to end-users and businesses. Some of the key developments in the microcontroller lifecycle are as follows:
1.      More ease-of-use and ability to reach market faster.
2.      More energy efficiency.
3.      More integrated features like RF and USB.
4.      Smaller form factors.
5.      Increasing processing power.

In future, MRAM (Magnetoresistive Random Access Memory) could be used in microcontrollers as it can store large amount of data which allows it to access faster consuming less power of  battery.

           Comparative study of different families: 
                   8051, AVR/ATmega, PIC

                                 Microcontroller Comparison, 8051, AVR & PIC Microcontroller
8051: These microcontrollers are old but still trendy and most of the companies fabricate these microcontrollers. The older types of 8051 have 12 clocks per instruction that make it sluggish whereas the recent 8051 have 6 clocks per instruction. The 8051 microcontroller does not have an in built memory bus and A/D converters. In 1980, Intel fabricated the single chip microcontroller 8051 with Harvard architecture.

PIC: Programmable Interface Controller is usually referred as PIC. They are slightly older than 8051 microcontrollers but excel cause of their small low pin count devices. They perform well and are affordable.  The Microchip technology fabricated the single chip microcontroller PIC with Harvard architecture. The programming part is very tedious and hence it is not recommended for beginners.

AVR:  In 1996, Atmel fabricated this single chip microcontroller with a modified Harvard Architecture. This chip is loaded with C- compiler, Free IDE and many more features. This microcontroller is a bit difficult for the starters to handle.

Criteria for choosing a microcontroller
The most important factor is that the microcontroller should be cost-efficient and work capably to handle the dedicated task. Some questions that should be asked while deciding on a microcontroller are as follows:  
1.         What is the maximum speed of the microcontroller?
2.         What is the amount of RAM and ROM on chip?
3.         How easy it is to upgrade to higher upgrade or lower consumption versions?
4.         Is the microcontroller readily available at cheaper rates?
5.         What is the number of I/O pins and timer on the chip?
Future of microcontrollers and applications 
The future is bright and shining for microcontroller manufacturers. This is because the global economies are booming and microcontrollers have a role to play in almost every gadget present on earth. The list of applications for these microcontrollers is:
1.         Energy Management:
Technology for energy management is in great demand due to government initiatives that focus on energy. Efficient metering systems help in controlling energy usage in homes and industrial applications. These metering systems are made capable by incorporating microcontrollers.
2.         Touch screens:
A touch screen is accepted as the most efficient method to implement user control. They enable dynamic user interfaces and allow increased productivity. Touch screen controller implementation is microcontroller-based and therefore, ample opportunities lie ahead for microcontroller providers that incorporate touch-sensing capabilities in their designs. Portable electronics such as home appliances, cell phones, media players, gaming devices are some of the domains where microcontroller-based touch screens will be in demand. 
3.         Automobiles:
Microcontrollers find wide usage in hybrid vehicles, especially to ensure smooth and simultaneous functioning of electric and petrol engines. Additionally, almost every car manufacturer uses microcontrollers to control functions within their vehicles and to ensure error-free rides for their customers. 
4.         LED Lighting:
Microcontrollers are used for led lighting in residential and industrial locations to enable greater control and power savings.  
5.         Personal Medical Devices:
The rise and popularity of portable medical devices such as blood pressure and glucose monitors have ensured that microcontrollers will have a role in the medical industry. Microcontrollers are used to display date and increase reliability in providing medical results.
Finally:-
    Microcontrollers are a very important electronic material now a day. But in our country,ETHIOPIA, this is not still in use in a wider area. universities and colleges have to deal with it and the course should have to be given as a carriculum specially in electrical and computer engineering department in all streams. Specifically for Communication, Control And computer streams.

IN THIS BLOG I WILL DEAL ABOUT THESE MICROCONTROLLERS AND THIER APPLICATIONS IN DETAIL AND REAL WORLD WORKS REGARDING IT.

                                         ENJOY



Programming Microcontrollers Introduction


            PROGRAMMING OF MICROCONTROLLERS

Programming or burning a microcontroller means to transfer the program from the compiler to the memory of the microcontroller. A compiler is a software which provides an environment to write, test and debug a program for the microcontroller. The program for a microcontroller is generally written in C or assembly language. Finally the compiler generates a hex file which contains the machine language instruction understandable by a microcontroller. It is the content of this hex file which is transferred to the memory of the microcontroller. Once a program is transferred or written in the memory of the microcontroller, it then works in accordance with the program.

In order to know how to program a microcontroller, we need a device called a burner/programmer. A programmer is a hardware device with dedicated software which reads the content of the hex file stored on the PC or the laptop and transfers it to the microcontroller to be burned. It reads the data of the hex file by connecting itself to the PC via a serial or USB cable and transfers the data to the memory of the microcontroller to be programmed in accordance with the protocols as described by the manufacturer in the datasheet.

The programmer and the compiler differ for microcontrollers from different companies. In some cases the compiler has programmer software inbuilt in it. You simply need to connect the programmer hardware and the microcontroller can be programmed from the compiler itself.
Steps to program the microcontroller:
1. Purchase a microcontroller capable of programming the microcontroller you are using. Ensure that it is compatible with the operating system you are using.
2.  Install the software which comes with the programmer.
3.  Connect the programmer with the PC and start the software.
4. Read the hex file which you want to burn in the software of the programmer.
5. Press the program/burn option in the programmer software. In either case i.e. whether the programming is successful or failed the programmer software will show the message.
        microcontroller programmer or microcontroller burner
A microcontroller programmer or microcontroller burner is a hardware device accompanied with software which is used to transfer the machine language code to the microcontroller/EEPROM from the PC. The compiler converts the code written in languages like assembly, C, java etc to machine language code (which is understandable by the machines/microcontrollers) and stores it in a hex file. A microcontroller programmer acts as an interface between the PC and the target controller. The API/software of the programmer reads data from the hex file stored on the PC and feeds it into the controller’s memory. The target controller on which the program needs to be burned is placed on the programmer using a ZIP socket. The software transfers the data from the PC to the hardware using serial, parallel or USB port.
                                               
 
Depending on the way it interacts with PC, there are three types of microcontroller programmers:

1. Parallel Programmer uses the parallel port of the PC. They are low cost programmer but not widely used.
2. Serial Programmers uses the serial port to interact with PC via RS232 protocols. They are more popular among hobbyist working on PC. However both the serial and parallel programmers will become obsolete in near future. The major reason being unavailability of parallel and serial ports in the PCs & Laptops in the coming years.

3. USB Programmer uses the USB interface to transfer the data from PC. The main advantage of the USB burner is that they are powered from the PC itself and there is no need of any additional supply.  The USB programmers have already become popular and will soon replace the serial and parallel programmer.

The programmer generally contains a microcontroller which is preprogrammed to take data from the PC and program the target controller. The programmer burns the target controller using any of the protocols like SPI, parallel interfacing, I2C/TWI or CAN. The speed of burning depends on the way of programmer is interfaced with PC and the protocols used to burn the target controller.

The conventional method to burn a controller is to take it out the circuit, place it on burner and then dump the hex file into the controller using the API. In order to remove this problem of removing the controller from the circuit every time it needs to be programmed, the controllers have now been upgraded with In System Programmer (ISP) feature. This allows burning/programming a controller without removing the controller from the circuit it is used in.  The latest controllers are coming with the feature like bootloader memory which allows self burning capabilities, i.e. such microcontroller controller does not need any additional programmer hardware. They need only an API to transfer the program to the target controller. This API can also be incorporated in the compiler and hence the compiler can directly burn the target controllers.

                                                ENJOY  !!