Nano control thirteen 14 segment Alphanumeric

I have Nano 328. I would like to use it to control thirteen 14-segment Alphanumeric. I was thinking to use all the pins A0-A7 and D0-D13 and use SN74154N with transistors 5517 NPN 5517 for each Alphanumeric to turn it on. Will that work? I took electronic classes 40 years ago. I got single Alphanumeric working but I control twelve or thirteen 14-segment Alphanumeric. Do you have a better suggestion on this?

No idea. But be aware that A6 and A7 are analogue input only. So you can't use them to control a transistor or whatever.

why not just using two HT16K33 on I2C and one of the existing libraries, e.g. Arduino Noiasca HT16K33 library for 7 segment and 14 segment Holtek LED driver

I was thinking to use all the pins A0-A7 and D0-D13 and use SN74154N with transistors 5517 NPN 5517 for each Alphanumeric to turn it on.

You can't conveniently use pins D0 & D1, they are needed for uploading your code and using the serial monitor. A6 & A7 can not be used as outputs as already mentioned. So you have only 17 conveniently useable outputs in practice. Even with the 4 to 16 line decoder, you would need 18. You might get away with using D1 (=TX) as the 18th, if you did not need to use the serial monitor. So yes, your idea could work. But it might not work well enough. I'll try to explain why.

The problem is current. The segments in LEDs can normally draw up to 20mA. That doesn't mean they have to, and often a fraction of that maximum can be bright enough. Modern LEDs are much more efficient than they were 30 years ago, and 2mA in a modern led can look as bright as 20mA in an led from 30 years ago.

Nano pins have a maximum current of 40mA, so that's not a problem here. But the chip has other internal limitations which mean that certain groups of pins are limited to perhaps 100mA in total and there is a total for the whole chip of 200mA. But you should always stay clear of maximums, if you want your circuit to have a long life. Assuming you use 140mA of that maximum 200mA, that's 10mA per output pin. Which sounds ok if you only want to run 1 digit.

But you are multiplexing 14 digits, switching rapidly between them fast enough to avoid visible flicker. So on average, the current received by any segment is only 1/14th of that 10mA, so about 0.7mA. It is the average current that determines the brightness the eye perceives.

0.7mA is a lot less than the maximum 20mA the segments can draw. You can guage how bright this would look by connecting a segment of your display to 5V and ground using a 4K7 series resistor. (Assuming your segments are red and have a forward voltage around 1.8V, ( 5 - 1.8 ) / 0.0007 = 4571 ohms, 4K7 is nearest). So try that and see if it will be acceptably bright.

If not, I certainly agree that ht16k33 chips would be a good plan.

noiasca,

Sorry, I did not get back to you soon. I am still trying to understand how to use HT16K33. You said we need two of them HT16K33 which we can run 13 of 14 segment Alphanumeric. I check it from Adafruit and looks like each HT16K33 can run 4 of 14 segment Alphanumeric. Can you explain to me how can we use two of them to run 13 of 14 segments? I am wondering how many digitals we can run 14 segments Alphanumeric? It would be nice to have some wire diagram or a schematic for it.

The HT16K33 is capable of controlling up to 8 16-segment displays, so it will work for 8 14-segment. Adafruit does not appear to sell a pre-made board with that configuration, although a google search should show you that they are available. The 4-digit boards from Adafruit have selectable I2C addresses that allow you to run up to 8 boards simultaneously, so you could run up to 32 digits using those.

most of the offers are only 4digit boards. So far I've found only this shop selling 8digits:

For wireing diagram take a look at the datasheet of the HT16k33 on page 34

Also Adafruit sells this board: Adafruit 16x8 LED Matrix Driver Backpack - HT16K33 Breakout : ID 1427 : $7.95 : Adafruit Industries, Unique & fun DIY electronics and kits
The only thing you need to do is to connect LEDs.

OK, I order two HT16K33. I need to find more information on it. How do we wire them to 13 of 14 segments alphanumeric and code for Arduino? Is there a website for learning how to use HT16K33 with some 14 segments alphanumeric and Arduino? I will keep google to see if I can find some.

For wiring you need common cathode displays. Wiring of the matrix is on page 37 of the datasheet.


Probably its a good idea to wire all segment A to row0, B to row1, ..., G1 to row6, ...

For programming the HT16k33 I ripped out the relevant code of my clock project. Might help you to get started. (lookup[] definitely needs to be adjusted for your needs)

#include <Wire.h>

#define ADDR_DISP 0x70

const uint16_t lookup[18] = {
  // PMLKJIHGGFEDCBA
  //        21
  0b0000000100111111, // 0
  0b0000001000000110, // 1
  0b0000010001011011, // 2
  0b0000100001001111, // 3
  0b0001000001100110, // 4
  0b0010000001101101, // 5
  0b0100000001111101, // 6
  0b1000000000000111, // 7
  0b0000000001111111, // 8
  0b0000000001101111, // 9
  0b0000000001110111, // A
  0b0000000001111100, // B
  0b0000000001011000, // C
  0b0000000001011110, // D
  0b0000000001111001, // E
  0b0000000001110001, // F
  0b0000000001000000, // -
  0b0000000000000000, // Blank
};

void sendCMD(byte b) {
  // Send command to display
  Wire.beginTransmission(ADDR_DISP);
  Wire.write(b);
  Wire.endTransmission();
}

void sendDigit(byte pos, uint16_t value) {
  // Send RAW data to display
  Wire.beginTransmission(ADDR_DISP);
  Wire.write((pos & 0x07) * 2);
  Wire.write(value & 0xff);  
  Wire.write((value >> 8) & 0xff);  
  Wire.endTransmission();
}

void setup() {
  Wire.begin();

  // init display
  sendCMD(0x21); // system oscillator on
  sendCMD(0xa0); // ROW driver output
  sendCMD(0xef); // Dimming ->  16/16duty
  sendCMD(0x81); // Display on, Blinking off

  // clear display
  for( int c=0; c<8; c++) {
    sendDigit(c, 0);
  }
}

int x=0;
void loop() {
  for(int y=0; y<8; y++){
    sendDigit(y, lookup[(x+y)%16]);
  }
  x++;
  delay(1000);
}