Thanks Russel (you are a living encyclopedia!!) and at the others for the interest in my question. I'm sorry for the late reply but in these two days I was gone at the italian "speleological meeting" (I'm a caver) where I have bought... a PETZL cap lamp!!! OK, this isn't the "main" cap that I want to build but a very small "emegency" led light (E+Lite, three white leds and one red, submersible. At first seems a nice product, probably it has been designed by Olin! ;-). My lamp: The fist idea was to use a LDO linear regulator circuit (as many LM334-based) or with a dimmer, as this one: http://radiolocation.tripod.com/LEDdimmer/LEDlampDimmer.html But using a PIC is more fascinating even if a bit more difficult due to my poor knowledge. Now, a bit more information on my lamp design. The led I use is a SEOUL Z-Power P4. Specs says 100 lm/watt at 350ma/3.25V (1Watt) and 240 lumen at 1A. I want to use only the lower current or less because 50-60 lm is enough for normal caving activities. Underdriving the led is better also for two other reasons: first, I want many hours of light from the battery. Second, the housing of my lamp is plastic: not too good to get out the heat of the LED and mosfet, even if they have a dissipator. I think that an aluminium case will be mandatory using powerleds. I'm thinking to use a PIC that PWM's the mosfet with a schematic not too different from the previous LED Lamp dimmer circuit. Russel, you says that voltage doubling isn't necessary: Well, this is a good notice since the circuit become simpler! I was thinking to use volt. doubling because in previous tests I done with the original circuit (without PWM) seemed that at voltages less than 3.5V this reduced a bit the voltage drop by the mosfet, as I obtained higher currents at the same voltage level (in these tests I used 18 leds). Maybe I was in error, not sure. I like very much boost circuits (as Olin's KNURD. At a first time I was thinking to use a single alkaline "D" cell for power supply and a step-up booster. But if the circuit is damaged I haven't any chance to have any light from the led. Instead, using a battery voltage greater than the LED vf I can implement a simple manual switch/jumper "emergency" that exclude the damage circuit and directly drive the led wit a simple resistor. Other useful features possible to implement using the PIC would be control of the LED temperature and battery voltage level... Ok, perhaps it is time to start working (other suggestions are well accepted). regards Marco ---------- Initial Header ----------- >From : piclist-bounces@mit.edu To : "Microcontroller discussion list - Public." piclist@mit.edu Cc : Date : Thu, 01 Nov 2007 12:55:59 +1300 Subject : Re: [PIC] CLKOUT signal on PIC12F629 > >> I'm starting to make an LED headlamp with a small > >> PIC12F629 > >> as the "brain". The PIC use PWM to drive a IRL3103 Mosfet > >> connected to a single power LED. The power source is a > >> 3.7V > >> Li-Ion battery so I need a voltage doubler to drive the > >> gate > > > If the FET is on the low side (and it's an N-ch device), > > do you ? > > The IRL3103 spec says gate threshold is 1.0V > > That's at 250 uA ! > > However, > > http://www.irf.com/product-info/datasheets/data/irl3103.pdf > > Fig 1 in the above datasheet says you can get 6A at 0.1V > drop TYPICAL with 3.3V gate drive and about 4.5A at 0.1V > drop with 3V gate drive. so the PIC has enough voltage. > > What the PIC doesn't have is the vast oodles of drive that > would be ideal to drive the gate hard and fast at very high > PWM frequencies - 100mA plus gate currents are "nice". > > HOWEVER, the PWM doesn't need to be fast - faster than a > speeding eye is fast enough - 200 Hz may do, 1 KHz almost > certainly would. At that speed the waveform edge can be a > bit rounded with minimal losses overall. > > A trickier questionis, how are you going to ensure the LED > is properly driven? > This happens to be an area that I've been giving a lot of > thought to lately. > As it's a headlamp I assume it's 1 Watt plus and maybe 3 > Watt or 5 Watt? > FWIW the Edison White LEDs seem to offer superb lumens per > watt per dollar at present. YMMV. > > I'd be interested in which White LEDs you choose to use and > why and how much. I can share what I've found of late. > You can even get a GENUINE 100 lumens/Watt 9at under 1 Watt > level) LED now and it's getting better all the time. As an > eg Luxeon Star 1 Watt is rated at around 40 l/W typical, use > of a higher l/W LED can save battery at the same light > levels. > > I have an Edison Star 3W that at 500 mW gives several times > the power of a 2 year old 1 Watt Luxeon and over 50% more > light than a 3W new Luxeon Star (also at 500 mW). Retail the > Edison is half the cost of the Luxeon. I have 100,000 > pricing info... :-). > > As LED power rises Vf typical tends to rise as well. While > you can get binned LEDs with VFs' in the low 3+V region the > norm is mid 3V range and the spec sheets say you can get > them at > 4V at rated current. Even with a low to medium Vf > that doesn't give a lot of voltage margin for the Isense > resistor for the constant current driver. You were of course > definitely going to drive it in constant current mode, > weren't you? :-) > > Rather than a voltage doubler for your FET gate you may wish > to end up with a constant current output boost regulator for > your LED ! :-). > > This is actually not too hard to do [tm] and the experience > can be "lots of fun" [tm again]. The magazines have quite a > few of them and the web has various examples. See Olins > website for some examples using a PIC 10Fxxx. [The 10F gives > access to all 3 pins of the comparator - there's a reason > that Olin always uses pin 3 as the sense pin :-) ] As the > FET is low side drive is easyish. With a boost SMPS you do > need higher frequency to get smaller inductor so you will > need a gate driver - but 3V is still ample. The classic FET > gate driver would be fine (attached) either for a SMPS of if > you wanted one for PWM drive. For even greater low drive D1 > can be replaced by a PNP - E to E of Q8, B to B of Q8 and C > grounded, remove D1. > > >> Final question: as the PIC is INTOSC running (4Mhz), can > >> I use > >> the CLKOUT signal on OSC2/GP4 (Fosc/4) for the voltage > >> doubler? > > Yes - but the cap wants to be VERY small to avoid loading > the OSC fatally. > But, as above, you don't need it ;-) > > > > > Russell > -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist