1
\$\begingroup\$

I am interested in making a 'life' indicator for my uC, as in, "Is the clock running?". As it has a clock output pin, I was thinking of attaching this schematic to it.

schematic

simulate this circuit – Schematic created using CircuitLab

(P1 is clock out)

Theory: P1 goes high, causing C1 to charge to 3V (uC is at 5V) via D1 (2V Vf), it then goes low, causing NODE1 to go to -3V because of the nature of capacitance. This causes D2 to become forward biased, and C1 discharge to 0.65V (D2 has .65Vf), rinse and repeat.

Clock frequency is 16.5MHz. At this frequency, the cap should have an impedance of roughly 965 Ohms, no? Will it act as a ~1k resistor in this circuit for the calculation of led current? And will incresing the size of C1 increase current drawn?

\$\endgroup\$
2
  • \$\begingroup\$ You might consider doing this as a line of code that repeats several times a second, based on a RTC or software loop. No need to pound the LED with such fast pulses. \$\endgroup\$
    – user105652
    Mar 16, 2018 at 1:27
  • \$\begingroup\$ Seems like it should work. \$\endgroup\$
    – user253751
    Mar 16, 2018 at 2:23

3 Answers 3

2
\$\begingroup\$

This is something that an engineer just tries. Fortune favours the bold.

I always liked the 2 pin r/g leds - you get D1 and D2 in one led, and it is glowing both ways.

If you use modern hi-efficiency leds, in clear smt package (where you can see the die) then they visibly glow at crazy low currents. Obviously Red LEDs will be able to turn on with the least V.

\$\endgroup\$
0
\$\begingroup\$

Kind of... You may need to use a larger capacitor to get the LED to turn on, but you will only get a fairly low duty cycle pulse of Light each clock cycle, you may be better off driving the LED Directly provided that pin can supply the current. That would also keep the led from seeing the negative voltages associated with the differentiated clock output. One Less placement too

\$\endgroup\$
2
  • 2
    \$\begingroup\$ I think the idea is that with AC coupling the LED will only turn on if the pin is oscillating. If the micro gets stuck with the pin on or off the LED won't light. \$\endgroup\$
    – Transistor
    Mar 16, 2018 at 0:31
  • \$\begingroup\$ Does your uC have a hardware watchdog? If so, that might be a better use of detecting the firmware hanging. \$\endgroup\$
    – TimB
    Mar 16, 2018 at 2:14
0
\$\begingroup\$

There are many variables that affect LED brightness as a small indicator and not just impedance of the cap as it is being pulsed with a current at some duty cycle from a driver which some maximum slew rate V/ns, with an estimated Ron or RdsOn and a supply voltage Vss from Vol/Iol in datasheet.

 Ic = CdV/dt   for V=Vss-Ic* Ron and dt= transition time.     
 Id average = Ic * dt * f      
 ESR of driver Ron ~50 Ohms =/-50% for 74HCxx logic @ 5V     
 Vss = 5V      
 Vf (red LED) = Vt+ESR*If  
 -  for Vt=1.8 and 5mm ESR~15 Ohms 
 - so @20mA Vf= 2.1V   @5mA Vf=1.85V 

If you substitute your values and 50% tolerances I would expect the following;

  C(pF)  Ipk  Iavg(mA)  
   10     5  1.4    
   15    7.5 2.0   
   30    15  3.8    
   60    25  6.4  

However load the clock with these current pulses will generate more stray EMI if it is a big loop. but 10pF with a 10Cd LED should be pretty bright at >1~2mA avg.

(edit) unfortunately LED capacitance increases towards conduction and if it is 10pF the LED dims with rising slew rates and may be 50% of these values.

Isn't it fun to play with LEDs?

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.