HP QDSP6064 Bubble Display

Featured_Image-1-15

The nostalgia is strong with this one, reminding me of innumerable calculators I had as a kid growing up, so when a bunch of these came up for sale, I bought a handful to play around with. This is, in fact, a direct contradiction of what I said in the MicroView review, “I’ve grown out of my ‘oooo shiny!’ phase”. But how could you not want to play with that thing? It’s so damn cute, I don’t know if I should build a circuit board with it, or make a cartoony caterpillar outline around it.

Bubble Display Basics

What you see is a four digit, seven segment display, but it’s very small — the size of a 12-pin DIP package. The display is arranged in a common cathode configuration, with the standard A-G + Decimal Point grid brought out to individual anodes. 8 segments + 1 cathode per digit = 12 pins. There are two remarkable things about these displays besides their size. First is the clarity of the individual LED segments which look like little incandescent filaments inside the acrylic bubble, and second, is the low power required to light them up, with an average current draw of 5mA/segment with a matching low forward voltage (1.6ish to 1.8ish).

Bubble Display Under Side
Bubble Display Under Side
Bubble Display Size
Bubble Display Size
Underneath the DIP packaging, you see the model number “QDSP-6064”, the HP logo next to the manufacturing location, and what might be a date code or a lot number … finding package marking data on HP’s website was impossible … but all five of the ones I bought have the same indicator. The final mark is the PIN 1 indicator which you can see on the upper left.

The Guts

Each digit is comprised of a series of LED surfaces, arranged in a seven segment digit grid, and connected with bond wires to their respective pins. The whole display die is then encased in an acrylic body with a dome shaped face to provide some degree of magnification of the embedded circuitry. I found an old datasheet for the 1970s version of these and it says the red color is important for the following reason…

To improve display contrast, the plastic incorporates a red dye that absorbs strongly at all visible wavelengths except the 655nm emitted by the LED. An additional filter, such as Plexiglass 2423, Panelgraphic 60 or 63, and Homalite 100-1600, will further lower the ambient reflectance and improve display contrast.

So that explains why there was always that smoked plastic in front of your calculator display!


Bubble Display Connection Options

The hookup method for these is fairly simple: provide a switchable current source to each of the segments, and then provide a switchable current sink to each of the cathodes. By powering specific segments you create the pattern of a digit, and by sinking specific cathodes, you allow current to flow through one of the four displays.

QDSP6064 Pinout
QDSP6064 Pinout

For powering the anodes, you can connect these directly to your microcontroller’s digital IO pins, remember that you’ll need to supply current limiting resistors for each. You might be tempted to put resistors on the cathodes instead, but as all 8 LEDs are wired in parallel in each digit, you would be relying on the segments all having precisely the same current vs. forward voltage characteristics. Now, in the real world, you probably wouldn’t burn any of them out, but if one has slightly more internal resistance than one of the others, it won’t be as bright. Resistors are cheap, so put them on the anodes. According to the datasheet, you want to supply 5mA and can expect a forward voltage of around 1.6V. They don’t supply a forward voltage curve so you can get a better estimate, they just say at 10mA, expect Vf of 1.6V, but they want an average of 5mA. There, clear as mud. Anyway, 5V – 1.6V = 3.4V and 3.4V/0.005A = 680Ω current limiting resistor. How conveeeeeenient!

For sinking the cathodes of the QDSP6064, you need to do a little bit of figuring. For the ATMEGA328P that makes up the brains of an Arduino, you are able to sink 40mA of current on any particular IO pin, up to a maximum of 200mA for the chip overall (including the 5V out). If you have 8 segments lit (that’s A through G and the decimal place), with the 5mA current draw stated in the datasheet for the display, that would put you right at the max limit to be able to just plug the common cathode pins right into one of the digital pins. Alternatively, for the Texas Instruments Tiva C Series, you have a maximum of 18mA on specific pins. That means for the TI you’d need to come up with a different solution, like sinking through a transistor.

In coordination with reading the datasheet, I did some measuring. I placed the 680Ω resistor on the cathode for digit 1, and then provided 5V (4.82V actually after regulation and getting squeezed through the ammeter of my cheap multimeter) to each of the segments in turn, noting the forward voltage and current draw.

SegmentResistorVsourceVforwardCurrent (mA)
A680Ω4.821.554.86
B680Ω4.821.554.86
C680Ω4.821.554.86
D680Ω4.821.554.86
E680Ω4.821.554.86
F680Ω4.821.554.86
G680Ω4.821.554.86
DP680Ω4.821.584.82

So, there is tremendous consistency across the QDSP6064 segments, and at full blast with all characters used you’d be at 38mA and change if you were sinking the digit through your Arduino digital pin. For purposes of building out a little test I’m fine with that. To double check, I connected all the segments up through 680Ω resistors and measured the current draw at the cathode: 34.77mA.

Current Draw for a Fully Lit Digit
Current Draw for a Fully Lit Digit

Here’s my thought process on why I’m not worried about sinking that much current into my Arduino’s digital pins…

  1. It’s under the max current rating. Barely, but under the max rating.
  2. I know the code I’m going to run on it will only have each digit on for about 5ms out of every 20ms.
  3. I would only be at the max 38mA if I was displaying the value “8.”. Anything else would require less.

If this were going into a production board like the Education Shield Display, I’d definitely sink the current through a transistor so that it wasn’t even a marginal concern.

The cost for a little surface mount quad NPN transistor chip is around $1.75 — cheap insurance. Here is a section of a schematic showing what is meant by “sinking the current through a transistor.”

Sinking Common Cathode Current Via An NPN Transistor
Sinking Common Cathode Current Via An NPN Transistor

To enable the digit, you would bring Digital 5 high, which would allow current to flow from the collector to the emitter of the transistor, lighting the digit. The NPN transistor is easily capable of handling both the current we’re talking about, 40mA or so, and the switching frequency of the code I’m using, 50Hz. If you want a little more detail on using NPN transistors in circuits, check out the Building Things with NPN Transistors article.

To provide a comparison, this is an ATA8401ARBJ 20mm four digit seven segment display in red. It’s continuous forward current is 20mA with a Vf of 1.90V. With all the segments illuminated it draws 84.3mA, over twice as much as the Bubble Display! No way you could sink that to a digital pin, so you’d have to use transistors. I tried it with a set of 560Ω resistors instead of the 150Ω I had originally. If you do the math you’ll see that generates about the same current draw as the bubble display then. The 20mm display was still relatively bright – imagine a clock radio display with a “dim at night” feature.

20mm Seven Segment Display Current Draw
20mm Seven Segment Display Current Draw

So that’s the common cathode beat to death. Let’s talk quickly about supplying the current in the first place.

We could just connect each of the segment pins up to our digital ports, but that’s a LOT of pins to use… four for the cathodes and then eight for the anodes. You’d use up every single digital pin on an Arduino (always try to leave digital 0 and 1 free since they double as the Serial Receive and Serial Transmit respectively.) I think a far better option would be to connect them to a shift register, and then control the display via serial commands. Provided we don’t need to use the Output Enable or Shift Register Clear pins, we would be able to control all eight segments with only three pins.

Here is the full schematic, using the shift register…

Bubble Display Full Schematic
Bubble Display Full Schematic

And here is the circuit completely assembled. Down at the bottom (lost in the fuzzy focus of bad depth of field) a voltage divider is formed with a light dependent resistor and a 6800Ω resistor, creating a simple sensor I can sample with the Analog 5 ADC pin, and send the value to the display.

Bubble Display Circuit Assembled
Bubble Display Circuit Assembled

By using shift registers, you could easily expand the display to include a second QDSP6064, and just daisy chain the shift registers together: Qh’ pin to SER pin, with the SCLK pin connected in series as well as the SRCLK pins.

Coding for the Bubble Display

(It strikes me I should break out this entire section into a dedicated “seven segment display” coding post. Until then, I’ll leave this all here.)

First let’s describe how we expect the circuit to function at it’s most basic: we send a byte of data to the shift register with a 1 in the position for each segment we want turned on to create a specific number, and then we turn provide a path to ground for the cathode representing only the digit position we want to light up, leaving the other digits off.

Sending Data to the Shift Register

The segments are connected to the shift register in a straight forward fashion: SEG A = QA, SEG B = QB, etc with the decimal point connected to QH. The LEDs are arranged in the usual 7-segment pattern under the red acrylic…

Seven Segment Display Pattern
Seven Segment Display Pattern

So, if you wanted to create the number “2”, you would need to set the highlighted segments to 1 in the byte that you send to the shift register, the rest would remain 0 to keep them off.

Seven Segment Representation of "2"
Seven Segment Representation of “2”

Now that you have the correct bit pattern, you load it into the shift register by bringing the latch (SRCLK) low, sending the byte, then bringing the latch high.

Enabling and Lighting a Digit

To turn one of the digits on, you first need to configure the pin as an output, and then set it low. When low, you are establishing a connection to ground for the current that wants to flow through the digit. When high, you are keeping it at the same level (actually slightly above, but the display is made of diodes so it doesn’t matter, as long as you don’t exceed the reverse voltage threshold) so no current flows.

In order to display different numbers on different digits, you need to turn one on while keeping the others off, show the number, then turn that one off, turn on the next, show the number, over and over. I found that with four digits, holding the value for 5ms was enough to make sure each number was bright, but no flickering was seen.

Putting It All Together

Some quick caveats about efficiency, specifically, this code isn’t. I had a calculus professor, the last time I tried to go to college, berate me for never finding the “elegant” solution – this is true, but my brain works in long hand and post-optimizes (and really, I’m not going to try to find the balance between “elegance” and “show your work” when a grade is involved). I also think that it’s important when writing these posts that the thought process be easily followed. So, here’s the code, and after the jump, I’ll show areas where improvements can be wrung out of it.

So, how can this be tightened up?

  1. Array 1: define the common cathode pins in an array to reduce the amount of code needed. Makes it a little more clean too.
  2. Array 2: instantiate the “places” variables in an array.
  3. Array 3: create an array to hold the pattern of the LEDs, with the pattern located at the array position that corresponds with the number it represents. That would make the “writeNumber” method much cleaner.
  4. enableDigits: combine the four forms of the “enableDigit” method to allow the same command to be used, passing the digit to be enabled as a variable. Having the common cathode pins established in an array would make this easier.
  5. Separating the values: You don’t need to have four commands to do that, using a for loop would be more efficient.
  6. It sticks in my craw to use delay(5). The timer library would be a good thing to use here, just for best practices. The code really doesn’t demand it, but I try to avoid outright “delay” uses whenever possible out of habit. Using it here makes it very obvious how the POV works though.

One thought on “HP QDSP6064 Bubble Display

  1. Pingback: Bubble display shield for Adafruit Trinket – OSH Park

Comments are closed.