Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: corrado33 on April 08, 2010, 08:28:32 AM

Title: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 08, 2010, 08:28:32 AM
So most of the power supply threads on this site are usually "How do I make a stable power supply for my robot with these batteries?" Or "How do I make an adjustable lab bench power supply?"

My question is, how do I make a 120VAC to 12VDC (or even 5VDC) power supply at 1ish amps.  Soeren I know you're going to read this, and yes I'm trying to make a power supply for my Moving Moonlight.  I don't want to make it adjustable, it doesn't have to deliver 15 Amps.  It CAN'T be a hard circuit, because all of the power supplies we have today for our cell phones, handheld games, etc are so small, and I bet most of the space is capacitors.  Basically I want to make this thing...

http://www.wolfesgps.com/store/index.php?main_page=product_info&cPath=10&products_id=55 (http://www.wolfesgps.com/store/index.php?main_page=product_info&cPath=10&products_id=55)

I mean what really is in that thing?  If I knew that, I'd just buy the parts and incorporate it into my design.  Of course I don't really want it to be a cigarette outlet, but that's just connections.  
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: waltr on April 08, 2010, 10:23:21 AM
There most likely is a switching PS inside that wall wart. Switchers are not that easy to make and match the efficiency and cost of the many commercially available ones. If you want one of these just buy it unless you really wish to spend lots of time learning.

The older wall warts, they are slightly larger and heavy, are just a step-down transformer, rectifier and filter caps and may or may not have a linear regulator inside. These are rather simple to build.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: z.s.tar.gz on April 08, 2010, 05:33:52 PM
My first thought is this:

Use a transformer to step down the voltage
Use diodes to convert AC to DC
Regulate it

Not very hard in my opinion, you can probably find premade schematics around the google-net.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: madsci1016 on April 08, 2010, 07:09:09 PM
My suggestion is to find a DC wall wart that's 12V+ at 1 Amp, and add a 12V voltage regulator. Most wall warts are unregulated, meaning when they say 12V, it's usually higher.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 08, 2010, 07:50:33 PM
I would find a wall wart thing, but I'm trying to put this into something that I might sell a few of, so I can't simply "find" things and incorporate them.  I might be able to find one or two laying around the house, but that's no good.  So does anyone know of a schematic that does something like this?  I've searched, but I can't find simple ones, I usually find adjustable ones.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: chelmi on April 08, 2010, 07:55:48 PM
You can buy it from digikey or mouser. And probably from other stores online.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 09, 2010, 07:32:27 AM
Hi,

I would find a wall wart thing, but I'm trying to put this into something that I might sell a few of, so I can't simply "find" things and incorporate them.
In how large numbers?
If a few are less than eg. 100 pieces, then your best bet is to find a place to get that number of wall warts with a slightly higher voltage or even AC warts (should be cheaper) and put the rectification and regulation on the board.
The reason for all the darned wall warts that clutters our home these days is (besides the easier going international), that if you have mains on your board, you are responsible for faults, but if you just buy the stuff, the manufacturer gets the blame.
You cannot allow yourself to be open to lawsuits when someones house is burning down or a kid is getting electrocuted, so pass this responsibility on to somebody else by buying warts for your board.

The reason to have regulation on-board is like madsci1016 (1016?) allready posted.


[...] does anyone know of a schematic that does something like this?
What voltage do you want?
And do you want to use some generic wall wart or would you rather have the entire thing on-board and mains voltage on the PCB?
Anything is possible, but I think you should consider the wall wart - your decision though.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: waltr on April 09, 2010, 07:50:34 AM
When I posted above I didn't know you wanted this for a product to sell. I thought you just wanted to learn how to build a PS (this is a hobbyist forum for the most part).

Since you want to sell your product Søren's advice is very good. Leave the Mains voltage issues to some else.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 09, 2010, 10:03:08 AM
I guess it seems as if I should buy a wall wart and leave the mains voltage to someone else.  I think I might try to buy DC ones, as regulating those is easy.  (For me at least), but depending on the price, I might have to go with AC.  I honestly didn't know you could buy them that's why I didn't think about using them. 

