I am building a digital clock using an ESP8266 and several HT16K33's. I am using the HT16K33s to drive 5V LEDs on the bottom of the clock for date, but I have some 2.3 inch white common anode LEDs that I wish to use to show the time (approx 13.25VDC).
I would like to use a HT16K33 on these as well and I think I have come up with a way to do this. I wanted to run it past some folks with more experience than me and see if I am missing something, or if this should work:
The HT16K33 will run on the 5V rail, and I am using 2N2222A (NPN) transistors to drive the cathodes of the individual segments.
The anodes required a bit more work. I am using a CD4050B to step up the 5V logic to 15V, then using the outputs of that chip to switch some 2N3906 (PNP) transistors to drive the common anodes of each segment.
My understanding of the HT16K33 is that the ROW outputs are active HIGH and the COM outputs are active LOW so this should flow fairly easily.
My concern is in the details of the HT16K33... am I going to be over-driving the 2N3906 transistors? I am not sure how many segments it will light at any one time.
Is there anything in general that I've missed here? I am not 100% sure on the resistor selection for the 2N2222A transistor as the datasheet shows plenty of different gains and I'm not sure how to read it. Thanks for any input on this project.
jremington, thanks for the catch on the transistors being upside-down. I updated my schematic. Surprisingly, the transistor being backwards WORKED on the breadboard. I flipped it around and it still works so... not sure what is happening there. It was my understanding that the CD4050 would switch between VSS and VCC given a 0..5V input but perhaps I need to go back to the drawing board on that one.
I appreciate the suggestion, thank you again. Looking at the circuit, it appears that applying 5V at the base of Q2 will turn on Q1 and the load would be energized. I need the reverse... Q1 needs to conduct when the input (SW1) is connecting R1 to ground.
Hi,
Can you, in a new post, show your edited schematic with PNP connected the correct way around?
Please include the LEDS etc so we have a complete diagram.
I thought I included the update with the last post but I see now that it did not upload. Here is the revised schematic (note the LED itself is the wrong part, I need to make one for Eeschema but have not had a chance to). It is not complete but shows the gist of the anode and cathode lines.
The PNP appears functional, despite being wired backwards. However I have set it aside and am using a new one to test a high side switch as follows:
Edit: My problem now is that the LED is always lit, regardless of the state of "GPIO" (+5V or GND)
I will still need an inverter if it is active high. This is not an MCU I am attaching it to but rather the HT16K33 LED driver chip that runs that line at active low. I know this is a bit convoluted but I am doing this to keep the driving logic out of the MCU itself.
My problem now is that the LED is always lit, regardless of the state of "GPIO" (+5V or GND)
How have you verified EBC pin assignments for the transistors?
Please post a hand drawn schematic of YOUR circuit, with actual component values entered.
Note that the schematic shown lacks the required base resistor for the PNP transistor. You may have destroyed both transistors, if you wired it that way.
why do you wish to use the HT16K33 in this case? It solve not problems, but produce a bunch of problems. Are you a masochist?
The easyest way are some 74HC595 shift registers with npn resistors or integrated driver. A SAA1064 (canceld by manufacturer) can work from 5 to 18V, drive 4 digits 7 segment CA with I2C. If you must use the HT16K33, use a smart trick: For every LED segment use a optocoupler 817 or 847 (4 couplers inside). With the npn transistor output you can drive easyly your 15V segments. Don't forget a resistor fore each segment. CTR from optocoupler should 100% or better. This means, the ratio from inpt to output current. With a factor smaler 100% it could be, that the transistor switches not fully open.
The Displays will also multiplexed over the optocouplers, like directly. This is importand for calculate the resistors.
Hi,
Do you have a DMM to troubleshoot the two transistor circuit?
Can you please post your circuit that you have in post #10, with resistor values included?
It is not surprising BJT transistors work with Collector and Emitter swapped. However it has much worse characteristics - it is slow, with low gain and has low breakdown voltage.