A new multi-function power supply unit for my Embedded Lab | Anna university questions papers projects for EEE,ECE,IT,MECHANICAL,MBA,MCA Anna university questions papers projects for EEE,ECE,IT,MECHANICAL,MBA,MCA: A new multi-function power supply unit for my Embedded Lab Bank Exam question paper, GATE Papers,Combined Defence Service Examination papers ,TANCET,BSNL JTO,ISRO,EBOOKS,DRDO ,BARC, , NTPC ,BHEL ,BEL ,HAL,Anna University Papers,ECE , EEE , CSE , IT , Mech , BIOMEDICAL , Textile , MBA , MCA , Anna University Question Bank , Anna University Syllabus , Anna University 'Q' Papers , Gate Papers , 8051, AVR, 8051 projects, free 8051 microcontroller projects, AVR projects, AVR tutorial, AVR microcontroller projects, circuits, hobby electronics, microcontroller based projects, microcontroller projects, final year projects, electronic projects, electronics projects, circuit diagrams, pin diagram, pin description, interfacing with AT89C51, 8051 tutorials, embedded projects, serial port, sensor, Electronic Components, Electronic Circuits, circuits for hobbyist, electronic schematics, DIY projects, breadboard circuits, at89c51, 8051 code, advanced circuits, hobby projects, circuit ideas, embedded system, embedded C, microcontroller programming in C, LCD interfacing, ADC interfacing, circuit components, hobby circuits, seven segment display, 89c51 projects, circuit description, major projects, minor projects, projects for circuit branches, interrupt, 8051 programming, RS232, 8 bit microcontroller,Microcontroller Tutorials, PIC Tutorial, 8051 Microcontroller Tutorial Resource, Connect to the PIC, PIC Tutorials, Micro Controller Tutorials, PIC Micro controller Tutorial Resource, DALLAS 80C320, DS80C320, Connect to the PIC, PIC Tutorials, Dallas DS80C320, 8051 Introduction, Types of Memory, Special Function Registers, Basic Registers, Addressing Modes, Program Flow, Low Level Information, 8051 Timers, 8051 Serial Port Operations, 8051 Interrupts, Additional Features of 8052, 8052 Instruction Set, Computer Science Seminar Topics, Mechanical Engineering Seminar Topics,Electrical Seminar Topics,Electronics Seminar Topics,Seminar Abstract And Report Downloads,High-Speed Architecture, New Instruction Speed, Variable Length MOVX Instruction, Timer Considerations, Dual Data Pointer, Watchdog Kicking, The Watchdog Watchdog Interrupt, Watchdog System Resets, Power Failure Functions, Power Failure Reset, Power Failure Interrupt, Secondary Serial Port, Timed Access Protection, PIC16F877A Tutorial, Introduction to the PIC16F877A, How to hook up the PIC so it will run?, What do the pins mean?, How to program the PIC?, Miscellaneous Advice, LED Blinker, Photoresistor Input, Analog Input (Photoresistor, Sonar sensor, IR sensor, Digital Input (Switches), Output messages to computer screen, Servo Motor Output, DC Motor Output,Gate sample paper with solution , Engineering E-Books , Free ebook websites , Final Year Projects , Placement papers,anna university previous year question bank, previous year question paper,model question paper, two mark question paper,sex,adult,results,atmel humidity Assembly Language code, Digital Clock Employing Memory Mapping, Humidity Sensing, Microcontroller51,control solid state relays, decoded 74ls138, latech 73ls373, port expander, Solid State Relays,urn ON, turn OFF, Relay Driver, back EMF, holding, current, pullup, resistor, coil, BC547, ULN2003, ULN2803, npn, transistor, microcontroller, Technology, circuit,bharathidasan university,university,thanjavur,madurai,coimbatore,chennai,adult,porn,sastra,sastra university, placement and training cell,java,j2ee,ajax,c,c++,oracle,COMPUTER SCIENCE,embedded, embedded systems, j2ee, dotnet, j2me, dot net, jsp, vb, c#, c, c sharp, computer science, cse, information technology, it, Electrical, Electronics, communication,SURVEY,ONLINE JOB,PAY TO CLICK,SEBOSA, ece, eee, academic, college, instrumentation, control, control systems, best ,project centers, project centres, company, companies, software, telecommunication, telecom, networking, matlab, robotics, Artificial intelligence, automation, cloud computing, cryptography, data mining, dsp, database, digital, image processing, fuzzy logic, gsm, gps, gprs, mobile computing, networks, network security, php, power, systems, vlsi, hardware, web services, wireless, rf, rfid, microcontroller, ns2, 2010, titles, list, download, latest, free, advanced, low cost, placement, zigbee, Chennai, india, uk, SOFTWARE ENGINEERING, APPLIED ELECTRONICS, VLSI Design, M.E,EMBEDDED SYSTEMS, COMMUNICATION SYSTEMS,Memory Organization, Microcontroller to LCD, moving message display using 8051 microcontroller, MOVING MESSAGE DISPLAY USING ATMEL 89C51, PIN Configuration, Programming Aspects, POWER ELECTRONICS, 89c51, 89s51 moving message display board, microcontroller 8051,8051, AVR, 8051 projects, 8051 microcontroller projects, AVR projects, AVR tutorial, AVR microcontroller projects, electronics projects, free electronic circuits, circuit diagrams, circuits, schematics, hobby electronic projects, electronic projects, hobby electronic circuit diagram, final year projects, embedded projects, technical articles. Interfacing microcontroller 8051 with peripherals like ADC, LCD, EEPROM,solenoid valve atmel dc control triac,dimmer bt138,uln2003 microcontroleur interfacing a microprocessor to a power thyristor microcontrol based level mesurement 89c51 as pwm controller,at89c2051 sine wave pwm,8051 lift, circuit design for a elevator, Elevator Lift control for three stories with microcontroller 8051, microcontroller based lift controller for three stories, three stories lift,ericsson at command microcontroller, GSM/ EDGE Modem in PCI Interface, Interface of mobile phone with micro-controller, Supporting AT commands,embedded projects,8051,pic,arm,pic16f877a,qualifity,best project in thanjavur,relay design,product manufuring,dvd,vcd,service,free training,electrical and electronic circuits,pcb board design,help of embedded,earn money with embedded,part time job,home based job,vacancy,ieee transaction,optimization,website design,university, Chapter 2 Liquid Crystal Display, Character Generator RAM, DDRAM or CGRAM, Display on or off control, LCD, microcontroller interface with LCD, PIN Configuration, Pressure monitoring with microcontroller 8051, Pressure sensing and controlling, Pressure Sensing System, Programmable Peripheral Interface, RS-232 serial communication,diploma in embedded,matlab in thanjavur, seo,site design @2900 onwards, 8255 and RS232, 89s51 LCD display LM 35 ADC0804 measurment, construction of a pressure sensing system using 8051, designed pressure sensor and transducer,microcontroller based heart rate meter,8051 pin diagram,invention heart rate meter,heart meter watch,heart beat monitor project,8051,AVR,8051 projects,free 8051 microcontroller projects,AVR projects,AVR tutorial,AVR microcontroller projects,circuits,hobby electronics,microcontroller based projects,microcontroller projects,final year projects,electronic projects,electronics projects,circuit diagrams,pin diagram,pin description,interfacing with AT89C51,8051 tutorials,embedded projects,serial port,sensor,Electronic Components,Electronic Circuits,circuits for hobbyist,electronic schematics,DIY projects,breadboard circuits,at89c51,8051 code,advanced circuits,hobby projects,circuit ideas,embedded system,embedded C,microcontroller programming in C,LCD interfacing,ADC interfacing,circuit components,hobby circuits,seven segment display,89c51 projects,circuit description,major projects,minor projects,projects for circuit branches,interrupt,8051 programming,RS232,8 bit microcontroller,microcontroller based heart beat monitor,8051 isp programmer,heartbeat monitor and display on LCD,heart beat rate monitor with sensor,training heart rate monitor with comaprators ans sensor,8051 microcontroller application,optocoupler based sensor of runner heart rate monitor,how to measure heart beat, calculate heartbeat just in one second,8051 rtos,limitations of heart rate monitors, quick display of heart monitor,advantages of electronic medical records,electronic medical billing,used electronic test equipment,electronic document management solution,fetal heart rate monitor,wrist heart rate monitor,avr 8051,baby heart monitor,heart beat counter using microcontroller 8051, block diagram for ir led and ldr based heartbeat monitor with display on computer, MICROCONTROLLER AT89C2051 BASED HEART BEAT MONITOR (PULSE RATE wth assembly code),ir led and ldr based heartbeat monitor with display on computer,wireless biomedical monitoring system using 89S52 microcontroller,wireless biomedical monitoring system using 89S52 microcontroller,8051microcontroller based heart beat monitor,heart pulse system project,very cheap cost in india,lm35,temperature sensor,heart beat sensor,technology,solutions,sastra university,data base design,speed ,innovative centre,home security system model design, water level indicator for home,COMPUTER SCIENCE, SOFTWARE ENGINEERING, APPLIED ELECTRONICS, VLSI Design,IEEE Project center, IEEE 2010 Projects in Tanjore, trichy, Kumbakonam, Pudukkottai, Ariyalur, Pattukkottai, Best IEEE Projects, final year projects, Project Center in Trichy, Project Company in thanjavur, Project training @ tanjore, Free 8051 Microcontroller projects,8052 projects,microcontroller,projects, Datasheers,circuit diagram,Microcontroller,8051,AVR,8085 Microprocessor,BASCOM,projects,tutorials,codes,Libraries,interfacing examples,embedded projects,serial port,infrared remote controls,rf remote controls,home automation,Intel 8051 microcontroller,electronic projects,embedded systems,control systems,computers,technical books,software,assembly language,programming intels 8051,serial communications,rs232,Electronics Projects,Books,Home Automation,Computer Software,Assemblers,Compilers,applications Programming,Embedded Systems Design,8052,AT89C2051,robotics applications,visualbasic, Microsoft Visual Basic,system, based, solar, control, intelligent, motor, controller, vehicle, monitoring, pwm, detection, home, temperature, tracking, alert, blind, alcohol, automated, automatic, close,Robotics,Kits,Circuit Examples,8051,Robots,micro Code,AT89c51, Programmer,IEEE 2010 embedded systems, embedded programming, PIC Micro projects, Microchip Programming, AVR tutorials, PIC Micro tutorials, ATMEL, Microcontrollers based systems, Microcontroller Projects, Embedded projects, Embedded designing in C, Microchip Lab, Embedded systems tips, DIY Electronics,Project Detail,onlinejob, Data Entry, no fee, no investment, part time, home based,recuirements,job,consultancy,helpline,maths,power,ultimate knowledge,prodigy,trichy,mobile
100% FAT LOSS TIPS Click Here!

A new multi-function power supply unit for my Embedded Lab

, Posted by ADMIN at 10:30 AM

One important parameter in embedded system designing is power consumption. This parameter is directly related to the battery lifetime, if the system is to be powered from a battery. In order to determine the power rating of your designed system, you need to know how much current the system draws from the source at a given voltage. While working on my projects, I usually measure current by placing an external ammeter in series with the current's return path. This is not always convenient to do, and so I thought of making a special power supply unit for my lab that would display both voltage and current information on a LCD screen while prototyping my circuit. This way I can continuously monitor how much power my test circuit is drawing at a specific operating voltage.

Multifunction bench power supply

This power supply unit provides fixed ±5 V as well as a variable dc voltage ranging from 1.25 V to  9 V. A PIC16F689 microcontroller is embedded into the power supply unit to measure the adjustable output voltage along with the load current. Besides, this unit also has a built-in frequency counter to measure the frequency of an external signal. The range is over 50 MHz. However, it has been tested up to 20.0 MHz, and works fine. There are still few I/O ports of PIC16F689 that are not used. So I am thinking about adding one or more features (like capacitance meter) to it. But that would be on my second version.


The fixed ±5 V power supplies are derived using LM7805 and LM7905 regulator ICs. A 12 V rectified output from a center-tapped transformer provides the dc inputs to these regulator ICs. For the variable dc output, a LM350 IC is used. LM350 is an adjustable 3-terminal positive voltage regulator that is capable of supplying in excess of 3A over a 1.2V to 33V output range. It requires only 2 external resistors to set the output voltage. Since my dc input is only 12 V (rectified output from the transformer), the regulated output from the LM350 IC would go up to 9 V (3 V less than the input, as specified in the datasheet). In order to obtain the full range of output voltage (up to 33 V) from LM350, you need a transformer with a higher output voltage. I rarely use power supply above 5 V in my projects, and therefore, a variable voltage source up to 9 V is good enough for me.

Next comes PIC16F689 microcontroller that measures the LM350 output voltage and current. You are right, I am implementing voltage and current measurement only to the LM350 output. The principles of voltage and current measurements using microcontroller were discussed in two of my posts: PIC-based digital voltmeter and How to measure dc current with a microcontroller. I am not going to repeat the details here. Both the parameters can be measured with built-in ADC channels of PIC16F689. Since the output voltage from LM350 could go higher than 5 V (up to 9 V in this situation), it is not directly  measurable from an ADC channel. A simple voltage divider network using two resistors is incorporated to scale down the output voltage to the safe ADC input range (0-5 V). On the other hand, the current to be measured must be first converted into voltage so that it could me measureable too with the ADC channels. The current to voltage conversion can be done by placing a small value resistance (shunt) in series with the current path. The voltage drop across the resistance will then vary linearly with the current. I am using a 0.286 Ω resistor (Rs) made by myself by coiling a 5 ft long 22 AWG solid copper wire that has a plastic insulation on its outer surface (see the picture below).

Current sensing resistor

Since this resistance is so small in value, the voltage drop across won't be very high for small currents. Even for 1 A of current, the voltage drop across it would be only 0.286 V. To improve the resolution (and hence accuracy) of current measurement, this voltage must be amplified before the AD conversion process. An operational amplifier with a suitable gain can do this task. The figure below shows how this whole technique works.

Block diagram for voltage and current measurements

An interesting thing to be noted here is that the output voltage across the load (Vo) is actually the measured voltage (Vm) minus the voltage drop across Rs (Vs). For small load current, the difference between Vm and Vo won't be very much, but it could be significant for higher current. For 1 A of load current, the output voltage across the load is 0.286 V less than the measured output voltage from LM350. This error will be corrected later in the software part by subtracting Vs from Vm.

The frequency counter uses Timer0 module in counter mode to measure the frequency of an external signal. A single transistor preamplifier stage is used to boost the low amplitude signals before they are sent to the Timer0 module for counting. An easily available BF199 RF transistor is used for this purpose.

Circuit Diagram

As mentioned earlier, two linear regulator ICs (LM7805 and LM7905) are used to derive fixed ±5 V supply. A center-tapped transformer output is rectified (using diodes) and filtered (using 4700 µF capacitors) to obtain unregulated ±12 V dc that serve as inputs to both the regulator ICs. The circuit diagram below shows all the components and their connections required for the fixed power supply.

Circuit diagram for fixed +/- 5 V supply

The variable power supply unit uses an adjustable regulator IC (LM350). The output voltage can be controlled through resistors R3 and Rp (see figure below). The expression for output voltage is, Vo ≈ 1.25 x (1+Rp/R3). This specific design allows the output voltage to vary from 1.25 to 9.0 V. R1 and R2 create a voltage divider network to scale the output voltage within the safe limit (0-5 V) of the microcontroller's ADC channel. An additional zener diode at the output ensures that the input voltage at PIC's ADC channel won't be greater than 5.1 V. The scaled output is connected to AN0 channel (pin 19) of PIC16F689.

Variable power supply with voltage and current measurement

The measurement of current is possible with a shunt resistor (Rs = 0.286 Ω) and an operational amplifier circuit. Rs is placed on the return path of the current and therefore, the voltage drop across it is proportional to the current drawn from the variable power source. This voltage is first amplified by a non-inverting Op-amp circuit and then passed through another non-innverting buffer stage to lower the output impedance. The output from the buffer goes to AN4 channel (pin 16) of PIC16F689 for A/D conversion. With R4 = 1.3 K and R5 = 12 K, the overall gain of Op-amp stage is 10.23. I am using LM324 IC for the Op-amp stage. LM324 does not provided rail-to-rail swing; the maximum output is about 1.5 V less than the applied power supply voltage. In this case, LM324 is powered with 0-5 V, and therefore, the maximum output voltage could be about 3.5 V. This means the maximum input voltage to the Op-amp stage would be 3.5/10.23 = 0.342 V. This gives the maximum range of the measurable current to be 0.324/0.286 = 1.2 A. Current values higher than this will saturate the LM324 output. The range of the measurable current can be increased either by decreasing the gain of the Op-amp stage or by using  a different Op-amp IC that provides rail-to-rail output swing (0-5 V).

The preamplifier stage for the frequency counter has an RF transistor (BF199) that is collector-feedback biased using a 10 K resistor. The 1 K resistor with diodes D1 and D2 at the input side clamp the input signal levels to ±0.7 V. The 0.1 uF capacitor eliminates any dc component presented in the input signal. The amplified output is derived from the collector with a 470 Ω resistor in series and is sent to T0CKI pin of PIC16F689. The Timer0 module counts the number of incoming pulses through the T0CKi pin to determine the incoming frequency.

Pre-amplifier stage for frequency counter

PIC16F689 runs with an external 20.0 MHz crystal. A 16 x 2 character LCD (HD44780 compatible) is interfaced in 4-bit mode. Data were transferred through RB4-RB7 pins whereas the RS and E signals are controlled through RC7 and RC6 pins, respectively. A diode connected between RC1 and RA2 acts as a gating enable for frequency counter. When RC1 is high, the T0CKI input is also held high, disabling the counting process. RC1 is set to low when the microcontroller has to count the external pulses from the preamplifier stage output. The 470 Ω resistor at the output of the preamplifier stage is to prevent any possible short circuit at T0CKI pin due to the voltage conflict between pins RC1 and RA2.

Microcontroller I/O port assignments

I constructed the complete circuit on a 180 mm x 128 mm general purpose prototyping circuit board which is shown below.

The complete circuit soldered on a general purpose prototyping circuit board.

Front panel installation

A/D Conversion Math

The use of A/D conversion for voltage and current measurements require some math to re-convert the digital outputs back to the voltage and current for display. Let's work on displaying the voltage first. The analog input voltage (Va) at RA0/AN0 pin is related to the A/D conversion output (digital number, DN) as,

DN = Va * (1024/5) = 204.08 * Va   (Vref = 5 V, ADC resolution is 10-bit)

or, Va = 0.0049 * DN

But Va = Vout * R2/(R1+R2), Vout is the actual output from LM350.

=> Va = 0.2418*Vout

=> Vout = 4.136 * Va = 4.136 * 0.0049 * DN

=> Vout = 0.0203 * DN

This is the conversion equation for calculating the LM350 output voltage from the 10-bit A/D conversion result (DN) for channel AN0.

Similarly, for current measurement, the output of Op-amp (V0) is related to the AN4 channel A/D output as,

V0 = 0.0049 * DN (just as above)

But V0 is related to the load current (IL) through Rs as,

V0 = 10.23 * IL * Rs = 10.23 * 0.286 * IL = 2.926 * IL = 0.0049 * DN

=> IL = 0.001675 * DN (gives current from A/D conversion output)

As mentioned earlier, the output voltage is actually less than the calculated voltage (Vout) under load condition. This is because of the voltage drop across the shunt resistor Rs = 0.286 Ω due to current IL. The adjusted output voltage should be, therefore,

Vout = 0.0203 * DN – 0.286 x IL

Operation of Frequency Counter

The Timer0 module (no prescaler) is used as an external pulse counter whereas Timer1 module is used to generate a precise 100 ms duration as counting interval. This means that the resolution of frequency measurement is 10 Hz. This resolution is valid for frequencies up to 99990 Hz. Beyond this, the Timer0 module uses the prescaler (1:64) and the new resolution becomes 640 Hz or 0.64 KHz. As PIC16F689 is using 20 MHz clock, wit h 1:64 prescaler value, it can count frequencies over 50 MHz. The operation of frequency counter is like this.

  • Initialize Timer1 registers with appropriate values for creating 100 ms delay.
  • Enable Timer0 as counter with prescaler 1:64.
  • Count the pulses for 100 ms.
  • Frequency = 10 x No. of Pulses
  • If frequency < 99990, change prescaler to 1:1, re-calculate frequency, and display it (in Hz). Otherwise, display the frequency in KHz.


I used MikroC compiler to develop the firmware. The compiler has built-in library routines for A/D conversion, LCD display, and Timer operation. This makes the firmware development easier and quicker. Both the source code and HEX files can be downloaded from the link provided below. Configuration bits for PIC16F689 can be set using the project edit window in MikroC editor (shown below).

Project Edit window in MikroC

Download complete project source and compiled HEX files


The finished project is tested for voltage, current, and frequency measurement. The displayed voltage is cross-checked with an external voltmeter, and the readings are found consistent. A 56Ω resistor is connected as load to measure current. The output voltage is set to 5.2 V, and the displayed current is 90 mA. The ideal value of current should be 5.2/56 = 92.8 mA. This gives an error of about 3% in the measurement of current but the 56 Ω resistor itself has tolerance of 5%. The testing frequency counter is done by applying the 20 MHz microcontroller clock derived from OSC2/CLKOUT pin (3). The displayed value is 20.00128 MHz which is really close.

Testing with 20 MHz clock frequency from PIC16F689 circuit

Testing the voltage reading with an external voltmeter under no-load condition

Voltage and current under load condition (load is a 56 Ohm resistor with 5% tolerance).

With Regards,

sms communication,
Tanjore -1.

mobile :9944 186 173           

Currently have 0 comments: