7 Segment, 4 digit LED Display

Resources

See this the downloads page at the Arduino section and download:

BV4513 7 seg.zip for this libary
I2C_bv.zip for the common I2C methods

Introduction

The BV4513 is an LCD controller that has an ASI and I2C interface. The ASI interface means that it can connect directly to a COM port if required and more than one device can share the same bus this is because each device has its own unique address. The address is settable by the user and stored on internal EEPROM.

The I2C interface address can also be set by the user. This provides a very flexible arrangement ad many devices can be put together or used with other I2C devices. A full description of the ASI protocol and connection information can be found here: http://www.asi.byvac.com/pr_asi.php

This guide deals with the I2C interface exclusively.

Choosing the interface

The I2C interface is the one with 4 pins. The pins are marked:

+V    This should be connected to 5V on the Arduino
SDA This is the data line and should be connected to the Arduino Analogue input 4
G    Is the ground
SCK This is the clock line and should go to the Ardiono Analogue input 5 - sometimes designated SCL

Pull up resistors

It is very important to supply two pull up resistors for two reasons. 1) the I2C specification requires it, the hardware interface to I2C is only partially complete (open collector). The addition of the resistors completes this hardware. The reason is so that more than one I2C device can be connected to an I2C bus -- only one set of resistors is required for the bus no matter how many devices are using that bus.

The second reason is that the BV4513 will detect the presence of the pull up resistors and switch its firmware to be I2C compatible. The value of the resistors is not that critical and any values from 1k to 10k will do. The recommended value is 5k6 but most of the time a 4k7 resistor is used because it is a more popular value.

Connecting Up

In this example an Arduino nano has been used and the display is pushed directly into the breadboard. The blue wires are the clock and data lines coming from the analogue inputs. On the left hand side the pull up resistors go to these lines and are connected to the 5V supply. In this example 4.7k resistors have been used.

Example pde

The example called BV513_I will run through a sequence of display examples. The example output can be seen on this video.

Software and Library

This library extends the I2c_bv library and the following is a description of the additional methods.

BV4513_I Specific

The library that can be downloaded from this site should be placed with the other Adruono libraries. It is called BV513_I, the 'I' refers to the I2C library as this device is capable of being operated in more than one way. There is also an example in the zip file. The library uses the Wire class and this should be provided as an include.

BV4513_I  This is the constructor. The 7 bit version of the address is used and the default will be 0x31, example:

BV4513_I seg(0x31);

bright(char value) Changes the brightness of the display, see the data sheet for suitable values, currently they are 0 for dim and 25 for bright. example:

seg.bright(1);

cls() Clears or blanks the display so that no digit is illuminated, example:

seg.cls();

sendbyte(char digit, char value) Individual segments of the display can be illuminated by sending a single byte. The datasheet has more information on the value of the byte to send to illuminate which segment. Digit is in the range 0 to 3, where 0 is the most left hand digit and 3 is the rightmost. Value is any byte value 0 0xff example:

seg.sendbyte(1,0x8) illuminates bottom bar of second digit along

number(char digit, char value) This will illuminate the appropriate segments to represent a number, in other words simply send a number and it will be displayed on the specified digit. The range of the number value is 0-16 as follows:
0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,<blank>. Digit is in the range 0 to 3, where 0 is the most left hand digit and 3 is the rightmost. Example:

seg.number(2,3); Places a '3' on the end digit.

sp(char digit, char on) Turns on or off the decimal point for the specifies digit, a non-zero value for on will turn the dp on, 0 will turn it off. Digit is in the range 0 to 3, where 0 is the most left hand digit and 3 is the rightmost. Example:

seg.dp(0,1);