0
\$\begingroup\$

I have a temperature circuit that uses a common anode seven segment four digit temperature display.

It uses a PIC12F1572 to read the temperature from a one wire device and shift the numerical bits to a TLC5917 LED driver (shift register) to display the 0-9 on each of the four digits. This chip sinks each of the LED segments so the cathode is connected to each of the ports.

Daisy-chained off the TLC5917 is 74HC595 shift register. Its job is to control which digit is lit during the multiplex process. I only use 4 ports for the four digits which connects the common anodes of the display. While this works I am concerned that I am drawing too much current from the 74HC5959 so I added transistors to turn the digits on and off.

Here is my question / confusion:

I had to use a 3904 NPN with the emitter connected to ground and the collector connected to the anode of the appropriate digit. This is not how I learned to use BJTs, and it seems wrong. Am I missing something, did I make a mistake or is the correct? Whatever the response is, why?

This circuit works as desired and is exactly what I wanted to achieve.

I have also attached a schematic to better illustrate the circuit.

enter image description here

Images of each section for better visibility. Feedback is welcome, thank you.

LED Sink Driver Section 74HC595 Turns the Digits on and off via PNPs PNPs between 74HC595 and common Anode of LED LED Connections One wire sensor and PIC12F1572 Microcontroler

\$\endgroup\$
6
  • 2
    \$\begingroup\$ That schematic really needs to be improved. It's way too grainy. Reminds me of 1979 or something. \$\endgroup\$ Commented Jul 6, 2021 at 2:06
  • \$\begingroup\$ The schematic needed to be corrected I had the BJT wire flipped. Now it represents the circuit properly. I will also try to post a better picture. \$\endgroup\$ Commented Jul 6, 2021 at 11:30
  • \$\begingroup\$ Pin 9 of the 74HC595 is an output. It MUST NOT be connected to Ground. Leave unused outputs unconnected. \$\endgroup\$ Commented Jul 6, 2021 at 16:03
  • \$\begingroup\$ @Kardacian Are you using NPNs with a "sink driver IC"? The newer, more readable schematic (still could be better as I still cannot read the pin names on the ICs) appears to suggest that reading. \$\endgroup\$ Commented Jul 6, 2021 at 16:37
  • \$\begingroup\$ @Peter Bennett thank you I was not sure if I should or not. I'll disconnect it. \$\endgroup\$ Commented Jul 6, 2021 at 21:01

2 Answers 2

2
\$\begingroup\$

You should edit a higher resolution picture in there.

You've grounded the collectors of the transistors so they are doing nothing but dropping a diode drop- all the current is still coming from the shift register and is passing through the forward biased E-B junction.

Ideally, to get them to work properly, use PNP transistors with base resistors as so:

schematic

simulate this circuit – Schematic created using CircuitLab

The control signals are inverted (low = ON), so you'll have to change the firmware slightly.

You'll probably see a significant improvement in display quality as well as saving the shift-register outputs from a possible early demise.

\$\endgroup\$
3
  • \$\begingroup\$ I agree with your assessment but I could not get that to work. Ill double check my firmware to be sure. What I am curious though why is it working with a NPN? Note my schematic was incorrect, I corrected it. The collectors are connected to the Anode of the LEDs. \$\endgroup\$ Commented Jul 6, 2021 at 11:39
  • \$\begingroup\$ The current is flowing through the B-C junction from the shift register to the anode, like a diode, so the transistor does not provide any gain. How could it? It's got no connection to Vdd. \$\endgroup\$ Commented Jul 6, 2021 at 13:12
  • 1
    \$\begingroup\$ That was my suspicion so I'm glad my instincts told me it was not correct. In reviewing my firmware I was off by 1 bit. What a difference a bit can make. \$\endgroup\$ Commented Jul 6, 2021 at 13:38
1
\$\begingroup\$

Thank you for the assistance on this. The first part of my quandary was that I was off by one bit on my code so the shift register had the wrong values. I corrected that and the circuit worked with a PNP BJT and display is brighter and more consistent as suggested it would be.

The second part was a learning exercise. Connecting the common Anode to the Collector of the NPN BJT means current would flow from Base to Collector and therefor not doing what they are supposed to do. I suspected this might be the case but wasn't sure.

Here is the revised schematic and working as desired. Thank you!

enter image description here

\$\endgroup\$
2
  • \$\begingroup\$ Great to see. Using a current-controlled sink IC is a great way to go. They are really nice, if a little 'boutique'. (They are less so, these days, than in days I remember well.) But you got the basic idea down, which is switches on the "common end" (whether common anode or common cathode) and current-sink/source on the other end for each individual LED. Since you are muxing these, they will appear a bit dim unless you increase the current when they are on. (Eye averages it out.) Anyway +1 \$\endgroup\$ Commented Jul 6, 2021 at 16:49
  • \$\begingroup\$ The sink IC is great and I only found them recently. I did have this circuit running with a common cathode but switching to common anode with the sink driver is better. And now that I have the PNP BJT wired correctly the display is improved. Even with the multiplexing they look great. I am running an "on time" of 500us per digit and I dont see any issues. The only draw back is the reverse bit logic on the 74HC595 is a bit trickey but I fixed that too. \$\endgroup\$ Commented Jul 6, 2021 at 20:59

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.