3. Design

I knew that the final design will include 6 units of 7-segment display - It is obvious when you want to display a hours:minutes:seconds time.The big question was how to drive them all. Equipped with the knowledge I had about 7-segment displays subjects, I knew that it is possible to drive 7-segment units with a 4511 driver chip. Now, this derives a new thought - My circuit is going to have some chips, such as the 4511, a microcontroller and maybe some more - They all need to operate at a voltage which usually is 0-5V. They also require that voltage to be stable. Looking at some other circuit designs with such compnents proved that the circuit voltage will be set to 5V and be stabilized with a voltage regulator unit - a LM7805 voltage regulator chip. (The 05 implies a 5V regulation).

So ok, the basic idea of how to light-up a single 7-segment unit is quite clear, but how about 6 of them on the same time?

Again, the previous knowledge I aquired helped me - I new I should use a technique called "Multiplexing". With this 'trick', you only need one 4511 driver that will control single 7-segment unit one at a time - but it will address each 7-segment unit for a very short period of time, than it will address the next one, again for a very short period of time, and the next one, again and again in an endless loop - The trick is in the human eye - It has a persistence of vision - this is why film movies work, and this is why your lamp in the room seems lighten up constantly - our eyes persist the image we see for a very short time, so if the image is flipped fast enough, we won't notice the flickering when the image change occured. Thus, when your light bulb turns on and off (because of AC current) 50 or 60 times per second, your eye just see a constant light.

So our 7-segments are going to be addressed on at a time - It will light up for a short period, displaying a specific number, and it will than turned off. The next unit will display a value for a short time and will be turned off and so forth. Great, so who's going to be responsible for all this?

First, how do you turn on and off a 7-segment? I knew a transistor should be involved - turning on and off the 7-segment unit cannot be done manually - some automatic circuitry must be provided. The transistor can be acted as a switch - I can allow current to flow or stopped. I thought about this issue - I knew that the transistor base should get forward biased so it will allow current to flow from collector to emitter.

I'm sure gonna have 6 transistors, one for each 7-segment unit, and I need something to tell one transistor to switch on, and tell all the others to switch off, so only one transistor is switched on in a single time, and thus - only a single 7-segment unit is active in a single time.

The thing is, that the 4511 driver should be set to a different value for each of the 7-segment units.

All this orchestration should be synchronized! Now I knew what are the basic duties of the 'smart device' that should control the 7-segments:

First duty - Set a binary value for the 4511 driver chip, using its four lines of inputs.

Second duty - Switch on one of the 6 transistors so the value will be displayed on the correct 7-segments unit.

The 'smart device' is actually some kind of a microprocessor or microcontroller - I read about microcontrollers on EPE Magazine and what I read about the PIC microcontrollers actually gave me the inspiration of trying to build something that involves a microcontroller. This is why actually all this project was initiated.With the knowledge I aquired about PIC programming, I decided to go for the PIC16F628A because it looked very popular, it was cheap and had many I/O ports.

It was a little like gambling here - I wasn't really sure if this was the right microcontroller, so I tried to collect all the facts I knew about the project.

I knew now, that to control a 4511 driver, I needed 4 lines that will send it the binary value.

I knew that I need 6 lines to control each transistor (for each 7-segment unit).

I also knew that the PIC cannot produce the values by its own - it's not an ordinary clock - it should get the time information from the Desktop PC.

After a lot of reading and investigation I found out that I need only one input for the USART to receive data from the PC - I'm not going to send data back tp the PC. I also found out, that a special circuitry is needed to bridge bweteen the PIC and the RS-232 COM Port of the PC. This is required because there are two circuits that should be connected by wires, but they work in different voltage levels. The device I'm building is working between 0V to +5V. The PC's RS-232 port uses voltage levels of -12V to +12V. So somehow, the -12V should be translated to 0V and +12V should be translated to +5V. This is done by a converting chip, the MAX232. Reading the MAX232 specification, it turns out there is a need to use 5 electrolythic capacitors with the chip - those capacitors should be connected exactly as shown in the specification - polarity really matters here becasue they are electrolythic.

I started to 'build' the circuit on paper. To be more preciesly - using Visio. I built my own Visio electronics symbols library, which included all the components I knew will be required including all specific ICs. Only when I started drawing the circuit and connecting the components, I started to undestand what is the required layout of the components. It turned out that my circuit can be divided into three sections: Power supply, logic control and display.

stripboard layout.pdf

ElectroTime Schematics

Power Supply

Building a full power supply was beyond my knowledge and my skills, mainly because I really didn't want to mess with high voltages and currents - I just don't want to get electricuted, and also don't whish to burn my device or my PC. My decision was to use some commercial power supply that fits my needs. Still, I was the one who is responsible for te stability of the voltage source, so my power supply actually does this - It get a voltage source and regulates it to +5V. It also has a diode to prevent inverted polarity.

Logic circuit

This is the heart of the system - In the center - there's the PIC micro which orchestrates the whole operation. There's also the communications section that provides a connector for the PC's RS-232 and the MAX232 with its 5 capacitors, connected to one input port of the PIC. There are the 6 transistors that gets their commands from 6 output ports of the PIC, and 4 output ports that goes and connects to the next circuit - t the 4511 driver.

Display circuit

This circuit is controlled by the single 4511 chip. The chip is connected to the PIC using 4 lines that goes from the PIC's 4 output ports.

There are 6 7-segment units that sits in this circuit - they are laied-out in groups of two, so every two units represents another section of the time in that format: HH:mm:ss. All the 7-segment units are connected one with the other in parallel - but only one leg of each is not connected to the other unit - the ground leg.

The ground leg of each 7-segment is connected to a transistor in the Logic circuit. The reason for this is that the 7-segment units are of type 'common-cathode'. There's also a type - 'Common-anode'. But I purchased the 'common-cathode' so the transistor should be connected to the ground of the 7-segment unit.

Please note - the schematic doesn't show it, but each rail that goes out of the 7-segment lines, is first connected to its own 110 Ohm transistor to limit the current to the 7-segment unit.

I also take no responsibility to anything that can happen by using this scheme or by trying to build this project!

Next >>