Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Help needed on designing a circuit for a digital clock (A level project)

Status
Not open for further replies.
The circuit needs a crystal not a signal generator.

Crocodile Technology might not have a crystal model in which case it's all right to substitute it with a signal generator for the purposes of simulating it because applying a signal to the oscillator pins will work.
 
for some reason the counters seem to be counting really slowly, maybe its just the program?
I managed to get a 1 min pulse by using a 404 chip with a signal generator at 6MHz, is this possible?
its just a signal generator(attached to ground and then clock pin of the chip)/crystal at 6MHz, and then the and gates are attached to outputs 1,2,3,4,5,6,8.
 
Radio clock

Hello,

Another thing you could try is using a radio receiver to pick up the time, decode it with a pic and then display the time. Means that the time is always accurate.

Radio Clock

For my electronics project I should have done it that way but I'm so far into it now its too late to turn back, only problem with mine is the program :(.

Rob
 
problem is, id need a PIC chip that would be able to power 72 different LED's =/
And would that be more complicated than mbarazeen's method?
 
It will be slower than in real life.

You'll need a very powerful computer to simulate a 6MHz circuit in real-time, especially in Crocodile Technology which isn't know for its speed or accuracy.

Plot the output using the oscilloscope probe and measure the time that way, but beware that it might take a long time for the cycle to complete.

There's no point in simulating such a simple circuit when it's so easy to figure it out and it will work if you design it correctly. It's not like a transmitter or audio amplifier where things can be fuzzy. Digital circuits like this will work privileging you add all the required power supply pypass capacitors and keep the oscillator section as small as possible. A simulator won't puck up any of the aforementioned design errors anyway.

If you must simulate it, get the 1 pulse per minute part working, then replace it with a squarewave generator set to one pulse per minute or even scaled up to 1Hz so you don't have to wait a day for the simulation to complete. The more components you have the slower the simulation is going to be, simply your circuit as much as possible and don't bother trying to simulate the whole circuit as you'd build it - that's a waste of time.
 
This i a new circuit i designed, it uses 2 4017's, it is only the minute part of the clock, at the moment this circuit only goes up to 45 minutes (the 1Hz signal generator replaces the one min time base so the simulation will run quicker)
 

Attachments

  • Untitled..jpg
    Untitled..jpg
    178.9 KB · Views: 294
yes you are approaching the right idea, i wanted to post you nearly the same, couldn't find good time 2 draw it fully.
use all 10 outputs of the 2nd IC, and take 6 outputs from the 1st one so you will get 60 states.(or other way round 10x6)

you don't want to use AND gates, from the 1st IC drive 6 transistors(, that will enable 6 set of 10 LEDs in sequence. so its made more simple. the same you can go for 12 states by 6x2 matrix (for hours) so you can avoid using AND gates.
 
can you show me how to connect the transistors? i am understanding this circuit more as i go along

see the attached to understand how it can be wired using transistors. i just did in paint coz i am out of home.
 

Attachments

  • circuit-1.JPG
    circuit-1.JPG
    30.2 KB · Views: 393
i did that, but the chips dont give the LED's enough power to light up brightly, is there a way where the chips can just send a pulse to the bases of the transistors, and then a seperate current is running through the transistors and LED's?
 
Why do you need all those NANDs?

You only need a couple of CD4017s and a hex inverter suck as the CD4069.

Why use a 6MHz crystal when you need loads of dividers?

Use a 32768Hz watch crystal which only needs a CD4060 and a divide by two counter.

You could use a CD4027 which contains two flip-flops, you might be able to use the spare one as part of the 12 hour counter, I haven't thought about that yet.
 

Attachments

  • 60 LEDs..PNG
    60 LEDs..PNG
    6.1 KB · Views: 419
I did that circuit in croc tech, but the LED's arent receiving enough power?
Is there any way to add external power to the LED's?
 

Attachments

  • Untitled1..jpg
    Untitled1..jpg
    139.8 KB · Views: 366
I managed to make a bit for the hours, but only 10 hours, i dont know how to use a flip flop or to get the last 2 hours and then make the whole system start again
 

Attachments

  • Untitled2..jpg
    Untitled2..jpg
    135.5 KB · Views: 306
I did that circuit in croc tech, but the LED's arent receiving enough power?
Is there any way to add external power to the LED's?

I realised that might be a problem after I posted it.

It's because the CMOS outputs have quite a high resistance.

Increasing the supply voltage will help.

Under a certain supply voltage you can omit the series resistors with CMOS so you might want to try that.

Another option is to move to move to HC because it has a higher output current, that is assuming you can get the 4017 in HC flavour.

Here's a an efficient way of doing the hour counter. You can use the other JK flip-flop on the CD4027 in the same way to convert the 2Hz from the CD4060 to 1Hz to drive the whole counter with.

Rather than using another IC for the AND gate you might be able use a couple of diodes and a resistor, I'll post a schematic if you're not sure.

I have a concern about the resetting of both of these circuits, it might work in the simulation but there might be problems in real life. The trouble is different ICs are being used and they will be on different parts of the PCB. This means that one IC might reset before another and its output could change before the other IC is set. This race condition could be solved using some RC circuits to ensure that the most important one resets first. Anyway I suggest breadboarding it before you make a proper PCB or solder it on a strip-board.

I have an old version of Crocodile Clips and although it's easy to use, it's not a very powerful simulator. I haven't tried the latest version but I wouldn't expect it to be that much better. I've moved on to more powerful software since leaving school but I still use Crocodile Clips for schematics or simulating very simple circuits or logic gates.
 

Attachments

  • 12 LEDs..PNG
    12 LEDs..PNG
    5.1 KB · Views: 421
Last edited:
here is the whole circuit with the 1 min time base replaced with a 1Hz signal
The whole thing works, 60 leds and 12 hour leds
The one problem is, because there are so many LED's, They light up quite weakly, even with 12V going through them.
 

Attachments

  • Untitled43..jpg
    Untitled43..jpg
    147.4 KB · Views: 383
It's got nothing to do with the number of LEDs because there are only two LEDs illuminated at any instant.

The LEDs are dim because the CMOS outputs are weak, I've told you how you can resolve this issue, I suggest you re-read my previous post.

I'd take what Crocodile Clips tells you with a pinch of salt, the current capability of a CMOS output varies with the supply voltage and high brightness LEDs shouldn't be too dim even at a couple of mA.

I also forgot that this circuit shouldn't be powered with voltages over 5V because it's the typical maximum reverse voltage rating of an LED, although, I've connected LEDs to 12V in reverse and they've survived before.
 
I dont know what CMOS is =/ The output pins from the 4017's only trigger the bases of the transistors, and the LED's are then powered by a voltage rail, the only way i can get them bright is if i connect the negative ends of the LED's to ground, but then they dont flash in sequence. The negative ends are connected to the pins of the 4017 and the Flip flop, but i dont know why its stopping the LED's from lighting brightly. Do you know why? sorry if you've allready answered this but if you did i didnt understand. And if you do do you know how to fix it?
 
CMOS is the technology used to make the CD4017. The old 4000 series CMOS has a low output current capacity (0.88mA to 8.8mA depending on the supply voltage), the newer 74HC series has a higher output current capability, typically 25mA per output. If you replace the CD4017 with the 74HC4017 you'll be able to drive the LEDs, straight from the outputs without using any external transistors. You'll also need to do this with the CD4027. In fact I recommend using HC for all the ICs if you can.

Lots more information on the 74HC vs 4000 series can be found on Wikipedia and using Google.

I didn't look at your circuit properly and thought you were talking about LEDs connected directly to CMOS outputs, not transistors.

It's difficult to see the circuit, can you please paste your circuit from Crocodile Clips to MS Paint and save as a GIF or PNG file rather than posting screenshots with the zoom level set so small.

You appear to be using the transistors as emitter followers. When you connect the LED and series resistor from 12V to 0V the voltage across them both is 12V so the LED will be bright. But with the transistors the maximum voltage across the LED and series resistor will be the logic level minus Vbe which in this case will be about 5V - 0.7V = 4.3V so the LED will be much dimmer.

There's no need for all those transistors, you only need six ICs (three 74HC4017s, a 74HC04 (hex inverter), a 74HC109 (dual JK flip-flop) and a 74HC4060), the only discrete semiconductors you need are the LEDs and a couple of diodes to make the AND gate I was telling you about, the rest will be resistors, capacitors and a crystal.
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top