Digital-Circuits (Page 2)

The basic digital circuits are Flip Flop and Counter, both are here. This circuit can be cascaded to make even a 6 digit event counter, even a simple frequency counter can be made.

These are best done with microcontrollers today. Then what if you have to design your own microcontroller on a FPGA, so the basics have to be sound, hence you have to know what gates, flip flops and counters are.

Simple Digital Event Counter

see the seven segment display. Inc, Dec, and Set buttons are momentary acting and Clk Button is latching type. The Dip Switch in the also can be set.

a. – Set the DIP Switch as you like and then Press the Set button. The BCD value will be at the 4029 output, The Decimal value will be seen in the seven segment Display. Now try for different dip switch settings and see the BCD and Decimal output.

b. – Now Press The Inc and Dec pushbuttons. Set it to Increment up-count or Decrement which is down-count. This is a simple flip flop control.

c. – Now Click the Clk – clock or count button, the switch will latch, press it again to release. If you toggle it once the counter will get a single pulse and it will count it, see the BCD and decimal displays. Now you turn it on and leave it, the counter will keep counting one per second till you turn it off, the clock nand gate is wired to be an oscillator.

The decimal point LED of display is given to Carry Out pin of 4029 so observe this at 9 and 0 or transitions.

Add 104 CD, 0.1uF ceramic disc cap to all the ICs across the supply pins. Also add a 104 CD cap across Inc switch and one across the Set switch for power on default settings.

See a Tutor Digital up down BCD counter that will help you take the first step in digital electronics.

This is an example of a cascaded or sequential timer, here two CD4541 are forming a two stage timer. You can add more in a chain, but better to use a microprocessor or Microcontroller for such a purpose. But make sure EMI-RFI immunity is high for these circuits or wrong resets and sets can make a machine like an Oven or Environment Chamber malfunction and even ruin the job.

Two Stage Sequential Timer – del90004

Two Stage Sequential Timer

U5B a flip-flop is used for the control switches Start and Stop to prime or shutdown the sequential cycle. The first timer U2 sets the flip-flop or register U5A after a period T1, this register turns the relay on thru Q3. The second timer U4 which was triggered by the first will reset the U5A after time period T2, U5A then shuts down relay. U5A also then resets entire process thru U3C and U3D.

Some outputs are via Dual Differential Line Driver type DS8830. This device will interface with standard TTL systems.

Differential to TTL convertor using LM339

The differential outputs are balanced and are designed to drive long lengths of coaxial cable, strip line, or twisted pair transmission lines with characteristic impedances of 50 ohms to 500 ohms. Differential transmission is superior to single wire transmission in that it nullifies the effects of ground shifts and noise signals which appear as common mode voltages on the transmission line.

Mixed and Interface Circuits

If the signal voltage at the end of the line is found to be of insufficient magnitude then the following circuit may be used (at the recipient equipment end) to boost the levels.

U1 CD4541 is a Timer with Long Duration Ability. This timer is started by a low pulse from earlier circuit, when the temperature goes above setpoint, a low state is at U2A inputs, this starts the timer. The timer output goes high after a preset time. U2C-D Flip flop is power on reset via cap C7. Even a manual ‘reset’ is used if required. This alarm toggle is ‘set’ when The temperature remains high even after the preset time period of U1.

Timer and Counter Modules – del90002

Timer and Counter Modules

A digital counter monitors the number of times a process goes beyond a certain temperature limit over a long cycle of time. This circuit has a Analog Timer and Digital Counter. The Analog timer turns on an Alarm if the Temperature Limit transition is very long.

This circuit is a small representation of a very low cost printer sharer. It has no Active Devices only diodes.

Simple High speed data switch

Pot the product in epoxy with a black dye, they serve the purpose. Output impedance of this circuit is high, sink is 220K source is 3.9K+ so use some buffers or drivers at Output. If Buffers are omitted, then fix this unit on the printer port connector of Computer.

when Enable A is at float-high impedance or low the output O1-O4 is not influenced by A1-A4 inputs. If Enable A is made logic high or 5V then A1-A4 is available at O1-O4.

By turning Enable A or Enable B high, you can route the data A1-A4 or B1-B4 to the output O1-O4, you can also mix data and you can expand to any number of input sets or data width. 1N4148 is fast, 4nS, that makes this data switch quite fast. This circuit cannot drive long printer cables without drivers. They will load the output.

CD4538 is a dual Monostable Multivibrator. When you trigger the chip the output sends off one single pulse or one high-low event.

Mixed Circuits Analog with Digital

The T+ pin 4 of U1a is the positive edge trigger or raising edge trigger input, the T- pin 5 is falling edge or negative edge trigger input. Now see the image of the single pulse above which shows both the edges, If this is the input pulse at pin 5 then the falling edge turns the output pin 6 from low to high, this output remains high for time T = R2 * C1 and then goes low again, The output Q at pin 6 also looks like the image of pulse above.
Monostable Multivibrator CD4538

The Output pin 7 is the complementary state of pin 6, it is the reverse state or inverted form of pin 6 output.

Now why is a slope shown in the edges, this i have exaggerated a bit so that it can be explained. But then there is a slight slope due to gate input and output capacitance.

In fact if you had a wire or twisted track coming to the input and the R2C1 was in nano seconds, then you would see a ringing at the edges, a tiny peak or spike, which will have giga hertz frequency components, in fact a square way may be many sine waves put together, this you know from a spectrum analyzer.

Two Stage Sequential Timer

CD4538B can give an output with pulse width of 1uS and above. 74HC4538 gives 120nS to 60 Seconds pulses. The above circuit produces a pulse of width T = R3 * C2 after a delay of T = R2 * C1. Some Chips formula is T = 0.7 * R * C .

I had to once interface an high voltage circuit to PC, The uC had to communicate thru RS232–Comm port–Serial Port.

Part of the 80C31 8051 SBC

Even though i had isolation at the sensors and actuators to make doubly sure the PC also has been isolated. There are chips that are available for this purpose, The circuit above is built with discrete and passive components except for the opto 4N35. You can use MCT2E and CNY17-3 Optos too. For MCT2E some tweak may be needed as current transfer ratio is 20, for the other two CTR is 100 so above design will work.
RS232 with Opto-Isolation

The circuit derives power from PC but does not load the PC supply. Any voltage above 5V applied to the PC connectors may lead to damage of motherboard in PC. Old PCs were more vulnerable but PCs today maybe a bit rugged at the Ports. Due to internal current limits and clamping.

The VCC, VDD and Agnd are derived from PC no other power needs to be applied on PC side of opto. On uC side of opto the uC power supply lines +5 and gnd has to be used. There is no copper link between the two sides and depending on opto a 1KV isolation is possible if PCB is well designed. The PCB should show the visual isolation above and components should be laid on separate areas of PCB to prevent creepage.

The LEDs are to indicate the port activity Rx and Tx, they are not required once testing is over. The circuit can be simpler, but this worked for me and it is not tested at very-high buad rates.

The levels of RS232 are not TTL like 0-5 we have both polarities +10 and -10. The circuit has to change that to drive the Opto Leds.

RS232 software. Understanding RS232 Serial Port Communication.