Author Topic: [SOLVED] Need help with OPAMP circuit pls.  (Read 1532 times)

0 Members and 1 Guest are viewing this topic.

Offline ChrissTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: 00
[SOLVED] Need help with OPAMP circuit pls.
« on: November 23, 2018, 01:52:24 pm »
Hi!
I made this design to control a relay with a UA741 OPAMP.

The idea is when a condition is reached (temperature HIGH or LOW) on the NTC the output of the UA741
should power on or off the relay through a transistor.

Everything is fine, and it is working well as expected, only one thing I can't figure out how to solve that
or where I made my mistake in my design.

Problem:
When the relay goes from OFF to ON or from ON to OFF it shakes, actually, there is no clean ON or OFF click on the relay.
It makes some "trrrrr" sound.  :-DD
Btw. I interchanged the BD679 with BC639.
That BD was a bit overkilled would I say.

I tried to change the R5 from 0.5M to 2M etc. but no result.
I wish to have the schematic as simple as possible, so no some extra parts to add like some IC or so if it is
possible to make the clean ON-OFF output without.

I have to say, OPAMP's are not my shiny side of knowledge.  :-[

Any advice would be nice.

Thank you.
My best regards.
« Last Edit: November 27, 2018, 10:17:06 pm by Chriss »
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: Need help with OPAMP circuit pls.
« Reply #1 on: November 23, 2018, 01:57:42 pm »
Hi!
I made this design to control a relay with a UA741 OPAMP.

The idea is when a condition is reached (temperature HIGH or LOW) on the NTC the output of the UA741
should power on or off the relay through a transistor.

Everything is fine, and it is working well as expected, only one thing I can't figure out how to solve that
or where I made my mistake in my design.

Problem:
When the relay goes from OFF to ON or from ON to OFF it shakes, actually, there is no clean ON or OFF click on the relay.
It makes some "trrrrr" sound.  :-DD
Btw. I interchanged the BD679 with BC639.
That BD was a bit overkilled would I say.

I tried to change the R5 from 0.5M to 2M etc. but no result.
I wish to have the schematic as simple as possible, so no some extra parts to add like some IC or so if it is
possible to make the clean ON-OFF output without.

I have to say, OPAMP's are not my shiny side of knowledge.  :-[

Any advice would be nice.

Thank you.
My best regards.
The left hand side of R5 should go to pin 3, the non-inverting input, not +12V. It provides positive feedback, i.e. hysteresis, so the on voltage is slightly higher than the off voltage.

R4 and R6 aren't needed. The transistor is configured as an emitter follower, thus the base current is inherently limited.

Although it will work, the uA741 isn't the best IC for this. It's an op-amp, which is designed as a linear amplifier, not a comparator. I'd recommend the LM311 which has up to 50mA of output drive and will be able to drive that relay with no external transistor.
« Last Edit: November 23, 2018, 02:08:09 pm by Hero999 »
 

Offline ChrissTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: 00
Re: Need help with OPAMP circuit pls.
« Reply #2 on: November 23, 2018, 02:04:14 pm »
Wow!
Such a fast replay! Thank you mate!

So, here is the mod of my new schematic.
Is this like you suggested?
Just to check if I understand it correct.

Thank you very much.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: Need help with OPAMP circuit pls.
« Reply #3 on: November 23, 2018, 02:08:34 pm »
Yes, that's good. It shouldn't oscillate.

It appears you're using the relay to switch mains. If so, make sure there's sufficient creepage and clearances between the mains and DC sides of the circuit to ensure protection against electric shock. Even if it works and doesn't shock you when you test it, a high voltage spike on the mains could be fatal, if the minimum creepage and clearances haven't been met.
 

Offline ChrissTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: 00
Re: Need help with OPAMP circuit pls.
« Reply #4 on: November 23, 2018, 02:17:43 pm »
Yes, you are right, I'm switching mains.
At the moment I was thinking about that what you wrote about the clearings of AC and DC side.
I didn't test it right now with a main connected, I'm playing now with the DC side to get the result I was expected.

I also was thinking to protect the circuit with some sort of painting so the painting would act as an insulator on the traces.

I don't sure does it really will do the job or should I make some other things.

The relay should drive an AC water pump which is Pmax=100w, most of the time it will work on Pmin=35w.

Do you have maybe some link with an explanation of a correct AC/DC separation etc.
or is there some rule of thumb maybe for such a circuit?

Thank you.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: Need help with OPAMP circuit pls.
« Reply #5 on: November 23, 2018, 04:08:25 pm »
Paint is typically not to be relied upon for protection against shock, since it can be easily scratched or flake off.

There are huge books and safety standards about this subject, but here's a brief summary.

Clearance is the physical distance, between two conductors.

