Testing Inverters

Hi,

I am trying to test a 74HC04 Hex Inverter and a 74HC14 Hex Schmitt Trigger using Arduino.
But I have no idea of how to do this, can someone help me? and show how I might go about writing the code for it?

Thanks in advance,

What exactly do you want to test? Are you concerned that the microchips may be faulty?

...R

I would suggest that you first try the examples of how to blink an LED; i.e. its a program which sets a pin to a particular logic level.

And then how to read a switch; i.e. which is a program that tests the logic level on a pin.

If you understand how an inverter works, you should be able to see how the programs above could be used to test such an inverter.

the easiest way would be to hook them up to individual pins and use a led + resistor on the output port or hook them back into the Arduino onto pins defined as INPUT.
The pinout for both types is the same
P14 = +,
P7 = GND
Gate 1 1->2,
Gate 2 3->4,
Gate 3 5->6,
Gate 4 13->12,
Gate 5 11->10,
Gate 6 9->8.

Or as i remind myself direction of the gate is power side to Gnd side.
So hook input side of the gates onto pins, and define those pins as output and see what the result is at the output side of the gate.
For testing the schmitt-trigger it is going to be quite a bit more complex, since the PWM is way to slow to not just flick the gate. Maybe you could use a resistor and a capacitor to get an actual voltage, though better you set the voltage manually using a variable resistor as a voltage divider, and measure the voltage using an analog input.

since the '04 and '14 have the same pinout, you presumably have a socket for them, wired to Vcc and Gnd, the inputs wired to Arduino pins configured as OUTPUT and the outputs wired to pins configured as INPUT.

it would make sense to create 2 arrays defining the 6 input and 6 output pins which can be used to config both appropriately as well as testing each pin, toggling its value HIGH/LOW and verifying that the corresponding output pin from the chip is the opposite.

presumably you'll report the results on the serial monitor.

post you code after giving it a shot

Hi, im guessing that you are trying to compare both IC's, not "test" them.
You have to apply the same input on both IC's, ie In1, then on the arduino you have to read the outputs of the IC's for a period of time and count how many times it goes from 0 to 1, Schmitt trigger should have just 1 count and the Inverter should have more than 1.

edpsycho:
You have to apply the same input on both IC's, ie In1, then on the arduino you have to read the outputs of the IC's for a period of time and count how many times it goes from 0 to 1, Schmitt trigger should have just 1 count and the Inverter should have more than 1.

not sure why you think there should be more than one count on the plain inverter without specifying what the input is.

if the OP is trying to better understand the differences between the two, an analog output voltage (not PWM) could be applied to both to determine the switching levels both for low to high and high to low. The level for the Schmitt invert will be farther apart.

while a heavily filtered PWM signal might work, it might be easier to simply use a pot and measure both the input voltage to the inverter as well as the digital output level

while a heavily filtered PWM signal might work

I think you'll get quite far with just a 10K resistor and a 100uF capacitor already, you can increase the values for bigger stability.

it's not clear what you are trying to do. It looks like you have some code to drive 6 outputs high or low. Are you "testing" the inverters or just trying to use them? where do you read the "inputPin1"? what are the pins connected to?

since truthValue1 is set to zero, the condition will always be the same

    truthValue1 = 0;

    if(truthValue1 == 1){

Deva_Rishi:
I think you'll get quite far with just a 10K resistor and a 100uF capacitor already, you can increase the values for bigger stability.

see Low-Pass Filter a PWM Signal

i'm not seeing the post for the emai from jazzclub2020 l i received the following

Yes, the goal is connect the inverters on a breadboard and then to connect it to an Arduino. The Arduino code should test if the inverter is working or not. That is my goal.

look like there was an earlier post from jazzclub that is missing as well

assuming this gets posted, 6 output and 6 inputs need to be configured and code to toggles each arduino output pin connected to an inverter input and verify that the corresponding arduino input pin is opposite

Still sounds like a lot of work, i would do it with on a breadboard using just a LED & 1K resistor one port at a time.

I am still unclear what there might be to test about logic chips. To my mind they are so reliable and predictable that I would use the logic chips for testing something else.

And how they work is described in great detail in the relevant datasheets - there is no mystery.

...R

PS ... they are so cheap that if you think one of them is faulty just throw it in the trash.

my mind they are so reliable and predictable

They can break or be broken and i understand you may want to test one before soldering it into a circuit board, still using an Arduino for it seems like overkill. A similar circuit board with an IC socket would do just fine.

if you think one of them is faulty just throw it in the trash.

Definitely !! throw it by all means, and straight away once you've determined it is faulty. Don't hang onto it, thinking that if one of the gates is not working may still use one of the others .. Just throw it. Order a few, if in doubt use IC-sockets in your projects. Have a few different types in stock, and be a little careful when connecting things on a breadboard. Connecting an output incorrectly will fry them, though not visibly, which does explain the need for testing.

like so many questions on this forum, it sounds like just another programming exercise

gcjr:
like so many questions on this forum, it sounds like just another programming exercise

...that was my impression as well. Especially when they didn't follow up in the thread.