Digital Speedometer (Help)

Discussion in 'The Projects Forum' started by Art, Dec 12, 2010.

  1. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Hi Guys,
    I'm trying to make a digital speedometer with a very large multiplexed LED display.
    I've done this twice with directly driven seven segment displays, and they work fine,
    but this time the display segments require eight volts to drive, so I've used a 7809 and transistors.

    I've run into an issue I think I might need help with.

    [​IMG]

    When I connect the device to 12 Volt source, I measure well over six volts at
    the output of the 7805,
    but when I pull the microcontroller out of the circuit, the output of the 7805 measures correctly.

    It appears some of the output of the 7809 is leaking through the transistors,
    and back through the microcontroller to the power supply.

    All of the segments on the display light up and stay that way after a quick
    initial display test routine which appears to work correctly.

    Any help appreciated.
    Cheers, Art.
     
  2. nomurphy

    AAC Fanatic!

    Aug 8, 2005
    567
    12
    The PIC driver is powered from +5V, and that would be the max output it's drivers can supply (although it is probably more like +4V or so). However, the emitter-followers need about 9V at the base to turn-off completely. This is typically handled by placing a larger value resisitor (~100K) from the emitter to the base to keep the xstr off, but this configuration is back-driving the +5V PIC. You may want to use NPN xstr's or Nmos Fets (2n7002) as a common-emitter/source. Also, you don't show any ballast resistors for the LED's which would go between the collectors and GND (LEDs and collector/drain if using N devices instead of P).

    ZD1 is a 16V zener or TVS for input protection, and then you use 16V caps. Pay close attention to the ZD1 datasheet for max breakover voltage (vs. current) and use higher voltage rated caps accordingly. Changing the 47uF inputs to smaller caps 0.1uf - 0.22uF at ~50V would also help, watch the voltage rating (not given) for the 470uF input cap and place it on the other side of the input resistor.
     
  3. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Could you possibly show me what one transistor in the circuit would look like?

    I have replaced one of the xsistors with a BC549 NPN, but that segment stopped working.

    It is still a PNP transistor where I should use a resistor between E & B?
    Then diodes between the pic and transistor bases should protect the pic shouldn't they?

    EDIT,, a 100K resistor connected between E & B for the current transistors still leaves the segment always on.
     
    Last edited: Dec 12, 2010
  4. nomurphy

    AAC Fanatic!

    Aug 8, 2005
    567
    12
    I assume that these are common-anode displays that are being powered from +9V?
    And, you don't show any LED segment resistors ...are they there?

    Theoretically, a xstr (and segment) is ON when the PIC output is low, or OFF when high -- per your present design.

    If you replace the PNP with NPN, the above operation will be reversed because the NPN will be an inverter. You must also turn the NPN xstr "over" by connecting the collector to the segment, and the emitter to GND. Again, there should be ballast resistors between each segment and each NPN collector. Reprogam the PIC to output a low signal when valid.
     
  5. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    They are common cathode displays, or else wouldn't they be connected to
    the supply instead of ground?

    Yes they need 9 Volts or more to light up. I've never had a problem with 5 Volt matrix displays.

    The cathode switching transistors are working because a display test startup routine
    cycles them for a few seconds, (ie. first digit is lit, then the second, then the third, then the first again, etc).
    This part works.
    The problem is the digits are always "8".

    I have replace one segment with an NPN (BC549) with C & B reversed from the schematic.
    The relevent segment is then never lit. Same with or without a 100K resistor across E & B.
     
  6. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    PS, I already have pics programmed for both common anode, and common cathode configuration.

    Here is a common anode version with small LED display:
    [​IMG]

    Both pics do the same thing in the big display circuit.
     
  7. nomurphy

    AAC Fanatic!

    Aug 8, 2005
    567
    12
    In closer examination of your schematic, I now see that the Ra outputs act as display selects while the Rb outputs act as segment drivers.

    However, the PIC is not supplying sufficient voltage to turn off the xstr (as previously noted). My sugestion of adding the 100K E-B won't work because the 470 base resistor acts as a divider that keeps the base voltage too low.

    You probably need to add common-emitter NPN transistors before each PNP to act as voltage translators. A high out from the Pic will turn on the NPN (low out), which will then turn on the PNP. Connect the NPN collector through a resistor to the base of the PNP, and add a 10K E-B resistor to the PNP (previously noted as 100K). You will also need a base resisitor between the PIC and the NPN (use the same value 470 for both).
     
  8. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    I have looked at a few jumbo led clocks on the net.
    It occurs to me I can simplify things by using a pair of 4050 buffers like in this circuit (last image on the page)...

    http://www.josepino.com/?led_clock

    Although I guess I'd leave the transistors I already have switching the cathodes
    because the work is already done.

    I'll add the series resistors when the thing is working... like in the prototype, I don't forget them ;)
     
  9. nomurphy

    AAC Fanatic!

    Aug 8, 2005
    567
    12
    The display selects (cathodes) will not switch properly for the same reason, you will need to add NPN buffers or use the IC.

    You can save a lot of power by using NMOS FET instead of NPN. Use a 10K resistor between the PIC and the gate, and connect the source to GND, the drain would connect to the PNP base as previously described. Note that if you used FET's for translators in your original circuit, it would save ~100mA over using the NPN as translators (saving ~10mA B-E current per device).
     
    Art likes this.
  10. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Thanks for the help. I'm planning on a six digit wall clock after this,
    but I think it is best to use a latching device rather than multiplexing that many digits.

    I'll see how I go with this one during the week. Hobby time has run out unfortunately :(
     
  11. nomurphy

    AAC Fanatic!

    Aug 8, 2005
    567
    12
    It was late and I didn't notice the obvious: the 3 display select xstr's driven by RA[2:0] should not be PNP. Change to NPN or 2N7002 FET (with 10K instead of 470), flip them over relative to the PNP, and use a high enable from the PIC. This will provide isolation between the two circuits using different voltages.
     
    Art likes this.
  12. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Ok, it works! :)

    I have added 120R resistors in series with the seven display segment rows.
    The display is dull enough for being multiplexed that I didn't want to go any higher value.

    The program works as expected.

    The hardware works flawless from a regulated 12 Volt supply, but when connected to
    my vehicle (14 Volts or greater), only a few segments light up either because the
    hardware (and maybe therefore microcontroller) software is playing up.

    I assume I have to fix the issues with the power supply.
    I will do as you suggested, but I have used a 100uF electro cap (63 Volts) in line with
    the source supply where 470uF is stated in the schematic.

    I will change the values and up the voltage of the rest.


    EDIT.. I didn't catch the last post.
    I have used two 4050 ICs like in the jumbo clock schematic in the link.
     
  13. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Varying the value of the 1 Watt resistor at the supply makes it work from the ignition.
    I adjusted the values (and voltages) of the supply caps anyway.

    EDIT,,,
    Maybe I need a regulator for each of the 4050 ICs?
    Also, the 1 Watt resistor was meant for the small digit design.
    I used a pot as a temp solution.
     
    Last edited: Dec 15, 2010
  14. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Here's a YouTube video featuring testing of the digital speedometer
    with big enough display to be seen outside the vehicle by other drivers.

    http://www.youtube.com/watch?v=LLZGanh06Ss

    This was done for test only (at the end of the video).

    Cheers, Art.
     
  15. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    The capacitors on the input and output sides of a 78xx regulator should not be equal. Make one 10x larger than the other, typically the output.

    You shouldn't need to use a resistor before the regulators to make it work, something with the design isn't correct.
     
  16. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    Hi, Yes, weird.
    I'll try changing the caps again,
    although I don't think that is the problem, since the micro appears to keep working
    and it is the display that fails.

    Here's a quote from another (local Australian) forum where I asked about it

     
  17. SgtWookie

    Expert

    Jul 17, 2007
    22,182
    1,728
    Do you have a 0.1uF bypass capacitor across the Vcc/Vdd/GND pins of EACH IC? They're required.

    The 10 Ohm resistor is a good idea for use on 12v automotive systems. You can get transient spikes up to 60v during load dumps. The resistor will help to protect against that. However, you should move the 470uF cap to the regulator side of the 10 Ohm resistor.

    The Zener alone might not be enough protection against the transient spikes. It might've gotten fried already; I suggest that you check it.

    Change the resistors from the PIC outputs to the MOSFET gates back down to the range of 270 to 470 Ohms; and add 10k resistors from the gates to their respective source terminals. This will keep the MOSFETs turned off if you remove the PIC from the socket.
     
  18. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    This is good for the finished product, but shouldn't be needed to make a system stable under normal conditions.

    Art:

    I was under the impression that the LED Display was powered by the 7809 Regulator, and not connected directly to vehicle power.

    Power should be:
    Vehicle Power -> 1A Fuse -> Small Power Resistor -> 470uF Automotive Rated Cap. After the cap, the vehicle voltage should only go to the 9V (LED Anode) and 5V (Logic) regulators, with 47uF on the output of each regulator, and a 0.1uF mica or poly cap across the Vcc/GND of each IC.

    DigiKey Automotive Rated Caps (Search Link)

    In addition to SgtWookie's advice, I would suggest etching a PCB for the speedometer and adding an enclosure simply for reliability. The circuit may work now, but it should be finished correctly.

    Automobiles are the harshest environment you can put an electronic circuit into. The very large temperatures over short periods of time (especially interior) will kill many components, electrolytic capacitors being the most vulnerable. Road vibration and pothole shocks will weaken any poor solder joints or jar components loose from a perfboard. These are just a couple reasons this forum doesn't allow modification to vehicle circuits or lighting.
     
  19. Art

    Thread Starter Distinguished Member

    Sep 10, 2007
    785
    61
    There's some things to think about.
    I only have a 0.1uF cap for the microcontroller.

    I no longer use a 1 Watt resistor at the power supply,
    The potentiometer is essentially doing the job, and is
    ready to be replaced with a fixed value resistor when problem is solved.

    That has been the case, but I bypassed the 7812 (formerly 7809) regulator for diagnosis,
    and left it that way for now.

    Yes it will go into an enclosure if I get it working satisfactory.
     
  20. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    A 7812 Regulator would need 13.5V to run, due to the dropout voltage. A 7809 would work fine with the engine running or off.

    The reason for the 0.1uF caps is to help prevent sags/glitches in the power supply, as well as suppress interference, this is important in all circuits, but very important with switching/digital circuits, and anything in a vehicle due to the electrically noisy environment. There's a tacked thread on that topic in General Electronics Chat, or some other area here.
     
Loading...