Creepage is the tracking distance, along a surface, such as a PCB.

The minimum distance on a PCB depends on the: insulation class, voltage, material group and pollution degree. For most indoor environments, at sea level, assume a pollution degree 2.

There are four insulation classes:
Functional: just enough to ensure the device works, not required to be relied upon for protection against shock.
Basic: insulation between a live part, i.e. the mains and an earthed conductor.
Reinforced: insulation between a live part and the user, i.e. an unearthed conductive surface which which user could touch.

Material group is how vulnerable the material is to an arc tracking across its surface. If you don't know what material group your PCB material falls into, just assume IIIa or IIIb which is the worst case.

Pollution degree is a measure of how clean and dry the environment is, just assume 2 if it's to be  used indoors in a house or office.

All parts which the user could come into contact with, which aren't connected to earth shall have two layers for basic insulation (classed as double insulation) or a single layer of reinforced insulation.

As a general rule, non-hazardous power supplies, i.e. too lower voltage to shock, are treated as exposed conductors, since they typically lack enough insulation to protect against shock. Allow sufficient creepage distances for reinforced insulation.

In short, if your device run off 230V mains, is being used in a dry environment, where there's the usual amount of dust and dirt, you'd expect a typical indoor environment, then allow a distance of at least 5mm between the mains and low voltage DC sides of the circuit. If it's used outdoors, then the distances will need to increase and it should be in a suitable enclosure to protect against moisture.

Here's more information:
http://www.reo.co.uk/files/safety_7_-_low_voltage_directive.pdf
https://resources.altium.com/pcb-design-blog/high-voltage-pcb-design-creepage-and-clearance-distance
https://pcbdesign.smps.us/creepage.html
http://blog.optimumdesign.com/clearance-and-creepage-rules-for-pcb-assembly
https://www.silabs.com/documents/public/application-notes/AN583.pdf
« Last Edit: November 23, 2018, 09:21:21 pm by Hero999 »
 
The following users thanked this post: Chriss

Offline HB9EVI

  • Frequent Contributor
  • **
  • Posts: 722
  • Country: ch
Re: Need help with OPAMP circuit pls.
« Reply #6 on: November 23, 2018, 04:16:01 pm »
...something more about the circuit

what I still don't like is that relay on the emitter of the transistor. If you want the transistor acting as a switch, you have to put a resistor on the base and move the relay between Vcc and collector; the same goes for the indication led.
« Last Edit: November 23, 2018, 04:17:44 pm by HB9EVI »
 
The following users thanked this post: Chriss

Offline Benta

  • Super Contributor
  • ***
  • Posts: 6257
  • Country: de
Re: Need help with OPAMP circuit pls.
« Reply #7 on: November 23, 2018, 04:43:22 pm »
...something more about the circuit

what I still don't like is that relay on the emitter of the transistor. If you want the transistor acting as a switch, you have to put a resistor on the base and move the relay between Vcc and collector; the same goes for the indication led.

Not necessarily, the circuit is fine as it is. What you need to take care of is the rather high voltage drop over the BD679 (opamp max. output voltage + ~1.5 V), making a 9 V relay necessary.
 
The following users thanked this post: Chriss

Offline ChrissTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: 00
Re: Need help with OPAMP circuit pls.
« Reply #8 on: November 23, 2018, 09:05:47 pm »
UFFF! guys so many answers, thank you to all of you.
I really appreciate your writing and time.

So, just to clear a bit more the unit.
The unit will monitor the temperature on the pipe of a heating boiler and the NTC is the sensor which will be connected to
the copper pipe which is really conductive material together with the water inside.

When I was thinking how to realize the unit I made several points what the device must meet:
1. safety ( user and device safety )
2. simplicity of design but long life


Description of the rules of "must meet":

Safety:
The device must be safe enough so no living being can ever come in touch with the AC (main 230v).
To reach this I use professional plastic cases what are used by electricians, where the device will be set.
The enclosure should meet the maximum safety what is regulated by law and some ISO or whatever standards.
This enclosure should deliver enough good distance and insulation so nobody can come in touch with the device
whatever inside should ever happen.

I decide to use a relay so I'm actually physically separate the AC and DC circuit.
Whatever should happen on the AC side that should theoretically never reach the DC side.

For powering the unit, I use an external AC-230V/DC-12V adapter with a transformer inside,
not that cheap china AC/DC adapters without a transformer.
This type of power source should be good enough to separate the unit galvanic again from the main 230V.

The body of the water pump is connected to earth, the unit will also provide the earth to the water pump
after the water pump is connected to this device.


Simplicity:
The device should be built simple enough so I can it build from simple part's and so
make it possible to build like a DIY project by novices too.

The device should be used in an average living environmental, with average air temp, air humidity, Indore etc.
Nothing special or complicated environment...

