Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Microcontroller based UPS

Status
Not open for further replies.

grandestlama

New Member
Hello,

I Am currently designing an Uninterruptible power supply unit. I am thinking of making it

"PIC based". Since I know more Java than assembly, I would like to ask the following

questions -

1. Can a PIC simultaenously handle generation of a 50Hz sine wave, Monitor battery level -

and trigger warning beeps or device shut down based on this, Compensate for battery drift

(by generating the sine wave at a suitable amplitiude), and send/receive status/control

information from a PC serially (or otherwise) ?

2. If your answer to the above is YES, then how complex will co-ordinating these task be in

the absence of multi threading. Do you think the microcontroller is an overkill or can

such feautures (probably excluding the PC control/status portion) be "more convineintly" be

implemented without a microcontroller ?


My aim is to realize an uninterruptible power supply unit (with or without a

microcontroller) that has the following features :

A form of output voltage control/regulation such that when the battery voltage is reduced

(before it reaches the lower threshold), the output voltage does not deviate much from the

norminal value.

OVER-DISCHARGE protection scheme for the battery - such that the UPS automatically shuts

down when the baterry reaches a specific lower voltage threshold in the absence of public

power.

A "reasonably" sinusoidal waveform as output.

OVERCHARGE protection scheme for the battery - such that the the battery charging

automatically stop when the battery is fully charged.

Power cut warning (a beeping sound)



I am thinking that it could be possible to obtain a sine wave by storing the sine amplitude

of regular intervals (for one cycle) as byte values in EEPROM, which could be read out by

the PIC to a DAC, giving rise to the analog sine wave. Is there a better method ?


If anybody has a useful idea or any link or circuit diagram, etc, PLEASE share it with me.

Thank you.
 
A UPS generally does not generate a square wave, but rather a modified square wave.

1. No problem at all.
2. No problem at all.

Is it overkill? Well, the tasks listed would consume only a small fraction of both available processing time and available memory space on most parts. But, it only costs $5-$10. When you consider how easy it is to design, how reliable & featured you can make it, and how many external components you will save, it's a no-brainer.

Use the extra capacity to throw in an LCD driver. You can read out all the voltage, etc info straight off the hardware.
 
Sample UPS project

Microchip has an excellent project report on their website. Search for "Picref-1". I haven't actually used it to build one but the information appears to very comprehensive.

Have fun
Rajiv
 
I've done a very large UPS used for upto 10 PC in 10hours. However, it's a commercial project, I cannot tell more about it. But I've done it with a PIC16f76. Everything is oki.

You need a 2 H bridges to creat 50Hz (but I prefer to 60Hz).

The key point is this H bridge. And the sin wave was made effectively.

With 50Hz pulses, I use timer0 to control it with interrupts. PIC is used at 4MHz crystal. My algorithm is as very simple as this:

pin1 creat 50Hz
pin2 creat 50Hz

These 2 pins make the sin wave.

Note that we have 4 state, pin1 L pin2 L, pin1H, pin2L, pin1L pin2L, pin1L pin2H.

Remember these states, and you BSF and BCF these pins relatively each interrupt of timer0 overflow.

I don't send any control to PC, everything is controlled by PIC. Read all ADC, than control the PIC. The source code is only about 1 or 2 Kwords.
 
When you do the pulse width modulation, you can just store the widths for one quarter of the sinusoid. Based on your switching frequency, you might need many values stored, but it gives you a nice looking sinusoid when you are finished.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top