CD40106 - Hex Schmitt Trigger Inverter IC Documentation
The CD40106 is a hex Schmitt trigger inverter IC, a type of integrated circuit (IC) that contains six independent inverter circuits with Schmitt trigger action. This IC is widely used in digital electronics and IoT applications where a high-level of noise immunity is required.
The CD40106 has a 14-pin DIP (Dual In-Line Package) configuration, with the following pinout:
| Pin | Function |
| --- | --- |
| 1-6 | Input (A) |
| 7-12 | Output (Y) |
| 13 | VCC (Positive Supply Voltage) |
| 14 | GND (Ground) |
Six independent inverter circuits with Schmitt trigger action
High noise immunity due to Schmitt trigger action
High current output drivers can switch up to 10mA
Wide operating voltage range: 4.5V to 15V
Low power consumption: 10mW (typical)
Here are three code examples that demonstrate how to use the CD40106 in various contexts:
Example 1: Simple Inverter Circuit
This example shows how to use the CD40106 as a simple inverter circuit. The input signal is connected to pin 1, and the inverted output is taken from pin 7.
```
// Connect input signal to pin 1
digitalWrite(1, HIGH);
// Read inverted output from pin 7
int output = digitalRead(7);
if (output == HIGH) {
Serial.println("Output is HIGH");
} else {
Serial.println("Output is LOW");
}
```
Example 2: Debouncing a Switch
This example demonstrates how to use the CD40106 to debounce a switch. The switch is connected to pin 2, and the debounced output is taken from pin 8.
```
const int switchPin = 2;
const int outputPin = 8;
void setup() {
pinMode(switchPin, INPUT);
pinMode(outputPin, OUTPUT);
}
void loop() {
int switchState = digitalRead(switchPin);
int debouncedOutput = digitalRead(outputPin);
if (switchState != debouncedOutput) {
// Debounce the switch output
delay(50);
debouncedOutput = digitalRead(outputPin);
}
if (debouncedOutput == HIGH) {
Serial.println("Switch is pressed");
} else {
Serial.println("Switch is not pressed");
}
}
```
Example 3: Oscillator Circuit
This example shows how to use the CD40106 to create a simple oscillator circuit. The oscillator frequency is determined by the values of R1, R2, C1, and C2.
```
const int R1 = 1k;
const int R2 = 2k;
const int C1 = 10nF;
const int C2 = 20nF;
void setup() {
pinMode(3, OUTPUT); // Pin 3 is the output of the oscillator
}
void loop() {
// The oscillator circuit is a closed-loop feedback network
// The output of one inverter is connected to the input of another
digitalWrite(3, !digitalRead(1));
delay(1); // Adjust the delay to change the oscillator frequency
}
```
Note: These code examples are for illustrative purposes only and may require modifications to work with your specific hardware and application.