Showing posts with label b2acypher. Show all posts
Showing posts with label b2acypher. Show all posts

Half Adder and Full Adder.

Half Adder

  • Two binary inputs and two binary outputs are required for a half-adder circuit. While the output variable generates the total and carry, the input variable displays the augend and addend bits. 
  • By creating a truth table, we can comprehend how a half-adder works. A half-adder's truth table is as follows:

Truth table of Half Adder

  • 'x' and 'y' are the two inputs, and S (Sum) and C (Carry) are the two outputs.
  • The Carry output is '0' unless both the inputs are 1.
  • 'S' represents the least significant bit of the sum.
The simplified sum of products (SOP) expressions is:
  • S = x'y+xy', C = xy
The logic diagram for a half-adder circuit can be represented as:

Half Adder

Full Adder

  • This circuit needs three binary inputs and two binary outputs. The truth table for a full-adder is:
Truth table of Full Adder.
  • Two of the input variable 'x' and 'y', represent the two significant bits to be added.
  • The third input variable 'z', represents the carry from the previous lower significant position.
  • The outputs are designated by the symbol 'S' for sum and 'C' for carry.
  • The eight rows under the input variables designate all possible combinations of 0's, and 1's that these variables may have.
  • The input-output logical relationship of the full-adder circuit may be expressed in two Boolean functions, one for each output variable.
  • Each output Boolean function can be simplified by using a unique map method.

K-Maps for a full-adder:



The logic diagram for a full-adder circuit can be represented as:

 Full Adder.

Difference between the Half adder and full adder:

S.No.ParametersHalf AdderFull Adder
1.DescriptionHalf Adder is a combinational logic circuit that adds two 1-bit digits. The half adder produces a sum of the two inputs. A full adder is a combinational logic circuit that performs an addition operation on three one-bit binary numbers. The full adder produces a sum of the three inputs and carry value.
2.Previous carryThe previous carry is not used. The previous carry is used.
3.InputsIn Half adder, there are two input bits ( A, B).  In full adder, there are three input bits (A, B, C-in). 
4.OutputsThe generated output is of two bits-Sum and Carry from the input of 2 bits. The generated output is of two bits-Sum and Carry from the input of 3 bits.
5.Used asA half adder circuit cannot be used in the same way as a full adder circuit.  A full adder circuit can be used in place of a half adder circuit.
6.FeatureIt is simple and easy to implementThe design of a full adder is not as simple as a half adder.
7.Logical ExpressionLogical Expression for half adder is : S=a⊕b ; C=a*b.Logical Expression for Full adder is : S=a⊕b⊕Cin; Cout=(a*b)+(Cin*(a⊕b)).
8.Logic gatesIt consists of one EX-OR gate and one AND gate. It consists of two EX-OR, two AND gates, and one OR gate.
9.ApplicationsIt is used in Calculators, computers, digital measuring devices, etc. It is used in Multiple bit addition, digital processors, etc.
10.Alternate nameThere is no alternate name for half adder.Full adder is also known as ripple-carry adder.

Cross bar switch.

Crossbar Switch: What Does It Mean?
  • A crossbar switch channels data or signals between two distinct network nodes as part of a crossbar topology. 
  • The crossbar arrangement, which connects every component of an architecture to every other component, is a matrix in which every crossbar switch lies between two locations.
  • Crossbar design finds application in the manufacturing of chips and electronic systems as well as networking.
  • Several cross-points exist at the intersections of the paths used by the processor buses and memory modules in the Crossbar Switch system. 
  • The little square at each cross-point stands in for a switch that determines the route from a CPU to a memory module. 
  • Control logic is built into every switch point to configure the transfer channel between a memory and processor. It determines whether a given module is being addressed by computing the address that is inserted into the bus. 
  • Furthermore, it removes several priority-based requests for access to the same memory module.

  • Figure illustrates the functional design of a crossbar switch that is coupled to a single memory module. 
  • Multiplexers in the circuit choose the data, address, and control from a single CPU to communicate with the memory module. 
  • Priority levels were established by arbitration logic to choose one CPU among multiple CPUs attempting to access the same memory. 
  • The binary code generated by a priority encoder in the arbitration logic can be utilized by the multiplexers.
  • Each memory module in a crossbar switch system has its own path, which allows for simultaneous transfers from all of the modules. 
  • As a result, the hardware required to implement the switch can grow to be rather complicated and huge.

Multiprocessor and its Characteristics

What is multiprocessor?

  • A computer with multiple processors integrated into it is called a multiprocessor. The processors in a multiprocessor system may be able to communicate and work together at different stages of problem solving.
  • A multiprocessor system is made up of two or more CPUs. It's a system that links memory and I/O devices to two or more CPUs. A multiprocessor's input-output processor (IOP) or central processing unit (CPU) can both be referred to as "processors." 
  • On the other hand, a system with a single CPU and one or more lOPs is typically not classified as multiprocessor unless the IOP has computing power equivalent to that of a CPU. 
  • Most people think of a multiprocessor system as having multiple CPUs plus one or more lOPs for good measure. As previously mentioned, multiprocessor systems are classified as MIMD (multiple instruction streams, multiple data stream) systems.

Types of Multiprocessors

The following are the types of multiprocessors. 
  • Symmetric Multiprocessors
  1. In these systems, every CPU connects to the others and runs a comparable version of the operating system. Since all of the processors are peer-to-peer, there is no master-slave relationship among them.
  2. Symmetric multiprocessing Unix for the Multimax Computer is called Encore.
  • Asymmetric Multiprocessors
  1. Every CPU in an asymmetric system is assigned a certain duty. All instructions to the other processors are sent by a master processor. The relationship in an asymmetric multiprocessor system is master-slave.
  2. Before symmetric multiprocessors were developed, there was only one kind of multiprocessor available: asymmetric multiprocessors. Right now, this is also the less expensive option.
Multiprocessor

Multiprocessor Systems' Benefits

The potential benefits of multiprocessor systems are listed below. 
  • More reliable Systems:- In a multiprocessor system, the system won't stop working even if one processor fails. Graceful degradation is the capacity to function without interruption even in the event of hardware failure. In a multiprocessor system, the four processors that remain operational take over if one of the five processors fails. Consequently, the machine slows down instead of stopping entirely.
  • Increasing Throughout:- When several processors collaborate, the system's throughput rises, meaning more processes are completed in a given amount of time. For every N processors, the throughput rises by a factor of N.
  • More Economic Systems:- Multiprocessor systems are less expensive over time than single-processor systems because they share peripherals, power supplies, data storage, and other resources. It is better to schedule many processes on multiprocessor systems with shared data rather than on separate computers with distinct versions of the same data if several processes share it.

Characteristics of Multiprocessor

Parallel Computing:- 
  • This calls for the use of several processors at once. These processors are designed to perform a common task using a single architecture. 
  • Processors are typically the same and cooperate in a way that gives consumers the impression that they are the only users in the system. In actuality, though, a large number of people are actually using the system at once.
Distributed Computing:- 
  • This calls for the use of a processor network. Every processor in this network is capable of handling problems and can be viewed as a standalone computer. 
  • These processors are diverse, and they are often assigned to a single task.
Supercomputing:- 
  • Using the quickest computers possible, large and computationally challenging problems are solved in this way. 
  • Vector computers were used in supercomputing machines in the past, although most people now embrace parallel or vector computing.
Pipelining:- 
  • This approach breaks down a given task into multiple smaller tasks that need to be completed in a certain order. 
  • The functional units support the completion of every subtask. Each unit functions simultaneously and is connected serially.
Vector Computing:- 
  • It makes use of vector processors, which break up operations like "multiplication" into numerous steps and apply them to a stream of operands, or "vectors."

BIOS and its functions.

  • The software that a computer's microprocessor uses to boot up a machine after powering on is called BIOS, or basic input/output system. 
  • Additionally, it controls the data flow between the operating system (OS) of the computer and any connected hardware, including the hard drive, display adapter, keyboard, mouse, and printer.
  • In 1975, American computer scientist Gary Kildall first used the word BIOS
  • It was included to IBM's first personal computer in 1981, and over time, it became more and more common in other PCs, eventually becoming a necessary component of computers. 
  • Nevertheless, Unified Extensible Firmware Interface (UEFI), a more recent technology, has gained traction at the expense of BIOS (फिर भी, यूनिफ़ाइड एक्स्टेंसिबल फ़र्मवेयर इंटरफ़ेस (UEFI), एक नवीनतम तकनीक, ने BIOS की कीमत पर लोकप्रियता हासिल की है). 
  • By 2020, Intel plans to replace outdated BIOS systems with UEFI, retiring support for them. This was stated in 2017.
How does BIOS works?

  • Computers are provided with BIOS installed as firmware on a motherboard chip. An operating system, on the other hand, such as Windows or iOS, can be installed manually by the user or pre-loaded by the vendor or manufacturer. 
  • Erasable programmable read-only memory, or EPROM, is a chip that the CPU uses to access programs, including BIOS. 
  • Upon turning on a computer, the BIOS program—which is permanently stored in the same location on EPROM—takes control from the microprocessor.
  • First thing the BIOS does when a computer boots up is check to see if all the required attachments are inserted and working. A boot device is any piece of hardware that holds the files required for the computer to boot up. 
  • The BIOS loads the operating system (OS) or important portions of it into the computer's random access memory (RAM) from a hard drive or diskette drive (the boot device) after verifying and validating that the boot devices are operational.
The BIOS performs the four main functions:- identifying, configuring, testing, and connecting computer hardware to the operating system. The boot process is the name given to this sequence of events.
The four primary functions of BIOS each perform these tasks:

Power on Self-test (POST):- 
  • When a user turns on the computer, a set of diagnostic tests known as POST begin immediately. 
  • The real test may vary based on the BIOS settings. But the standard test also checks the disk drives, RAM, and keyboard. 
  • In the event that these tests are successful, the computer will boot up and load the operating system; if not, it will alert the user to the issues with a sequence of beeps before displaying an error message on the monitor.
Bootstrap loader:-
  • It finds the OS this way.
Programs and drivers:- 
  • This finds the drivers and applications that, once the OS is operational, interface with it.
Complementary Metal-Oxide Semiconductor (CMOS):- 
  • This software allows users to modify system and hardware configurations. The non-volatile memory of the BIOS is called CMOS.

Accessing BIOS:-

  • Users can use the BIOS Setup Utility to access and configure the BIOS. Depending on the computer being used, there are differences in how to access the BIOS Setup Utility. Nonetheless, users can typically access and configure BIOS using Setup Utility by following these steps:
  1. Turn off the computer or reset it.
  2. Look for a notification that reads "entering setup" or something similar when the computer restarts. The user must press the key that corresponds with that message in order to access system configuration. Here's an illustration of a message a user could see: "Press [key] to enter BIOS setup." The function keys (F1–F12) and Del, Tab, Esc, and other keys are frequently used as prompts.
  3. As soon as you see the prompt, tap the designated key.
Among other setup options, users can adjust the BIOS password, boot order, RAM settings, hardware settings, and boot device once they are in the BIOS Setup Utility.

  • Every PC user, whether aware of it or not, sees the BIOS screen every time they switch on their machine. The Basic Input/Output System (BIOS) is the name given by the manufacturer of the computer to the screen display. There are two primary types of BIOS, which are as follows:
UEFI: 
  • An acronym for Unified Extensible Firmware Interface, which supports disks up to 2.2 TB in size. 
  • Using the Master Boot Record, a more advanced GUID Partition Table technology than GPT, it manages disks. Moreover, the BIOS has never been utilized on an Apple Mac computer.
Legacy BIOS: 
  • Older motherboards employed the Legacy BIOS to power on computers. The inability of legacy BIOSes to manage or identify drives larger than 2.1 TB is one of its limitations. 
  • Nonetheless, it manages the communication between the CPU and the other parts.

BIOS vs UEFI

  • In most modern systems, UEFI will most likely be present instead of BIOS. That being said, what distinguishes UEFI from BIOS? Given how nearly identical their functions are, it can be challenging to distinguish between the two. Unified Extensible Firmware Interface, or UEFI for short, is the same as BIOS and serves as a software bridge between the operating system and the hardware.
  • When it comes to features and customization options, UEFI surpasses BIOS. The operating system can be loaded without the requirement for a separate bootloader program. Since it has native support for GPT, which BIOS cannot provide, it can handle hard disks that are larger than two Terabytes.

Interfacing Liquid Crystal Display (LCD) – display data generated by sensor on LCD.

This project will demonstrate how to configure a 16 × 2 LCD screen to display numerous sensor values.

Hardware components required:-
  • Arduino UNO
  • Adafruit Standard LCD - 16x2 White on Blue
  • Rotary potentiometer (generic)
  • Jumper wires (generic)
  • Solderless Breadboard Full Size
  • RM065 10K ohm 103 Trim 
  • Pot Potentiometer
This project makes use of two potentiometers connected on a breadboard to an Arduino and an LCD. As a result, when both potentiometers are adjusted, the LCD should display their values.
Liquid Crystal Display (LCD)
Before we begin the configuration, let's take a closer look at the LCD and see what the 16 pins are for:
  • GND - Ground Connection
  • VCC - +5V Connection
  • VO - analogue pin used for screen brightness, connects to Potentiometer.
  • RS - tells the LCD what will be written to it.
  • R/W - the read/write pin (normally hardwired to ground).
  • E - tells the LCD the data is ready to be written.
  • D0 to D7 - bus lines for the LCD, this is where your data is passed from the Arduino to the LCD.
  • A - +5V Connection for the backlight of the LCD.
  • K - the ground pin for the backlight of the LCD.
Working:-

We may now begin building connections on and to the breadboard. A step-by-step approach is provided below:
  • Connect the 10K Ohm potentiometer (this potentiometer controls the LCD's contrast). The VO pin is linked to the potentiometer's center pin, while the other two wires are connected to +5V and ground on the breadboard.
  • Connect pin-A to the +5V and pin-K to ground on the breadboard.
  • Connect pin-D7 to digital pin 12, pin-D6 to digital pin 11, pin-D5 to digital pin 10 and pin-D4 to digital pin 9. (Digital pins on the Arduino).
  • Connect pin-RS to digital pin 7 on the Arduino.
  • Connect pin-RW to ground on the breadboard.
  • Connect pin-VSS to ground on the breadboard.
  • Connect pin-VDD to +5V on the breadboard.
  • Connect pin-E to digital pin 8 on the Arduino.
  • Place the first potentiometer on the board and connect the center pin to Analog Pin 1 on the Arduino and the other pins to ground and +5V on the breadboard.
  • Place the second potentiometer on the board and connect the center pin to Analog Pin 2 on the Arduino and the other pins to ground and +5V on the breadboard.
Connection Diagram:-

Display data generated by sensor on LCD.

The potentiometers that will be utilized are shown in the image below.


Code:-
  • Upload the code below to your Arduino and make any necessary adjustments to the potentiometers. 
  • The potentiometer values will be displayed on two lines on the LCD display. 
  • The B10K potentiometer can be adjusted to ensure that the contrast of the LCD is optimal for reading the values.
// include the library code:
#include <LiquidCrystal.h>

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7,8,9,10,11,12);

int potPin1 = A1;
int potPin2 = A2;

void setup()
{
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
lcd.clear();

pinMode(potPin1, INPUT);
pinMode(potPin2, INPUT);
}

void loop()
{
lcd.setCursor(0,0); // Sets the cursor to col 0 and row 0
lcd.print("SensorVal1: "); // Prints Sensor Val: to LCD
lcd.print(analogRead(potPin1)); // Prints value on Potpin1 to LCD
lcd.setCursor(0,1); // Sets the cursor to col 1 and row 0
lcd.print("SensorVal2: "); // Prints Sensor Val: to LCD
lcd.print(analogRead(potPin2)); // Prints value on Potpin1 to LCD
}

Output Display:-

Interfacing Liquid Crystal Display



Random Access Memory (RAM) and Read Only Memory (ROM) chips.

In a computer system, the main memory serves as the primary storage device. Programs and data are stored in this comparatively huge quick memory during run-time operations.

Integrated circuit technology is the major technology utilized in the main memory. There are two primary categories for the integrated circuits used in the main memory.
  1. RAM (Random Access Memory) integrated circuit chips
  2. ROM (Read Only Memory) integrated circuit chips

RAM integrated circuit

  • Static and dynamic are two more categories into which RAM integrated circuit chips can operate.
Static RAM:-
  • The binary data is stored by flip-flops, which are the main components of a static RAM. 
  • Information that is saved has a volatile nature, meaning that it is only valid while the system is powered on. 
  • Compared to dynamic RAM, static RAM is simpler to utilize and requires less time to perform read and write operations.
Dynamic RAM:-
  • The binary information is displayed by the dynamic RAM as applied electric charges to capacitors. 
  • MOS transistors are used inside the chip to combine the capacitors. 
  • Dynamic RAM offers significant store capacity on a single memory chip while using less power.
  • RAM chips come in different sizes and are used based on the needs of the system. 
  • The interconnection of the chips of a 128 * 8 RAM chip is shown in the block diagram that follows.

  • The memory capacity of a 128 * 8 RAM chip is 128 words, or eight bits (one byte) per word. An 8-bit bidirectional data bus and a 7-bit address are needed for this.
  • Data can be transferred from memory to the CPU during a read operation or from the CPU to memory during a write operation thanks to the 8-bit bidirectional data bus.
  • The two chip select (CS) control inputs are used to enable the chip only when the CPU picks it, while the read and write inputs define the memory operation.
  • Three-state buffers are used in the construction of the bidirectional data bus.
  • Three alternative states are available for the output produced by three-state buffers: a high-impedance state, a signal equal to logic 0, or a signal equal to logic 1.

Note: The logic 1 and 0 are standard digital signals whereas the high-impedance state behaves like an open circuit, which means that the output does not carry a signal and has no logic significance.

Advantages of Random Access Memory (RAM)

Speed: 
  • The computer can access data stored in RAM more quickly since RAM operates at a significantly higher rate than other storage media like hard drives and solid-state drives.
Flexibility: 
  • RAM is volatile memory, which implies that it is simple to add or remove data from it. 
  • For storing data that the computer is presently utilizing or processing, this makes it perfect.
Capacity: 
  • The RAM's capacity may be readily increased, enabling the computer to store more information there and perform better overall.
Power Management: 
  • RAM is the best type of memory for portable devices because it uses less energy than solid-state drives and hard drives.

Disadvantages of Random Access Memory (RAM)

Volatility: 
  • RAM is a volatile memory, meaning that when the power is switched off, the information contained inside is gone. 
  • This could be an issue for crucial data that must be kept safe, including unsaved work or unbacked-up files.
Capacity: 
  • Although RAM can be expanded, its limited capacity may still leave it insufficient for some applications or tasks that demand a lot of memory.
Cost: 
  • Upgrading a computer or device's memory might be more expensive when RAM is used instead of alternative memory types like hard drives or solid-state drives.

ROM integrated circuit

  • Although some memory may be built using ROM chips, RAM integrated circuit chips are the major component of main memory.
  • Programs and data that are stored on the computer permanently are kept in a ROM memory.
  • The ROM section of main memory is required not just for the permanent storage of data but also for the initial program known as a bootstrap loader. 
  • When the power is turned on, the bootstrap loader program's main job is to get the computer software running.
  • ROM chips come in different sizes and are utilized based on the specifications of the system. 
  • The chip connections in a 512 * 8 ROM chip is shown in the block diagram below.

  • RAM chips and ROM chips are structured similarly. But the data bus can only function in an output mode; a ROM can only read data.
  • Any one of the 512 bytes that are stored on the ROM chip can be specified by its 9-bit address lines.
  • For the unit to function, chip selects 1 and 2 must have values of 1 and 0. The data bus is considered to be in a high-impedance state otherwise.

Types of Read-Only Memory (ROM)

  1. PROM (Programmable Read-Only Memory)
  2. EPROM (Erasable Programmable Read Only Memory)
  3. EEPROM (Electrically Erasable Programmable Read Only Memory)
  4. MROM (Mask Read Only Memory)
Programmable read-only memory, or PROM: 
  • You can program it yourself. The information and instructions within are unchangeable once coded. 
Erasable Programmable Read-Only Memory, or EPROM: 
  • It is re-programmable. You can use UV light to remove data from it. Wipe off all of the prior info to reprogram it. 
EEPROM (Electrically Erasable Programmable Read-Only Memory): 
  • No ultraviolet radiation is required to erase the data; an electric field can be used instead. Only a piece of the chip can be erased.
Mask ROM, or MROM: 
  • A type of read-only memory called mask ROM is removed during manufacturing. 
  • Mask ROM, like other forms of ROM, does not allow the user to alter the data that is contained within. If it could, the procedure would be challenging or delayed.

Advantages of Read Only Memory (ROM):-

Non-volatility: 
  • Random Access Memory (ROM) is memory that does not lose data when the power is switched off. 
  • For storing data that doesn't need to be changed, like the BIOS or firmware for other hardware devices, this makes it perfect.
Reliability: 
  • Compared to other forms of memory, ROM data is less prone to corruption or errors since it is difficult to alter.
Power Management: 
  • Random Access Memory (ROM) is a great memory option for portable devices since it uses less power than other memory types.

Disadvantages of Read Only Memory (ROM):-

Reduced Flexibility: 
  • Random-Origin Memory (ROM) is read-only memory, meaning that its contents cannot be changed. 
  • For programs or firmware that need to be updated or changed, this could be an issue.
Limited Capacity: 
  • ROM often has a finite capacity, and updating it might be costly or challenging.
Expense: 
  • ROM can be more expensive than other memory types, including solid-state or hard drives, which might increase the expense of upgrading a computer's or device's memory.
What are the Differences Between RAM and ROM?
ParameterRAMROM
Full FormRAM stands for Random Access Memory.ROM stands for Read Only Memory.
DefinitionRAM is a primary memory of the computer that stores those data and instructions on which the CPU is currently working.ROM is a primary memory of the computer that stores those computer instructions and programs that do not need to be altered in future like BIOS.
NatureRAM is a volatile memory. Which means it stores data as long as power is on.ROM is a non-volatile memory that means it stores data permanently even when power is off.
Data AccessThe CPU of the computer can read, write, or alter the data on RAM.CPU can only read data from ROM, but it can write or change.
UsageRAM is used to store data that CPU needs for current instruction processing.ROM is used to store data that in needed to bootstrap the computer.
TypesThere are two major types of RAM available – SRAM (Static Random Access Memory) and DRAM (Dynamic Random Access Memory).Three types of ROM available – PROM (Programmable ROM), EPROM (Erasable PROM), and EEPROM (Electrically EPROM).
SpeedThe speed of RAM is quite high.The speed of ROM is slower than RAM.
CPU AccessCPU can access data stored on RAM directly.Data to be copied from ROM to RAM so that CPU can access its data.
CapacityRAM memory is large and high capacity.ROM is generally small and of low capacity.
Used asRAM is used as CPU Cache, Primary Memory.ROM is used as firmware by microcontrollers.
CostRAM is costly.ROM is not so expensive.

Interfacing DHT11 Temperature and Humidity Sensor with Arduino Uno.

We will learn how to interface the DHT11 temperature and humidity sensor with the Arduino UNO in this tutorial. The acronym for Digital Humidity and Temperature sensor is DHT. The resistive humidity sensor, NTC temperature sensor, and 8-bit microcontroller that make up the DHT11 provide great quality, fast response times, anti-interference capabilities, and affordability.

Components Required:-
  • DHT11 Sensor
  • Arduino Uno
  • 0.96 inch OLED
  • Bread Board
  • Jumper Wires
DHT11 Temperature and Humidity Sensor
DHT11 Sensor
Specifications
  • Operating Voltage : 3V ~ 5.5V
  • Temperature range : 0 ~ 50°C
  • Temperature Accuracy : 2°C
  • Humidity range : 20 – 90 %RH
  • Humidity Accuracy : 5 %RH
  • Maximum Sampling Rate : 1 Hz
  • Pin Out : VCC – Power In, Data – Data Out, NC – No Connection, GND – Ground
VCC pin provides power to the sensor. Despite the fact that the supply voltage ranges from 3.3V to 5.5V, a 5V supply is recommended. With a 5V power supply, the sensor can be placed up to 20 meters away. With 3.3V supply voltage, the sensor can be placed up to 1 meter away; otherwise, the line voltage drop will cause measurement errors.
Data pin is used for communication between the sensor and the microcontroller.
NC Not connected
GND is the ground pin.

Working:-
  • Both an NTC temperature sensor and a humidity measuring component are included with the DHT11 sensor.
  • The component used to measure humidity is made up of two electrodes with a substrate positioned in between.
  • The resistance between the electrodes varies when there is a change in the conductivity of the substrate due to variations in humidity or moisture.
  • As the temperature rises, the NTC thermistor's resistance falls.
  • The inbuilt microcontroller measures, interprets, and transmits the resistance change via the data line.
Circuit Diagram:-
Circuit Diagram DHT11 Temperature and Humidity Sensor with Arduino Uno

Description:-
  • DHT11 VCC pin – 5V output of Arduino Uno
  • OLED VCC pin – 5V output of Arduino Uno
  • DHT11 GND pin – GND of Arduino Uno
  • OLED GND pin – GND of Arduino Uno
  • DHT11 Data pin – Digital pin 2 of Arduino Uno
  • OLED SCL pin – Pin A4 of Arduino Uno
  • OLED SDA pin – Pin A5 of Arduino Uno
Program:-

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include "DHT.h"

#define DHTPIN 2     
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);

#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);

void setup()   {                
    display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C
    display.display(); // show splash screen
    delay(2000);
    display.clearDisplay();   // clears the screen and buffer
    dht.begin();
    delay(2000);
}

void loop() {
    float h = dht.readHumidity();
    // Read temperature as Celsius (the default)
    float t = dht.readTemperature();
    // Read temperature as Fahrenheit (isFahrenheit = true)
    float f = dht.readTemperature(true);

    // Check if any reads failed.
    if (isnan(h) || isnan(t) || isnan(f)) {
        delay(2000);
    } 
    else {
        // routine for converting temp/hum floats to char arrays
        char temp_buff[5]; char hum_buff[5];
        char temp_disp_buff[11] = "Tmp:";
        char hum_disp_buff[11] = "Hum:";
    
        // appending temp/hum to buffers
        dtostrf(t,2,1,temp_buff);
        strcat(temp_disp_buff,temp_buff);
        dtostrf(h,2,1,hum_buff);
        strcat(hum_disp_buff,hum_buff);
    
        // routine for displaying text for temp/hum readout
        display.clearDisplay();
        display.setTextSize(2);
        display.setTextColor(WHITE);
        display.setCursor(0,0);
        display.println(temp_disp_buff);
        display.println(hum_disp_buff);
        display.display();
        delay(2000);
    }
}

Functioning:-
  • The pin that is attached to the OLED reset pin is defined by the Adafruit_SSD1306 display (OLED_RESET).
  • The DHT sensor type and the pin that the data line is attached to are specified by DHT dht(DHTPIN, DHTTYPE).
  • The DHT sensor and the OLED display are initialized with their I2C addresses (0x3C) in the setup() function.
  • We continuously read the temperature and humidity values from the sensor and print them on the OLED display in the loop().
Functioning with circuit diagram

Conclusion

  • I hope you now have a better understanding of how the Arduino Uno and DHT11 temperature and humidity sensor function together. Moreover, regarding the Arduino Uno and SSD1306 OLED display integration. If you have any questions, don't hesitate to leave a remark below.