How much harder is it to go with an AC wall wart, and make it DC, than to simply go with a DC one... Also, which one would be cheaper in the long run.

For DC power...
Do you guys think I should go with 12V, in case I want to incorporate anything else later, or should I go with 5V, because that's all I really need (and regulation will be really easy).

I just searched on DigiKey and only found "power supplies" and not the things you plug into walls.  Could someone post a link to a wall wart on digikey?

Thanks for all the help guys!

EDIT:  Sorry, I found the wall ones, they were in a different section.  They're not that expensive.  About 7 bucks. for AC to DC, and I saw one AC to AC I could use around 4 bucks. 
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: chelmi on April 09, 2010, 11:01:45 AM
For DC power...
Do you guys think I should go with 12V, in case I want to incorporate anything else later, or should I go with 5V, because that's all I really need (and regulation will be really easy).

Bear in mind that linear regulator have a drop out, i.e. you will need more than 5V to get a regulated 5V. The exact drop out depends on the regulator.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: waltr on April 09, 2010, 01:50:27 PM
Here's a link the AC adapters at Mouser:
http://www.mouser.com/Search/Refine.aspx?Keyword=Plug-In+AC+Adapters (http://www.mouser.com/Search/Refine.aspx?Keyword=Plug-In+AC+Adapters)
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 09, 2010, 02:32:09 PM
Hi,

They seem a little expensive for AC output, especially when you buy more, discounts should be higher IMO.
This is a fairly cheap 5V/500mA adapter (http://www.dealextreme.com/details.dx/sku.34296) that probably work right out of the box (for $5.22 each)

And while Dealextreme seems cheap, they're actually pretty expensive compared to Chinese companies (in general) with less web presence, so finding one (that's still producing reliable quality) might get the price down to $1..$2 a pop in quantities - and one can allways buy a smaller sample quantity at the low (high quantity) price to assert the quality.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 09, 2010, 10:01:19 PM
Thanks again!  I'll probably end up buying one from digikey, as I'm not going to cry over a few dollars here or there.  I'll probably end up buying one at 6.5V or 9V and regulating it down (with a nice big fat heatsink on the regulator ;) )  I really appreciate it guys, you really help when putting a project together. 

So, just a quick question.  If something can provide .5 amps at 9V, it can provide .9 amps at 5V?  I know the regulator will take some power, but how much?  Secondly, since I'd be using LEDs that will probably run at 3.5ish V and 30ish mA, and I'd be controlling them with resistors, how does THAT factor into the equation?

So if I were something like this in my project, what else would be involved in the "power regulation".  A couple capacitors and maybe an inductor?  I'm trying to plan out a price range here.

Oh, and if you haven't noticed, I like to buy everything in one place.  That's why I keep going back to digikey. 
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 09, 2010, 11:36:38 PM
Hi,

So, just a quick question.  If something can provide .5 amps at 9V, it can provide .9 amps at 5V?  I know the regulator will take some power, but how much?  Secondly, since I'd be using LEDs that will probably run at 3.5ish V and 30ish mA, and I'd be controlling them with resistors, how does THAT factor into the equation?
If something can provide 0.5A at 9V and you use a linear regulator to burn off the excess power you get 0.5A at 5V.
With an ideal switch mode converter, you could get VA in = VA out, but in this non-ideal world, even a switcher have some loss, so you'd loose from a few percent to 30%..40%, depending on topology and designer.
Only your total current factor in. You might get the idea to run more than one LED for each LED in the schematic, if not now, perhaps later and what other stuff would you drive from the supply besides LEDs and the controller?


So if I were something like this in my project, what else would be involved in the "power regulation".  A couple capacitors and maybe an inductor?  I'm trying to plan out a price range here.
I am still not sure what voltage you want out, 5V or 12V?
And at what current?
Do you plan to use A/D-C? And if so, how many bits precision?  (That decides how noise free it has to be).
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: chelmi on April 10, 2010, 08:23:39 AM
I built a led cube a few months ago. And now that I think about it, it has a schematic similar to
what soeren suggested for your moon ligtht (except that I used a led driver instead of transistor)
For the power I used a 1A, 6V DC regulated power supply, a LDO voltage regulator on the board
to power the logic part and used the 6V to power the led directly. This way I figured I would waste to
much energy in the voltage regulator and my LED driver chip was happy with 6V.

