Maker Pro
Maker Pro

DIY UPS unit?

MagicMatt

Jun 15, 2011
70
Joined
Jun 15, 2011
Messages
70
I have an aquarium which has a pump that needs to run 24/7. The bacteria in the pump would not be able to survive for more than about 1-2 hours if the power failed, so I want something to kick in and power the pump if this happens.

Pump power requirements:
Manufaturer states it is a 5 watt motor in the pump. Having measured this, it varies from 8 watts when it first kicks in, then about 3 seconds later levels off around 5 to 6 watts. The motor is a 240V motor.

I have a DIY circuit with a PIC (16F690) that detects power failure and screams loudly (buzzer), so I see no reason that couldn't be used to also control the battery system.

This is where I get stuck. I have no idea how to build an inverter, but I have seen them on eBay for about £15. Obviously there's no charger.

What would be the easiest approach to building this, or would I do better (from a cost perspective) just to buy a cheap PC UPS?
 

daddles

Jun 10, 2011
443
Joined
Jun 10, 2011
Messages
443
You'll have to decide how long you want the pump powered from the battery backup. Personally, I would say to buy and use a cheap UPS meant for computers if it's possible, as you will save time and effort, not to mention money.

You can buy an appropriate inverter and provide e.g. a 12 volt lead-acid battery to power it (I use such a thing in my RV when we're camping). But then you have to have a way to switch the power from the line to the battery/inverter. This is not a trivial task; you may wind up backfeeding the power line and could possibly cause a safety problem to someone during a power failure. You'll probably also find that such a thing is strongly regulated by law and requires an installation be done by a qualified electrician.
 

MagicMatt

Jun 15, 2011
70
Joined
Jun 15, 2011
Messages
70
You'll have to decide how long you want the pump powered from the battery backup.

For the length of a power cut... or whatever I could get out of a cheap SLA battery.

We don't get many, when we do they don't last long, but it's a complete unknown. Generally people who do this also want to run their heater off of the system too, but I don't see that as an issue, as I think temp. drop in the room would be negligable and water holds its heat well.

Even if we said the inverter was not overly efficient under small loads, and it was a 10watt load (6 watt load and 60% efficient inverter), that's only 0.8Ah out of a cell in an hour isn't it? A 7Ah battery is only cheap, and by that account would last over 5 hours (unless I've screwed up my maths). Even a bank of good NiMH AAs (charged externally) would probably give me a couple of hours, but I want this to be something fairly self servicing, and as far as I know charging NiMH and NiCd is not straightforward.


Personally, I would say to buy and use a cheap UPS meant for computers if it's possible, as you will save time and effort, not to mention money.

That's what I figure at the moment. The cheapest I can find one is £50 new. I have no idea how it would cope with such a small load, and they're not the smallest of beasts, hence can I do it cheaper and smaller bearing in mind the tiny power requirement?

...you have to have a way to switch the power from the line to the battery/inverter. This is not a trivial task; you may wind up backfeeding the power line and could possibly cause a safety problem to someone during a power failure. You'll probably also find that such a thing is strongly regulated by law and requires an installation be done by a qualified electrician.

....surely just a simple case of switching over contacts on a relay for Live and Neutral? It's only 4 watts, so again, a 240VAC/6A rated relay could cope with 240VAC/0.02A easy....am I missing something?
 

daddles

Jun 10, 2011
443
Joined
Jun 10, 2011
Messages
443
....surely just a simple case of switching over contacts on a relay for Live and Neutral? It's only 4 watts, so again, a 240VAC/6A rated relay could cope with 240VAC/0.02A easy....am I missing something?
Nope -- it was a brain fart on my end. I was envisioning an inverter supplying your house, but that's not the case here. I agree that a simple two pole double throw relay would be adequate to transfer the load to the backup and you don't have to worry about a few missing power cycles that might hose up a computer. There will probably need to be another relay to power up the inverter appropriately.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
Inverters vary from simple square wave (easily made) to accurate sine wave (expensive). Your pump may not like a square wave inverter with its high harmonic content.

Have you considered a 12V DC pump, you will not then need an inverter?
 

MagicMatt

Jun 15, 2011
70
Joined
Jun 15, 2011
Messages
70
Inverters vary from simple square wave (easily made) to accurate sine wave (expensive). Your pump may not like a square wave inverter with its high harmonic content.

That sounds like it's going to get complex or expensive. Are you saying I should make my own inverter? I have PICs laying around so could probably generate a 50Hz sine wave to 8bit resolution, but beyond that I'm lost!.

Have you considered a 12V DC pump, you will not then need an inverter?

Aquarium filter systems are all mains voltage... moving over to a 12VDC pump would involve making my own submerged filtration unit, which would have to be both watertight and made from materials that are aquarium safe. That's surprisingly tricky, as many metals and plastics aren't.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
I am no expert on inverters but square wave inverters will be more efficient than sine wave inverters. Square wave inverters are kind to rectifier input devices.
Your pump probably has a shaded pole motor which may get hot with a lot of harmonics.
Parts for a square wave inverter would cost about £5 plus a small 9-0-9 transformer.
To get a sine wave out, you could use a sine wave oscillator driving an audio amplifier into a step-up transformer, I doubt if the efficiency would be more than 25%.

If there are some tame mathematicians around perhaps they can advise on the optimum delay on turning on the square wave to get maximum fundamental/harmonic ratio.
 

Resqueline

Jul 31, 2009
2,848
Joined
Jul 31, 2009
Messages
2,848
If you can program the PIC to give timed pulse trains on two outputs then it could be very easy to make a small DIY UPS using two transistors and a 9-0-9V transformer.
The timing is inherent to the square-root-of-two relationship, see picture. It's called a modified sine wave, gives a minimum of harmonics, and is commonly used in UPS's.
 

Attachments

  • Modified sine wave.GIF
    Modified sine wave.GIF
    2.7 KB · Views: 446

MagicMatt

Jun 15, 2011
70
Joined
Jun 15, 2011
Messages
70
I'm struggling a bit to understand this. I don't know anything about square waves and harmonics. I'm a bit lost as to how the square waves turn into a sine wave!?

25% efficient sounds a bit poor to me. All I want to do is keep that little motor running. Is there an easier way I'm overlooking?

I have quite a few "wall-wart" type power supplies not being used that have been lurking in the box for years. Could I use some part of those - get one of the transformers out perhaps, and just feed it with a sine wave?

Found this, which generates a very nice sine wave cheaply...
http://uk.rs-online.com/web/p/logic-timing-misc/6866027/
...get it set to 50Hz, then through a power transistor...
http://uk.rs-online.com/web/p/darlington-transistor/3136900/
...and into the transformer extracted from an old power supply?

By my very crude maths, I need 1Amp if it were 100% efficient, 4Amp if it were 25% efficient, and that transistor is rated 8Amp (with a heat sink obviously) so it would be ok?
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
There are many ways of generating a sine wave, the problem is making a power amplifier which is efficient. Since the voltage and current are changing over time there is always power lost in the system, hence the big heat sinks on audio amplifiers.
If you use a square wave, the output devices are either on (no voltage) or off (no current) so very little power is lost. The down side is that the square waveform contains the fundamental sine wave (wanted) and odd order components (unwanted). These harmonics will heat your motor with no benefit to the torque. Depending on the motor, it may not be a problem.
Fets make better output devices than junction transistors since they can be turned hard on and drop very little voltage. There is a plethora of these at very reasonable prices, look for one with low on resistance.

I attach a circuit of an invertor generating a modified square wave (see Resquiline above).
For a simple square wave delete the 4093. A PIC could replace both chips.
You will need a centre tapped transformer so a wall wart is not suitable
 

Attachments

  • inveror.jpg
    inveror.jpg
    52.3 KB · Views: 1,053

MagicMatt

Jun 15, 2011
70
Joined
Jun 15, 2011
Messages
70
I'm sorry, I really appreciate all the help, but I am just getting confused.

I don't understand FETs at all, which is why I always go for transistors. It's not that I don't want to understand them, but I tried to use one in a project and all I managed to do was ignite the thing and fry half the other componenets. Something to do with turning it on wrong and getting a negative voltage... I just couldn't grasp it.

I tried looking on RS for a transformer but it starts asking me for the type of transformer and there's nowhere I can see to say "9V-0-9V"... it also turned up nothing in the search. It started listing things in "micro henrys" but I don't want a small vacuum cleaner, and I have no idea what frequency response or primarey and secondary resistences are much less what values I need.

Again I'm really sorry, and thanks so much for trying to help, but I guess I'll have to abandon this as I'm obviously just not clever enough.
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
You have to be very clever to negotiate the RS on-line catalogue, everything else is easy!
I have old paper catalogues for RS and Maplin, these give:-
RS
Transformers 805-057 or 231-8252
FET IRF540N 244-9536 or HUF75333P3 294-9626
Maplin
Transformer DH26D
FET HUF75337P3

The transformers have two separate secondary windings and the end of one should be connected to the start of the other to get 9V-0-9V. They are standard 20VA mains transformers used in reverse.
I have never had trouble with fets but you need to be careful about static voltages during fitting. I am having problems with valves at present, 800V and plenty of sparks!
 

MagicMatt

Jun 15, 2011
70
Joined
Jun 15, 2011
Messages
70
Yeah, RS used to be easy to navigate, but they've changed the site layout completely in the last two weeks and so now I can't seem to find anything!

Thanks again. I will pick myself up, dust myself off, and keep trying. :)

If I'm feeding a nearly perfect (well ok, 256 steps) sine into the FET, does that improve the efficiency, or just provide a better supply for the motor?

Am I correct in thinking the main loss in efficiency is because of the transformer, and power dissipated by the FET when not "fully on" or "fully off" ?

I noticed it's a 9V not 12V transformer... am I right thinking that 12V in will give 333V out because the ratio is about 27.7:1 on the transformer, giving me 235VAC RMS ?
(I think my brain just popped).
 

duke37

Jan 9, 2011
5,364
Joined
Jan 9, 2011
Messages
5,364
A perfect 240 to 9 V transformer will have a ratio of 26.7 but things are not perfect. There will be some voltage drop due to the resistance of the windings. The 9V transformer is therefore likely to be wound to give out 10V when unloaded, a ratio of 24.
If this transformer is used in reverse, the output will be low and will drop further under load.

I think you have also understood that with 12V peak into the transformer, you get an output peak of 12V times the ratio.

The loss in a sine wave inverter is, as you say due to loss in the switching device. This can be minimised by using two devices in push-pull as in most audio amplifiers (class B). In such a configuration I think the maximum efficiency is 70% (will have to look this up) so 50% is probably the best you can do. The most of the rest of the power will go into the heat sinks. Audio amplifiers often have fairly small heat sinks and rely on low average sound out with only short peaks. In the case of an inverter, it is likely to be running flat out for a considerable time.
To drive from a micro, you will need to supply one fet with half a sine wave and then drive the other for the other half. It will be necessary to add some voltage to the sine since the fets do not turn on until the voltage has risen somewhat. A scope would be very handy for determining this level.
Depending on the voltage that the micro uses, you may need to amplify the voltage to drive the fets. Much less voltage is needed to drive junction transistors but will need current amplifiers.
 
Top