Search This Blog

Sunday, 29 November 2020

DIY digital clock at home|| how to make a digital clock||Lucifer||the robotics guy

Code for the Arduino πŸ‘‡ 

// set current time by editing the values at line 16 and 17
const int clock = 7;
const int data = 8;
uint8_t digits[] = { 0x3f, 0x06, 0x5b, 0x4f, 0x66, 0x6d, 0x7d, 0x07, 0x7f, 0x6f };
void setup()
{
  setupInterrupt();
  pinMode(clock, OUTPUT);
  pinMode(data, OUTPUT);
  start();
  writeValue(0x8c);
  stop();
  write(0x00, 0x00, 0x00, 0x00);
}
byte tcnt2;
  unsigned long int setMinutes = 22;
  unsigned long int setHours = 15;
  unsigned long time = (setMinutes * 60 * 1000) + (setHours * 3600 *1000);
void setupInterrupt()
{
  TIMSK2 &= ~(1<<TOIE2);
  TCCR2A &= ~((1<<WGM21) | (1<<WGM20));
  TCCR2B &= ~(1<<WGM22);
  ASSR &= ~(1<<AS2);
  TIMSK2 &= ~(1<<OCIE2A);
  TCCR2B |= (1<<CS22) | (1<<CS20); 
  TCCR2B &= ~(1<<CS21);
  tcnt2 = 131;
  TCNT2 = tcnt2;
  TIMSK2 |= (1<<TOIE2);
}
ISR(TIMER2_OVF_vect) {
  TCNT2 = tcnt2;
  time++;
  time = time % 86400000;
}
void loop()
{
  unsigned long t = (unsigned long)(time/1000);
  uint8_t minutes = (byte)((t / 60) % 60);
  uint8_t hours = (byte)((t / 3600) % 24);
  uint8_t seconds = (byte)(t % 60);
    write(digits[hours / 10], digits[hours % 10] | ((seconds & 0x01) << 7), digits[minutes / 10], digits[minutes % 10]);
}
void write(uint8_t first, uint8_t second, uint8_t third, uint8_t fourth)
{
  start();
  writeValue(0x40);
  stop();
  start();
  writeValue(0xc0);
  writeValue(first);
  writeValue(second);
  writeValue(third);
  writeValue(fourth);
  stop();
}
void start(void)
{
  digitalWrite(clock,HIGH);
  digitalWrite(data,HIGH);
  delayMicroseconds(5);
  digitalWrite(data,LOW);
  digitalWrite(clock,LOW);
  delayMicroseconds(5);
}
void stop(void)
{
  digitalWrite(clock,LOW);
  digitalWrite(data,LOW);
  delayMicroseconds(5);

  digitalWrite(clock,HIGH);
  digitalWrite(data,HIGH);
  delayMicroseconds(5);
}
bool writeValue(uint8_t value)
{
  for(uint8_t i = 0; i < 8; i++)
  {
    digitalWrite(clock, LOW);
    delayMicroseconds(5);
    digitalWrite(data, (value & (1 << i)) >> i);
    delayMicroseconds(5);
    digitalWrite(clock, HIGH);
    delayMicroseconds(5);
  }
  digitalWrite(clock,LOW);
  delayMicroseconds(5);
  pinMode(data,INPUT);
  digitalWrite(clock,HIGH);
  delayMicroseconds(5);
  bool ack = digitalRead(data) == 0;
  pinMode(data,OUTPUT);
  return ack;
}

Circuit diagram πŸ‘‡πŸ‘‡πŸ‘‡
circuit diagram πŸ”πŸ”πŸ”

Friday, 27 November 2020

how to make a fire alarm 🚨 || flame sensor interface with aurdino nano|| fire alarm using ARDUINO nano|| the robotics guy|| lucifer

Code for ARDUINO nano ⬇️⬇️



   // Your program code goes here
 
const int buzzerPin = 12;
const int flamePin = 10;
int Flame = HIGH;
int redled = 8;
int greenled = 7;
void setup() 
{
  pinMode(buzzerPin, OUTPUT);
  pinMode(redled, OUTPUT);
  pinMode(greenled, OUTPUT);

  pinMode(flamePin, INPUT);
  Serial.begin(9600);
}

void loop() 
{
  Flame = digitalRead(flamePin);
  if (Flame== HIGH)
  {
    digitalWrite(buzzerPin, HIGH);
    digitalWrite(redled, HIGH);
    digitalWrite(greenled, LOW);
  }
  else
  {
    digitalWrite(buzzerPin, LOW);
    digitalWrite(greenled, HIGH);
    digitalWrite(redled, LOW);
  }
    


Materials required;
Bread board
Flame sensor
Arduino nano
Jumper cables
Buzzer
2 LEDs
Type B mini USB cable..........
.
.
.
.let's get started 🀩🀩🀩


Step by step explained with photos...!!πŸ‘
.                          πŸ”πŸ”πŸ”
Positive terminal of buzzer (green wire ) to be connected to D12 on ARDUINO nano

                            πŸ”πŸ”πŸ”
Negative terminal of buzzer (yellow wire) to be connected to GND on ARDUINO nano
.                            πŸ”πŸ”πŸ”
LED'S positive terminal (blue wire ) to be connected to D8 on Arduino nano
.                            πŸ”πŸ”πŸ”
Second LED'S positive terminal(orange wire) to be connected to D7 on Arduino nano
.                            πŸ”πŸ”πŸ”
 LEDs negative terminal (both the LED's)(yellow wire) to be connected to GND on the Arduino nano
.                         πŸ”πŸ”πŸ”
Sensor's output (brown wire) to be connected to D10 on the Arduino nano
.                           πŸ”πŸ”πŸ”
Sensor's positive terminal (red wire) to be connected to 5V of ARDUINO nano
.                          πŸ”πŸ”πŸ”
Sensor's negative terminal (black wire) to be connected to GND on the Arduino nano
.
.
.
.
.
.
 We are done with the circuit and placing the components on bread board let's test and enjoy the video ......don't forget to subscribe,like and share πŸ˜€

Tuesday, 24 November 2020

obstacle avoiding robot

Code for the Arduino πŸ‘‡πŸ‘‡πŸ‘‡⬇️πŸ™ƒ
String ms;
int a,b;
void setup() {
  // put your setup code here, to run once:
Serial.begin(9600);
pinMode(2,OUTPUT);
pinMode(3,OUTPUT);
pinMode(4,OUTPUT);
pinMode(5,OUTPUT);
pinMode(8, INPUT);
pinMode(9, OUTPUT);
digitalWrite(9, LOW);
digitalWrite(8, LOW);
}
void loop() {
    long duration,cm ;
  // SEND ECHO
    digitalWrite(9, HIGH);
    delayMicroseconds(5);
  digitalWrite(9, LOW);
delayMicroseconds(5);
// CALCULATE DISTANCE
  duration = pulseIn(8, HIGH);
  cm = microsecondsToCentimeters(duration);
    Serial.print(cm);
  Serial.print("cm");
   if(cm>15){
  // Forward
digitalWrite(2,LOW);
digitalWrite(3,HIGH);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
   }
  if(cm<15){
  // Reverse
  digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,HIGH);
  }
  if(cm<15&cm>10){
  // Right
    digitalWrite(2,HIGH);
digitalWrite(3,LOW);
digitalWrite(4,HIGH);
digitalWrite(5,LOW);
delay(1000);
  }
  if(cm<10){
  // stop
    digitalWrite(2,LOW);
digitalWrite(3,LOW);
digitalWrite(4,LOW);
digitalWrite(5,LOW);
  }
}
long microsecondsToCentimeters(long microseconds) {
  // The speed of sound is 340 m/s or 29 microseconds per centimeter.
  // The ping travels out and back, so to find the distance of the
  // object we take half of the distance travelled.
  return microseconds / 29 / 2;
}



.      Circuit diagram πŸ”πŸ‘†πŸ”πŸ‘†πŸ”πŸ‘†

Monday, 23 November 2020

smart glove for blinds

Code for the Arduino nano
#define trigPin 13


#define echoPin 12


#define motor 7


#define buzzer 6


void setup()

{

pinMode(trigPin, OUTPUT);


pinMode(echoPin, INPUT);


pinMode(motor, OUTPUT);


pinMode(buzzer,OUTPUT);


}


void loop()


{


long duration, distance;


digitalWrite(trigPin, LOW);


delayMicroseconds(2);


digitalWrite(trigPin, HIGH);


delayMicroseconds(10);


digitalWrite(trigPin, LOW);


duration = pulseIn(echoPin, HIGH);


distance = (duration/2) / 29.1;


if (distance < 70)     // This is where checking the distance you can change the value


{


digitalWrite(motor,HIGH);    // When the the distance below 100cm


digitalWrite(buzzer,HIGH);


} else


{


digitalWrite(motor,LOW);     // when greater than 100cm


digitalWrite(buzzer,LOW);


} delay(500);


}

               circuit diagramπŸ”πŸ‘†πŸ‘†πŸ‘†



Friday, 20 November 2020

joystick module with ARDUINO nano||how to use ARDUINO nano with joystick module||the robotics guy||Lucifer

Code for the Arduino
/*How to use the joystick module.
 *Serial monitor readings.
 *Read the code below and use it for any of your creation
 */
 
void setup() {
  Serial.begin(9600);//enable serial monitor
}
void loop() {
  int joy = analogRead(A0);//get analog value (0-1024)
  int joy1 = analogRead(A1);//get analog value (0-1024)
  String x = "x axis ";//creating string variable
  String y = "y axis ";//creating string variable
  Serial.print(x + joy);//print x axis value
  Serial.print("\t");//tab space
  Serial.println(y + joy1);//print y axis value
  Serial.println( "");//space
  delay(100);//delay
}

Tuesday, 17 November 2020

ultra sonic sensor with ARDUINO nano

Code for the ultra sonic sensor with ARDUINo
const int trigPin = 9;
const int echoPin = 10;
const int buzzer = 11;
const int ledPin = 13;

// defines variables
long duration;
int distance;
int safetyDistance;


void setup() {
pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output
pinMode(echoPin, INPUT); // Sets the echoPin as an Input
pinMode(buzzer, OUTPUT);
pinMode(ledPin, OUTPUT);
Serial.begin(9600); // Starts the serial communication
}


void loop() {
// Clears the trigPin
digitalWrite(trigPin, LOW);
delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds
digitalWrite(trigPin, HIGH);
delayMicroseconds(10);
digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds
duration = pulseIn(echoPin, HIGH);

// Calculating the distance
distance= duration*0.034/2;

safetyDistance = distance;
if (safetyDistance <= 20){ //Enter the Distance 
  digitalWrite(buzzer, HIGH);
  digitalWrite(ledPin, HIGH);
}
else{
  digitalWrite(buzzer, LOW);
  digitalWrite(ledPin, LOW);
}

// Prints the distance on the Serial Monitor
Serial.print("Distance: ");
Serial.println(distance); >
}

Sunday, 15 November 2020

introduction to Arduino nano

Arduino Nano Pin Configuration

Pin Category

Pin Name

Details

Power

Vin, 3.3V, 5V, GND

Vin: Input voltage to Arduino when using an external power source (6-12V).

5V: Regulated power supply used to power microcontroller and other components on the board.

3.3V: 3.3V supply generated by on-board voltage regulator. Maximum current draw is 50mA.

GND: Ground pins.

Reset

Reset

Resets the microcontroller.

Analog Pins

A0 – A7

Used to measure analog voltage in the range of 0-5V

Input/Output Pins

Digital Pins D0 - D13

Can be used as input or output pins. 0V (low) and 5V (high)

Serial

Rx, Tx

Used to receive and transmit TTL serial data.

External Interrupts

2, 3

To trigger an interrupt.

PWM

3, 5, 6, 9, 11

Provides 8-bit PWM output.

SPI

10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK)

Used for SPI communication.

Inbuilt LED

13

To turn on the inbuilt LED.

IIC

A4 (SDA), A5 (SCA)

Used for TWI communication.

AREF

AREF

To provide reference voltage for input voltage.

 

Arduino Nano Technical Specifications

Microcontroller

ATmega328P – 8 bit AVR family microcontroller

Operating Voltage

5V

Recommended Input Voltage for Vin pin

7-12V

Analog Input Pins

6 (A0 – A5)

Digital I/O Pins

14 (Out of which 6 provide PWM output)

DC Current on I/O Pins

40 mA

DC Current on 3.3V Pin

50 mA

Flash Memory

32 KB (2 KB is used for Bootloader)

SRAM

2 KB

EEPROM

1 KB

Frequency (Clock Speed)

16 MHz

Communication

IIC, SPI, USART

 

Other Arduino Boards

Arduino UNOArduino Pro Mini, Arduino Mega, Arduino Due, Arduino Leonardo

Understanding Arduino Nano

The Arduino board is designed in such a way that it is very easy for beginners to get started with microcontrollers. This board especially is breadboard friendly is very easy to handle the connections. Let’s start with powering the Board.


Powering you Arduino Nano:


There are totally three ways by which you can power your Nano.


USB Jack: Connect the mini USB jack to a phone charger or computer through a cable and it will draw power required for the board to function 


Vin Pin: The Vin pin can be supplied with a unregulated 6-12V to power the board. The on-board voltage regulator regulates it to +5V


+5V Pin: If you have a regulated +5V supply then you can directly provide this o the +5V pin of the Arduino.


 In itput/output:


There are totally 14 digital Pins and 8 Analog pins on your Nano board. The digital pins can be used to interface sensors by using them as input pins or drive loads by using them as output pins. A simple function like pinMode() and digitalWrite() can be used to control their operation. The operating voltage is 0V and 5V for digital pins. The analog pins can measure analog voltage from 0V to 5V using any of the 8 Analog pins using a simple function liken analogRead()


These pins apart from serving their purpose can also be used for special purposes which are discussed below:


Serial Pins 0 (Rx) and 1 (Tx): Rx and Tx pins are used to receive and transmit TTL serial data. They are connected with the corresponding ATmega328P USB to TTL serial chip.

External Interrupt Pins 2 and 3: These pins can be configured to trigger an interrupt on a low value, a rising or falling edge, or a change in value.

PWM Pins 3, 5, 6, 9 and 11: These pins provide an 8-bit PWM output by using analogWrite() function.

SPI Pins 10 (SS), 11 (MOSI), 12 (MISO) and 13 (SCK): These pins are used for SPI communication.

In-built LED Pin 13: This pin is connected with an built-in LED, when pin 13 is HIGH – LED is on and when pin 13 is LOW, its off.

I2C A4 (SDA) and A5 (SCA): Used for IIC communication using Wire library.

AREF: Used to provide reference voltage for analog inputs with analogReference() function.


 


Reset Pin: Making this pin LOW, resets the microcontroller.

 


These special functions and their respective pins are illustrated in the arduino nano pin diagram shown above.


 


How to use Arduino Nano

It will hardly take 5-10 minutes to upload you first program to Arduino Nano. All you need the Arduino IDE an USB cable and your Nano board itself.


Download and Install Arduino:


The first step would be install the Arduino IDE which is available for download for free from the below link. After installing Arduino you might also want to install the drivers (link given below) for you Arduino to communicate with your Computer


Arduino IDE Download

Driver Download

 


Uploading your first program

Once arduino IDE is installed on the computer, connect the board with computer using USB cable. Now open the arduino IDE and choose the correct board by selecting Tools>Boards>Arduino/Nano, and choose the correct Port by selecting Tools>Port. Arduino Uno is programmed using Arduino programming language based on Wiring. To get it started with Arduino Uno board and blink the built-in LED, load the example code by selecting Files>Examples>Basics>Blink. Once the example code (also shown below) is loaded into your IDE, click on the ‘upload’ button given on the top bar. Once the upload is finished, you should see the Arduino’s built-in LED blinking. Below is the example code for blinking:


// the setup function runs once when you press reset or power the board

void setup() {

  // initialize digital pin LED_BUILTIN as an output.

  pinMode(LED_BUILTIN, OUTPUT);

}

// the loop function runs over and over again forever

void loop() {

  digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)

  delay(1000); // wait for a second

  digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW

  delay(1000); // wait for a second

}


Applications

Prototyping of Electronics Products and Systems

Multiple DIY Projects.

Easy to use for beginner level DIYers and makers.

Projects requiring Multiple I/O interfaces and communications.

 


Difference between Arduino UNO and Arduino Nano

The Arduino Nano is very much similar to the Arduino UNO. They use the same Processor (Atmega328p) and hence they both can share the same program. One big difference between both is the size UNO is twice as big as Nano and hence occupies more space on your project. Also Nano is breadboard friendly while Uno is not. To program a Uno you need Regular USB cable where as for Nano you will need a mini USB cable. The technical difference between Uno and Nano is shown below.

πŸ‘‰πŸ‘‰πŸ‘‰πŸ‘‰ click here for video πŸ‘ˆ πŸ‘ˆπŸ‘ˆπŸ‘ˆ






 


Difference between Arduino Nano and Arduino Mega

There is a considerable amount of difference between the Arduino Nano and the Arduino mega as the processor used itself is different. Arduino Mega is more powerful than an Arduino Nano in terms of speed and number of I/O pins. As you might guess the size is also bigger than an Arduino UNO. Arduino Mega is normally used for projects which require a lot of I/O pins and different Communication protocols.




 

led chaser using aurduino nano

Code for the led chaser 
You can copy the whole code and past it on the editor....

void setup(){
  pinMode(2, OUTPUT);
  pinMode(3, OUTPUT);
  pinMode(4, OUTPUT);
  pinMode(5, OUTPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
  pinMode(10, OUTPUT);
  pinMode(11, OUTPUT);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
}

void loop(){
 

  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
 
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  delay(100);
 
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
 
  digitalWrite(2,LOW);
  delay(100);
  digitalWrite(3,LOW);
  delay(100);
  digitalWrite(4,LOW);
  delay(100);
  digitalWrite(5,LOW);
  delay(100);
  digitalWrite(6,LOW);
  delay(100);
  digitalWrite(7,LOW);
  delay(100);
  digitalWrite(8,LOW);
  delay(100);
  digitalWrite(9,LOW);
  delay(100);
  digitalWrite(10,LOW);
  delay(100);
  digitalWrite(11,LOW);
  delay(100);
  digitalWrite(12,LOW);
  delay(100);
  digitalWrite(13,LOW);
  delay(100);
 
  digitalWrite(13,HIGH);
  delay(100);
  digitalWrite(2,HIGH);
  delay(100);
  digitalWrite(12,HIGH);
  delay(100);
  digitalWrite(3,HIGH);
  delay(100);
  digitalWrite(11,HIGH);
  delay(100);
  digitalWrite(4,HIGH);
  delay(100);
  digitalWrite(10,HIGH);
  delay(100);
  digitalWrite(5,HIGH);
  delay(100);
  digitalWrite(9,HIGH);
  delay(100);
  digitalWrite(6,HIGH);
  delay(100);
  digitalWrite(8,HIGH);
  delay(100);
  digitalWrite(7,HIGH);
  delay(100);
 
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
 
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
 
  digitalWrite(13,LOW);
  delay(100);
  digitalWrite(12,LOW);
  delay(100);
  digitalWrite(11,LOW);
  delay(100);
  digitalWrite(10,LOW);
  delay(100);
  digitalWrite(9,LOW);
  delay(100);
  digitalWrite(8,LOW);
  delay(100);
  digitalWrite(7,LOW);
  delay(100);
  digitalWrite(6,LOW);
  delay(100);
  digitalWrite(5,LOW);
  delay(100);
  digitalWrite(4,LOW);
  delay(100);
  digitalWrite(3,LOW);
  delay(100);
  digitalWrite(2,LOW);
  delay(100);
 
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
 
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
 
  digitalWrite(13,LOW);
  delay(100);
  digitalWrite(2,LOW);
  delay(100);
  digitalWrite(12,LOW);
  delay(100);
  digitalWrite(3,LOW);
  delay(100);
  digitalWrite(11,LOW);
  delay(100);
  digitalWrite(4,LOW);
  delay(100);
  digitalWrite(10,LOW);
  delay(100);
  digitalWrite(5,LOW);
  delay(100);
  digitalWrite(9,LOW);
  delay(100);
  digitalWrite(6,LOW);
  delay(100);
  digitalWrite(8,LOW);
  delay(100);
  digitalWrite(7,LOW);
  delay(100);
 
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
 
  digitalWrite(11,LOW);
  delay(100);
  digitalWrite(12,LOW);
  delay(100);
  digitalWrite(13,LOW);
  delay(100);
 
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
 
  digitalWrite(8,LOW);
  delay(100);
  digitalWrite(9,LOW);
  delay(100);
  digitalWrite(10,LOW);
  delay(100);
 
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
 
  digitalWrite(5,LOW);
  delay(100);
  digitalWrite(6,LOW);
  delay(100);
  digitalWrite(7,LOW);
  delay(100);
 
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
 
  digitalWrite(2,LOW);
  delay(100);
  digitalWrite(3,LOW);
  delay(100);
  digitalWrite(4,LOW);
  delay(100);
 
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(2, LOW);
  delay(100);
 
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
 
  digitalWrite(2, LOW);
  delay(100);
  digitalWrite(2, HIGH);
  delay(100);
  digitalWrite(3, LOW);
  delay(100);
  digitalWrite(3, HIGH);
  delay(100);
  digitalWrite(4, LOW);
  delay(100);
  digitalWrite(4, HIGH);
  delay(100);
  digitalWrite(5, LOW);
  delay(100);
  digitalWrite(5, HIGH);
  delay(100);
  digitalWrite(6, LOW);
  delay(100);
  digitalWrite(6, HIGH);
  delay(100);
  digitalWrite(7, LOW);
  delay(100);
  digitalWrite(7, HIGH);
  delay(100);
  digitalWrite(8, LOW);
  delay(100);
  digitalWrite(8, HIGH);
  delay(100);
  digitalWrite(9, LOW);
  delay(100);
  digitalWrite(9, HIGH);
  delay(100);
  digitalWrite(10, LOW);
  delay(100);
  digitalWrite(10, HIGH);
  delay(100);
  digitalWrite(11, LOW);
  delay(100);
  digitalWrite(11, HIGH);
  delay(100);
  digitalWrite(12, LOW);
  delay(100);
  digitalWrite(12, HIGH);
  delay(100);
  digitalWrite(13, LOW);
  delay(100);
  digitalWrite(13, HIGH);
  delay(100);
 
  digitalWrite(13,LOW);
  delay(100);
  digitalWrite(12,LOW);
  delay(100);
  digitalWrite(11,LOW);
  delay(100);
  digitalWrite(10,LOW);
  delay(100);
  digitalWrite(9,LOW);
  delay(100);
  digitalWrite(8,LOW);
  delay(100);
  digitalWrite(7,LOW);
  delay(100);
  digitalWrite(6,LOW);
  delay(100);
  digitalWrite(5,LOW);
  delay(100);
  digitalWrite(4,LOW);
  delay(100);
  digitalWrite(3,LOW);
  delay(100);
  digitalWrite(2,LOW);
  delay(100);
}
 
circut diagram πŸ”

interfacing ph sensor with arduino

You will need to connect the pH sensor to the Arduino board and configure the pins accordingly. Refer to the documentation of your pH se...