Hope this helps.

Chelmi.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 11, 2010, 09:42:57 AM
Hi,
you could get VA in = VA out, but in this non-ideal world

I thought that... too bad we live in a non-ideal world!

Quote
Only your total current factor in. You might get the idea to run more than one LED for each LED in the schematic, if not now, perhaps later and what other stuff would you drive from the supply besides LEDs and the controller?

I changed my mind, I don't plan on using anything else besides LEDs and the MCU.  

Quote
I am still not sure what voltage you want out, 5V or 12V?
And at what current?
Do you plan to use A/D-C? And if so, how many bits precision?  (That decides how noise free it has to be).

I want 5V output. 

I found this on digikey.  http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T977-P6P-ND (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T977-P6P-ND)  .  It provides 1A at 5V DC.  I looked for one between 500 mA and 1A, but couldn't find any.  I figured if I could power 25ish high power LEDs (40mA) then I have all of my bases covered.  And when it's only 1 or 2 dollars more for twice the amperage I'm happy.  Plus it's an energy star adapter, so power isn't wasted.  However, if I actually need more than 5V to get a regulated 5V output, I also found this one.  http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T1019-P5RP-ND (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T1019-P5RP-ND)  I don't really know which one I need, but either is fine.

Yes I do plan to use the analog/digital converter.  However, it doesn't have to be extremely accurate.  I do see where the source would affect the accuracy, since the ADC uses source voltage as a comparison number.  However, the way I see it is that the thing I'm adjusting with the ADC, the total brightness factor (TBF), is relative.  I'm not doing precise calculations with them.  Plus, what's the lower limit for recognizing LED brightness changes in humans?  Is the (in)accuracy of the ADC going to change the brightness to a point where someone would recognize it?  My point is that it doesn't need to be extremely accurate.  Oh, I only used 8 bits precision instead of the 10 offered.    I don't know if that is really accurate, or not that much.  I chose it because there are two places for the result of the ADC.  One holds 8 bits, and the other holds 2 bits.  I read that it is possible to read only the most important 8 bits, so that's what I did.  (It was much easier that way.)
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: waltr on April 11, 2010, 12:58:01 PM
Quote
Oh, I only used 8 bits precision instead of the 10 offered.    I don't know if that is really accurate, or not that much.  I chose it because there are two places for the result of the ADC.  One holds 8 bits, and the other holds 2 bits.  I read that it is possible to read only the most important 8 bits, so that's what I did.  (It was much easier that way.)

I also do this at times for not critical ADC measurements in PICs. I Left Justify the ADC result and only use the upper 8bits.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 11, 2010, 01:49:50 PM
I also do this at times for not critical ADC measurements in PICs. I Left Justify the ADC result and only use the upper 8bits.

That's exactly what I did.   :)
EDIT:  I have a question though.  In the datasheet it says the ADC result is (Vin * 1024)/Vref.  However, if I only use 8 bits, is it really (Vin*255)/Vref?

Anyway, I made a discovery about noisy power.  The programmer I'm using (USBTinyISP) can provide <1A of power, so that you can simply use the programmer to power the chip when it's being programmed.  (Or for testing, when you don't want to unplug the programmer every time you try a different program.)  The voltage varies from 5.07 to 5.12.  This wreaks HAVOK on ADC.  So, I used a much more stable power source (a 5V switching regulator and lab bench PSU), and it worked much better, not even close to perfect, but better.  So I don't exactly know how stable a power source has to be for ADC to function correctly, but I see the importance now. 
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: waltr on April 11, 2010, 03:43:59 PM
Quote
if I only use 8 bits, is it really (Vin*255)/Vref?
yes

Quote
So I don't exactly know how stable a power source has to be for ADC to function correctly, but I see the importance now
Yep that is very true. You could add de-coupling and by-pass the your processor's Vdd (Vref) to help reduce the PS noise.
And you are only using 8 bits, with one bit of ADC is ~19mV. For a 10bit ADC one bit is ~4.8mV which is a good reason to only use 8 bits if the analog input value is not critical.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 11, 2010, 03:46:02 PM
Hi,

I want 5V output. 

I found this on digikey.  http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T977-P6P-ND (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T977-P6P-ND)  .  It provides 1A at 5V DC.  I looked for one between 500 mA and 1A, but couldn't find any.  I figured if I could power 25ish high power LEDs (40mA) then I have all of my bases covered.  And when it's only 1 or 2 dollars more for twice the amperage I'm happy.  Plus it's an energy star adapter, so power isn't wasted.  However, if I actually need more than 5V to get a regulated 5V output, I also found this one.  http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T1019-P5RP-ND (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=T1019-P5RP-ND)  I don't really know which one I need, but either is fine.
Before I even saw your second link, I was looking at the datasheet, which is valid for the entire series and since they have a max. ripple of 100mV, I thought I'd tell you to go for the 6V/1A (a little bit more expensive, but 20% more power) version and follow up with an LDO on-board. Nice that you found a link to that one  ;D


Yes I do plan to use the analog/digital converter.  However, it doesn't have to be extremely accurate.  I do see where the source would affect the accuracy, since the ADC uses source voltage as a comparison number.  However, the way I see it is that the thing I'm adjusting with the ADC, the total brightness factor (TBF), is relative.  I'm not doing precise calculations with them.  Plus, what's the lower limit for recognizing LED brightness changes in humans?  Is the (in)accuracy of the ADC going to change the brightness to a point where someone would recognize it?  My point is that it doesn't need to be extremely accurate.  Oh, I only used 8 bits precision instead of the 10 offered.    I don't know if that is really accurate, or not that much.  I chose it because there are two places for the result of the ADC.  One holds 8 bits, and the other holds 2 bits.  I read that it is possible to read only the most important 8 bits, so that's what I did.  (It was much easier that way.)
I have DSOs that use only 8 bits and for most stuff, that's all it takes.
These days, a 24 bit A/D-C can be realized, although not by an amateur, as it is extremely demanding on the supply and PCB layout and even a 16 bit converter can be a challenge.
I guess that's the reason for the bit width craze (sort of like "my bits are bigger than your bits" ;)), but just for a sanity check:

I think it's a quite sensible choice to go with 8 bits here (even less would do, since this has nothing to do with the "move" algorithm, but just the overall intensity and that should only change with changing ambient/room light I assume, whether automatic or by a potentiometer).
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 11, 2010, 03:58:09 PM
Hi,

Anyway, I made a discovery about noisy power. [...] The voltage varies from 5.07 to 5.12.  This wreaks HAVOK on ADC.  So, I used a much more stable power source (a 5V switching regulator and lab bench PSU), and it worked much better, not even close to perfect, but better.  So I don't exactly know how stable a power source has to be for ADC to function correctly, but I see the importance now. 
I don't think a 1% (or rather a +/-0.5%) variance in could do that, so you might wanna review how you decoupled the analog reference.

A 1% total change, if piped undampened (not possible) through to analog reference would give a variance of 2.6% total (max.), so I think there's other issues at play - like perhaps noise from the port driving your programmer.

Shielding and proper PCB layout is very important when using A/D-C. How is your circuits analog reference voltage decoupled and such (a schematic would help).

I'll throw a 5V LDO on-board regulator together, but the analog side will probably still need attention.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 11, 2010, 06:09:12 PM
Hi,

How is your circuits analog reference voltage decoupled and such (a schematic would help).

Uh... as I'm new to ADC, I used the most simple circuit available.  I don't think I decoupled anything (although I have read about it).  I simply took a wire and ran it from my 5V+, to the Vref.  HOWEVER, I wrote a program to blink LEDs to tell me what the resultant value from the ADC was, and it's stays constant.  It's been sitting in front of me blinking 1, 3, 2 (132) for 10 minutes.  (I think I could have done this an easier way.)  That makes me doubt that the ADC is my problem.  Regardless, I want to have a very constant power source.

Quote
I'll throw a 5V LDO on-board regulator together, but the analog side will probably still need attention.

Thanks, I wish I could learn how to design those things. (So I don't have to keep pestering you for schematics  ;))  Where do you learn that kind of stuff?  I really appreciate the help all of give, this really is a wonderful community we have here at SoR.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 12, 2010, 10:02:51 AM
Hi,


Uh... as I'm new to ADC, I used the most simple circuit available.  I don't think I decoupled anything (although I have read about it).  I simply took a wire and ran it from my 5V+, to the Vref.  HOWEVER, I wrote a program to blink LEDs to tell me what the resultant value from the ADC was, and it's stays constant.  It's been sitting in front of me blinking 1, 3, 2 (132) for 10 minutes.  (I think I could have done this an easier way.)  That makes me doubt that the ADC is my problem.  Regardless, I want to have a very constant power source.
Nice way to check the A/D-C, but did you try to change its input to get different readings or was it just open circuit?

Reading about it is good, but won't filter anything in itself ;)

You'll have to make sure the analog reference has a direct feed (with nothing else tapping from this line) from where the supply enters the board and then add 1..2 decoupling caps as close to the pin as physically possible. 4µ7 and 10n in parallel or something in that vicinity should do.

If you use a wire for this, use either thin coax cable with the screen grounded at the end where it connects to the analog reference, or a twin-lead with the extra wire grounded in the same way - twisting it will be good - or you could use 2 single wires and twist them together with about 2 full twists/inch. Whichever you use, ground the most sensitive end of the wire (i.e. the analog reference pin) and only ground one end (or you'll be creating hum loops.


I wish I could learn how to design those things.
Oh, you probably can. Most people can learn it, but unfortunately it does take a certain knack for creation or what I should call it.
I have a colleague who is a very well trained engineer. Give him a large complicated schematic and he reads it as well as I do and he's even a bit faster than me calculating it, but ask him to design eg. a one transistor microphone amplifier or a thermometer and he gets a look like somebody just Rayshamboo'd* him, goes all stuttering and you're allmost ready to call an ambulance on him. He's simply blank when he has to come up with something and while he's an extreme case, I don't think this creation part is something which can be taught - either you've got it or you don't.

* You gotta know South Park to know the meaning  ;D


(So I don't have to keep pestering you for schematics  ;)) 
No problem, We only do what we feel like doing and I usually make a couple of designs a day in my spare time anyway (when my family don't claim my presence or such like).


Where do you learn that kind of stuff?
Start with a few beginners books and build a few simple circuits to experiment with, to get to grips with how components work. Learn Ohms Law (R = U/I), Watts Law (P=U*I) and their derivatives, read more, build more, think more, build more, ask more build more etc.
Allways have paper and pencil around you, even on bus trips and such, in case you need to jot down an idea while it's fresh.


There are two designs here (http://That.Homepage.dk/PDF/MoonPower.pdf). One is the LDO supply and the other is a filter which, in case the supply is well regulated. The filter may be better to use, as it will dampen the ripple (LDO's are not the best in that respect) with an insertion loss of around 1V. (Use either of them, but not both).

If you don't use a PCB (you really ought to if selling it), all ground connections from terminals, caps and the regulator should each have a wire going to a central spot (star connection), to reduce hum and noise.
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 12, 2010, 04:01:49 PM
Hi,
Nice way to check the A/D-C, but did you try to change its input to get different readings or was it just open circuit?

Of course!  If I understand what you are asking, I had a potentiometer hooked up to the ADC.  I really wanted to see if I got values from 255 all of the way down to 0, or if it was more like 250-5.  It turned out to be the former although it's VERY touchy to try to get specific values.  I thought the POT was the problem originally.  I thought maybe whenever I turned it the dial wouldn't stay in a the same spot causing for some wobble.  However, that was not the problem.  

Quote
You'll have to make sure the analog reference has a direct feed (with nothing else tapping from this line) from where the supply enters the board and then add 1..2 decoupling caps as close to the pin as physically possible. 4µ7 and 10n in parallel or something in that vicinity should do.

I understand the REASONING for the capacitors.  They store energy in an electric field (between a negative and positive plate), so that whenever a high demand time comes they can simply provide energy FROM the field to the circuit preventing "noisy" power.  I THINK I understand the reason for 2 capacitors.  One big cap for large power spikes, and one small one for smaller wobble.  (Large caps won't be able to do anything about tiny power fluctuations.)  Am I correct?  

Also, the direct feed?  I understand WHY, just not the HOW.  So I should have one +5V wire that powers my MCU and other things, then I should have a separate +5V line that goes to Vref?  Aren't both of those +5V coming from the LDO supply? (If I use the LDO supply)  If so then how does that work, because the two would still essentially be connected to each other?

I will be using a PCB, so that solves some of the problems.

Again, I really appreciate everything.  
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 12, 2010, 07:29:48 PM
Hi,

Of course!  If I understand what you are asking, I had a potentiometer hooked up to the ADC.  I really wanted to see if I got values from 255 all of the way down to 0, or if it was more like 250-5.  It turned out to be the former although it's VERY touchy to try to get specific values.  I thought the POT was the problem originally.  I thought maybe whenever I turned it the dial wouldn't stay in a the same spot causing for some wobble.  However, that was not the problem.  
Then what was?
Potentiometers comes in all flavours, from those made of thin carbon deposits on phenolic PCB to those made of ceramics or conductive plastic. Some are 270°, some are 3600° or more.
I would imagine that with the cheaper variants, it would be hard to hit exactly the same spot or keep it there (1.05° precision) as that position could be just on the verge of shifting to the next value.
With +/-1 count allowed, it should be attainable with a bit of fiddling though.


I understand the REASONING for the capacitors.  They store energy in an electric field (between a negative and positive plate), so that whenever a high demand time comes they can simply provide energy FROM the field to the circuit preventing "noisy" power.  I THINK I understand the reason for 2 capacitors.  One big cap for large power spikes, and one small one for smaller wobble.  (Large caps won't be able to do anything about tiny power fluctuations.)  Am I correct?  
Not quite. The reason for different sizes in parallel is that they have different frequencies of resonance (and related parameters), so will have different frequency bands that they deal with best. Otherwise, we'd just slab eg. a 10'000µF on everything, but that won't do for high frequency noise and a small cap will not be able to do much good against low frequency noise.
High or low demands are met mostly from the cap (in a parallel connection) with the least internal resistance.

Here's Tonys tutorial on capacitors (http://www.sentex.ca/~mec1995/gadgets/caps/caps.html), worth a read, but probably with an error here and there, so allways use your filter (a.k.a. the sceptical mind) when reading, but that goes for anything you read, in particular on the web.


Also, the direct feed?  I understand WHY, just not the HOW.  So I should have one +5V wire that powers my MCU and other things, then I should have a separate +5V line that goes to Vref?  Aren't both of those +5V coming from the LDO supply? (If I use the LDO supply)  If so then how does that work, because the two would still essentially be connected to each other?
Why do we use coils?  They're just a piece of wire like a PCB traces.  Ahaaaa  ;D

To sum up.
Any piece of wire has resistance (often negligible though, but sometimes of a magnitude that needs to be dealt with, at other times something that can be used).
Any piece of wire has inductance (same applies as with resistance).
Any two pieces of wire of different voltages has got capacitance (yada yada).

Now I don't want to scare you off electronics, but here's more of this scary stuff. Any resistor has got capacitance and inductance as well, any capacitor has got resistance and inductance and any inductor has got resistance and capacitance as well.
The higher the frequency, the more The Dark Side laughs. Designing a PC motherboard involves microwave techniques to speed things up, since poorly terminated lines will have standing waves that slows signals down considerably.
As long as you stick to DC and low frequency AC, all components behave more or less close to "ideal components" (an expression covering how we'd like them to be, with no parasitic influences or real world issues).

In the case of the supply line coming from the same place:
The feed point will be the one with the lowest impedance (= "AC resistance") and will have less noise, as there is resistance in the trace supplying the rest of the board, the different consumers will each contribute more and more noise (each transition will give noise, the steeper the transition, the more noise and the higher the max. frequency of the noise), the farther we get from the "clean" spot.
So, we grab the "signal" where it's the cleanest and feed it to the reference without allowing any consumers to taint that lead. Right at the analog reference pin, we buffer with caps that'll lower the impedance at the point and provide noise dampening.

Don't be scared if you don't get some (or most) of it, the above will be several books if you want a full explanation and you will get it over time, just grab what you get (and need) at the present.


I will be using a PCB, so that solves some of the problems.
Certainly!
I guess you know that stripboard isn't PCB (which is an acronym for Printed circuit Board?
(Despite the name, it's neither wood for making poles in clubs for grown up single males ;D)
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: corrado33 on April 13, 2010, 10:30:31 AM
Hi,

Some are 270°, some are 3600° or more.

Mine's a cheap 270˚ servo from radioshack!  Honestly, I don't know what was the problem because the last few degrees of the POT all gave values of 255, so even IF I was stuck between two values, they'd both be 255 so I don't think it's the pot in any way, I think it's more my program.  I apply the "overall dimming" factor EVERY time through the loop.  I think if I applied it maybe every 10 times of every 30 times it might work better.  Plus every 10 times is maybe .05 of a second?  I haven't tried this yet, as I've been pretty busy, but I'll try it today. 

EDIT:  It was my programming.  I was dividing an int by a double, to get a percentage 0<=x<=1.  Because it was an int, when the calculation would result in something less than 1, the result would simply be zero.  I don't know where the flickering was coming from.  I fixed it.  There doesn't seem to be any change resulting from the instability of the ADC at all. (At least none that I can see).  My rounding function slows my program down a whole lot though.  Again this doesn't matter in the long run, it's just an observation.


Quote
So, we grab the "signal" where it's the cleanest and feed it to the reference without allowing any consumers to taint that lead. Right at the analog reference pin, we buffer with caps that'll lower the impedance at the point and provide noise dampening.

Don't be scared if you don't get some (or most) of it, the above will be several books if you want a full explanation and you will get it over time, just grab what you get (and need) at the present.

I understand.  I just thought ANYTHING connected to a source, regardless of position (close to source, or far) affected EVERYTHING that was connected to it.  For example, I thought that even though we'd grab the reference from the clean point, the things connected further down the line would affect the reference.  Apparently I was wrong. Chalk that one up to inexperience!

Quote
Certainly!
I guess you know that stripboard isn't PCB (which is an acronym for Printed circuit Board?
(Despite the name, it's neither wood for making poles in clubs for grown up single males ;D)

Yes, I plan on using the method of printing out a PCB design with a laser printer, then ironing it, then getting some kind of chemical that eats copper (FeCl3 maybe).  I've never made one, but I'm no stranger to chemicals... being a chemist and all, so it shouldn't be that hard.  I believe the timing would be the hardest part. 
Title: Re: 120VAC to 12VDC at 1ish amp?
Post by: Soeren on April 13, 2010, 12:58:06 PM
Hi,

Mine's a cheap 270˚ servo from radioshack!
Servo?  ;)


[...] the last few degrees of the POT all gave values of 255
Quite normal.


EDIT:  It was my programming.  I was dividing an int by a double, to get a percentage 0<=x<=1.  Because it was an int, when the calculation would result in something less than 1, the result would simply be zero.  I don't know where the flickering was coming from.  I fixed it.  There doesn't seem to be any change resulting from the instability of the ADC at all. (At least none that I can see).  My rounding function slows my program down a whole lot though.  Again this doesn't matter in the long run, it's just an observation.
Great :)


I understand.  I just thought ANYTHING connected to a source, regardless of position (close to source, or far) affected EVERYTHING that was connected to it.  For example, I thought that even though we'd grab the reference from the clean point, the things connected further down the line would affect the reference.  Apparently I was wrong. Chalk that one up to inexperience!
Here is a simplified drawing of how it works. (http://That.Homepage.dk/PDF/PCB_resistance_and_the_effect_of_same.pdf)


[...] being a chemist and all, so it shouldn't be that hard.  I believe the timing would be the hardest part. 
If you're going to use photo transfer, make a test strip and place a piece of carton or something that stops UV light over it. Start the light and move the cover to expose perhaps 5mm, wait half a minute (use a watch or a timer) and expose one more slice of 5mm and so on, until 5 minutes have passed. Then develop and etch, and you'll see what time to use (a permanent marker could be used to write the times (or just numbers) before the UV exposure, to make it easier to know after etching which time was best.