Components: 1:Arduino 2: OLED 128×64 3: Wires Connections: VCC : 5v Gnd : Gnd SDA : A4 SCL : A5 Code: /* * Created by ArduinoGetStarted.com * * This example code is in the public domain * * Tutorial page: https://arduinogetstarted.com/tutorials/arduino-oled */ #include <Wire.h>#include <Adafruit_GFX.h>#include <Adafruit_SSD1306.h> #define SCREEN_WIDTH 128 // OLED display width, in pixels#define SCREEN_HEIGHT 64 // OLED… Continue reading OLED 128×64
LCD Screen
LCD Screen Components: 1-Arduino 2-LCD Screen 3-220 Ohm resistor 3-Wires Connections: VSS : Gnd SVD : 5v RS : D12 RW : Gnd E : Digital 11 D4 : Digital 10 D5 : Digital 9 D6 : Digital 8 D7 : Digital 7 A : 220 Ohm Resistor : 5v K :… Continue reading LCD Screen
Dino LDR Servo
Dino LDR Servo Components: 1-Arduino 2-LDR Module 3-Servo motor 4-Wires Connections: LDR Module: Vcc : 5v Gnd : Gnd A0 : A0 Servo Motor Vcc : 5v Gnd : Gnd Data pin : D3 Code: #include <Servo.h> int ldrPin = A0; int ldrThreshold = 500; int servoPin = 3; Servo servo; void setup() { … Continue reading Dino LDR Servo
Gyroscope and Accelerometer
Gyroscope and Accelerometer Components: 1- Arduino 2-MPU6050 Sensor 3- Wires Connections: Vcc : 5v Gnd : Gnd SCL : A5 SDA : A4 INT : D2 Code: #include <Wire.h>#include <MPU6050.h> MPU6050 mpu; void setup() { Serial.begin(9600); while (!Serial) {} if (!mpu.begin(MPU6050_SCALE_2000DPS, MPU6050_RANGE_2G)) { Serial.println(“Failed to initialize gyroscope sensor.”); while (1); } … Continue reading Gyroscope and Accelerometer
Temperature and Humidity
Temperature and Humidity Components: 1- Arduino 2- Humidity and Temperature sensor module 3- 1k resistor 4-Wires Connections: Data pin : pin 3 Gnd : 1K Resistor :Gnd Vcc : 5v Code: #include <dht.h> // Define the DHT11 sensor pin#define DHTPIN 2 // Create a DHT11 objectdht DHT; void setup() { // Start… Continue reading Temperature and Humidity
Ultrasonic sensor
Ultrasonic distance measuring Components: 1-ِArduino 2- Ultrasonic sensor 3-Buzzer 4- wires Connections: pin : pin pin : pin pin : pin Code: // Define the ultrasonic sensor pins#define trigPin 2#define echoPin 3 // Define the buzzer pin#define buzzerPin 4 void setup() { // Set the ultrasonic sensor pins as input/output pinMode(trigPin, OUTPUT); pinMode(echoPin, INPUT); … Continue reading Ultrasonic sensor