555 timer vs PIC controller

Thread Starter

drkblog

Joined Oct 4, 2012
109
I need a simple circuit capable of creating pulse trains with a 38kHz carrier. Each pulse train should have 12 pulses, 600µs width, with the 38kHz carrier. There must be a pause of 3ms between each train.
At first I though I could use a 38kHz crystal for the carrier and a LM556 (Dual 555) with one timer astable at 1.2ms 50% duty cycle and the other astable for the 3ms pause. But, to my own surprise, 38kHz crystals aren't easy to find. Then I though of replacing the crystal with an LM555 astable at 38kHz.

At this point I wonder if such a circuit makes sense. Since I could create that signal with a 8-pin PIC microcontroller like PIC12F629. The circuit would be a lot smaller and much more simple (this PIC has internal 4MHz clock). I could easily change the signal updating the code. Even when using a PIC12F629 is going to be more expensive than the timers, there's no big difference really. Or I could find a cheaper PIC one-time writable.

So my question is: Am I missing something here? Can you think of any reason for staying with the timers?
 

ronv

Joined Nov 12, 2008
3,770
Depending on the current you need for the IR LED the timers may drive it without powering it up with something like a FET.
 

Thread Starter

drkblog

Joined Oct 4, 2012
109
Depending on the current you need for the IR LED the timers may drive it without powering it up with something like a FET.
I thought about that but I have to make the led work at its maximum. So I guess I will need a transistor anyway (I have to check the led datasheet).
But, even if I can save a transistor, I think it is worth to use the PIC.

PS: Why did you suggest a FET instead of a BJT?
 
Last edited:

ronv

Joined Nov 12, 2008
3,770
I thought FET when you said micro. They are often easier to drive with the low current outputs, but either would work.
 

JohnInTX

Joined Jun 26, 2012
4,787
Its not too difficult to generate a pulsed 38KHz with a PIC. One way is here. Add a counter to the TMR2 overflow IRQ that toggles the IO line. Maybe that's enough.

Have fun.
 

Thread Starter

drkblog

Joined Oct 4, 2012
109
Its not too difficult to generate a pulsed 38KHz with a PIC. One way is here. Add a counter to the TMR2 overflow IRQ that toggles the IO line. Maybe that's enough.

Have fun.
In fact, I forget to mention it but I used an Arduino for testing such signal :)
Now I have to find the cheapest PIC available in Buenos Aires, or use the PIC12F629 which is 2 USD.

About the led: I'm reading QED234 datasheet, taking the forward current to 400mA moves the radiant intensity from1 to 4. Datasheet states that maximum continuous forward is 100mA and peak current can be up to 1.5A top. But there is no clear information about the how long can be that peak, maybe it's 100µs but not sure.

Can I safely make 1A flow through the LED using this signal? Of course I'm aware the LED is going to die if the program has a bug and stops with a high level in the output.
 

ronv

Joined Nov 12, 2008
3,770
If your bursts are continuous I wouldn't go over 300ma. The forward voltage at 300 ma. is about 2.2volts so peak power is 660 mw. If you have say 14 cycles and another 14 off it would be about 25% duty cycle - so 165 mw. Spec is 200 mw max.
 

Thread Starter

drkblog

Joined Oct 4, 2012
109
If your bursts are continuous I wouldn't go over 300ma. The forward voltage at 300 ma. is about 2.2volts so peak power is 660 mw. If you have say 14 cycles and another 14 off it would be about 25% duty cycle - so 165 mw. Spec is 200 mw max.
You are right. In fact, I have to subtract 2.65 mW per ºC over 25ºC. I think a summer day under the sun (even when the LED won't be right under the sun) the temperature could raise up to 35ºC. I have to set maximum power dissipation to 173.5 mW in my calculations.
 

Thread Starter

drkblog

Joined Oct 4, 2012
109
I'm back with this circuit. I'm going to divide the pulse train along eight LEDs using some sort of clock divider circuit. But in the end I'll be using eight LEDs in turns. A pulse train of 16 pulses is going to turn on each LED twice.
According to my math, if I start with a 50% duty cycle in the 38kHz signal, dividing by eight LEDs takes me to 6.25% duty cycle (even if there is a continuous pulse train). If I take 173.5mW maximum from my previous post, using 6.25% duty cycle is like raising the power dissipation maximum to 2776mW.
So I should be able to use 400mA (which is 880mW at 100% duty cycle) or even more. Am I right?
 

Thread Starter

drkblog

Joined Oct 4, 2012
109
If you are going to use 8 LEDs, why not just run them in parallel at 1/8 the desired output power?

Bob
These eight LEDs work one at a time. When the first one is on, the rest is off. Then when the second one turns on, the rest is off.
 

BobTPH

Joined Jun 5, 2013
8,967
Yes, I understand that, but I thought the only reason for it was to increase the power you could output. Maybe I am wrong and they are in different places or pointed in different directions. If not, running all of them at lower power is more efficient and less likely to damage them.

Bob
 

Thread Starter

drkblog

Joined Oct 4, 2012
109
Yes, I understand that, but I thought the only reason for it was to increase the power you could output. Maybe I am wrong and they are in different places or pointed in different directions. If not, running all of them at lower power is more efficient and less likely to damage them.

Bob
Yes, each LED is placed in a specific position for the purpose of the circuit. I need them to turn on in turns. Eventually I could duplicate the LEDs (to 16) and put them in parallel pairs, resulting in eight pairs of LEDs. In that case I can reduce the current in the LED to 50% and get the same radiant intensity. Of course, it's more expensive.

I have to start thinking in the power dissipation on the switching transistor.
 

ErnieM

Joined Apr 24, 2011
8,377
I would rather run 8 LEDs in parallel, each seeing 1/8th the current then each seeing the full current for 1/8th of the time.

AFAIK LEDs loose efficiency when driven harder, so it may even be brighter.
 

Thread Starter

drkblog

Joined Oct 4, 2012
109
There is another issue with this circuit, which I would like to solve. If the main clock (created with a PIC micro) freezes, there is a good chance of one LED staying on. If that happens the LED, or the transistor, or both are fried. Is there something I can do to prevent this?
 

ronv

Joined Nov 12, 2008
3,770
I suppose since it is pulsing at a 50% duty cycle you could add a current sense resistor and integrate it. When hung the current would be twice as high/ I don't know who (what) you would tell :eek: so I guess you would need a hardware latch and some gates to shut them off. Or you could do the same thing with the clock - might be easier.
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
There is another issue with this circuit, which I would like to solve. If the main clock (created with a PIC micro) freezes, there is a good chance of one LED staying on. If that happens the LED, or the transistor, or both are fried. Is there something I can do to prevent this?
Use the PIC's watchdog timer set to a short period, to ensure the PIC always resets and clears the output pins if a glitch occurs.
 
Top