Volt-Ammeter - Page 2 - diyAudio
Go Back   Home > Forums > Amplifiers > Power Supplies

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 22nd May 2013, 02:29 PM   #11
MarianB is offline MarianB  Romania
diyAudio Member
 
MarianB's Avatar
 
Join Date: Jul 2011
Location: Romania
Send a message via Yahoo to MarianB
Indeed the sense resistor conections can be switched, thank you, that makes it possible to use single supply, but i think i still need a second amplifyer stage for greater amplification flexibility, cus when calibrating the device i need to be able to adjust the amplification in order to get the best accuracy. I would use the 5V line of the PIC controller, and LM358 operational amplifier in witch case i see that the input common mode voltage range is between -0,3V up to Vcc, so i need to make sure i do not have more that 5V on the imputs and that's a problem cus the only way i can make sure i do not have more than 5v on In+ for example at max voltage ( arround 30V ) is to have an order 6 divider there and that would mean not only no voltage amplification but rather attenuation ( is it even possible? ), a solution as i can see it would be to power the LM358 directly from the pos rail, in it's datasheet i can see that the max power supply voltage for single one is 32V, i would reduce that voltage to a max of let say 25V by use of some zenner witch would make sure that the supply voltage cannot exeed it's breakdown voltage, that way the common mode input range would increase with the output so it would be much easyer to get it right... eyther that or i am way off base here...
__________________
Trance Session Live by Dj Marik
  Reply With Quote
Old 22nd May 2013, 05:08 PM   #12
FoMoCo is offline FoMoCo  United States
diyAudio Member
 
Join Date: Dec 2012
Good point. Once you attenuate the input to stay in the common-mode range, it doesn't give you much flexibility without adjusting two resistors for gain. The second stage would make it easier to calibrate.

By the way, attenuation is possible. Short of a floating supply, that's the only way to make this work easily.
__________________
Account Deletion Requested: 1/26/2014
  Reply With Quote
Old 22nd May 2013, 05:21 PM   #13
MarianB is offline MarianB  Romania
diyAudio Member
 
MarianB's Avatar
 
Join Date: Jul 2011
Location: Romania
Send a message via Yahoo to MarianB
Great, and i was affraind to mention that word, cus i didn't wanna say something ridiculous

So when powering the OA from the PIC's power line my option would be set up the resistor vallue as so at max output i will not exceed CMIR, and then the second noninverting amplifier set's up the voltage amplification the way i need it. Now, how about the other option i have mentioned? the one that would mean poering the LM358 from a variable supply ( the pos power rail ), would it be a problem that voltage will vary?
__________________
Trance Session Live by Dj Marik
  Reply With Quote
Old 22nd May 2013, 06:25 PM   #14
diyAudio Member
 
Join Date: Jun 2011
Also check the LM358 data sheet figure 25 for an other solution...
OpAmp can be powered from your supply rails directly.
  Reply With Quote
Old 22nd May 2013, 08:28 PM   #15
MarianB is offline MarianB  Romania
diyAudio Member
 
MarianB's Avatar
 
Join Date: Jul 2011
Location: Romania
Send a message via Yahoo to MarianB
Witch datasheet are u reffering to? i've consulted more that 20 different ones but didn't find any "25'th figure"...

I am hesitating to power the 358 directly from the power rail, the voltage could exceed the maximum allowed limmit and i do not want to worry about that any time i increase the voltage on the power supply, a zenner could make sure i do not go above some chosen limmit but i worry about another thing, the power rail will varry accordingly with what i need to power at any given time, and a varrying supply i fear could do harm to the OA or to it's performance, maybe i could do with powering it from just before the series pass regulator, that way no matter what voltage level i set up for the outputs the OA will have a fixed power supply ( i will regulate it to somewhere near 30V ), so bearing that in mind it seam i have 2 possible solutions:

1.-Powering the 358 from the PIC's power supply 5V, and making sure that the OA's imputs do not exceed those 5V ( that is what is needed for the CMIR, -0,3V up to Vcc ), that will imply attenuation at the first stage, the differencial amplifier, and having a second noninverting stage with adjustable amplification to suit the needs for the PIC controller;

2.-Powering the 358 before the series pass regulator or from another power source, somwhere near 30V regulated, that way the CMIR has a much larger range, i can go with a gain of 1 witch would mean half the voltage on the output ( at any given vallue ) so far from the max cmir limmit, after that a second adjustable amplifier again to calibrate it for the PIC.

Witch one do you think would be best?
__________________
Trance Session Live by Dj Marik
  Reply With Quote
Old 22nd May 2013, 09:21 PM   #16
FoMoCo is offline FoMoCo  United States
diyAudio Member
 
Join Date: Dec 2012
Remember that the output cannot go all the way to the supply rail. If you supply it with 5V the '358 can give about 3V max output. I'd use either a 7812 (7815) regulator, or similar Zener, to supply 12 or 15 volts, respectively. This will give you more headroom on the input and require less attenuation.

Just be sure to use a 1K (or so) resistor between the '358 and the PIC, just in case the '358 delivers more than 5V for some reason. Most PICs have input diodes that allow a series resistor to be good enough protection.

One other thing to be aware of: I had a 16F685 (I assume the same ADC is used in other mid-range PICs) that would get upset when the input voltage for the ADC exceeded supply, even with the resistor. It would not be damaged or latch up. It just read 0x00 as a conversion result until power was cycled. That was frustrating to figure out.

How I fixed the problem:
Image1.png
__________________
Account Deletion Requested: 1/26/2014
  Reply With Quote
Old 23rd May 2013, 05:20 AM   #17
MarianB is offline MarianB  Romania
diyAudio Member
 
MarianB's Avatar
 
Join Date: Jul 2011
Location: Romania
Send a message via Yahoo to MarianB
I cannot be sure but i think thet in the original schematic the 5V power line for the 358 was used exactly to protect the PIC, the software written so as it could work with a variation from 0 to about 3V ( a bit more perhaps ), my big problem is that despite the fact that i do have a programmer and the PC software needed for it, i haven't the slightest ideea of how to write a software for any given PIC ( i know it's shamefull but that's the truth ) so i cannot know exactly what imput margin the software is desiged for, i've asked the one that gave me the hex file for detailes but he only sayd that it is good for 50V and 10A... i guess i just have to make sure i cannot go more than 5V on the imput and then try to calibrate it, eyther by changing the shunt as needed or by changing the amplification, i cannot see any other way...

Regarding that max 5v on the PIC imput, i've thought at first to config the shunt and amplification so as it cannot allow more than 5V at the output for those ~5A max, but it is no enough cus what if a shorted output or overload? the power supply it's self will be imune to that ( i'll make it so ) but that would mean much more than 5A current on the shunt so more than 5V on the output of the OA... please explain a bit your suggestion for this? as i see if the OA goes more than +5V D1 will be forward biased and it will carry the margin to the PIC power supply line, but woudn't that increase the pic's supply voltage? or isn't that 5V the pic's supply? I appologise if i am hard headed...
__________________
Trance Session Live by Dj Marik
  Reply With Quote
Old 23rd May 2013, 08:04 AM   #18
diyAudio Member
 
Join Date: Jun 2011
http://www.ti.com/lit/ds/symlink/lm158-n.pdf
Figure 25, page 15...
  Reply With Quote
Old 23rd May 2013, 05:27 PM   #19
MarianB is offline MarianB  Romania
diyAudio Member
 
MarianB's Avatar
 
Join Date: Jul 2011
Location: Romania
Send a message via Yahoo to MarianB
Thank you, i did found that config in other datasheets but wasn't sure if it was the one you suggested till now. I have decided tough to go with the differencial amplifier, simulations made me happy, and i will go with a separate supply for the OA, somewhere around 15 or 20V depending on what i have at my disposal, my problem now is not knowing how to write the code and so i cannot know if the old one would still work nor do i know what it exactly needs at the imput to work properly, i guess i'll just have to go by try and error... this is the code in question, too bad i do not know how to read it or edit it...
Attached Files
File Type: zip voltamper 2x24 50v@10a.zip (1.2 KB, 15 views)
__________________
Trance Session Live by Dj Marik

Last edited by MarianB; 23rd May 2013 at 05:34 PM.
  Reply With Quote
Old 23rd May 2013, 07:41 PM   #20
FoMoCo is offline FoMoCo  United States
diyAudio Member
 
Join Date: Dec 2012
That code is useless. It's in hex. There's no easy way to read it. You need the source if you want us to read it. Otherwise, just make sure you can adjust the gain until things match.

For your earlier question: It's highly unlikely that you can raise the 5V supply with the output of that op-amp.
__________________
Account Deletion Requested: 1/26/2014
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
12 volt to 300 volt inverter question for tubes yourownfree Tubes / Valves 93 30th March 2014 04:41 PM
Switching 230 Volt Transformer to 120 Volt OMNIFEX Parts 10 6th April 2008 05:34 PM
Ammeter wiring? ThSpeakerDude88 Tubes / Valves 15 5th April 2008 03:43 PM
need help about ammeter xiaonan Parts 6 13th November 2006 08:33 PM
Help changing scale of ammeter Sandy H. Parts 2 13th March 2003 01:04 AM


New To Site? Need Help?

All times are GMT. The time now is 04:37 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2