Posts

Showing posts from February, 2023

Arduino Secret Knock Pattern Door Lock

Image
Arduino Secret Knock Pattern Door Lock CIRCUIT DIAGRAM : MATERIALS : Arduino UNO / NANO Relay module 5V Solenoid Lock Speaker LED Resistor 220, 10k, 1M Push Button Wires Breadboard CODE : //Eliyas Science Info //Secret Knock Pattern Door Lock const int knockSensor = 0; const int programSwitch = 2; const int lockMotor = 3; const int redLED = 4; const int greenLED = 5;   const int threshold = 3; const int rejectValue = 25; const int averageRejectValue = 15; const int knockFadeTime = 150; const int lockTurnTime = 2000; const int maximumKnocks = 20; const int knockComplete = 1200; int secretCode[maximumKnocks] = {50, 25, 25, 50, 100, 50, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int knockReadings[maximumKnocks]; int knockSensorValue = 0; int programButtonPressed = false; void setup() {   pinMode(lockMotor, OUTPUT);   pinMode(redLED, OUTPUT);   pinMode(greenLED, OUTPUT);   pinMode(programSwitch, INPUT);      Serial.begin(9600);   Serial.println("Program start.&

Arduino Timer Control Relay Devices

Image
Arduino Timer Control Relay Devices CIRCUIT DIAGRAM :  MATERIALS : Arduino Nano/UNO LiquidCrystal I2c Display Relay Module Buzzer Push Buttons BreadBoard Bulb Holder Socket Wires CODE : //Eliyas Science Info //Arduino Timer Relay - Triger relay for specific time #include <LiquidCrystal_I2C.h> //https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library LiquidCrystal_I2C lcd(0x3F, 16, 2); // LCD HEX address 0x3F -- change according to yours #include "Countimer.h" //https://github.com/inflop/Countimer Countimer tdown; #include <EEPROM.h> #define bt_set A3 #define bt_up A2 #define bt_down A1 #define bt_start A0 int time_s = 0; int time_m = 0; int time_h = 0; int set = 0; int flag1=0, flag2=0; int relay = 5; int buzzer = 6; void setup() { Serial.begin (9600); pinMode(bt_set, INPUT_PULLUP); pinMode(bt_up, INPUT_PULLUP); pinMode(bt_down, INPUT_PULLUP); pinMode(bt_start, INPUT_PULLUP); pinMode(relay, OUTPUT); pinMode(buzze

GSM SIM900A Home Automation System

Image
GSM SIM900A Home Automation System CIRCUIT DIAGRAM : MATERIALS : Arduino UNO / NANO SIM900A Module GSM SIM card 2G Wires LED Breadboard CODE : // Eliyas Science Info // GSM SIM900A Home Automation with Arduino const int DEVICE1 = 2; const int DEVICE2 = 3; const int DEVICE3 = 4; const int DEVICE4 = 5; const int DEVICE5 = 6; const int DEVICE6 = 7; const int DEVICE7 = 8; const int DEVICE8 = 9; const int DEVICE9 = 10; const int DEVICE10 = 11; String textMessage; String DEVICE1State = "LOW"; String DEVICE2State = "LOW"; String DEVICE3State = "LOW"; String DEVICE4State = "LOW"; String DEVICE5State = "LOW"; String DEVICE6State = "LOW"; String DEVICE7State = "LOW"; String DEVICE8State = "LOW"; String DEVICE9State = "LOW"; String DEVICE10State = "LOW"; void setup()  {     pinMode(DEVICE1, OUTPUT);   pinMode(DEVICE2, OUTPUT);   pinMode(DEVICE3, OUTPUT);   pinMode(DEVICE4, O

Arduino MPU6050 Digital Spirit Level Measuring Device

Image
Arduino MPU6050 Digital Spirit Level Measuring Device CIRCUIT DIAGRAM : MATERIALS : Arduino NANO MPU6050 OLED Display Buzzer LED Breadboard CODE : //Eliyas Science Info //MPU6050 LEVEL Device Pitch Roll #include <Wire.h> #include <Adafruit_SSD1306.h> //OLED==================================================================== #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 #define OLED_RESET 4 Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET); //Level LEDs============================================================== int levelLED_neg2 = 5;   int levelLED_neg1 = 7; int levelLED_level = 8;  int levelLED_pos1 = 9;   int levelLED_pos2 = 11;  int buzzer = 13; //Variables for Gyroscope================================================= int gyro_x, gyro_y, gyro_z; long gyro_x_cal, gyro_y_cal, gyro_z_cal; boolean set_gyro_angles; long acc_x, acc_y, acc_z, acc_total_vector; float angle_roll_acc, angle_pitch_acc; float angle_pitch,

Arduino Calculator [Display]

Image
ARDUINO CALCULATOR [DISPLAY] CIRCUIT DIAGRAM : Materials : Arduino UNO Display 16x2 keypad 4x4 Jumpers wires Potentiometer CODE : // Eliyas Science Info #include <LiquidCrystal.h> #include <Keypad.h>   LiquidCrystal lcd(0, 1, 2, 3, 4, 5); const byte ROWS = 4; const byte COLS = 4; char keys [ROWS] [COLS] = {   {'1', '2', '3', '+'},   {'4', '5', '6', '-'},   {'7', '8', '9', '*'},   {'C', '0', '=', '/'} }; byte rowPins[ROWS] = {13,12,11,10}; byte colPins[COLS] = {9,8,7,6}; Keypad myKeypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS ); boolean presentValue = false; boolean next = false; boolean final = false; String num1, num2; int answer; char op; void setup() {   lcd.begin(16,2);   lcd.setCursor(0,0);   lcd.print(" Viral Science");   lcd.setCursor(0,1);   lcd.print(" Calculator");   delay(30

Arduino HourGlass with Matrix Display and MPU6050

Image
Arduino HourGlass with Matrix Display and MPU6050 CIRCUIT DIAGRAM : MATERIALS : Arduino NANO MPU6050 Matrix 8x8 Display Breadboard Jumper Wire CODE : // Eliyas Science Info // Arduino Matrix 8x8 Display Hour Glass Project #include "Arduino.h" #include <MPU6050_tockn.h> #include "LedControl.h" #include "Delay.h" #define MATRIX_A 1 #define MATRIX_B 0 MPU6050 mpu6050(Wire); // Values are 260/330/400 #define ACC_THRESHOLD_LOW -25 #define ACC_THRESHOLD_HIGH 25 // Matrix #define PIN_DATAIN 5 #define PIN_CLK 4 #define PIN_LOAD 6 // Accelerometer #define PIN_X mpu6050.getAngleX() #define PIN_Y mpu6050.getAngleY() // Rotary Encoder #define PIN_ENC_1 3 #define PIN_ENC_2 2 #define PIN_ENC_BUTTON 7 #define PIN_BUZZER 14 // This takes into account how the matrixes are mounted #define ROTATION_OFFSET 90 // in milliseconds #define DEBOUNCE_THRESHOLD 500 #define DELAY_FRAME 100 #define DEBUG_OUTPUT 1 #define MODE_HOURGLASS 0 #define MODE

Arduino Water Level Indicator Automatic Water Pump System

Image
Arduino Water Level Indicator Automatic Water Pump System CIRCUIT DIAGRAM : MATERIALS : Arduino Nano Water Level Sensor I2c LCD 16x2 Display Breadboard Jumpers CODE : //Eliyas Science Info //WaterLevel Sensor Automatic Water Filling #include <LiquidCrystal_I2C.h> LiquidCrystal_I2C lcd(0x3F, 16, 2); // LCD HEX address 0x3F -- change according to yours   int val = 0;   int watersensor = A0;  int Motor = 2; void setup() {   Serial.begin(9600);   lcd.begin();    pinMode(Motor,OUTPUT);   digitalWrite(Motor,LOW);   // Print a message to the LCD.    lcd.print("WATER LEVEL: ");  }     void loop() {    val = analogRead(watersensor);    Serial.println(val);   lcd.setCursor(13,0);   lcd.println(val);   lcd.setCursor(0, 1);            if (val<=100)   {      lcd.println("Empty ");      digitalWrite(Motor,HIGH);   }    else if (val>100 && val<=450)   {      lcd.println("Low ");     digitalWrite(Motor,HIGH);    }    else if

Arduino Tetris Game Max7219 8x8 Matrix Display

Image
Arduino Tetris Game Max7219 8x8 Matrix Display CIRCUIT DIAGRAM : MATERIALS : Arduino NANO Matrix 8x8 Display PushButton Buzzer Breadboard Jumper Wire CODE :  #include <LedControl.h>   LedControl lc = LedControl(12, 11, 10, 2); // (dataPin, clockPin, csPin, totalDevices)   int lc0[] = {0, 0, 0, 0, 0, 0, 0, 0}; int lc1[] = {0, 0, 0, 0, 0, 0, 0, 0}; long active[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; long screen[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; int tmpCol = 0;     int figura = 0; int figuraNext = 0; int fromLeft = 0; int fromRight = 0; int angle = 0; int colCheck = 0; int moveCheck = 0; int score = 0; int started = 0; int lcRows = 16; int lcCols = 8; int allLines = 0; int currLines = 0; int brickDelay = 0; int defDelay = 500; int level = 0;   boolean sound = true; //Pinos   int rotate_button = 2; int left_button = 3; int down_button = 4; int right_button = 5; int start_button = 6; int speaker_pin = 7; int sound_butto