How to Logic Gates Work?

by cristinepotu7171 in Circuits > Arduino

770 Views, 13 Favorites, 0 Comments

How to Logic Gates Work?

thumbnail.png
How To Logic Gates Work! Arduino Beginners Project! Free Code!

A project with attractive graphics for learning the operation of logic gates for the youngest users in Arduino or electronics

Supplies

arduino-nano-500x500.jpeg
images.jpg
1k-ohm-resistor__05927.1532890549.jpg
downloadV.png
TFT-Display-0-96-1-3-1-44-1-77-1-8-2-4-2-8.jpg
download (5).jpg
download.png
12615-02_Full_Size_Breadboard_Split_Power_Rails.jpg
71cA6PNV9TL.jpg

1.Arduino NANO board

2.ST7735 display

3.3xpush buttons

4.LED

5.470 ohm resistor

6.breadboard and jumper wires

7Visuino software

8.IDE Arduino software

Schematic Diagram

schematic diagram.png
  • As you can see, the connection diagram is very simple. There is no need for pull up resistors for the buttons, they are made of software. Carefully study the connections of the display to the Arduino board, this being practically the most complicated part of this project.The resistance for the leds varies in the range of 330...560 ohms.

The Code

snapshot59.png
snapshot60.png
snapshot62.png
snapshot63.png

The software is compiled in Visuino, a program that helps you program a controller very easily. You can also use Arduino IDE, the codes are for both programs. As you can see in the video, you can see the logic circuits in the code. The sketch is at the limit of Arduino's memory, for a more complex project a more powerful board like ESP32 is needed.

Verification and Assembly

snapshot43.png
snapshot44.png
snapshot50.png
snapshot51.png
snapshot53.png
snapshot54.png
snapshot55.png

We make the connections on the breadboard strictly following the connection diagram. You need extra attention when connecting the display, as it has a few more pins. Together with another project, finding out the value of a resistor by reading the color code on it, a project that you can find on my YouTube channel Compact DIY, or Instructables, , you can build a very useful device for those who want to get started in the world of electronics.

Start the Device

snapshot55.png
snapshot56.png
snapshot57.png
snapshot52.png
snapshot58.png

We power the device by inserting the USB plug into the Arduino. The AND gate symbol appears on the screen. By pressing the first two push buttons, the two inputs A and B will light up green on the display depending on their position. The output of the logic gate is signaled on the screen in red as well as on the board with the help of the related LED. This LED can be missing, it's optional. We look at the truth table of each logic gate (you can find them on google) and see its operation. Example AND gate. The output LED will light up only when the two inputs A and B are pressed (green) or in 'electronic' language logical level 1 (high). I hope you liked my project, good luck to everyone!