-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, Nov 14, 2007 at 07:32:49PM -0800, Marcel Duchamp wrote: > Peter Todd wrote: > > > >If you got any better ideas, do tell! > > > > I don't know about better but here's one way to do it. See attached gif. > > U1 is whatever you are driving your pwm from. R2 is whatever is needed > to keep from overloading U1 when the current limiting fun begins. > > Q1/R1 limit the current when it reaches Vbe/R1 or around 20 ma, > exclusive of temperature for the circuit shown. > > Dissipation, etc. is left as an exercise to the student. Well, gave it a try with a 2n3904, and the circuit works quite nicely. Current regulation isn't world class by any means, but plenty adequate for leds. The current limiting does seem to depend on R2 as well though, 10k vs. 100k changes the limited current by a few mA. In actual use the current limiting kicks in when the voltage at the base reaches 0.78 volts. Other references I found say Vbe is generally 0.7 volts. Finally on the 2n3904 datasheet, there are two graphs, Vbe saturation and Vbe on, both of which are dependent on temperature and collector current. Now my collector current, at 100k R2, should be way less than 1ma, yet according to the datasheet's Vbe(on) graph even at 1ma Vbe is < 0.7V, (at 25C) and decreases as current goes down. This isn't a device-to-device difference, I tried 2n3904's from different mfgs and they both acted the same way. What's going on there? > I'll leave the design of the clever switch mode power supply to others; > I'm out of town through the weekend for my daughters wedding. Congrats! - -- http://petertodd.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQFHPZlv3bMhDbI9xWQRAjAhAJ4iMAUZmyiRFCJVUMeS4LpY8byC+ACfbxDQ MN2X6xIZxgnSyDTOznV1y9I= =riIC -----END PGP SIGNATURE----- -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist