Jump to content
Sign in to follow this  

Looking for help with a schematic

Recommended Posts

Would someone be so kind as to help me with how to get some LEDs to shut off.

The circuit is a set of start lights Formula-1 style used for RC cars.

It also detects false starts using a photo-diode and a laser pointer.

If I can get this part to work a track timer is next. Which will then lead to my other problem of identifying more than one car on the track.

Here are the schematics.



The DB-15 from one plugs into the other. When I put this on the breadboard it worked (with only one LED in place though). Now that I built the PCB and soldered the circuit, when I set a pin from high to low on the PIC to shut off the BS170 to get a series of LEDs to go off, it only goes off once some others go on. Actually they fade first, and as more LED's go on they finally shutoff.

I'm thinking that perhaps I need a decoupling capacitor.

I'm just not sure where to place it and what value to use.

Or perhaps some way to pull it down to ground.

Which would be pretty hard the way I have it now since all the LED's feed off the same V+.

Thanks for any assistance,


Share this post

Link to post
Share on other sites

(1) The problem (or at least a contributor) is that your R4 LED current limit will not work well with multiple LED's. You need a resistor in series with EACH LED. In other words, you will need to eliminate R4 and install 20 new resistors (one on each LED).

For help with the resistor choice you can use RC-CAM's nifty LED Calculator.

(2) Your 78L05 Vreg will probably not be able to handle the required current. With standard red LED's and 220 ohm current limits, you will need well over two hundred mA's if all they are all on at the same time. Upgrade to the TO-220 package (LM7805/LM340T-5.0) for best results. You will be dissippating about 1W, worse case, so a heatsink might be needed when a fresh 9V battery is used.

(3) Lastly, if you still have problems then check the gate voltage of the FET's. You will need 3VDC+ to fully turn them on (should not be a problem with your 5V Vcc).

Additional comments:

(4) A .1uF ceramic cap should be across the PIC's VSS & VDD. Short leads.

(5) You may need a small value resistor in series with the speaker to limit the AC current to less than 20mA. I suggest 15 ohms 1/4 watt.

These are simple corrections. Looks good otherwise.

Share this post

Link to post
Share on other sites

For the LEDs... I do see that they fade as more LEDs are lit up. So I will move the resistor and multiply it 40 times to the "lights" board. I was trying to save some room. I'll have to find 1 part that has 10 resistors on it. I have used them before but don't remember on which project. There are actually 2 boards sandwiched together (40 LEDs). It does work this way, but the dimming (althoug slight) is annoying. And I do realize it's bad design.

RE the 78L05... I'm actually using a LM7805. I simply did not have one in my parts LIB. It is heatsunk etc. It also uses either a 9V battery or a Wall-Wart through a 3 pin socket that either shorts, or opens up the ground between the battery and the board when the plug is inserted.

The voltage for the gates are fine. I did figure out my problem. I mixed up the source and drain pins on the FETs. I unsoldered all of them, put them back in and it works fine now.

For the ceraminc cap, I'm actually using a 1uF Tantalum. Seems to be ok like this.

Is there any reason why I should use a .1uF ceramic cap instead?

As for the speaker, it's working fine like this but I will try it with the resistor to see what happends. It's a 5W, 8ohm speaker.

Thanks a lot for taking the time to look over the circuit.

Any ideas for a timer? I'm thinking there are 2 ways to do this.

1) using a RTC which I have used a lot in the past and am comfortable with. I've been looking for one with either 1/10 or 1/100 of seconds, but haven't been very succesful in my search. I did find one that has 44 pins... too many for me!

2) simply using the counters of the PIC.

Any comments?



Edited by mikep

Share this post

Link to post
Share on other sites

Couple more thoughts:

1) If you source power from the unregulated battery, rather than the Vreg, you will reduce the current burden on the Vreg IC. Even a 78L05 would work in this case. The observed LED brightness will not vary much over the life of the battery under this arrangement. BTW, this is usually the preferred method to power a field of LED's.

2) If you wire your LED pairs in series, rather than paralleled pairs, you will reduce the current limit resistor count in half. You will also reduce wasted power. With the series configuration the LED pairs source voltage will need to be higher than twice their Vf spec. So, hi-lumen LED's that have Vf's greater than 2.4V will need to consider using the unreg battery voltage method.

3) If you really want to get sexy, then consider using a scanning method of turning on the LED's. With this scenario, only one LED pair is on at a time. By scanning/updating the LED's at a high frame rate (usually 120 Hz or more), multiple LED's can appear to be on at once. The reduced brightness from the scanning is offset by using higher LED currents.

Why do this? Well, only four (or two if you series wire the LED pairs) current limit resistors would be needed for your 40 LED's . And current consumption would be dramatically reduced (good for battery operation). The hardware timers in the PIC make this task a bit easier to implement in your S/W.


4) I did not see the 1uF cap on the schematic. It will be fine as long as the traces from it to the PIC are minimal (required for proper decoupling). I would normally suggest you solder a .1uF mono-ceramic directly across (or nearly so) the PIC's Vdd & Vss pins for good measure (they have low ESR).

5) The resistor that I suggested for the speaker is to protect the PIC. For port protection, you need to limit each pin's current to 20mA max. With an 8-ohm speaker, operating at resonance, the peak currents can theoretically exceed several hundered mA's (will be lower due to the internal impedance of the PIC, but still nasty). It will work without the extra resistor, but the PIC might get stressed.

If you need more volume you can drive the speaker with a transistor. Lastly, if the tone frequencies are within the resonance range of a typical Piezo, then consider using one. They are more efficient and produce a lot of noise, especially when differentially driven from two PIC pins.

Timer Suggestions:

6) By all means use the hardware timers in the PIC. They are not troublesome to implement and are very accurate. With a 20Mhz oscillator your resolution will be 0.2uS. Timer 1 is 16-bits, so use it to minimize housekeeping. A 10mS interrupt configured timebase for your "stopwatch" should offer decent resolution for your R/C car application.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...