EEVblog #232 - Lab Power Supply Design Part 5

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi it's time for the next part in the power supply series I've been designing this cute little power supply and I thought would take a look at the final schematic let's go and if you remember the previous videos here's the existing circuit we already had which I breadboard it up we pretty much developed this from scratch now the the final schematic we're going to go through today is essentially exactly the same configuration as this but I've gild the lily a bit added a few niceties and put some system engineering into it I guess you could say and tada here it is is the final schematic now it might look a bit complicated that's because I've put it all sort of crammed it all onto an a4 sheet here it's not terribly modular but stick with me we'll go through it and you'll see that it's not that hard at all it's very simple first of all if you take away all the other circuitry there you'll find that this circuitry in here is pretty much identical to our existing circuit here so let's take a look at that part of it first and the current shunt that our current shunt amplifier and resistor which I've changed up here but before we do that let's just take a look at the thing for a block diagram level shall we this is exactly the same circuit we had before I've added a microcontroller down here it's an 80 mega 168 it could be an 18 mega 3 2 8 or whatever any of those are twenty eighteen eighty meters it's going to be arduino compatible because the software will be written in the arduino software environment I've added external ADC and external ADC here around here with some voltage falls and an external DAC as well now you know how I did the video on the pulse width modulation output and how you can control the output voltage occurrence with PWM I was originally going to do that because most microcontrollers are only ten bit resolution our ABCs so I don't know I decided to gild the lily a bit I wanted a bit more resolution so I'm using external 12 bit DAC and an external 12 bit ADC which we'll go into later up here we've got two LCD because we've got to have LCD display to display the voltage and current and all sorts of other stuff to nice squared C 1 going to that some push-button switches rotary encoders down here two of them one for voltage one for current decided not to use the more expensive 10 turn pots up here I've added a 5 volt USB output connector on the front panel with some iPod kind of compatible things in there so it can tell an iPod that it's a genuine charger just so that you can not power up 5 watt USB devices directly there's a couple of voltage regulators up here and here I've added I've really gilded the lily here I've added what is essentially one of my microcurrent devices into the design here so I think this is probably one of the first start power supplies bench power supplies on the market that I'm aware of anyway that can measure down to micro amps output current so I can do a massive range from anywhere from a couple of micro amps all the way up to a couple of amps with full resolution and full accuracy so that's a little nicety I've up going to the trouble dad there take a look at that but that's the basic block diagram in the previous design we used a a very crude differential amplifier here for the current shot and that's not very accurate at high resolution stuff 10 or 12 bits which we're trying to do here it's either be ok for 8 bit or something like that but so I've decided to add a maximum max 48 EF high side current sense amplifier specifically designed for the task and it does a really nice job it's only $1 or a dollar 50 or something like that so it's you know it's a reasonable price but it's very accurate and does a really good job the current shunt resistor here I've actually made up um I've well when I've laid out my board I've put in 10 1/2 1/2 what resistor and footprints in there so that you can basically get better than your are 1% typical tolerance because it's quite difficult to get in accurate precision current shop resistor like half a percent or 0.1 percent or 0.2 or something it's very difficult to actually get those very difficult and expensive to source so I've put ten resistors in parallel so hopefully if you see my previous videos on the Gaussian resistor response we should get better than the typical 1% resistors we're using the tolerance there now because we've got an intelligent controller over here we don't really need technically need a high-precision accurate resistors in all of this power supply design because we can all we can calibrate the thing and compensate for that in software but oh that's just not nice I didn't want to have to do that so I've made this overall design fairly high precision so I've used 0.1% high side current sense amplifier here of years 0.1% resistors elsewhere in the circuit down here as we'll see and the current sensor is just up well we'll see what we can get when we actually build the thing up but I'm going to try and get it as accurate as possible now you notice on my schematics that I've added these notes in various places here and I love doing that sort of thing because it just output formulas and things like that in little boxes next to the next to the actual pin that you're actually talking about and it just helps explain the schematic and when you come and look at it later all the formulas are there and you don't have to do the calculations it's all done and little notes and things you know you might add a star ground over here so you put little notes and current values and things like that that's just a nice touch to add to any schematic that you're actually doing so we're using a maximum 48 EF high side current sense amplifier and that's got a fixed gain of five it's basically a differential amplifier so it measures the differential voltage across a high side current shunt resistor we've got here and it multiplies by five and it gives you a direct voltage output referenced to ground and that's all it is very simple device and this is a quite precise one and it's at naught point one percent so with a gain of five we can do various calculations up here for various current shut sister values now I'll just mention that I'm actually using a 2.0 for 8 voltage reference here it happens to be in on ASL 2107 / it can be any one on the market really it's you know it's not too bad it's 30 ppm + minus 0.25 0.25 percent now why I'm using 2.0 for 8 volts instead of the more traditional are 2.5 volt voltage reference is because then the values that we're going to get out of our analog to digital converter are going to be spot-on we don't have to fudge them or do anything like that now I'll give you an example of that let's say we use a 2.5 volt voltage reference okay and we're using a 12 bit analog to digital converter there's going to be up to to the power of 12 or 4096 arm different steps in that analog to digital converter now if we divide our 2.5 volts maximum input to our analog to digital converter because we're using the 2.5 volt voltage reference divide that by 4096 steps you end up with some weird-ass value here the 610 or there abouts are micro volts per bit resolution on your analog to digital converter and that's that's hopeless you know if you feed in 100 you know if you're measuring a hundred bits out or something that represents a voltage of you know sixty 1.03 5 millivolts is not a nice round number it sucks so and you have to compensate for that in software you've got to actually do some math in software it's not that bad but there's a reason they make these voltage references which correspond to the like a power of two to match analog to digital converter in this case 2.0 for 8 volts but you can get 4.0 9 6 volt voltage reference there but 2.0 4 volts is more common so we're going to use that so look what happens if you're using 2.0 for 8 volts okay I'm a maximum ADC value and you divide that by your 4096 bits bingo you've got a nice round number of 500 microvolts per bit and if you have a look up here of when you translate this into your current values you end up with a very nice round 500 microamps per bit resolution or if you use different values you can have one milliamp per bit resolution precisely from the output of your analog to digital converter that works out really nice in your software I love it and that's why I've used it if we take a look at our parent shut resistor R here let's take a value of 2 ohms if you put 10 in parallel you're going to get point 2 ohms current shunt resistor now I've put up here for a gain of five in this max 4080 remember it's built in gain of five if you can get different versions our gain of 20 or I think a gain of 60 but we're going to use a gain of five and I'll tell you why in a minute and that out free that will give us because it's a gain of five okay not 0.2 ohms let's say an amp through it is not point two volts multiplied by a gain of five is one volt so you're going to get out of your account chakra at your current sense amplifier here you're going to get out one volt per amp output and of course that will give you a range because you're using a reference voltage on your analog to digital converter it's going to give you a range a usable measure of real range of zero to two point zero four eight amps and that translates to five hundred micro amps per bit resolution and you can go through let's say you wanted to use a three amp version that's LT thirty-eight EBL to 3083 then you could say set it for a four amp current range and you get what still get an excellent resolution of 1 millivolt per bit awesome and because you've used ten resistors in parallel like this say at half of what each or you might have a 1 watt resistor in there then you might have 5 watts or 10 watts dissipation capability in your current shut resistor there and that's plenty so this current shunt resistor isn't going to heat up at all so you can use you know fairly low grade ones and they're going to work quite well then to change much with temperature because they don't hear that much let's take the example of the 2 ohm resistor here if we've got two hours flowing through it I square R 2 squared is 4 and times 0.2 ohms we are only going to dissipate not point 8 watts in all of those resistors and we've got never got 5 watts total capability or 10 watts not a problem whatsoever it's not going to heat up much at all now of course the value of your current shunt resistor is going to determine how much voltage drop you get across there and depending on your input voltage over here depending on what you power it from that may be an issue in this case if we use our 0.1 ohms then we're only well in either of these two cases up here we're only talking about a naught point 4 volts maximum drop which really isn't that bad at all and you don't want to make it too low and use like a gain of 20 here or gain a 60 because then you can start getting right down into the noise and you can get errors and issues like that so you really don't want to go there you want to tolerate you want to get as maximum voltage drop across your current shunt resistor as you can tolerate and the lowest gain here so you minimize your errors so how much error can you tolerate in this amplifier here what's the minimum well it depends on your specs and what you're willing to whether or not you're willing to compensate for it in software which I don't really want to do I want to try and get the maximum possible absolute accuracy out of this thing so the input offset error that this amplifier is going to matter so you can't make this resistor shut resistor arbitrarily small because then the voltage drops going to be so small it's going to be swamped by the input offset voltage of this op amp of this amplifier here so what's the minimum that we can tolerate well it's a basic rule of thumb is that well you don't want it to be any more than one bit resolution on your analog to digital converter you want to be able to measure accurately down to your last bit why not so in this case we've got a 500 microamps per bit so 500 microamps is the minimum we can measure so if we do 500 micro amps here at times our point two I'm Raziel start there we're basically going to get a hundred micro volts drop across this resistor here so that's the minimum that we're going to get a hundred micro volts so let's go over to our datasheet here for our max 4080 device and what's its input offset voltage huh what a coincidence it's a hundred micro volts typical you could go into there but it's going to be a hundred micro micro volts input offset voltage so as you can see the max 4080 is almost ideal for this its input offset voltage is exactly the same as L minimum voltage on our input here that's pretty good I mean ideally you know if you're designing a really high precision thing you'd want it to be and maybe an order of magnitude lower you know automate it you'd lower or something like that B in this case perfect good enough we're happy for a one bit error there and of course the input offset voltage is just that it's relative to the input so this amplifier has again so the actual output error the error you're going to get on the output is the input offset voltage times five which is 500 micro volts an error on the output but because it scales up five we're still only talking about one bit error there cool coil input offset voltage beautiful and as I said you just can't make that resistor arbitrarily low because not only is their input offset voltages but then you get noise and things like that causing issues so there you go let's almost perfect that device and just to get rid of any noise I've added just a little arm RC low-pass filter there which then goes down into our existing circuit which was seen before now our constant current comparator down the bottom here and not only that if you look at the net name there it also goes over to our analog to digital converter over here one of the channels there it is a DC by out now speaking of the ADC we've used a four channel one here so it's going to measure out not only does it the outputs a carrot VY here it also measures the output current from this micro amp circuit over here so I can measure the current two different ways either in series with the output like that well they're both in series with the output I'll explain this one later but it measures the output from the micro current and I can also measure the output voltage which we'll take a look at there and also the ADC input but the voltage input as well coming from your source so then your software is able to determine whether or not it's got adequate voltage and whether or not this regulator is going to actually drop out so our 2.0 4/8 voltage reference here goes into the DAC over here the 12 bit DAC and it also goes over to our 12 bit analog to digital converter here and both of those are our devices from microchip this is the DAC is an MCP 49:22 and the ADC is an MCP 3204 so why did I choose this specific analog to digital converter and DAC well let's find out let's go into a parametric search in digi-key here let's search for ADC and we'll go down here to analog to digital converters ADC there we are almost twelve thirteen thousand of them can you believe it and here we go here's our parameters we want a 12 bit converter only there's no point searching for all the others so let's drill that down bingo has still got four thousand four hundred and thirty four different converters well because this is a kid we only want through-hole so we'll select through-hole over here and we apply the filter and bingo we are down to four hundred thirty-nine ADCs so from these particular manufacturers microchip I like them national Texas you know all the biggies are there linear analog devices but let's sort by price because we'll really I yeah I do care about I do care about price so let's search for that let's say we're going to make a hundred kits let's sort by price based on 100 and bingo what comes up first not terribly surprising microchip they make pretty cheap and log parts people think they have people mostly know them for their pic microcontrollers and stuff like that but they make some pretty cheap analog stuff I'm finding I'm using more and more of them lately so basically let's have a look at the number of converters it's only got one bang yeah I'm not too happy with that we want to basically we want something with at least four channels in there so let's select that way what's going on no I pretty sure there's a microchip one in there so something's happened to that digi-key search I don't know what's what's gone wrong there something horrible but I know here we go ah look they've digi keys got it wrong here's my converter it's a full channel it's only got what number of converters one why fail okay so much for that but there you go the cheapest device is there these are single channel dual Channel and the cheapest device for channel ADC we can get is a microchip MCP 3204 and bingo that's the one I used purely because it was the cheapest in quantities 2 dollars 40 in hundred of quantity which is you know expensive but it is a 12 bit I converter the next nearest brand is analog devices sorry Texas Instruments ATS 78 double 2 but that that might be a four-channel in an 8-pin package so really you know there's no competition the prices start going up and up and up so that's why I chose the microchip and I did exactly the same thing for the duck and the matching microchip DAC unsurprisingly I guess came up as the cheapest again so that's why I used them that's parametric search and if you're wondering why I just didn't use a microcontroller with a 12 bit analog to digital converter and PWM in it well let's take a look I've gone through and selected all the dip devices here you can't select through holes I've just want dip microcontrollers I'm searching through the 32,000 microcontrollers available from digi-key any brand-ne manufacturer so let's take a look over here ADC at 12 bits 12 bits 12 bits it gets a bit tedious you have to go through and select your 12 bit ones in here but if we do that and then if we go through and select just the ones in here with 12 bit ADCs let's not worry about the pwm at the moment cuz that's harder to find but let's just as a first pass find ones with 12 bit analog to digital converters what are we got we got freescale and we've got microchip that's it so will you at Mill fanboys out there don't come running why I didn't use some at Mill thing or some or if you're a TI fanboy I didn't use those because they're not available with a 12 bit ADC in a dip package so there you go and if we go along here and we probably search for say the best price over here let's hundred off quantity let's have a look it happens to be the free scale the HCS oh wait time that's a going to be a tiny a tiny little device that's only a 16 pin dip not enough pins 28 pin dip may or may not be enough you know it's just I don't know and then you get into the pic devices here and there are quite a few art pic devices available with 12 bit and log to digital converters but if you want one with a decent number of pins and then you'd have to go through and look at the ones that actually have a 12 bit capable pulse width modulation output it just gets trickier and trickier and well it was just all too hard so I just decided simply decided to use an external ADC and DAC and generally anyway you got to get better performance with an external ADC and DAC the ones built into micro controls and they great so when you start trying to push 12 bits inside a microcontroller and you know you're probably better off going to external 10 that's why most of them only have 10 bits because that's generally all they got up to now you see that I've got a couple of voltage buffers down here driving the ADC like this now there's a reason I've actually got that is because when you got a successive approximation ADC like this you can't have an arbitrarily high input impedance so in this case a DC V out is coming from over here look at these 10k resistors okay we've got a relatively high input impedance I'm driving this analog to digital converter and this has sample and holds in here and it can cause you all sorts of problems so it's good practice to actually buffer that so it provides a low impedance drive to your analog to digital converter these ones here don't need it because it's coming directly from the output of the op-amp here through three a little low-pass filter of 330 ohms here not a problem that's low enough not to cause an issue and the other comes from the ADC layout which is the current we looked at before once again it's 330 ohms low enough not to cause an issue and as always read the datasheet here's the ADC the mCP 3204 which is the 4 channel version also available a channel version it actually warned you about high input impedances and here's the equivalent circuit of the analog to digital converter and as you can see it's got an inbuilt our sampling switch here with an internal series resistance of 1k and that's got a twenty Pico farad's sampling capacitor on here and basically your input impedance which I just talked about over here here's your input pin so this is all inside of the ball inside now onto digital converter chip so your external impedance here will actually affect the time that this capacitor takes to charge up so that's that charge up to the value and if you got 12 bit converter it's got to get very close to the nominal value not to introduce any additional errors into your analog to digital converter and if you take a look down here they actually provide you a graph here so that actually shows you the input resistance in ohms 10k here 1k here down to 100 ohms down here and the maximum clock rate in megahertz at different voltages and as you can see if you operate in a low voltage we're operating at 3.3 volts so it's going to be like in there somewhere there's going to be another curve which goes in there and down like that as you can see if you've got a 10k input impedance it's useless to you can't get a point one percent less significant bit deviation on this thing so the input impedance matters in practice we may not need these op amps down here and if we don't need them well we can just not insert it and then just short out pins two and three and five and six they're not a problem but good practice to put it in if you need it based on your input resistance because that can affect your maximum sampling rate and by the way it's not just specific to this analog to digital converter either if you use the one inside your microcontroller you would have the same issue just beware now I've actually used a really cheap garden-variety op-amp here it's an nmj one for double 5/8 it's a variation on the very common for double 5/8 op-amp and this one has five a nominal value not a maximum value but nominal of five hundred five hundred micro volts input offset forty so that should be good enough for our circuit but as always it's a standard pin out if we need to put really a better precision op amps in there we just drop them in and as for our 12 bit DAC over here well it's pretty damn boring there's some digital input lines here it's an SPI so we've got a clock a chip select and data input a voltage reference input bypass cap and adjust output now puts two different voltages it's a dual channel 12 bit DAC this one's quite nice well for the price it's really cheap and and so that just generates our volt v set and I said exactly as we would if we hooked a pot onto here like we've seen in the previous video is all we use a pulse width modulation output from our digital or from our microcontroller here we could also drive it um but a nice good 12 bit resolution DAC that gives us some great resolution on the output and that's for our current resolution well we've already looked at that we can actually set the current limit in steps of 500 microamps brilliant over the whole range of 500 microamps to 2 amps fantastic that's the advantage you get with the 12 bit analog the 12 bit DAC if we used a 10 vet DAC you'd be looking at about 2 milliamps per bit not as good but still you know might be certainly adequate so I just gilded the lily here you could have just used the micro controller for sure depends on your requirements now as for our voltage output well our DAC is going to give out 0 to 2 point 0 for 8 volts because because that's our voltage reference coming in here so 0 to 2.0 for 8 volts I've put in a gain of 5 here in this amplifier set by these two resistors here exactly the same circuit you've seen before the tap actually comes from here so compensates for these series resistances here but that circuit has a gain of 5 so once again off of engineering note in there and there it is gain equals 5 0 to 2 point 4 8 volts input which gives a 0 to 10 point to 4 volts output with 2.5 millivolt resolution for our 12 bit and log to digital converter so we can set now output now voltage output up here on the supply in steps of 2 point 5 millivolts awesome and of course if you use the 10 bit DAC or a 10 bit PWM in your microcontroller you will get a 10 millivolt resolution Apple once again that's still adequate for most purposes I'm just gilding the lily some of you might be asking why if I put two resistors in parallel here and two resistors in series well if you'll note they're both there all 10k I've tried to basically optimize my design to reuse existing values on my sheets here so I've got done you know and 10k up there point one percent because these resistors are fairly and how it fairly expensive because they're not point one percent tolerance so I've just used it's better I think it's better to use their memories juice more of them at reduce your build materials than it is to have all these different values and over here which we'll look at later I've also used 10k there as well and 10k here so I bought you know you can buy a whole bunch of those so you can consolidate your build materials and you only have to buy the one item that's not bad so I've done that up here like for this last time you'll notice that I set my current fix current output here the LM 3 3 4 to 1 milliamp but that required an oddball value resistor here I'm not using elsewhere on my circuit so I decide to use a hundred ohm I am using elsewhere in the circuit and it's still good enough 677 micro amps good enough for a minimum load on our LT 30 80 component consolidation is one of those steps you should do in any good design so you'll see not only the resistors I've done that but also elsewhere on the circuit I've done that for the capacitors as well if I needed 4.7 micro farad's and I don't use it anywhere else well but I've used 10 micro farad somewhere else well I'm going to use a 10 micro farad in there instead of the four point seven and four output protection I've got a big nice 5 amp reverse Schottky diode there now this is the output I'm going to have a load switch our external to the board's not actually mounted on the ball that's why it's not showing here and you'll note that I'm this is my sense line that senses the output voltage goes back to the analog to digital converter down here this start net here goes down to the ADC now the reason I'm doing that is because some people like to have the sense line directly on the output so that it still reads the voltage when the switch the load switch is open others prefer it the other way around they'd like to know what the output voltage is going to be before they are or what the output voltage actually is regardless of the load switch position so this just having a separate sense line gives people the flexibility to wire it up any way they like and once again I've just got some voltage divider resist here and that will give me a certain voltage into my analog to digital converter scaled down to our meet my 2.0 for volt voltage reference and more than that it is precisely the voltage here is precisely one-fifth of the output voltage and coincidentally remember I had a times five gain over here so once again my ad that scales perfectly my F my max output voltage is ten point two four volts divided by five the max input to my ADC is going to be art two point zero four eight volts or that the output voltage divided by five so it's perfect I'm using them for maximum range of my analog to digital converter to measure my output and that's what you want you don't want to piss away any bits now as for the current limit LED indicator over here you know how I use this convoluted up here before this one to show you that you could actually do that as a sparrow bamp but that's not the nicest way it's better to actually use a second transistor here and drive it direct and that's exactly what I've done on the circuit here here's my current I my current limit comparator down here and as well as drive in the as well as driving the set pin as per normal it also drives a separate of second transistor here because we're already used on same type very cheap he already got him and that current limit goes into your microcontroller over here doesn't go directly to a lead I decided to put input pin and then you can the software can do intelligent stuff with the lead it can blink it and do all sorts of things depending on various modes so there you go and you don't need a pull-up resistor on there because you can program a pull-up resistor directly on your microcontroller here and you'll notice same with the optical rotary encoders they've got two outputs here they go directly into the microcontroller normally they need pull-up resistors on there but you can do it inside the micro no problems save a couple of resistance save some board space now let's take a look at this effectively a micro current circuit here which allows us to if you're if this lab power supply is powering your little microcontroller circuit and goes into sleep mode well you don't have to use your multimeter this sucker this power supply will be able to actually measure low value is not as good as the microcurrent it only goes down to a maximum of 2.5 micro amps per bit as we'll go into but still I don't know any other power supply that can measure the output current down to 2.5 micro amps and the way it does that is it basically this circuit doesn't operate all the time this circuit will only effectively be in use when you want to measure and you want to measure low values and your microcontroller knows that the values are very low it can switch this circuit in it does that with this MOSFET here it can switch on this and effectively insert another load because our output voltage is here's our output voltage here but the ground here's our output our negative output terminal instead of going directly to ground it goes through a current shunt resistor here at what's called a low side as opposed to the high side currents shut resistor we have up here we have an additional low side one and normally I don't like doing that because then it introduces an offset voltage error here from ground and depending upon your output current that's why at very high output currents we don't want to go through this resistor here we want to shut that excuse the pun we want to shut that through a much lower value MOSFET here so we don't get any errors introduced on our low side it's going to be effectively ground so let's say we want to only tolerate one bit resolution error on this output what value do we need well our output voltage is maximum output voltage is ten point two five volts two point 4 volts sorry divided by 4096 we have a 12 bit converter so 2 point 5 millivolts so basically our ADC down here can measure our output voltage to 2.5 million volts resolution so it'd be nice if this circuit here only dropped to point 5 millivolts or one bit or less so pretty much we want to point 5 millivolts maximum drop across this MOSFET here when it's switched on and all this circuit is disconnected on our high current range our maximum resistance there is going to be 2 point 5 millivolts divided by the 2 amps our maximum current that 1.25 million so our fit their needs to get 1 bit error is going to need one point two five in the ohms so that's actually a very low value for a MOSFET if you actually want to meet that you need a really really beefy MOSFET I've decided to use one of these it's cheap readily available in a nice package I like it it's going to be near enough it's got a rated maximum RDS on for a maximum maximum resistance of 8.4 millions but that's going to be at the maximum current it's going to be better than that at the lower current and at higher our VG essence as well or higher gate source voltages so in any case that MOSFET should give us a very insignificant error at our maximum range of two amps so as I said the software is capable of switching this MOSFET on and to do that I've actually to get a higher gate source voltage I've actually used rather than drive it directly from the microcontroller which would only be a0 to 3.3 volt now put that's not really good enough for this MOSFET I really wanted to a nice high value so I'm going to tie it to v+ here and I'm going to use an external transistor to turn it off and on so the gate voltage is going to go between zero and V Plus which is our input all the way over here so we could get in a nice high gate source voltage because the higher the gate source voltage the lower the turn-on resistance for this MOSFET so you want it as low as possible and during that 2 amp range this circuit isn't used at all it's still measuring it's trying to measure something but we don't read it at all micro doesn't read it we're doing our measurement based on this high side a current shunt resistor so I've effectively got two different current measurement ranges so let's have a look at the low value current measurement when this circuit is active now what we've got here is we've got four resistors here one on there in a series parallel combination giving a total shunt resistor here low-side shunt resistor value of 1 ohm now the reason I'm using fall like that is well not only to get a little bit extra accuracy like we did with the high side current shock resistant but a bit of margin for error in case these software selects the wrong range when it's when there's actually a high output current so in this case let's say it was to ask maximum like that and then in theory if the software accidently turned this transistor off instead of on then all that current will try and flow through the world would flow through these resistors here and we would get a power dissipation those resistors of for what so really you know if you put a tiny little resistor single resistor in there you might burn it out accidentally you don't want that to happen so a couple of extra resistors it's you know it's going to survive anyway it's still not going to be great it's going to be a very very hot but at least survive and it won't blow those resistors so if we've got a 1 ohm current shunt resistor here and 1 milliamp flow through there we're going to have 1 millivolt across here this op-amp the max 42-38 you've seen in my micro car it's exactly the same it's got a gain set by these two resistors here of 200 it's quite a high gain and so if we've got 1 milli volt drop across the shunt resistor will get nought point 2 volts output so my little engineering note here says it again at 200 the V out equals naught point 2 volts per milli air flowing through here and that can from that we can determine our maximum range because there a DC down here remember it's only 2.0 for 8 volts maximum so it can only tolerate that voltage or it can only read that voltage maximum so we can have 10 times that or roughly 10 milliamps or if you rounded-off 10.24 milliamps maximum is what this circuit is capable of measuring so the microcontroller when it when it measures over here on this shut resistor that the current drops below 10 milliamps or you can do it under manual control with one of the switches here it can automatically if it wants switch on disconnect this MOSFET and then start reading from this circuit over here so your let's say your circuits powering your microcontroller but this power supply is powering your microcontroller circuit it's just gone into sleep mode the software but this power supply can detect that and it can switch on this circuit and measure that sleep current accurately I think that's brilliant like on all power supplies have a feature like that so just let the high side current sense amplifier what is the maximum input offset voltage we can tolerate here before we start getting air as well if our maximum output is 2.0 for 8 volts ok we divide that by our 4096 we're getting 500 micro volts is our minimum on the output here so we're going to read 500 micro volts per bit 1 bit resolution here but we've got a gain of 200 so let's divide that by 200 ok and it can tolerate and that translates to 2.5 micro volts is our minimum per bit value across here and of course the only way that you're going to get an input offset a voltage error pretty much of to point down in the order of 2.5 micro volts as you seen in my micro current is to use a is to use a chopper amplifier and auto zero in amplifier which exactly what the max 42-38 is and what is its value and ultra-low nor point one volts micro volt offset voltage or than order magnitude more than what we lead that's typical but its maximum and ambient temperature or even over the full temperature range is about 2.5 microvolts so over the 4 temperature range we're only going to get one bit error fantastic more than what we need a little bit overkill but how I already use that from the microcurrent so we're going to use it here again now because I wanted to make this design into a kit I wanted all the components to be through-hole and I tried as hard as I could to make everything through hope and unfortunately the backside 42:38 is only in an Esso 8 package and likewise the max 48 years own in an Esso 8 package and the voltage reference although I can get ones in like a tio 92 package they're cheaper and more readily available especially in the 2.0 for 8 volt version in a sock 23 so they're the only three surface mount parts on the entire design everything else is through-hole and I pretty much optimized a choice parts based on through-hole availability there were maybe one or two others on the market for the current sense amp they weren't quite right and didn't have the right Dana didn't work out the values and it just wasn't nice size pretty much forced to use an SOA there and pretty much an SI over here and because I've used the chip before oh well you can't have everything you have to if you don't build this thing up you're going to have to solder a couple of SOA packages sorry and I've got a little maximum MCP 1700 3.3 volt voltage regulator there they're quite nice devices they're actually got very high very close output tolerance of a percent or less or half a percent they're really really quite nice neat you can actually use those almost as a voltage reference at an ambient temperature I think I've mentioned that before but anyway I've got a standard AM lm7805 to give our 5 volts out from our us for our USB output connector over here and because I've this is the heating I'm actually using this from electronics here in Australia um I don't think you can buy it anywhere else I think it is our specific to them it's a PCB map one it's got PCB pins it's upside down there because it was in my breadboard it's got an extra hole here so I can mount both devices on the same heating but uh-huh just be careful you don't want to put them directly on there like that because then you'll short out the tabs which are connected through to the center pin and in this case it'll be ground and output which should be shorting so if you put this package here on if you put both these packages on the same heatsink you've actually be shorting the output of your LT 3080 so oops you don't want that make sure you put our some micro washes or some sill pad in there to isolate them out from the heating now as you'll see down here with the micro I've actually used every available pin at every single one of them enter I probably goofed up here I think I'm actually going to change it because I thought I could get away with using the 8 megahertz internal oscillator in year and a bit it good enough to do my external serial rs-232 comms but to do rs-232 as a rule of thumb you need a 1% our tolerance frequency error or better and the oscillator in this thing can be trimmed to 1% or better in that software you can actually software trim it but but it's not as good as the pic 1 I've done this on the pic before and they come factory trim to 1% or better so out of the factory over-temperature you can't actually fairly reliably do rs-232 but I don't think that's the case for the Atmel so probably going to have to use I'm going to have to free up these 2 pins down the bottom and put a oscillator on there the external 8 megahertz oscillator from there or 16 or whatever you want to use which is arduino compatible you can use either and change if at all we probably use a ceramic resonator there at 8 megahertz I've got to free up 2 extra lines here so I can get that precision rs-232 serial coms out of here I think it's just you know it's good practice one of those ceramic resonators you'll get you know easily get to half a percent tolerance on those so more than good for rs-232 now there is no VAT in a separate serial port hearing to be a separate board because really I want it to be able to do a whole bunch of things be it just a standard you know 9p and rs-232 you know have an rs-232 chipped or nine pin serial interface or we can have electrically isolated because a power supply you can get major problems if you if your your connectors on the back are reference to the computer which is reference to mains earth that can be a big problem so electrical isolation can be a big issue so you can build a separate board with a USB de and isolated USB interface to rs-232 if you wanted to or you could use one of those are xB Wireless boards or something like that so this could be a wireless controlled power supply that'd be awesome there's no reason why you can't do that and all that would be fantastic so I to free up these pins basically my deck up here and my ADC over here they're both SPI input devices and because I had enough pins available I just drove them separately but what I'm going to have to do is actually combine the clock pin on both so instead of having a separate clock pin coming from the micro I'll have the same clock pin and I'll have the same data input pin as well they can be shared and I'll just have a separate chip select pin for each and separate chip select for each for the ADC and DAC and that should do it bingo i free up two pins so I can put the ceramic resonator and we're all sweet for our rs-232 and arduino compatibility and I've got the external AVR our isp interface here so you can program the chip in circuit and download your hex code to it no problems for the LCD display up here chosen a New Haven display I rather like them that they're one of the LCD manufacturers that I like their displays are quite neat and what it is is it's an I squared C interface there it is SCL and SDA that requires less pins on your microwave also I freed up pins here rather than using a standard parallel or 4-bit interface one I can get away with just well three lines actually there's an LCD reset line as well but that wasn't the only reason I'm here it is it just so happened that this some LCD fits nicely into the case that I'm using it was exactly the right dimensions and it's a 20 character by two line because I figured sixty by two probably wouldn't give be able to give the status displays that I actually wanted so it's a twenty character by two line display I squared C compatible input it's only about eight or ten bucks or something it is the most expensive component in the whole in this entire power supply project but yeah you've got to have a decent display this is actually an RGB backlight one I didn't want that but that's the only one that they had in stock for a couple of months so I'm not using the backward no just be standard but there you go I pretty much a lot of my design design decisions for this entire project were actually built around the case the actual case I'm going to build this in and another aspect I haven't talked about the project which you'll find about out about in another video and so I'll talk about that next time I think how to actually how I system engineered this thing to fit into this case because that's really a very important decision and that drove a lot of the design requirements in terms of how many switches I used to fit on my front panel whether or not I had room for a USB output connector you know the type of heat sink I use the maximum power dissipation all sorts of stuff the room I had the LCD for the controls how big I could make those the knobs how big they could be whether or not I could use ten turn pots and everything just sort of you know we're pretty much revolved around the case I'm using so this videos been long enough I'll have to make that a separate video and I've already designed the PCB for this think I've got some time-lapse video of me doing that so there'll be a couple more videos coming up in fact probably more than that two or three coming up to finish off this power supply project so thanks see you next time
Info
Channel: EEVblog
Views: 143,273
Rating: 4.9462519 out of 5
Keywords: Laboratory, lab, power, supply, design, dac, adc, pwm, atmel, avr, isp, microchip, pic, newhaven, lcd, display, 16x2, 20x2, rotary, encoder, schematic, opamp, lt3080, lt3083, linear, technology, constant, current, sense, amplifier, high, side, low, Electronics, usb, charger, circuit, i2c, open, source, hardware, oshw, creative, commons, ucurrent, microcurrent, measurement
Id: Lg6oYFerUlA
Channel Id: undefined
Length: 51min 30sec (3090 seconds)
Published: Mon Jan 02 2012
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.