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.

Quick question on figuring out the circiut

Status
Not open for further replies.

pablome

New Member
Im trying to know what values I should be using for the circuit I will attach.
 

Attachments

  • IMG.pdf
    473.3 KB · Views: 216
Well, it looks like that circuit would just blow up if you connect 120Vac to "I/P 1". What exactly is the circuit supposed to do? Is it to switch between a generator and utility supply when the power goes out? If so, you need to rectify the AC into DC before trying to use that comparator circuit. Then you'd need to scale the voltage down so you don't blow the LM311s. Opto isolators would be a good idea also.
 
Yes I will scale it down so I'll have to purchase maybe 2 PT's...
https://www.hammondmfg.com/pdf/5c0011-12.pdf

um the middle POT may be a variable one. Im just comparing the voltages than, and need to figure out the correct resistors, I guess with the formulas i wrote lalready, basic voltage divider. So yes step down to like 5V and i wanna be like between a error window od maybe 4.9-5.1 V difference between the two sources/references.
IDEA:The grid(or the lab station in school), lets say 120V Line to Neutral 60Hz from 3phase source.... is the main reference......,the motor is gonna be controlled to get it to 120V and 60 Hz and also later in sync. with the 3phase source(grid), 120degrees off from each phase- the later step to come.
Right now im gona want to compare two voltages, downscaled so my microcontroller can read them.
Just still have to figure out which resistor values to use.
I could just test with 10V or 5VDC just to see how it works as comparing the voltages, before adding in the PT too......
 
Im getting two Inputs. One Reference and one Input to compare. Vref is around 120 AC 60 HZ Single Phase from 3 phase source bench/lab supply.
Other is from 3phase synchronous motor(only gonna use one phase from it to compare). At 1800RPM supplies 60Hz and hopefully around 120V.

I want to compare the voltages, frequency/phase with some circuit and feed it to the microcontroller(motorlla 68hc11e9)
 
pablome said:
I want to compare the voltages, frequency/phase with some circuit and feed it to the microcontroller(motorlla 68hc11e9)
The safest way would be to use two step down transformers and resistive dividers to scale the AC voltage down. Then you can safely feed it into your MCUs ADC, comparator, etc.

www.electronics-made-chin said:
:confused: ,i really don't understand the electronics even though i learned some
when i was in school
:confused: ,i really don't understand the reason for your post.
Are you just spamming so we'll check out your site?
 
OK but what circuit works best or how regarding the voltage comparing.
I tried some circuits and dont think I'm getting what I want.
The MCU has an input capture to help me read the period so I know its in phase.
But how about to read if its very close to the 60Hz(frequency comparing) and voltage with like maybe 1-2% error.
 
Last edited:
For comparing voltage, peak detectors using OpAmps with the DC result fed into the HC11s ADC should work. You could also work with the raw unrectified AC into the ADC, with a suitable DC offset, to calculate the voltage difference, phase and frequency but the code will be more complex. Are you using the MCU in expanded or single chip mode?
 
Id be using the MCU in Expanded Chip mode.

Ok so for voltage comparing I don thave to rectify it but use A/D with offset, 5V max.
I have an offset circuit from lab exp and program that read in this value.
But my ordeal is to make a circuit that does the comparing.
At first I thought I could just get an output logic high or just low if they are same voltages or not.
They will never be exactly the same though...so Ill have to have a error window of 1% lets say; of 120V. And close to dead on frequency and phase.

For frequency...60Hz I was wondering again if there is a simple comparing circuit?
The MCU has Input Capture to read the period, or waveform. Dont know what circuit would be needed for that.
 
Last edited:
Id be using the MCU in Expanded Chip mode.
Then you have the option of more RAM making it easier to compare the frequency, phase and amplitude using software if you digitize the AC two waveforms with the ADC.
But my ordeal is to make a circuit that does the comparing.
Why can't you do it in software?
You could do it in hardware by using a window comparator referenced to the rectified AC, but why not use the HC11 to do this and save on parts?
For frequency...60Hz I was wondering again if there is a simple comparing circuit?
You could use a PLL if you wanted to I guess.
The MCU has Input Capture to read the period, or waveform. Dont know what circuit would be needed for that.
You'd need to convert the AC to a squarewave using a schmitt buffer before feeding it to a input capture pin.
 
Iv never used the MCU to do multitasking in c code that will compare two voltages...use PLL to compare for 60Hz, and also use the input capture pin for square wave comparison between two signals coming from a schmitt buffer circuit....

Im just not sure how itl do all that at once...

but yes, the idea of software comparing the voltages is good idea. just gota still have a circuit to step down the voltage and offset it.
I was thinking of just havening a comparing circuits too..
I have componenets like LM741, rectifier bridge IC, 2of (120 to 10 or 5V) PT's, the lm311 comparator, and even the quad....someother components too...DAC08 w/74ls324/74...MPF102 I think and the IRFZ20 for waveform signal...(regarding that, can 120V go in to Gate, 5V to Drain and pull up resistor 1K form Source to ground, source going to I/P Capture.?)...
i provided a circuit from first post that supposably did a voltage comparing..but didnt seem it it did too well for me when tried it.
 
Last edited:
You would use interrupts to do multiple tasks as needed. You could use a timer for the voltage compare routine. The timer would set the rate at which you do the comparisons. The voltage compare routine could also be in the main loop if it is a low priority for you. The input capture pins have their own interrupts and vectors. 60hz is a pretty low frequency so, with good coding, the MCU should have no problem keeping up.
What is the ultimate goal of this project?
 
IRFZ20 for waveform signal...(regarding that, can 120V go in to Gate, 5V to Drain and pull up resistor 1K form Source to ground, source going to I/P Capture.?)
Definitely not! The IRFZ20s gate can only handle 20V or so and there is no electrical isolation from the mains making this very dangerous for you and the HC11. Use a transformer to isolate and stepdown the lethal mains voltage. A pair of small AC wallwarts, rectifier, some extra filtering and a resistive divider/load are all you need to interface the HC11s ADC to the 120VAC sources. Make sure you get a wallwart without a built in rectifier so you can measure the AC frequency too.
 
why get a walwart. The AC supply will not be from a normal AC plug but termials.
I have 2 power transformers which ill reorder one cuz i might have damaged internal coils from a short or something.

also what circuit to use though, thats what im trying to figure out as much. I have an offset one but whatelse and what is it like?
help.
 
Last edited:
A pair of small transformers, rectifiers, capacitors and a resistive dividers/loads are all you need to interface the HC11s ADCs to the 120VAC sources. The component values / design depend on how fast you want it to respond and how much ripple you can tolerate.
What exactly are you trying to accomplish? This will also effect the design.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top