Author Topic: System of volts control  (Read 8998 times)

0 Members and 1 Guest are viewing this topic.

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
System of volts control
« on: April 10, 2017, 11:33:18 am »
Hi friends, help me to understand, I need to make control on arduino system of volts, it is probably possible to make also on other microcontroller when tension becomes 240 volts arduino has to see it and instantly switch-off my device and if tension lower than 170 volts fell in network it has to switch-off my device too. What scheme can be applied, probably there are schemes and a code on arduino, will be very grateful to any council, thanks.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4078
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: System of volts control
« Reply #1 on: April 10, 2017, 11:37:57 am »
You are explaining the functionality of a Voltage Monitoring Relay. You should not have to make these yourself.

There are cheaper variant than Phoenix. But since you've used a translator I'd suggest you search for them in your country.
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: System of volts control
« Reply #2 on: April 10, 2017, 11:41:57 am »
I can tell English isn't your first language, as such i may misinterpret some things.

You want your microcontroller to know when the input mains voltage is higher than 240V AC, and switch on an output of some kind, and switch it off if that mains voltage falls beneath 170V AC,

How you will want to approach it is with an Optocoupler with a suitable resistor, for the mains side,
and an op amp working as a "peak detector" on the arduino side, measuring the peak current through the optocoupler, you then measure that peak with an ADC, and set your thresholds accordingly,
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #3 on: April 10, 2017, 11:51:01 am »
I can tell English isn't your first language, as such i may misinterpret some things.

You want your microcontroller to know when the input mains voltage is higher than 240V AC, and switch on an output of some kind, and switch it off if that mains voltage falls beneath 170V AC,

How you will want to approach it is with an Optocoupler with a suitable resistor, for the mains side,
and an op amp working as a "peak detector" on the arduino side, measuring the peak current through the optocoupler, you then measure that peak with an ADC, and set your thresholds accordingly,

Excuse for my English, Rerouter yes you are right quite so and it is necessary, perhaps you know the good scheme, and it is possible to eat a code which can be finished for mine is more whole,Here approximately so has to be as here.



« Last Edit: April 10, 2017, 12:17:35 pm by Lachin012 »
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: System of volts control
« Reply #4 on: April 11, 2017, 08:25:18 am »
Here would be the basic circuit, 4N25 is an optocoupler, you will need a diode in antiparellel with it,  the 330K resistor should be 2W through hole,

The optocoupler outputs a current, this currecnt creates a voltage on the 1K resistor, the 2 op amps then switch if the voltage is higher than there set point,

The diode, resistor and capacitor on the right act like a filter, it will hold the arduino pin logic high until the next cycle arrives,

You can then use those 2 logic outputs however you decide.


 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: System of volts control
« Reply #5 on: April 11, 2017, 08:41:44 am »
Here would be the basic circuit, 4N25 is an optocoupler, you will need a diode in antiparellel with it,  the 330K resistor should be 2W through hole,

The optocoupler outputs a current, this currecnt creates a voltage on the 1K resistor, the 2 op amps then switch if the voltage is higher than there set point,

The diode, resistor and capacitor on the right act like a filter, it will hold the arduino pin logic high until the next cycle arrives,

You can then use those 2 logic outputs however you decide.
I don't see how that will work in practise, without having to be readjusted periodically.

The CTR of an opto-coupler is hugely variable and will change depending on the temperature and as the optocoupler's LED wears out.

A better way to do this would be to use a small mains transformer and a potential divider connected to the ADC of the MCU. It would still need some adjustment, as a small transformer always output a much higher voltage than its rated vale but once it's set up it won't need to be adjusted again.
« Last Edit: April 11, 2017, 01:02:45 pm by Hero999 »
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #6 on: April 11, 2017, 08:48:18 am »
Hi Rerouter thank you for the scheme and what it is necessary to use op amps? tell still please what diodes at you on the scheme and what condensers? and it is possible to use this scheme without arduino?
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #7 on: April 11, 2017, 08:50:32 am »
Hi Hero999, you can show the scheme?
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: System of volts control
« Reply #8 on: April 11, 2017, 10:23:37 am »
Hero, as there was no product lifetime given, i assumed it was a short term hobby project, as such, by keeping the led current to a rather low 1mA and no reverse potential stress, i would imagine it would last a number of months before it drifted enough to be noticible

Equally, based on the implied electrical knowledge of the op, i wanted to keep it as simple as possible,

To the op,
the op amps are acting as "Comparitors" they compare the voltage out of the optocoupler against your set points and switch if exceeded,

the condensors (Capacitors) would be 10uF electrolytic capacitors, likely 16V for a 5V supply,

And yes it could function without an arduino, attached is an approach with 3 nand gates
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: System of volts control
« Reply #9 on: April 11, 2017, 01:47:40 pm »
Hero, as there was no product lifetime given, i assumed it was a short term hobby project, as such, by keeping the led current to a rather low 1mA and no reverse potential stress, i would imagine it would last a number of months before it drifted enough to be noticible
Try building it.

Hi Hero999, you can show the scheme?
Like this.

R3 & R4 depend on the voltage on the transformer, when the mains is at the maximum voltage. For example: if you get 8V out, when the mains is at 250V and your MCU's ADC range is 0 to 5V:

VIN(P-P) = 8*20.5 = 11.314

The potential divider needs to divide by:
11.314/5 = 2.268

The ratio for R3 to R4 is 1:1.268

Suggested values for R3 & R4 to give a ratio of 1:1.25 which is near enough.
R4 = 15k
R3 = 12k

 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #10 on: April 11, 2017, 02:21:12 pm »
Hi Rerouter thank you, you can tell me what it is precisely necessary to put operational amplifiers? it is possible to learn their name.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12859
Re: System of volts control
« Reply #11 on: April 11, 2017, 02:31:32 pm »
Why even have an Arduino in the loop?  Unless its providing delays or interlocking with other circuits or providing software adjustable thresholds, you'd be better off with a LM319 dual comparator wired as a window comparator.
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #12 on: April 11, 2017, 02:35:01 pm »
Hero999 thank you, your scheme I will check too, it is possible you have a code under your scheme?
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #13 on: April 11, 2017, 02:43:33 pm »
There remains one question, perhaps someone already wrote similar code for arduino or atmega8? Tell me where to start writing code, how should this be?

Perhaps there are some other schemes that can work without arduino, I will be glad to any proposal, thank you.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: System of volts control
« Reply #14 on: April 11, 2017, 02:55:01 pm »
Hero999 thank you, your scheme I will check too, it is possible you have a code under your scheme?
No, because I haven't written any.

Fortunately, it should be fairly easy to figure out for your self. The values read from the ADC will be scaled and biased at half the supply voltage. All you need to do is work out the peak to peak voltage by subtracting the lowest value from the highest, over each mains cycle and switch the relay on/off accordingly.
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #15 on: April 11, 2017, 04:18:35 pm »
Can I apply LM339?
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12859
Re: System of volts control
« Reply #16 on: April 11, 2017, 05:36:21 pm »
Sure.  See National Semiconductor Application Note 74, Fig.9 for the basic window comparator circuit and place the relay coil (with an anti-parallel diode)  in place of the lamp.

Then all you need is a DC voltage that follows the average mains voltage reasonably accurately and quickly.   There are a number of ways of getting that.  The most popular for a standalone professional application would be to directly divide and rectify the mains.  However that would lleave the whole circuit live so is unsuitable for a novice experimentor.

The next best choice is a small transformer with an adequate voltage rating, but as you want to sense over 240V a typical small transformer wont do it. However you can get two identical transformers and put their primaries in series and their secondaries in parallel to double the primary voltage rating.  220V to 6V or 9V transformers would be ideal.  Feed that into a bridge rectifier - I'd probably use Schottky diodes for lower voltage drop and better linearity, and load the bridge output with a resistor, 220R 1W should do nicely.   

Next you need a RC filter - you probably want no more than 1% ripple which means it needs a time constant of 4.6/f.  The input frequency is 100Hz (50Hz full wave rectified) so RC needs to be 0.046.   A 1K resistor feeding a 47uF capacitor will do nicely.   If the output voltage is too high, replace the 1K resistor with a potential divider, but either keep the Thevenin equivalant resistance at 1K or scale the capacitor value to maintain the time constant.  The resulting voltage can directly feed the window comparator.  I wouldn't go above 10K for the filter resistance as you don't want the comparator's load on it to become significant.

Obviously you need a seperate regulated supply for the LM339 and relay - if yo try to use the same transformer as the control voltage it will make the relay chatter at the lower end as when it turns on the voltage will drop, causing it to turn off again.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: System of volts control
« Reply #17 on: April 11, 2017, 05:50:20 pm »
Sure.  See National Semiconductor Application Note 74, Fig.9 for the basic window comparator circuit and place the relay coil (with an anti-parallel diode)  in place of the lamp.

Then all you need is a DC voltage that follows the average mains voltage reasonably accurately and quickly.   There are a number of ways of getting that.  The most popular for a standalone professional application would be to directly divide and rectify the mains.  However that would lleave the whole circuit live so is unsuitable for a novice experimentor.

The next best choice is a small transformer with an adequate voltage rating, but as you want to sense over 240V a typical small transformer wont do it. However you can get two identical transformers and put their primaries in series and their secondaries in parallel to double the primary voltage rating.  220V to 6V or 9V transformers would be ideal.  Feed that into a bridge rectifier - I'd probably use Schottky diodes for lower voltage drop and better linearity, and load the bridge output with a resistor, 220R 1W should do nicely.   

Next you need a RC filter - you probably want no more than 1% ripple which means it needs a time constant of 4.6/f.  The input frequency is 100Hz (50Hz full wave rectified) so RC needs to be 0.046.   A 1K resistor feeding a 47uF capacitor will do nicely.   If the output voltage is too high, replace the 1K resistor with a potential divider, but either keep the Thevenin equivalant resistance at 1K or scale the capacitor value to maintain the time constant.  The resulting voltage can directly feed the window comparator.  I wouldn't go above 10K for the filter resistance as you don't want the comparator's load on it to become significant.

Obviously you need a seperate regulated supply for the LM339 and relay - if yo try to use the same transformer as the control voltage it will make the relay chatter at the lower end as when it turns on the voltage will drop, causing it to turn off again.
That's a good idea but isn't it a bit overkill?

Although less accurate, one transformer will probably do, with the reference derived from the voltage regulator powering the circuit. Relay chattering could be avoided by adding some hysteresis (more than the ripple voltage) to the comparator. It would need some adjustment but should be fairly reliable.
 
The following users thanked this post: Lachin012

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12859
Re: System of volts control
« Reply #18 on: April 11, 2017, 06:09:01 pm »
IMHO it gets rather complicated to use the same transformer for power and control, and as 1VA transformers are fairly cheap its easier for a novice to spend a little more with a higher probability of success.  You yourself proposed a dedicated control voltage transformer in reply #9 - I just pointed out that unless you want to spend a lot of money on a 380V rated control transformer, you'd need two cheap 220V ones in series/parallel to get the voltage rating.

Of course if you are willing to draw up a circuit with a single shared transformer for power and control to guide the O.P given that the input voltage range exceeds 170V to 240V (or it would be pointless), and specify critical parts, its a different matter.
« Last Edit: April 11, 2017, 06:12:49 pm by Ian.M »
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #19 on: April 11, 2017, 06:21:24 pm »
Thank you, and nevertheless what to me it is necessary to take the scheme what I could begin work and do the scheme?

I of course need the reliable scheme what well would work, I of course wanted to make on arduino, but if it is possible and without arduino that let there will be so, for me a main thing what everything would work.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: System of volts control
« Reply #20 on: April 11, 2017, 07:41:11 pm »
IMHO it gets rather complicated to use the same transformer for power and control, and as 1VA transformers are fairly cheap its easier for a novice to spend a little more with a higher probability of success.  You yourself proposed a dedicated control voltage transformer in reply #9 - I just pointed out that unless you want to spend a lot of money on a 380V rated control transformer, you'd need two cheap 220V ones in series/parallel to get the voltage rating.

Of course if you are willing to draw up a circuit with a single shared transformer for power and control to guide the O.P given that the input voltage range exceeds 170V to 240V (or it would be pointless), and specify critical parts, its a different matter.
What he really needs is a voltage measuring transformer but they're expensive. A separate 1VA transformer will do. Two in series is a bit overkill. If it's very underloaded, then it should be fairly linear.

I agree that running the circuit off the same transformer can complicate matters, introduce instability and wasn't a good suggestion for a beginner.

EDIT:
You need lots of hysteresis. Attached is a simulation showing it connected to rectified AC (simulated by V1 & Vripple). The voltage is divided by a factor of eight by R1 & R2. V2 provides the reference which is further divided by R3 to R5 to set the thresholds for the windows comparator. R6 & R7 and R8 & R9 introduce hysteresis.
« Last Edit: April 11, 2017, 09:09:08 pm by Hero999 »
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #21 on: April 11, 2017, 08:09:08 pm »
I will find the transformer for what it is necessary? you just show me what it is necessary to collect the scheme, also one transformer will be enough for me, my loading will be no more 2kW, and all this will switch-off the relay if tension 240v or 170v, it is visible on video what was made by the person if it is so possible to make me arranges it as at him on video.

 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: System of volts control
« Reply #22 on: April 11, 2017, 08:50:00 pm »
I will find the transformer for what it is necessary? you just show me what it is necessary to collect the scheme, also one transformer will be enough for me, my loading will be no more 2kW, and all this will switch-off the relay if tension 240v or 170v, it is visible on video what was made by the person if it is so possible to make me arranges it as at him on video.


Is there supposed to be someone talking in the background? It's horribly muffled.

Have you asked the creator of the video for the schematic?
 

Offline Lachin012Topic starter

  • Regular Contributor
  • *
  • Posts: 81
  • Country: tr
Re: System of volts control
« Reply #23 on: April 11, 2017, 09:06:52 pm »
Yes I wrote him, there where watched video in You Tube, but he hasn't answered me.
 

Offline Zero999

  • Super Contributor
  • ***
  • Posts: 19519
  • Country: gb
  • 0999
Re: System of volts control
« Reply #24 on: April 11, 2017, 09:22:16 pm »
The attached schematic will only work, as drawn with the transformer linked below. You could use a different transformer but component value would need to be changed.


http://www.farnell.com/datasheets/65263.pdf

Part numbers:
VB 1,0/2/6
VB 1,0/2/12
VB 1,0/1/6
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf