Deshbot Logic Gate Tester Using Arduino and OLED
by devkrishnavhora in Circuits > Arduino
37 Views, 0 Favorites, 0 Comments
Deshbot Logic Gate Tester Using Arduino and OLED
The Deshbot Logic Gate Tester is an Arduino-based project that demonstrates the working of different digital logic gates using an OLED display, two push buttons, and the Arduino's built-in LED.
The project allows the user to select different logic gates from a menu and change the input values using buttons. The Arduino calculates the logic output and displays the gate name, inputs, output, and LED status on the OLED display.
The project includes seven common logic gates:
- AND
- OR
- NOT
- NAND
- NOR
- XOR
- XNOR
Supplies
Components Required
Deshbot Shield
Arduino Uno
128×64 OLED Display
Push Button
Pin Connections
OLED Display
OLEDArduino Uno
SDA - A4
SCL - A5
VCC - 5V
GND - GND
Push Buttons
ButtonArduino PinFunction
Button A - D10
Next / Input A - Button B
D12 - Select / Input B
Output
OutputArduino Pin
Built-in LED = LED_BUILTIN
Working Principle
When the Arduino starts, the OLED displays the DESHBOT LOGIC GATES screen.
The user can use D10 to move through the available logic gates.
Pressing D12 selects the currently displayed gate.
After selecting a gate:
- D10 changes Input A
- D12 changes Input B
- The Arduino calculates the logic result
- The result is shown on the OLED
- The built-in LED turns ON when the output is 1
- The built-in LED turns OFF when the output is 0
For the NOT gate, only Input A is used.
Logic Gates
AND Gate
The output is 1 only when both inputs are 1.
ABOutput
0
0
0
0
1
0
1
0
0
1
1
1
OR Gate
The output is 1 when at least one input is 1.
NOT Gate
The NOT gate reverses Input A.
NAND Gate
NAND is the opposite of AND.
NOR Gate
NOR is the opposite of OR.
XOR Gate
The output is 1 when the two inputs are different.
XNOR Gate
The output is 1 when the two inputs are the same.
Program Flow
OLED Menu
The OLED displays the available gates as a scrolling menu.
Example:
The > symbol indicates the currently selected gate.
Gate Display
After selecting a gate, the OLED displays its inputs and output.
Example:
Button Functions
Menu Mode
D10
Moves to the next logic gate.
D12
Selects the current logic gate.
Gate Mode
D10
Changes Input A between 0 and 1.
D12
Changes Input B between 0 and 1.
Both buttons together
Returns to the logic-gate selection menu.
Programming Concepts Used
Arrays
The names of the gates are stored in an array:
switch-case
A switch-case statement is used to calculate the selected logic gate.
Boolean Logic
The program uses logical operators such as:
OLED Display
The Adafruit_SSD1306 and Adafruit_GFX libraries are used to display the menu and logic-gate information.
Button Input
The buttons use:
so an unpressed button reads HIGH and a pressed button reads LOW.
Features
- Seven logic gates
- OLED-based menu
- Two-button control
- Real-time logic calculation
- Built-in LED output
- Input A and Input B control
- NOT gate support
- Easy-to-understand interface
- Useful for learning digital electronics
Downloads
Conclusion
The Deshbot Logic Gate Tester provides a simple practical way to understand how digital logic gates work.
Using an Arduino, OLED display, and two buttons, the user can select different gates, change their inputs, and observe the calculated output. The built-in LED provides a physical indication of the logic result.
This project combines Arduino programming, Boolean logic, digital electronics, button control, and OLED display programming into one practical learning project.