The painting stuff:
Because I was thinking about the possibility of sparking between the traces on the PCB, I really don't know much
about the rule of thumb of a good clearance between the traces on the PCB, I read several descriptions and they are all telling different, so I decided to check how it is made in a computer UPS.
There I found a clearance around 1mm, I don't know does that will be enough but if that is made in a UPS why I should not make the same?
But, for some safety from maybe sparking between the traces where the main voltage is traveling into the relay contact and out from, I was thinking to spray it with some sort of car paint or so. That paint should deliver enough insulation
to the trace, so the possibility of creating a voltage arc should be minimized due to the painting.
This is just theoretically but I don't know does it works practically.

- nobody can come in touch with the live main voltage due to the plastic enclosure
- even if something would go wrong and the main would reach the water pump body,
 there is the earth what should trigger the main safety switch in the fuse box of the house.

This is how I was thinking when I first come to the ide to build this device.

If I do something wrong pls. let me know.

Thank you.
My best regards.

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19962
  • Country: gb
  • 0999
Re: Need help with OPAMP circuit pls.
« Reply #9 on: November 24, 2018, 10:42:53 pm »
I anticipated my reply would have caused some confusion regarding the creepage distances. The standards petty much all agree, but will give different figures, depending on the variables used.

The minimum distance depends on several factors, which I've already hinted at, but you need to research further to fully understand. For example, I mentioned the material group, which depends on the PCB material's comparative tracking index.
https://en.wikipedia.org/wiki/Comparative_Tracking_Index

Nearly all AC:DC power supplies contain transformers. Even the really cheap ones. I think what you're referring to is switched mode power supplies which have a small lightweight transformer, rather than a big and bulky iron cored transformer. There's nothing unsafe about a switched mode power supply, as long as it's decent quality and complies with all of the relevant safety standards. It will be much more efficient, than a bulky iron cored transformer based power supply, especially when lightly loaded.

As far as your UPS is concerned: are you sure you're looking at the gap between the mains and DC traces? Is the DC side connected to earth and therefore only needs basic insulation? Do you know what material group the PCB belongs to? Is it a decent quality unit, not a cheap one?

One thing you shouldn't confuse is creepage and clearance. Creepage is the distance between two tracks, along a surface and clearance is the distance between two electrodes separated by air i.e. line of sight. The minimum creepage distance for voltage, pollution degree etc.  is normally greater than the clearance, never smaller.  Quite often you''ll see slots in PCBs between two traces, to fullfil the creapage distance requirements, whist keeping within space constraints.

An interesting thing to note is that it's actually impossible for arcing to occur, between two electrodes at normal air pressure, at the typical mains voltage of 230V. Look up Paschen's law.
https://en.wikipedia.org/wiki/Paschen%27s_law

The standards use far higher voltages than the nominal mains, because it's possible for much higher spikes to occur and a huge margin of safety is required for something with the potential to kill. The maximum voltage the insulation has to withstand depends on the normal operating voltage, the class of insulation and the electrical environment. Typical withstand voltages for 230V in a domestic/office environment are 1.5kVAC for basic insulation and 3kVAC for reinforced insulation.

I recommended a distance of 5mm between the mains and DC side because it assumes the worst case, regarding material group or comparative tracking index and a normal indoor domestic environment. Obide by that and you'll be safe.
« Last Edit: November 26, 2018, 01:15:57 pm by Hero999 »
 
The following users thanked this post: Chriss

Offline ChrissTopic starter

  • Frequent Contributor
  • **
  • Posts: 534
  • Country: 00
Re: Need help with OPAMP circuit pls.
« Reply #10 on: November 26, 2018, 12:26:35 pm »
Quote
Nearly all AC:DC power supplies contain transformers.
You alright about that, I was thinking in iron core transformer where are the two coils separated from each other.
Somehow I more trustful in this type of AC/DC adapters, I also know about the efficiency of those robust old transformers but I saw a lot a time huge damage on the secondary side when that low-cost psu's are failing.
Most of the time such a failure was made because of a shored cap which is connected between the primary and sec side of the switching psu.
I can't know the quality of that almost always made in China switching mode psu's...
But however, I agree with your consideration.

Quote
As far as your UPS is concerned: are you sure you're looking at the gap between the mains and DC traces?
Yes, I look at the gap between the mains and DC trace, maybe it is 1.5mm but not more.
It is hard to measure and I have also sayit is a low-cost UPS.

Quote
I recommended a distance of 5mm between the mains and DC side...

I have a distance around 8-10mm.
So I think that will be ok.

Btw.
I made the correction as you suggested in your post here: 
Quote
November 24, 2018, 12:57:42 am
and the stuff works like a charm!
I'm very happy.
Thank you.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf