Forums

small (3A) AC current measurement

Started by Luis Perez November 25, 2011
On Nov 27, 4:57=A0pm, Luis Perez <lp.guan...@gmail.com> wrote:
> On 26 nov, 19:09, NT <meow2...@care2.com> wrote: > > > > > On Nov 25, 11:27=A0pm, Luis Perez <lp.guan...@gmail.com> wrote: > > > > Hi guys, > > > > I'm trying to measure resistance, current, and voltage of a resistor > > > (heater) connected to a 0-24V @ 3A transformer. > > > > The heater's consumption is actually 2A max., and I'd be controlling > > > it with a triac driven with an 8-bit micro, which I'd also use to get > > > the above readings and send them to the host. > > > > This is my initial layout: > > > >https://docs.google.com/viewer?a=3Dv&pid=3Dexplorer&chrome=3Dtrue&srci=
d=3D0Bz...
> > > > As the transformer only has 0-24V output, and I'm using the usual op- > > > amps + shunt configuration, my main worry is that what I've done is > > > actually electrically safe. > > > > Also, any other comments are also very welcome, including suggestions > > > as per the op-amps (part) to use, about the layou itself, etc. > > > > This is the "pseudo-code" I more or less have in mind for it: > > > >http://pastebin.com/X9QeJWgg > > > > Cheers, > > > If there's a safety issue I'm not seeing it, as long as you relabel > > 'N' as 'E'. > > Thanks, done. > > > Your 9v transformer gives about 13v dc, leaving Vreg to drop 8v. You > > might as well run them off the 24v psu. > > The maximum voltage the lm7805 accepts (as per it's spec) is 18V, but > even if it worked, wouldn't it get too hot?
You dont need regulation for the opamp.
> > The whole arrangement of multiple opamps seems odd. Starting with a > > differential stage might make more sense, with both inputs divided > > down to lower v. > > > NT
Luis Perez wrote:
> On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: >> Luis Perez wrote: >>> Hi Joerg, >>> On 26 nov, 00:10, Joerg <inva...@invalid.invalid> wrote: >>>> Luis Perez wrote: >>>>> Hi guys, >>>>> I'm trying to measure resistance, current, and voltage of a resistor >>>>> (heater) connected to a 0-24V @ 3A transformer. >>>>> The heater's consumption is actually 2A max., and I'd be controlling >>>>> it with a triac driven with an 8-bit micro, which I'd also use to get >>>>> the above readings and send them to the host. >>>>> This is my initial layout: >>>>> https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0Bz... >>>>> As the transformer only has 0-24V output, and I'm using the usual op- >>>>> amps + shunt configuration, my main worry is that what I've done is >>>>> actually electrically safe. >>>> If "N" means the neutral wire and not protective earth then no, it is >>>> not safe. In pretty much all jurisdictions I've dealt with it isn't >>>> allowed unless the whole thing is fully isolated per their requirements. >>>> It says "Earth Ground" at the transformers so it must be connected to >>>> PE, not N. >>> Sure. "Earth Ground" is the actual iron core. >>>> Also, the schematic doesn't say whether the two kinds of ground are >>>> connected and where. So the dividers at the opamp inputs can be floating >>>> which wouldn't be cool. >>> My fault as well. I did draw that in a rush. >> Could be worse. The ones I draw in a rush are often readble to only one >> person. Me ... >> >>> "N" is actually protective earth from mains, but the question behind >>> it was how would one procceed when a center-tapped secondary is not >>> available, yet a ground reference is needed. >> Unless it is the standard in your country for some strange reason I >> would not call that "N" :-) > > Hehe, actually N has more to do with L1 or L2 than with earth, I don't > really know why I used that, but I changed it already. > >>> I guessed I should not be using the one given by the rectifier + >>> lm7805, not that using chassis ground looked any better, but I'm now >>> thinking that if T20 weren't present at all, I should just hook a >>> rectifier hanging off T16's secondary even if it's just to get a >>> ground reference. Am I right here? >> If you keep T20. You could connect the bottom (anodes) of the rectifier >> to the top of T16. If you don't keep T20 but supply it from T16 you >> could use single-diode rectification and then ground one side of T20. >> > > Call me ignorant, but I don't use to mix circuit's ground and earth > ground. The real intent was to have an isolated ground reference for > the secondaries. >
Unless there is a compelling reason such isolation will increase the circuit complexity significantly. Also, even in your new schematic you don't really have an isolation because R44 and R40 provide a conductive path to circuit ground. That is a situation that can kill the opamp input with ESD.
> My worry was using the lm7805's ground because perhaps by mixing ac > and dc I would be pulling the 7805 (and eveything connected to it) to > -24V. I'm actually done a mess with understanding of ground after this > thread. >
You could connect the 7805 ground to a dedicated ground on the secondary of T16.
>> Keep in mind that many opamps such as the LM324 can operate all the way >> to their negative supply pin with the inputs, actaully even to 300mV >> below that. Very practical for shunt measurements. >> >> Also, opamps don't necessarily need a regulated supply if this doesn't >> have to become a scientific instrument. >> > > Thanks. Well, the max accuracy acheivable, the better. T16 is needed > anyways because will be powering the mcu. >
Unless the MCU is a major power hog you could also power that from T16. But the regulator must be able to accept a much higher input voltage or you'd have to drop that via transistor stage or zener.
>>>> Put some values on the resistors so we can all see whether it's ballpark >>>> accurate. Usually large values for the dividers and then a low-ohms >>>> shunt won't be so stellar for accuracy. >>> Well it's just an inital layout, not even parts have been selected, >>> but I was thinking just in what's needed to scale (24 * 1.414) down to >>> +2.5V, and -2.5V for the other input (or whatever else the selected >>> part's datasheet can stand. (Guess input-range amplitude, doesn't >>> affect op-amp's precission). >>> I've zero experience in the analog field, though, so that on it's own >>> needs more research. I'm reading the art of electronics, among others >>> for this. >> Michael is right, your opamps do not amplify but only compare because >> tere is no feedback on U64 and U72. Read up on differential amplifiers, >> that shows how it's done if you must have it differentially. But if you >> ground one side of T26 you may not need that. >> > > Yes, I got the initial idea very wrong it seems. >
No worries, we've all started out in analog at some point, it didn't all miraculously fall into our laps at birth :-)
>>> As per the shunt, will be a hand-wound piece of wire giving me very >>> low ohmic value at the required wattage, 0.01 or the like, or a coil, >>> which I've also been employed in other circuits for this same purpose. >>>> Can you ground one side of T16's output? That would make life a ton easier. >>>>> Also, any other comments are also very welcome, including suggestions >>>>> as per the op-amps (part) to use, about the layou itself, etc. >>>> The triac might need a snubber. Depends on the type. >>> Thanks. It also seems that I need to struggle with R154, and perhaps >>> add another resistor at the triac's gate, as it will somehow related >>> to the quadrants the triac will open. >> And right now you have D4's gate shorted but I guess you've caught that >> already :-) >> >>> I've seen triacs designed for opening at specific quadrants (like >>> nxp's bt136), and others that can open "anywhere", or at least their >>> datasheets mention (Igt) at each quadrant (like ST's TLC86B), which is >>> another one I've got at hand. >>> I do know triac's will close on their own at zero crossing. >> The datasheet also says whether they need a snubber, usually. Not sure >> about low voltage triacs though, I mostly use big ones. >> >>>>> This is the "pseudo-code" I more or less have in mind for it: >>>>> http://pastebin.com/X9QeJWgg >>>> I'll leave that to the code gurus :-) >>> No probs. But in general, does the circuit makes sense to you? >> Except for the issues menioned above, yes. The whole grounding and >> supply thing needs some redesign. And you have to get the triac out of >> the equation. >> >> You may also need a driver for U60, not sure how much muscle your MCU >> port pins have. > > Sure, it's just a led with a consumption of 20mA max. >
That's a lot. For example, if the MCU has 50ohm outputs the port pin will already drop 1V. Also, it might not quite be rated for 20mA but the datasheet will tell.
>>> I basically open the triac when the wave goes from 0 to +ve, and >>> while it's open, for a cycle I read maximum positive and negative >>> peaks before the shunt, and only max. positive peak after it. >> With "open" you mean "conducting"? Remember that it triggers a little >> later in the half wave, needs to get above the trigger current threshold >> first. >> >>> This way I can know voltage and current, and then can use ohm's law to >>> find out resistance of the heating element. I'm using peaks instead of >>> RMS because I guess is what I should use for this calculation. >>> Another idea I had in mind is placing a similar circuit behind the >>> triac, such that when I turn the triac off, I still can use a mosfet >>> or other to let 5 volts DC or so through the heater and be able to >>> monitor how it's resistance drops. >> Nah, measuring around the peak of a half wave sould be fine ... but: >> >> You need to measure the voltage only across the load (or load plus shunt >> because the shunt can be calculated out), not across the load plus the >> triac like you have it now. A triac is not an ideal zero ohms switch. If >> you ground T16 on one side this becomes easy. >> > > Nice, I didn't even think of meassuring only behind the shunt, but > yes, the whole schematics were anything but well done. I've made > another one: > > https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BziRtOXljuLhNTdhNWYwMTYtZGMxMS00N2RiLTlmZmYtMjY5ZmRmMDFmM2Y0&hl=es >
Mucho mejor. But now the shunt is missing and you still don't have a ground reference for the measurement. R40 goes to ground but the secondary of T16 is floating. D4's gate is still shorted. Looks like the values of R40 and R44 are flipped. Just cosmetic: It's customary to keep signal flows left to right, like at U60. And the port symbol should point towards R150, maybe read "from MCU pin". Just so others can understand easier.
> Was trying to simulate the circuit using gschem and ngspice, but there > seems to be some weird directives on the lm324 models I found on the > internet, cose ngspice says doesn't like them much. > > So I installed ltspice, simulated and tweaked it. I get a voltage > swing between 100mV and 4,40V on the output, which is fine at least > for get the thing going. >
In reality you will only get a realiable reading with this circuit if you ground the top of T16. And you need to add a shunt and another opamp if you still want current information. BTW, sometimes MCUs have pretty decent input circuitry if they contain an ADC. Then you don't need U64. Depends on which MCU. Some like the dsPIC need a low impedance drive or a larger capacitor which can shift the phase too much so there an opamp might be advised. However, you will always need an opamp for the current measurement because that's a very small voltage that has to be amplified.
> The problem being ltspice has only linear technology's op-amps, so, > either I study if models from other vendors can be used with it, or > pick a part number close to an lm324 or something (I used a LT1014). > > Does it looks any better now? >
Un poco, se esta mejorando :-) -- Regards, Joerg http://www.analogconsultants.com/
NT wrote:
> On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: >> On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: >>
[...]
>>>> This would be for both, allowing me to keep a constant temperature >>>> more precisely, and monitoring how the resistance drops back to room >>>> temperature according to different environmental conditions. But for >>>> now I'm more concerned with getting the initial circuit working. >>>> Can't wait to see voltage, current and resistance on my laptop's >>>> screen in "real time". It's gonna be quite an achievement! hehe. >>> Well, good luck :-) > > You've got rid of the excess opamps, but T20 is redundant, and I > reckon there's a diagram mistake with D4. Psu regulation isnt needed > for the opamp(s).
That depends. If Luis uses one of those newfangled 5V opamps he needs regulation. A LM324 doesn't need regulation. But ... then I would never drive the ADC pin directly with that. One spike on the input and the opamp would try to drive the ADC pin to 10V or so. Not sure whether the ADC input would survive that. At least that needs to be lokked at. [...] -- Regards, Joerg http://www.analogconsultants.com/
On 27 nov, 18:18, Joerg <inva...@invalid.invalid> wrote:
> NT wrote: > > On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: > >> On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: > > [...] > > >>>> This would be for both, allowing me to keep a constant temperature > >>>> more precisely, and monitoring how the resistance drops back to room > >>>> temperature according to different environmental conditions. But for > >>>> now I'm more concerned with getting the initial circuit working. > >>>> Can't wait to see voltage, current and resistance on my laptop's > >>>> screen in "real time". It's gonna be quite an achievement! hehe. > >>> Well, good luck :-) > > > You've got rid of the excess opamps, but T20 is redundant, and I > > reckon there's a diagram mistake with D4. Psu regulation isnt needed > > for the opamp(s). > > That depends. If Luis uses one of those newfangled 5V opamps he needs > regulation. A LM324 doesn't need regulation. But ... then I would never > drive the ADC pin directly with that. One spike on the input and the > opamp would try to drive the ADC pin to 10V or so. Not sure whether the > ADC input would survive that. At least that needs to be lokked at. > > [...] > > -- > Regards, Joerg > > http://www.analogconsultants.com/
Thanks, Heh, you know some spanish, don't you? What you mean with grounding at the top of T16? Forgot to ask that in my last post. I've wired as I understood it, for you to see in this last schematics: https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BziRtOXljuLhM2YwOGQyMjktY2RkZS00NjRmLWE2NjItOGFmNzE5ZDYwZWUy&hl=es But you're obviously right, one of the problems is that ground is floating. I would even use a rectifier just to get the ground reference on T26, can't wait to see this on the breadboard and play with it, hehe. I've simulated it a little bit more, and have changed the values such that input to the opamp will never exceed it's supply voltage, which is going to be 5V that it'll share with the mcu from the 7805 (unless greater voltage would be better). As you also said large resistors are evil for accuracy, would it be better to scale down the voltage divider as much as possible then? The mcu is an atmega164. It shouldn't have a problem driving the opto with 1K resistor, or even less. I've corrected the short on the triac, have mirrored it (did it to save space but looked really odd), and added the shunt. I've also uploaded an image of what ltspice has to say about the opamp subcircuit (blue trace being opamp's output, and green voltage at the voltage divider): https://docs.google.com/leaf?id=0BziRtOXljuLhNTg1MTViNjktNjVjYi00NmFjLWIzYjUtNmVhMDViNTUwMzYx&hl=es Regards,
On Nov 27, 10:04=A0pm, Luis Perez <lp.guan...@gmail.com> wrote:
> On 27 nov, 18:18, Joerg <inva...@invalid.invalid> wrote: > > > > > NT wrote: > > > On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: > > >> On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: > > > [...] > > > >>>> This would be for both, allowing me to keep a constant temperature > > >>>> more precisely, and monitoring how the resistance drops back to ro=
om
> > >>>> temperature according to different environmental conditions. But f=
or
> > >>>> now I'm more concerned with getting the initial circuit working. > > >>>> Can't wait to see voltage, current and resistance on my laptop's > > >>>> screen in "real time". It's gonna be quite an achievement! hehe. > > >>> Well, good luck :-) > > > > You've got rid of the excess opamps, but T20 is redundant, and I > > > reckon there's a diagram mistake with D4. Psu regulation isnt needed > > > for the opamp(s). > > > That depends. If Luis uses one of those newfangled 5V opamps he needs > > regulation. A LM324 doesn't need regulation. But ... then I would never > > drive the ADC pin directly with that. One spike on the input and the > > opamp would try to drive the ADC pin to 10V or so. Not sure whether the > > ADC input would survive that. At least that needs to be lokked at. > > > [...] > > > -- > > Regards, Joerg > > >http://www.analogconsultants.com/ > > Thanks, > > Heh, you know some spanish, don't you? > > What you mean with grounding at the top of T16? Forgot to ask that in > my last post. I've wired as I understood it, for you to see in this > last schematics: > > https://docs.google.com/viewer?a=3Dv&pid=3Dexplorer&chrome=3Dtrue&srcid=
=3D0Bz...
> > But you're obviously right, one of the problems is that ground is > floating. I would even use a rectifier just to get the ground > reference on T26, can't wait to see this on the breadboard and play > with it, hehe. > > I've simulated it a little bit more, and have changed the values such > that input to the opamp will never exceed it's supply voltage, which > is going to be 5V that it'll share with the mcu from the 7805 (unless > greater voltage would be better). > > As you also said large resistors are evil for accuracy, would it be > better to scale down the voltage divider as much as possible then? > > The mcu is an atmega164. It shouldn't have a problem driving the opto > with 1K resistor, or even less. > > I've corrected the short on the triac, have mirrored it (did it to > save space but looked really odd), and added the shunt. I've also > uploaded an image of what ltspice has to say about the opamp > subcircuit (blue trace being opamp's output, and green voltage at the > voltage divider): > > https://docs.google.com/leaf?id=3D0BziRtOXljuLhNTg1MTViNjktNjVjYi00NmFj..=
.
> > Regards,
How is shorting T16 going to work? Do you really think a mains transformer is cheaper than a transistor & zener? NT
Luis Perez wrote:
> On 27 nov, 18:18, Joerg <inva...@invalid.invalid> wrote: >> NT wrote: >>> On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: >>>> On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: >> [...] >> >>>>>> This would be for both, allowing me to keep a constant temperature >>>>>> more precisely, and monitoring how the resistance drops back to room >>>>>> temperature according to different environmental conditions. But for >>>>>> now I'm more concerned with getting the initial circuit working. >>>>>> Can't wait to see voltage, current and resistance on my laptop's >>>>>> screen in "real time". It's gonna be quite an achievement! hehe. >>>>> Well, good luck :-) >>> You've got rid of the excess opamps, but T20 is redundant, and I >>> reckon there's a diagram mistake with D4. Psu regulation isnt needed >>> for the opamp(s). >> That depends. If Luis uses one of those newfangled 5V opamps he needs >> regulation. A LM324 doesn't need regulation. But ... then I would never >> drive the ADC pin directly with that. One spike on the input and the >> opamp would try to drive the ADC pin to 10V or so. Not sure whether the >> ADC input would survive that. At least that needs to be lokked at. >> >> [...] >> >> -- >> Regards, Joerg >> >> http://www.analogconsultants.com/ > > Thanks, > > Heh, you know some spanish, don't you? >
Not really but I wish I could. What I do know is the important stuff such as margarita and cerveza :-)
> What you mean with grounding at the top of T16? Forgot to ask that in > my last post. I've wired as I understood it, for you to see in this > last schematics: > > https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BziRtOXljuLhM2YwOGQyMjktY2RkZS00NjRmLWE2NjItOGFmNzE5ZDYwZWUy&hl=es > > But you're obviously right, one of the problems is that ground is > floating. I would even use a rectifier just to get the ground > reference on T26, can't wait to see this on the breadboard and play > with it, hehe. >
A few comments: The triac gate is still shorted. T20 is also now shorted ... tsssst ... *POOF* :-) Run the ground at U56 pin 2 over to the top of T16 and get rid of the two other lines. U56: The shunt drops only a very low voltage so you don't need the R40/R44 divider. Get rid of R56, there should be no resistors in an opamp supply. But provide a 0.1uF bypass capacitor tight at the opamp. Also several of those at the MCU. Reduce R60 and increase R2 until you get the desired full scale rading for current. 1k for R150 sounds too high, not enough current, but I don't know what type U60 is. Also, now you have a current reading but the voltage monitoring has somehow disappeared. Ha desaparecido.
> I've simulated it a little bit more, and have changed the values such > that input to the opamp will never exceed it's supply voltage, which > is going to be 5V that it'll share with the mcu from the 7805 (unless > greater voltage would be better). >
The LM324 will be really mushy and weak with 5V single supply, then you need a lower voltage opamp. Something that is designed to work with only 5V. Keep in mind offset errors in opamps. For example, if the shunt drops 100mV full scale then the opamp can turn that into 2V or whatever the MCU wants. But if the opamp can have 10mV offset error then you can have a 10% offset and also error in the results.
> As you also said large resistors are evil for accuracy, would it be > better to scale down the voltage divider as much as possible then? >
High value resistors are ok if in a simple divider. The combination of small shunt (small voltage drop) and large value resistors you had before was not so good but that's gone now. But you can simply use a voltage divider and go into your ATMega MCU directly.
> The mcu is an atmega164. It shouldn't have a problem driving the opto > with 1K resistor, or even less. > > I've corrected the short on the triac, have mirrored it (did it to > save space but looked really odd), and added the shunt. I've also > uploaded an image of what ltspice has to say about the opamp > subcircuit (blue trace being opamp's output, and green voltage at the > voltage divider): > > https://docs.google.com/leaf?id=0BziRtOXljuLhNTg1MTViNjktNjVjYi00NmFjLWIzYjUtNmVhMDViNTUwMzYx&hl=es >
The short on the triac is still there. -- Regards, Joerg http://www.analogconsultants.com/
Luis Perez wrote:

> On 27 nov, 18:18, Joerg <inva...@invalid.invalid> wrote: > >>NT wrote: >> >>>On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: >>> >>>>On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: >> >>[...] >> >> >>>>>>This would be for both, allowing me to keep a constant temperature >>>>>>more precisely, and monitoring how the resistance drops back to room >>>>>>temperature according to different environmental conditions. But for >>>>>>now I'm more concerned with getting the initial circuit working. >>>>>>Can't wait to see voltage, current and resistance on my laptop's >>>>>>screen in "real time". It's gonna be quite an achievement! hehe. >>>>> >>>>>Well, good luck :-) >> >>>You've got rid of the excess opamps, but T20 is redundant, and I >>>reckon there's a diagram mistake with D4. Psu regulation isnt needed >>>for the opamp(s). >> >>That depends. If Luis uses one of those newfangled 5V opamps he needs >>regulation. A LM324 doesn't need regulation. But ... then I would never >>drive the ADC pin directly with that. One spike on the input and the >>opamp would try to drive the ADC pin to 10V or so. Not sure whether the >>ADC input would survive that. At least that needs to be lokked at. >> >>[...] >> >>-- >>Regards, Joerg >> >>http://www.analogconsultants.com/ > > > Thanks, > > Heh, you know some spanish, don't you? > > What you mean with grounding at the top of T16? Forgot to ask that in > my last post. I've wired as I understood it, for you to see in this > last schematics: > > https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BziRtOXljuLhM2YwOGQyMjktY2RkZS00NjRmLWE2NjItOGFmNzE5ZDYwZWUy&hl=es > > But you're obviously right, one of the problems is that ground is > floating. I would even use a rectifier just to get the ground > reference on T26, can't wait to see this on the breadboard and play > with it, hehe. > > I've simulated it a little bit more, and have changed the values such > that input to the opamp will never exceed it's supply voltage, which > is going to be 5V that it'll share with the mcu from the 7805 (unless > greater voltage would be better). > > As you also said large resistors are evil for accuracy, would it be > better to scale down the voltage divider as much as possible then? > > The mcu is an atmega164. It shouldn't have a problem driving the opto > with 1K resistor, or even less. > > I've corrected the short on the triac, have mirrored it (did it to > save space but looked really odd), and added the shunt. I've also > uploaded an image of what ltspice has to say about the opamp > subcircuit (blue trace being opamp's output, and green voltage at the > voltage divider): > > https://docs.google.com/leaf?id=0BziRtOXljuLhNTg1MTViNjktNjVjYi00NmFjLWIzYjUtNmVhMDViNTUwMzYx&hl=es > > Regards, >
The secondary of T20 that goes to the bridge rectifier has both its AC leads shorted together where you connect them to the other transformer below. Did you over look that? Jamie
On 27 nov, 22:46, Joerg <inva...@invalid.invalid> wrote:
> Luis Perez wrote: > > On 27 nov, 18:18, Joerg <inva...@invalid.invalid> wrote: > >> NT wrote: > >>> On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: > >>>> On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: > >> [...] > > >>>>>> This would be for both, allowing me to keep a constant temperature > >>>>>> more precisely, and monitoring how the resistance drops back to room > >>>>>> temperature according to different environmental conditions. But for > >>>>>> now I'm more concerned with getting the initial circuit working. > >>>>>> Can't wait to see voltage, current and resistance on my laptop's > >>>>>> screen in "real time". It's gonna be quite an achievement! hehe. > >>>>> Well, good luck :-) > >>> You've got rid of the excess opamps, but T20 is redundant, and I > >>> reckon there's a diagram mistake with D4. Psu regulation isnt needed > >>> for the opamp(s). > >> That depends. If Luis uses one of those newfangled 5V opamps he needs > >> regulation. A LM324 doesn't need regulation. But ... then I would never > >> drive the ADC pin directly with that. One spike on the input and the > >> opamp would try to drive the ADC pin to 10V or so. Not sure whether the > >> ADC input would survive that. At least that needs to be lokked at. > > >> [...] > > >> -- > >> Regards, Joerg > > >>http://www.analogconsultants.com/ > > > Thanks, > > > Heh, you know some spanish, don't you? > > Not really but I wish I could. What I do know is the important stuff > such as margarita and cerveza :-) >
Hahaha, nice! Those are actually important words when in hollidays. You can also say "birra" for cerveza.
> > What you mean with grounding at the top of T16? Forgot to ask that in > > my last post. I've wired as I understood it, for you to see in this > > last schematics: > > >https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0Bz... > > > But you're obviously right, one of the problems is that ground is > > floating. I would even use a rectifier just to get the ground > > reference on T26, can't wait to see this on the breadboard and play > > with it, hehe. > > A few comments: The triac gate is still shorted. T20 is also now shorted > ... tsssst ... *POOF* :-) > > Run the ground at U56 pin 2 over to the top of T16 and get rid of the > two other lines. U56: The shunt drops only a very low voltage so you > don't need the R40/R44 divider. Get rid of R56, there should be no > resistors in an opamp supply. But provide a 0.1uF bypass capacitor tight > at the opamp. Also several of those at the MCU. Reduce R60 and increase > R2 until you get the desired full scale rading for current. > > 1k for R150 sounds too high, not enough current, but I don't know what > type U60 is. > > Also, now you have a current reading but the voltage monitoring has > somehow disappeared. Ha desaparecido. >
Ok. I didn't have much time today, haven't been arround. There's nothing wrong using an lm324. I've got some arround I can employ for this, so I've added an lm7812 to power the opamps (is it ok, or is even better to rectify and use the 24V?), connected the ground to (now) T2 as you said, and finally removed the sort on the triac. Also, I was looking at the lm78xx datasheet, and I was wrong. The regulators accept up to 35V, but still an 7805 would get too hot off the 24V I reckon. Perhaps the 78012 (if being kept) would dissipate "acceptably" and T1 can be removed, never tried so far. For the half an hour I could spend on this today, I couldn't make LTspice show any variations in the output signal by playing with the opamp's gain after having removed the voltage divider though. Given now is powered above mcu's vcc, a biasing stage will be needed at each output to make it match. But it's fine as the lm324 stil has spare ones. This is the last version of the schematics: https://docs.google.com/viewer?a=v&pid=explorer&chrome=true&srcid=0BziRtOXljuLhMzliNDg4MGMtNzY2OC00NzM1LTllMWMtMjYxYzQ5ZDVkMDky&hl=es Regards and thanks!
> > I've simulated it a little bit more, and have changed the values such > > that input to the opamp will never exceed it's supply voltage, which > > is going to be 5V that it'll share with the mcu from the 7805 (unless > > greater voltage would be better). > > The LM324 will be really mushy and weak with 5V single supply, then you > need a lower voltage opamp. Something that is designed to work with only 5V. > > Keep in mind offset errors in opamps. For example, if the shunt drops > 100mV full scale then the opamp can turn that into 2V or whatever the > MCU wants. But if the opamp can have 10mV offset error then you can have > a 10% offset and also error in the results. >
> > As you also said large resistors are evil for accuracy, would it be > > better to scale down the voltage divider as much as possible then? > > High value resistors are ok if in a simple divider. The combination of > small shunt (small voltage drop) and large value resistors you had > before was not so good but that's gone now. But you can simply use a > voltage divider and go into your ATMega MCU directly. > > > The mcu is an atmega164. It shouldn't have a problem driving the opto > > with 1K resistor, or even less. > > > I've corrected the short on the triac, have mirrored it (did it to > > save space but looked really odd), and added the shunt. I've also > > uploaded an image of what ltspice has to say about the opamp > > subcircuit (blue trace being opamp's output, and green voltage at the > > voltage divider): > > >https://docs.google.com/leaf?id=0BziRtOXljuLhNTg1MTViNjktNjVjYi00NmFj... > > The short on the triac is still there. > > -- > Regards, Joerg > > http://www.analogconsultants.com/
On 27 nov, 22:40, NT <meow2...@care2.com> wrote:
> On Nov 27, 10:04=A0pm, Luis Perez <lp.guan...@gmail.com> wrote: > > > > > > > > > > > On 27 nov, 18:18, Joerg <inva...@invalid.invalid> wrote: > > > > NT wrote: > > > > On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: > > > >> On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: > > > > [...] > > > > >>>> This would be for both, allowing me to keep a constant temperatu=
re
> > > >>>> more precisely, and monitoring how the resistance drops back to =
room
> > > >>>> temperature according to different environmental conditions. But=
for
> > > >>>> now I'm more concerned with getting the initial circuit working. > > > >>>> Can't wait to see voltage, current and resistance on my laptop's > > > >>>> screen in "real time". It's gonna be quite an achievement! hehe. > > > >>> Well, good luck :-) > > > > > You've got rid of the excess opamps, but T20 is redundant, and I > > > > reckon there's a diagram mistake with D4. Psu regulation isnt neede=
d
> > > > for the opamp(s). > > > > That depends. If Luis uses one of those newfangled 5V opamps he needs > > > regulation. A LM324 doesn't need regulation. But ... then I would nev=
er
> > > drive the ADC pin directly with that. One spike on the input and the > > > opamp would try to drive the ADC pin to 10V or so. Not sure whether t=
he
> > > ADC input would survive that. At least that needs to be lokked at. > > > > [...] > > > > -- > > > Regards, Joerg > > > >http://www.analogconsultants.com/ > > > Thanks, > > > Heh, you know some spanish, don't you? > > > What you mean with grounding at the top of T16? Forgot to ask that in > > my last post. I've wired as I understood it, for you to see in this > > last schematics: > > >https://docs.google.com/viewer?a=3Dv&pid=3Dexplorer&chrome=3Dtrue&srcid=
=3D0Bz...
> > > But you're obviously right, one of the problems is that ground is > > floating. I would even use a rectifier just to get the ground > > reference on T26, can't wait to see this on the breadboard and play > > with it, hehe. > > > I've simulated it a little bit more, and have changed the values such > > that input to the opamp will never exceed it's supply voltage, which > > is going to be 5V that it'll share with the mcu from the 7805 (unless > > greater voltage would be better). > > > As you also said large resistors are evil for accuracy, would it be > > better to scale down the voltage divider as much as possible then? > > > The mcu is an atmega164. It shouldn't have a problem driving the opto > > with 1K resistor, or even less. > > > I've corrected the short on the triac, have mirrored it (did it to > > save space but looked really odd), and added the shunt. I've also > > uploaded an image of what ltspice has to say about the opamp > > subcircuit (blue trace being opamp's output, and green voltage at the > > voltage divider): > > >https://docs.google.com/leaf?id=3D0BziRtOXljuLhNTg1MTViNjktNjVjYi00NmFj.=
..
> > > Regards, > > How is shorting T16 going to work? Do you really think a mains > transformer is cheaper than a transistor & zener? > > NT
Thanks, I'll look for info on that and how it should be used.
On 27 nov, 23:46, Jamie
<jamie_ka1lpa_not_valid_after_ka1l...@charter.net> wrote:
> Luis Perez wrote: > > On 27 nov, 18:18, Joerg <inva...@invalid.invalid> wrote: > > >>NT wrote: > > >>>On Nov 27, 4:54 pm, Luis Perez <lp.guan...@gmail.com> wrote: > > >>>>On 26 nov, 16:18, Joerg <inva...@invalid.invalid> wrote: > > >>[...] > > >>>>>>This would be for both, allowing me to keep a constant temperature > >>>>>>more precisely, and monitoring how the resistance drops back to roo=
m
> >>>>>>temperature according to different environmental conditions. But fo=
r
> >>>>>>now I'm more concerned with getting the initial circuit working. > >>>>>>Can't wait to see voltage, current and resistance on my laptop's > >>>>>>screen in "real time". It's gonna be quite an achievement! hehe. > > >>>>>Well, good luck :-) > > >>>You've got rid of the excess opamps, but T20 is redundant, and I > >>>reckon there's a diagram mistake with D4. Psu regulation isnt needed > >>>for the opamp(s). > > >>That depends. If Luis uses one of those newfangled 5V opamps he needs > >>regulation. A LM324 doesn't need regulation. But ... then I would never > >>drive the ADC pin directly with that. One spike on the input and the > >>opamp would try to drive the ADC pin to 10V or so. Not sure whether the > >>ADC input would survive that. At least that needs to be lokked at. > > >>[...] > > >>-- > >>Regards, Joerg > > >>http://www.analogconsultants.com/ > > > Thanks, > > > Heh, you know some spanish, don't you? > > > What you mean with grounding at the top of T16? Forgot to ask that in > > my last post. I've wired as I understood it, for you to see in this > > last schematics: > > >https://docs.google.com/viewer?a=3Dv&pid=3Dexplorer&chrome=3Dtrue&srcid=
=3D0Bz...
> > > But you're obviously right, one of the problems is that ground is > > floating. I would even use a rectifier just to get the ground > > reference on T26, can't wait to see this on the breadboard and play > > with it, hehe. > > > I've simulated it a little bit more, and have changed the values such > > that input to the opamp will never exceed it's supply voltage, which > > is going to be 5V that it'll share with the mcu from the 7805 (unless > > greater voltage would be better). > > > As you also said large resistors are evil for accuracy, would it be > > better to scale down the voltage divider as much as possible then? > > > The mcu is an atmega164. It shouldn't have a problem driving the opto > > with 1K resistor, or even less. > > > I've corrected the short on the triac, have mirrored it (did it to > > save space but looked really odd), and added the shunt. I've also > > uploaded an image of what ltspice has to say about the opamp > > subcircuit (blue trace being opamp's output, and green voltage at the > > voltage divider): > > >https://docs.google.com/leaf?id=3D0BziRtOXljuLhNTg1MTViNjktNjVjYi00NmFj.=
..
> > > Regards, > > The secondary of T20 that goes to the bridge rectifier has both its AC > leads shorted together where you connect them to the other transformer > below. =A0Did you over look that? > > Jamie
Yes, thanks.