PWM relay?

For users of Matrix Multimedia Electronics software to discuss projects, circuits and any other electronics concepts.

Moderators: Benj, Mods

Post Reply
Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

PWM relay?

Post by Creative25 »

Hi
I am creating a new board.
Supply voltage is 11.5-29V
I regulate it down to 5V with an LM 7805 for the IC
I wonder if I could use a 12 Volt (omron GL5) relay with PWM.
If the voltage is greater than 12 Volt I would reduce the duty cycle accordingly.
Has anyone done this kind of thing before?
Best Regards:
Uli

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PWM relay?

Post by Enamul »

I wonder if I could use a 12 Volt (omron GL5) relay with PWM.
If the voltage is greater than 12 Volt I would reduce the duty cycle accordingly.
Why u want to use relay?

Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: PWM relay?

Post by Creative25 »

I want to bypass a speed set resistor on a 12V Compressor.
If there is no resistor the Motor runs at 2000 rpm the datasheet says.
With a resistor it runs at 3000 rpm.
I use a transistor to turn the power supply to the device on or off.
But i do not want to interfere with the electronics because i have no understanding how the electronics of this device works.
I think it might be a risk.
Best Regards:
Uli

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PWM relay?

Post by Enamul »

Hi,
I have controlled speed in an EC-FAN using PIC PWM and FC in a commercial project. It seems clear to me now why you want to use relay...i.e. to bypass resistor to change speed....although I think you could have other alternative to relay..
You have said earlier that supply voltage could be upto 29V which no good for LM7805..it will go into thermal shutdown..rather you can use LM7812 first..which will drive LM7805..so that input to LM7805 is 12V..
So, can you point out what help exactly you are looking for and brief project idea? If you have no problem to post, can you please post the link of the datasheet
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: PWM relay?

Post by Steve001 »

not sure why you want a relay via pwm ?

the maximum input voltage on most 7805's is about 18vdc?
If you need to power off 30vdc have a look at a LM317 this has a input max of 39vdc

Steve

i Have a excell file for the calculation of the resistors will post later on tonight

as prommised
Attachments
LM317 Calculator.xls
(26.5 KiB) Downloaded 850 times
LM317.pdf
(226.76 KiB) Downloaded 823 times
Last edited by Steve001 on Wed Jul 11, 2012 7:40 pm, edited 2 times in total.
Success always occurs in private and failure in full view.

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: PWM relay?

Post by Creative25 »

Thanks for your reply.
I didn't realize that the Lm7805 is only up to 18 volts.
My cirquit is now working with 11.5 to 14.5 volts. But the Compressor can work between 12 and 24 Volts.
So I would modify the cirquit so that it can also work on 24 Volts.
The Pic works on 5 volt. Unfortunately I do not have a 5 Volt relay but only a 12 Volt one which just uses the Positive supply before the regulator.
If I use a regulator for the input into the relay it would work with 12 and 24 volt. But with a minimum supply voltage of 11.5 volt I would have to go down to 9 Volts which is a bit low for a 12 volt relay. So I thought maybe to use PWM might be a easy solution.
Unfortunately the datasheet does not say much about the electronics of the control board of the compressor, except what resistor to use for what speed, and what current will flow trough the resistor.
http://www.ra.danfoss.com/TechnicalInfo ... 00b602.pdf
The electronic unit of mine is 101N200 it must be the same as the 101N210 since it does not have the AEO function.
Best Regards:
Uli

User avatar
petesmart
Valued Contributor
Valued Contributor
Posts: 395
Joined: Thu May 06, 2010 11:42 am
Location: Sydney, Australia
Has thanked: 187 times
Been thanked: 140 times
Contact:

Re: PWM relay?

Post by petesmart »

Hi,

You can drive your 12 volt relay coil via a npn transistor wired in an open collector mode... You can use a bc337 transistor or similar with a 1k resistor in series between the pic output and the base of the transistor...the emitter of the transistor goes to ground, with the collector connected to the relay. The other side of the relay goes to 12 volts pre regulator...

Don't forget to place a protection diode across the coil of the relay...

When the pic output goes high, it drives the transistor on, saturation state, which causes current to flow via the relay coil to ground via the transistor...the 12 volt reLy is isolated form the 5 volt pic..

See how you go with this..

Best

Pete
sorry about that Chief!

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: PWM relay?

Post by Creative25 »

Thanks.
That is what I do right now and it works fine.
Because I did not have a bc337 I used a mosfet.
Currently I use a supply voltage of between 11.5 and 14 volt depending on the solar system. I do not have a pre regulator because the data sheet of the 7812 says the input voltage has to be at least 2.5 volt higher than the output voltage. So what would happen at 11.5 volts input?

I would like to be able to use it on both 12 and 24volt
Since I already measure the Incoming voltage, I was wondering if I could just add Pwm and have a 50% duty cycle when it is connected to 24 volts.
Best Regards:
Uli

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: PWM relay?

Post by Benj »

Hello,

I'm not sure if this is the case but if you intend to switch the relay on and off using the PWM then this may not work as relays are generally fairly slow devices to respond and need time to allow the coil to charge or discharge. I would maybe use a transistor or a FET with a PWM signal but really this depends on what you are intending to drive with the relay.

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PWM relay?

Post by Enamul »

Hi Uli,
The electronic unit is a dual voltage device. This means that the same unit can be used in both 12V and 24V power supply systems. Maximum voltage is 17V for a 12V system and 31.5V for a 24V power supply system.
This means that you don't need and also can't use PWM for this compressure. You have to maintain 11.7V to 17V in 12V mode and 24.2V to 31.5V in 24V mode. Another important issue on this FUSE(icon 3 in figure 1 in datasheet for safety ). So, my suggestion you have to use 24V DC relay with current rating 20A to switch between two voltage mode. This relay can be switched on/off by PIC through opto-coupler plus transistor/MOSFET. DPDT Relay common will be connected to +ve terminal of compressure..NO will be connected to +12v source and NC will be connected to +24V source..or u can alter NO & NC.

So..now issue comes how will you know which source you are going to use now..you can use PIC adc to sense your voltage supply if you want to make this automatic when voltage changes relay switches to correct voltage source..(even though I don't know how you will get two discrete voltage source!). For pic power supply..as pete said best to use LM317 which will independent of voltage source can produce +5v supply.

According to datasheet, in solar application without battery you have to use 220Kohm between C&P. You can use variable resistor between C&T to have variable speed..I think you mentioned earlier you don't want to use resistor here which means that you will run the motor at 2000rpm..

I think this will help :)
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: PWM relay?

Post by Creative25 »

No I do want to use to make dual Speed
I use a resistor to set the High speed.
I have a resistor to set the speed.
When I want 2000 RPM I bypass the resistor with a relay.
For turning on and off the Compressor I simply cut the supply with a mosfet.
Everything is working fine on 12 Volt now I just want to modify it so it also can work on 24 Volts.
The things that have to be changed is the Regulator to an LM317 and I have to make a plan for the relay.
Best Regards:
Uli

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: PWM relay?

Post by medelec35 »

If it was me, I would also go along voltage regulator line.
It depends on how much current relay is going to draw.
The way you could determine correct regulator is visit a component supplier like RS
Search for liner regulator, then use filters to derive suitable component:
http://uk.rs-online.com/web/c/semicondu ... er=default
reg select.png
Not selected update yet so regulators displayed will not be correct.
(126.9 KiB) Downloaded 14696 times
E.g for 1amp max current,o/p 12V, Max input of 35V you could use LM7812ACT

I personally would not go go down PWM route. If transistor driving relay fails or microcotroller o/p stays high then relay will be burnt out.
So you will more than one component to replace if cause of failure is just one component.
Martin

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: PWM relay?

Post by Creative25 »

I think some of you misunderstood my question.
I definitely do not want to make the relay switch on and off to create a PWM signal to the compressor.
I just was thinking of using PWM to reduce the average power supply to the relay. Just use the PWM to to put the relay on High and thought it would be nice instead of burning all the energy with a regulator. But now I understand that this can be dangerous if the Pic should hang or so. I will check the data sheet of the Relay what the minimum voltage for it is. If it needs more than 9 volts I need to either find a LDO regulator or just use a 5 volt relay.
I was also wondering if i could create a simple solid state switch with two fet transistors and the sources tied together, with one drain going to the C terminal and the other going to the T terminal of the compressor, but I am a bit worried that it could interfere with the electronics of the Compressor.
Can anyone tell me if this one will work.
Best Regards:
Ueli

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PWM relay?

Post by Enamul »

Hi,
Actually I become clear after my last post. You have used relay to bypass resistor for speed change. This relay power is your issue. For 12v you can use directly power source that you have but for 24v you need to use regulator to down 24v to 12v for relay supply. But the problem is 11.5v in input drop output of regulator to less than 9v in that case relay operation will be ceased.
So two solution of the problem. .
1. You can use two 1N 4007 diode in gnd terminal of lm 7812 regulator (connection. . .Pin 2. .Anode of D1. .Cathode of D1. .Anode of D2. .Cathode of D2..ckt GND). This will change lm7812 output to 13.2v but if input becomes 11.5v of regulator and output becomes 9v but with respect to GND it will be 10.2v which is enough for relay.
2. This option is easy option. You can use SSR (solid state relay ) which can be driven by as low as 5v. .
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: PWM relay?

Post by Creative25 »

Could you tell me a bit more about a SSR
Does it it work exactly work as normal relay or does it introduce some current into the circuit that is switched?
Best Regards:
Uli

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PWM relay?

Post by Enamul »

Hi,
SSR is triac at output which is optically triggered by gate so the trigger signal has no effect on the connecting contacts.
But the problem I'm thinking now is current when you used in circuit as it is not mechanical contact like normal relay. It is semiconductor so there would be some current in play when connected.
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

Creative25
Posts: 323
Joined: Tue Sep 06, 2011 2:54 am
Has thanked: 166 times
Been thanked: 26 times
Contact:

Re: PWM relay?

Post by Creative25 »

According to the Data Sheet of the Copmressor the control current is between 2 and 5 mA
I guess I also would have to consider the on Resistance of the device.
If it is only about the on resistance I guess it should work.
Or does a solid state relay actually supply a small amount of power?
Best Regards:
Uli

User avatar
Enamul
Posts: 1772
Joined: Mon Mar 05, 2012 11:34 pm
Location: Nottingham, UK
Has thanked: 271 times
Been thanked: 814 times
Contact:

Re: PWM relay?

Post by Enamul »

Hi,
I would suggest not to use SSR after considering current issue.
Please Google HEF4052 data sheet you will details about analog switch. So the idea is to use Lm317 to get 5v output with 11.5v to 31v input.
The advantage of using the analog switch that if connected it doesn't insert anything to circuit and when disconnected it is in high impedance state and it Can be controlled by 5v signal.

Hope This will hehelp:)
Enamul
Enamul
University of Nottingham
enamul4mm@gmail.com

mikky7
Posts: 2
Joined: Tue Dec 03, 2013 1:19 pm
Contact:

Re: PWM relay?

Post by mikky7 »

I use a transistor to turn the power supply to the device on or off.

alexadam1212
Posts: 2
Joined: Fri Dec 13, 2013 10:21 am
Contact:

Re: PWM relay?

Post by alexadam1212 »

nice post

Post Reply