Smart 4 Way Traffic Signal Control with Variable Delay

Hello guys! I hope you’re all in a good mood today because we are going to review the design of an interesting project today. We’ll be looking to design 4-way traffic lights in such a way that their delay is variable and is dependent upon the traffic density. This project is of intermediate difficulty level for people studying in undergrad engineering school with electronics, electrical and mechatronics as their major. It is also for the people learning Arduino and basic circuit design on their own or through some course. We have already designed a Simple 4-Way Traffic Light Control using Arduino and today we will make it smart by adding a variable delay.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LEDsAmazonBuy Now
2ResistorAmazonBuy Now
3LCD 16x2AmazonBuy Now
4Arduino Mega 2560AmazonBuy Now

Variable 4 Way Traffic Light:

As you all already know the importance of traffic lights and their usage has solved a number of traffic problems, traffic is becoming denser on each road in the whole world by the hour. This leads us to consider traffic density at such roads as well. A number of different solutions have been developed in recent times to help with this problem such as roundabouts. This is done so to ensure the safety of vehicles on road and of people walking on pedestrian walks. With the world going towards automation and autonomous systems, this is the right time to switch traffic lights to an autonomous traffic light system too and make the system intelligent.

Software to Install:

We will be going through how to make an autonomous traffic system by using Arduino as a microcontroller. However, we’re not making an actual system rather we will be making a simulation of the said traffic system on a circuit simulating software Proteus. So make sure you already have the latest version of Proteus installed on your PCs and laptops. If not, you should first install the Proteus Software by following the embedded link. Proteus is open database software, meaning people can easily make their own circuit simulating libraries for the software and can easily integrate those libraries. This helps in making the software versatile and easy to use. You can easily add your own components or download libraries of components and place them within the software.

To start working with this project, you need to install and include the following libraries on your Proteus software:

  • Arduino Library for Proteus: This library includes all the microcontroller-based programming boards made by the company Arduino.cc. This allows you to program on the Arduino software and after that, you can see the implementation of this code in Proteus simulation.
  • LCD Library for Proteus: LCDs are displays that can be used to display text or values being used in a certain code. These LCDs come in two sizes, namely a 16x2 and 24x4. LCDs are controlled by the Arduino board.
  • Ultrasonic Sensor Library for Proteus: Since we are using an ultrasonic sensor as well in this project for which Proteus does not have a built-in component, you would need to download its library as well.

Project Overview:

This is a smart 4-way traffic light system. The pedestrian lights work such that whenever a certain traffic light is green its opposite pedestrian lights turn on. An addition of ultrasonic sensors have been made in the traffic light sequence. One ultrasonic sensor is placed at each traffic light. Each ultrasonic sensor controls the time of their respective green traffic light. When the ultrasonic sensor output is high, the traffic light opens for one second, when the ultrasonic sensor output is intermediate the traffic light opens for two seconds and when the ultrasonic sensor output is low the traffic lights open for 3 seconds.

The main components and their use in this project is given below:

  • Arduino Mega: We have used Arduino mega in this project and recommend using an Arduino mega as well. This is because there are about 40 digital pins required to perform communication between the microcontroller and only an Arduino Mega fulfills that requirement.
  • Traffic Light Module: Proteus provides an in-built module for simulating traffic lights and we will use this instead of using RGB lights to create a better effect.
  • Ultrasonic Module: This module is not built-in, but information to integrate this module with Proteus has been given above. This module has a test pin in order to simulate it and works just like real life.
  • LCD: Liquid crystal display will be used to show the time in which the traffic light remains on.

Components Needed:

  • Arduino Mega
  • Traffic Lights
  • Green and Red LEDs
  • Variable resistors
  • LCD
  • Ultrasonic Sensor

Component Details:

We will go through the details of some of the important components being used in this project.

Arduino Mega:

Arduino is an open-source programmable board that serves as a microcontroller and processes information based upon inputs and gives information to actuators in terms of output. Arduino Mega is based upon the chip ATmegaGA2560 and has 53 digital I/O pins.

Figure 1: Arduino Mega

LCD:

Liquid Crystal Displays used in electronics are of two basic sizes, 16x2 and 24x2. These represent the number of columns and rows of the LCD. Each pixel can store one character in it. It is also known as a character LCD. It comes equipped with a backlight. The intensity or glow of the backlight can be controlled by attaching a potentiometer at specified pins.

Figure 2: LCD display

Ultrasonic Sensor:

An ultrasonic sensor uses SONAR technology to identify objects. It is basically used to find the distance of objects from the sensor. The ultrasonic sensor works by sending out ultrasonic waves and when these waves or parts of waves hit an object, they are reflected backward and the time from their propagation to their return is then noted. This time is then converted into the distance because we already know the speed by which those waves are traveling.

Figure 3: Ultrasonic Sensor

Proteus Simulation of Variable Traffic Lights:

In order to simulate this project on Proteus software, we will first make the circuit diagram on Proteus. After that, we will write our code on Arduino IDE software and integrate it with the circuit made in Proteus.

Open Proteus and open a new project. Import the following components in your Proteus worksheet.

Figure 4: List of components

Place the component in your worksheet as illustrated in the figure below:

Figure 5: Placement of components

After placing the components, make the connections as follows:

  • Connect 0,1 and 2 digital pins of Arduino to red, yellow and green of traffic light 1 respectively.
  • Connect 3,4 and 5 digital pins of Arduino to red, yellow and green of traffic light 2 respectively.
  • Connect 6,7 and 8 digital pins of Arduino to red, yellow and green of traffic light 3 respectively.
  • Connect 9,10 and 11 digital pins of Arduino to red, yellow and green of traffic light 4 respectively.
  • Connect 12and 13 digital pins of Arduino to red and green LEDs of pedestrian light 1 respectively.
  • Connect 14 and 15 digital pins of Arduino to red and green LEDs of pedestrian light 2 respectively.
  • Connect 16 and 17 digital pins of Arduino to red and green LEDs of pedestrian light 3 respectively.
  • Connect 18 and 19 digital pins of Arduino to red and green LEDs of pedestrian light 4 respectively.
  • Ground the negative terminals of all LEDs.
  • Connect one end of a variable resistor to the Vss pin of LCD.
  • Connect the other end of the variable resistor to the input.
  • Connect the input pin of the variable resistor with the Vee pin of LCD.
  • Ground the RW pin of LCD.
  • Connect RS pin of LCD to 22 digital pin of Arduino.
  • Connect E pin of LCD to 23 digital pin of Arduino.
  • Connect D4, D5, D6 and D7 pin of LCD to 24, 25, 26 and 27 digital pins of LCD respectively.
  • Connect the test pin of ultrasonic sensors to their respective potentiometers.
  • Connect the trigger pin and echo pin of the ultrasonic sensor of traffic light 1 to 28 and 29 digital pins of Arduino respectively.
  • Connect the trigger pin and echo pin of the ultrasonic sensor of traffic light 2 to 30 and 31 digital pins of Arduino respectively.
  • Connect the trigger pin and echo pin of the ultrasonic sensor of traffic light 3 to 32 and 33 digital pins of Arduino respectively.
  • Connect the trigger pin and echo pin of the ultrasonic sensor of traffic light 4 to 34 and 35 digital pins of Arduino respectively.

With this, your circuit connections are complete and we will now move on to the firmware setup of this circuit.

Arduino Code:

We have divided the Arduino code in 3 segments:

  • Declaration Code
  • Void setup
  • Void loop

We will look at these sections separately now.

Declaration Code:

The first step in the code is the declaration of variables that we will utilize in our program. At first is the declaration of ultrasonic sensor pins and setting them up with their respective pins of Arduino board. The syntax of this code is as follows.

Figure 6: Ultrasonic declaration code

Now we will include the library of LCD into our Arduino program, you can download this library from within the software. After that we will declare the LCD by defining the LCD pins. The syntax for which is as follows:

Figure 7: LCD declaration

In the next step, we will declare traffic light variables and define their Arduino pins.

Figure 8: Traffic light variable declaration

Now, we will declare the variables of pedestrian LEDs and then allot them their Arduino pins being used in the circuit.

Figure 9: Declaration of pedestrian LEDs

Now, there are two variables being used for each ultrasonic sensor for the calculation of their distance and time duration. We will declare those variables now.

Figure 10: Declaration of variables being used for calculations

Void Setup:

Void setup is the part of Arduino program that only runs once, in this section the program that only needs to run once is put, such as declaring pins as output pins or input pins.

Only the echo pins of ultrasonic sensor are input pins while all other pins are going to be output pins for this project.

We will first set up ultrasonic pins as follows:

Figure 11: Defining Ultrasonic pins as I/O for the Arduino Board

Now we will declare traffic light pins as output pins. The syntax for this is given as follows:

Figure 12: Setup of Traffic light Pins as Output

Now we will setup our pedestrian LEDs.

Figure 13: Setup of Pedestrian LEDs as Output

Now we will initialize our LCD, this basically tells the microcontroller to start the LCD and give power to it. The syntax is given below.

Figure 14: Initializing LCD

Void Loop:

This part of Arduino Program runs in a loop and consists of the main code of the program in which all the calculations are being done.

In the first part of the program, we will set the trigger pin of the first ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.

Figure 15: Syntax of 1st Ultrasonic Sensor

This distance calculation is for our first traffic light. Now we will use the if loop to check our distance value.

Figure 16: If Loop for Signal 1

If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.

Figure 17: Arduino Code

After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.

Figure 18: Arduino Code

Now we will use the if loop to check our distance value.

If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.

Figure 19: Arduino Code

After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.

Figure 20: Arduino Code

Now we will use the if loop to check our distance value again.

If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.

Figure 21: Arduino Code

After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.

Figure 22: Arduino Code

Now we will set the trigger pin of the second ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.

Figure 23: Arduino Code

This distance calculation is for our Second traffic light. Now we will use the if loop to check our distance value.

Figure 24: Arduino Code

If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.

Figure 25: Arduino Code

After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.

Figure 26: Arduino Code

Now we will use the if loop to check our distance value.

If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.

Figure 27: Arduino Code

After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.

Figure 28: Arduino Code

Now we will use the if loop to check our distance value again.

If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.

Figure 29: Arduino Code

After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.

Figure 30: Arduino Code

Now we will set the trigger pin of the third ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that, we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.

Figure 31: Arduino Code

This distance calculation is for our third traffic light. Now we will use the if loop to check our distance value.

Figure 32: Arduino Code

If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.

Figure 33: Arduino Code

After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.

Figure 34: Arduino Code

Now we will use the if loop to check our distance value.

If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.

Figure 35: Arduino Code

After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.

Figure 36: Arduino Code

Now we will use the if loop to check our distance value again.

If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.

Figure 37: Arduino Code

After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.

Figure 38: Arduino Code

Now we will set the trigger pin of the fourth ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that, we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that, we will calculate the distance from the duration of the wave.

Figure 39: Arduino Code

This distance calculation is for our fourth traffic light. Now we will use the if loop to check our distance value.

Figure 40: Arduino Code

If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.

Figure 41: Arduino Code

After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.

Figure 42: Arduino Code

Now we will use the if loop to check our distance value.

If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.

Figure 43: Arduino Code

After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.

Figure 44: Arduino Code

Now we will use the if loop to check our distance value again.

If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.

Figure 45: Arduino Code

After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.

Figure 46: Arduino Code

Results/Working:

At first, after writing the code, generate its hex file and put that hex file on the Arduino board on your Proteus software. After that, run the simulation. The results of the simulation are shown below thoroughly.

At first, when sensor one gives the output within 500 cm, the traffic light will turn on for one second only.

Figure 47: Simulation Results

However, if the sensor one value is between 500 and 900 cm, the traffic light 1 will be green for 2 seconds with the LCD displaying the remaining time.

Figure 48: Simulation Results

If the sensor values are above 900 cm, then the lights will be green for 3 seconds.

Figure 49: Simulation Results

When the sensor two gives the output within 500 cm, traffic light 2 will turn on for one second only.

Figure 50: Simulation Results

However, if the sensor two value is between 500 and 900 cm, the traffic light 2 will be green for 2 seconds with the LCD displaying the remaining time.

Figure 51: Simulation Results

If the sensor values are above 900 cm, then the lights will be green for 3 seconds.

Figure 52: Simulation Results

When sensor three gives the output within 500 cm, traffic light 3 will turn on for one second only.

Figure 53: Simulation Results

However, if the sensor three value is between 500 and 900 cm, the traffic light 3 will be green for 2 seconds with the LCD displaying the remaining time.

Figure 54: Simulation Results

If the sensor values are above 900 cm, then the lights will be green for 3 seconds.

Figure 55: Simulation Results

When sensor four gives the output within 500 cm, traffic light 4 will turn on for one second only.

Figure 56: Simulation Results

However, if the sensor four value is between 500 and 900 cm, the traffic light 4 will be green for 2 seconds with the LCD displaying the remaining time.

Figure 57: Simulation Results

If the sensor values are above 900 cm, then the lights will be green for 3 seconds.

Figure 58: Simulation Results

Phew! I know that this was an extremely long project, but that is a part of an engineer’s life. Multiple receptions and running recurring patterns smoothly requires skill and patience only an engineer can possess. I hope you guys made it through. Kudos to your nerves of steel. Thanks for reading.

pH Sensor Library for Proteus

Hi guys, I hope you are good and doing well in your life. In this article, I am going to tell you about a new pH Sensor Library for Proteus. I hope you all will enjoy it and find it useful. We are all well aware of pH Sensors which are used for the detection of pH of different fluids. By knowing the pH of a liquid we can tell whether the liquid is acidic or basic. You can’t find a pH sensor in Proteus software, so we designed a pH sensor for simulation purposes. You can interface this pH Sensor with any Microcontroller, for example: Arduino, PIC Microcontroller, 8051 Microcontroller etc.

In this pH Sensor Library, I have added four different pH Sensors, which are used for the detection of the pH of any fluid. Since we can’t place real liquid and measure pH in this software, I have attached a test pin in the pH meter where you have to connect a potentiometer. The potentiometer will produce a reading from 0 to 1023, which will be mapped from 0 to 14 in the program code. We can predict the nature of the liquid. We will have a look at how to use these sensors below. So, here’s the list of all four pH sensors, I have added to this pH sensor  library:

  • PH METER
  • PH METER 2
  • PH METER 3
  • PH METER 4

So, let’s start with downloading and installing the pH Sensor Library for Proteus.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LEDsAmazonBuy Now
2ResistorAmazonBuy Now
3Arduino UnoAmazonBuy Now

What is a pH Sensor?

  • A pH sensor is a device that is used to measure the pH value of a liquid. pH can be defined as the concentration of H+ ions in a liquid. We can find whether the fluid is acidic, basic or neutral by knowing the pH of the liquid.
  • Real pH sensors are shown below:

pH sensor Library for Proteus

  • First, download the zip file of Proteus Library for pH Sensor.
  • Click the link below to download the library zip file of pH Meter:
pH Sensor Library for Proteus
  • After downloading the zip file, extract its files and open the folder named “Proteus Library Files“.
  • In this folder, you will find three files, named:
    • pHMeterLibraryTEP.IDX
    • pHMeterLibraryTEP.LIB
    • pHMeterLibraryTEP.HEX
  • We have to place these files in the ‘LIBRARY’ folder of Proteus software.
  • Now, open Proteus. if you are already working on it you have to restart it.
  • In the components search box, search for “PH METER” and you will get four results, as shown in the below figure:
  • Let’s place these four pH Meter models in our Proteus workspace:

Adding Hex File to the Sensor

  • Now we need to paste the hex file of the pH METER in the properties section of the sensor. Double click on the sensor to open the properties window.
  • Go to the program file section, browse to the hex file, which we have downloaded above and placed it in the ‘LIBRARY’ folder of Proteus software:
  • After adding the hex file, click the Ok button.
  • Now all is ready, let’s create a circuit to check it's working.

pH Sensor Proteus Simulation

  • The pH sensor is now ready to simulate in Proteus, so let’s design a simple circuit to understand its working:
  • As you can see, I have placed an LC filter on the analog output of the pH sensor, it's because proteus gives us a peak to peak voltage value and we need to convert it to Vrms.
  • While performing the real experiment, you don’t need to do the above stuff.
  • Now, let’s run the Proteus simulation. You will see such a screen if everything will work fine.

Interfacing of pH sensor with Arduino UNO

  • Add Arduino UNO  and pH sensor to the components list and place them in the workspace.
  • Placed an LC filter on the analog output of the pH sensor, as mentioned above.
  • Connect it to the A0 pin of Arduino. Add a virtual terminal also to see the readings generated.
  • Paste the hex file of the program at the program file section of the Arduino.
  • Now run the simulation, if everything's fine you will get results as shown in the below figure:
  • You can watch the complete working simulation in the below video:

So, that was all for today. I hope you have enjoyed today's lecture. Thanks for reading !!!

Latest Proteus Libraries for Engineering Students V2.0

Hi Friends! Hope you’re well today. Happy to see you around. In this post today, I’ll walk you through Latest Proteus Libraries for Engineering Students V2.0.

We have been designing proteus libraries for our blog readers for quite a while now. You might have visited our Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0. We keep working on those libraries and make sure the bugs are removed and you always get the updated version of those libraries.

We are going to share the most advanced and upgraded version of Proteus Libraries V2.0 we have designed for our readers. These libraries are more robust, fast, and efficient than previous versions. Moreover, we have converted some digital sensors to analog sensors, helping you pick from a wide range of libraries for your projects. If you think some sensors or modules are missing in the Proteus database that should be included, leave your valuable suggestion in the section below. We’ll try our best to design and simulate those in proteus.

Before further ado, let’s jump right in.

Where To Buy?
No.ComponentsDistributorLink To Buy
1LEDsAmazonBuy Now
2ResistorAmazonBuy Now
3ACS712AmazonBuy Now
4DHT11AmazonBuy Now
5DHT22AmazonBuy Now
6DS18B20AmazonBuy Now
7Flame SensorsAmazonBuy Now
8Arduino Mega 2560AmazonBuy Now
9Arduino NanoAmazonBuy Now
10Arduino UnoAmazonBuy Now

Latest Proteus Libraries for Engineering Students V2.0

We’ll be covering both Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0.

Arduino Libraries for Proteus V2.0

Arduino boards are open-source electronic development boards that you can use in your projects. Arduino Libraries for Proteus V2.0 contain the following Arduino boards.

1. Arduino UNO Library for Proteus V2.0

Arduino UNO is a microcontroller board based on the Atmega328 microcontroller. We have designed Arduino UNO Library for Proteus V2.0 which you can download from the link given below. We’ve previously designed the Proteus Library for the Arduino UNO V1.0 board and the below figure shows the comparison of both V1 and V2 Arduino boards. You can see the V2 board is more compact and small-sized compared to the V1 Arduino UNO board.

In this library, we’ve also interfaced LCD with the Arduino UNO. If you find any difficulty in interfacing the board with the LCD, you can approach me in the section below. I’d love to help you the best way I can.

Download the Arduino UNO Library for Proteus V2.0 by clicking the link below:

Download Arduino UNO Library for Proteus V2.0

2. Arduino Mega 1280 Library for Proteus V2.0

Arduino Mega is an electronic board that features an Atmega1280 microcontroller. You can use this board to develop stand-alone electronic projects or you can also incorporate it into embedded projects. Again, the following figure shows a comparison between Arduino Mega 1280 V1 and V2. The V2 board is compact and small-sized compared to the V1 board.

We have developed the Arduino Mega 1280 library for proteus V2.0 which you can download to simulate Arduino Mega 1280 in proteus.

Download the Arduino Mega 1280 Library for Proteus V2.0 by clicking the link below:

Download Arduino Mega 1280 Library for Proteus V2.0

3. Arduino Mega 2560 Library for Proteus V2.0

Arduino Mega 2560 is a sophisticated, application-type microcontroller board that features an Atmega2560 microcontroller. This board comes in handy when you require more input and output pins and more memory space to store the code for your electronic project. We have developed Arduino Mega 2560 Library for Proteus V2.0 to help you simulate this board in the proteus. Moreover, we’ve also interfaced LCD with this board so if you have any questions about it, you can ask me in the section below:

]TEPImg6]

Click the link below and download the Arduino Mega 2560 Library for Proteus V2.0.

Download Arduino Mega 2560 Library for Proteus V2.0

4. Arduino Mini Library for Proteus V2.0

Arduino Mini is a small-sized, powerful open-source microcontroller board based on the Atmega328 microcontroller. The board is 1/6th of the size of the Arduino UNO board and can easily rest on hard-to-reach places. We have designed Arduino Mini Library for Proteus V2.0 that you can download to simulate Arduino Mini in Proteus.

Click the link below and download the Arduino Mini Library for Proteus V2.0:

Download Arduino Mini Library for Proteus V2.0

5. Arduino Pro Mini Library for Proteus V2.0

Arduino Pro Mini is a small-sized microcontroller board that includes an Atmega328 microcontroller. The Proteus library V2.0 is designed for Arduino Pro Mini, moreover, we have also interfaced the board with the LCD 20x4.

Click the link below and download the Arduino Pro Mini Library for Proteus V2.0.

Download Arduino Pro Mini Library for Proteus V2.0

6. Arduino Nano Library for Proteus V2.0

Arduino Nano is a powerful and bread-board-friendly microcontroller board based on ATmega328p/Atmega168 microcontroller. We have developed the Arduino Nano Library for Proteus V2.0 which you can download to simulate Arduino Nano in the Proteus workspace.

Click the link below and download the Arduino Nano Library for Proteus V2.0:

Download Arduino Nano Library for Proteus V2.0

Analog Sensors Libraries for Proteus V2.0

Analog Sensors Libraries for Proteus V2.0 contain the following Analog Sensors.

Vibration Sensor Library for Proteus V2.0

An analog vibration sensor, also known as a piezoelectric, is mainly employed to detect the vibration of industrial machinery. The sensor gets activated if the vibration of the machines goes above the standard value. Vibration sensors are used to monitor the small changes in temperature, acceleration, pressure, and force.

We have done a little work and designed Analog Vibration Sensor Library for Proteus V2.0. Earlier we designed the proteus library for V1 version analog vibration sensors. The V2 version is more robust, compact, and advanced compared to the V1 version. Four vibration sensors are included in the proteus library and they have both digital and analog output pins which you can interface with Arduino boards or microcontrollers.

You can download the analog vibration sensor library for proteus V2.0 by clicking the link below:

Download Vibration Sensor Library for Proteus V2.0

Sound Detector Sensor Library for Proteus V2.0

A sound detector sensor is used to detect the sound in the environment. This sensor is only used for sound detection, not for sound recognition.

We have designed the Sound Detector Sensor Library for Proteus V2.0 that you can download to simulate this sensor in proteus. An LC filter is used on the analog output of the sensor since we need to convert the peak to peak voltage into Vrms. Know that you don’t require this LC filter in the real sensor circuit. We have simulated two sound detector sensors in proteus as they have different outputs because of different voltages on the test pin.

Click the link below and download the Sound Detector Sensor Library for Proteus V2.0:

Download Sound Detector Library for Proteus V2.0

Analog Flex Sensor Library for Proteus

An Analog flex sensor, also known as a bend sensor, is a special type of sensor used to detect the value of bend in the application. This sensor is mainly employed indoor sensors, robot whisker sensors, and stuffed animal toys.

We have developed an analog flex sensor library for proteus that you can download to simulate this sensor in Proteus. Know that Test Pin is included in the pinout of this sensor in proteus only, you won’t find this pin in the real sensor. This pin will determine the value of the bend. The HIGH value at this pin will give the value of bend and the LOW value at this pin will indicate there is no bend. We have also interfaced the Arduino board with the sensor where the analog input pin of the board is connected with the voltage appearing across the voltmeter.

Click the link below and download the Analog Flex Sensor Library for Proteus:

Download Flex Sensor Library for Proteus

Analog PIR Sensor Library for Proteus

PIR (Passive Infrared) sensor is a small, inexpensive, low-power sensor used to detect heat energy in the surrounding. The sensor monitors if the human body has come in or out of the sensor’s range.

We have designed Analog PIR Sensor Library for Proteus that you can download to simulate this sensor in Proteus. Moreover, we’ve also developed a simulation of this PIR sensor with an Arduino board. Know that, besides Arduino boards, you can also interface this sensor with PIC or Atmel microcontrollers. We’ve added four PIR sensors file in the proteus that are the same in terms of working but they come in a different color. Again, a test pin is added in the pinout of this sensor in proteus only, you won’t find this pin in real. This pin is added to sense the motion in the proteus workspace.

Click the link below and download the Analog PIR Sensor Library for Proteus:

Download PIR Sensor Library for Proteus

Water Sensor Library for Proteus

A water sensor is a sensor used to sense the presence of water. The water’s electrical conductivity is measured using this sensor to sense the presence of water. This sensor is widely used in applications where we need to monitor rainfall, water level, and water leakage.

We have designed the water sensor library for proteus which you can download to simulate this sensor in proteus. The Test pin is added to detect the water in the proteus simulation. We’ve also interfaced this sensor with the Arduino board where we have connected the analog input pin of the Arduino board with the output of the water sensor appearing across the voltmeter.

You can download the water sensor library for Proteus by clicking the link below:

Download Water Sensor Library for Proteus

Soil Moisture Sensor Library for Proteus

A soil moisture sensor is employed to analyze the water content in the soil. The sensor uses capacitance to monitor the dielectric permittivity of the soil which defines the function of the water content.

We have designed the Soil Moisture Sensor Library for Proteus where we have connected the test pin with the variable resistor. This resistor is used to define the soil moisture content in the proteus simulation. The maximum resistance on the test pin shows zero volts across the voltmeter, referring to the zero moisture value of the water content. The sensor is also interfaced with the Arduino board as shown below.

Click the link below and download the Soil Moisture Sensor Library for Proteus:

Download Soil Moisture Library for Proteus

IR Proximity Sensor Library for Proteus

The IR proximity sensor is used in robots to detect obstacles. This sensor is widely used for path navigation and obstacle avoidance in electronic projects.

We have designed the IR Proximity Sensor Library for Proteus which you can download to simulate this sensor in Proteus. The Test pin is used for hurdle detection. HIGH value on this pin means there is an obstacle in front and LOW value on this pin means there is no hurdle.

LC filter is included in the simulation which you don’t require in real. This filter is used to convert the Peak to Peak value we get on Proteus into the Vrms value.

[TEPImg16]

You can download the IR proximity sensor library for proteus by clicking the link below:

Download IR Proximity Sensor Library for Proteus

That’s all for today. Hope you find this article helpful. If you have any questions, you can approach me in the section below. I’d love to help you the best way I can. Thank you for reading this article.

Pulse Width Modulation using 555 Timer in Proteus

Hello Engineers! Welcome to the board. We hope you are having a good day. In this tutorial, we teach you about Pulse Width Modulation. We'll discuss some important points about the topic. Let's have a look at the Topics of the tutorial:
  1. What is Pulse Width Modulation?
  2. What is 555 Timer?
  3. how does 555 Timer is used in the Pulse Width modulation circuit?
  4. How do we design the circuit of Pulse Width Modulation in Proteus ISIS?
In addition, you will have some useful information bout Pulse Width Modulator in DID YOU KNOW section.
Where To Buy?
No.ComponentsDistributorLink To Buy
1555 TimerAmazonBuy Now
2LEDsAmazonBuy Now
3ResistorAmazonBuy Now

Pulse Width Modulation

Pulse width Modulation is a useful technique in the world of Modern Electronics. Let's have a look at the information about Pulse Width Modulation.

Abbreviation of Pulse Width Modulation

The Abbreviation of the Pulse Width Modulation technique is PWM.

Definition of Pulse Width Modulation

We define the pulse Width Modulation as:
"The Pulse Width Modulation is the technique  in the electronics to control the power given to the analogue devices through which the average power delivered by the electrical signal is reduced due to division of the signals into discrete parts."
The Pulse Width Modulation is important to the inertial load devices such as motors because in these devices the change is slow due to their inertial ability and the Pulse Width Modulator has enough time to control the device.

Example of PWM

We know that in the bulb that we use in our daily life, the AC Power changes its direction from positive to negative cycle and vise versa. The frequency through which the cycle change decides the brightness of the bulb. Consider the example of the circuit in which the LED is connected to the power. The Power connection lightens the LED. When the switch between the power source and the bulb is close, the power is transmitted to the bulb and the brightness is observed. The opening and the closing of the switch can be controlled through the Pulse Width Modulation. The more is the duty cycle of the Pulse width, the more rapidly it opens and closes the switch and hence the brightness of the bulb is more and vise versa. hence we can conclude that by controlling the pulse width we are controlling the opening and closing of the switch and through which we are controlling the brightness of the bulb.  

DID YOU KNOW????????????

"The Pulse Width Modulation technique is also called as the Pulse Duration Modulation or PDM. It is because this technique works with the duration of the cycle of the circuit. "

555 Timer in Pulse Width Modulation

Prior to start the work of 555 Timer in Pulse Width Modulator, we must clear some important concepts about the 555 Timer device. Let's have a glance on the points.

Definition of 555 Timer

The 555 Timer was termed as the SE NE555 Timers. Another Type of the 555 Timer is SE555 Timer. These were first invented by "Signetic Corporation" . We define the 555 Timer as:
"The 555 Timer is an 8 pin Integrated Circuit that generates accurate timing pulse. The designing of the 555 timer is done by collectively arranging the electrical and electronic components such as resistors, transistors, diodes and Flip Flops."
These are monolithic Timing circuits that are designed to provide stable time delay and oscillations. These are highly reliable and low in cost.

Pin out of 555 Timer

There are 8 pins of 555 Timer and each pin has its own function and operation. For the best concept, we have designed a table for each pin given below:
Pin Number Pin Name Description
1 Ground This pin is labeled as GND and used to supply the 0 voltage.
2 Trigger When the Time interval starts, the output remains low when this pin is high and vise versa.
3 Output This is the output pin.
4 Reset This pin overrides the Trigger pin and that overrides the Threshold. It is connected with Vcc if not used.
5 Control It controls the Pulse Width and the level of threshold and Trigger.
6 Threshold Hen the voltage is applied at this pin, it acts in the contrast to the voltage.
7 Discharge This pin is an open-collector output. During the intervals, this pin is used to discharge the capacitor.
8 Supply This is the power supply pin. The input of power is taken against the Ground pin.

DID YOU KNWO???????????

"We use the counter instrument in the Proteus to count the Pulse Width Modulation of the circuit using 555 Timer."

Implementation of PWM using 555 Timer in Proteus ISIS

To implement the Pulse Width Modulation using 555 Timer, we are using the simulation in Proteus ISIS. To Implement the 555 Timer PWM  just follow the simple steps given next:
  • Fire up your Proteus Software.
  • Choose the following components:
  1. 555 Timer
  2. 1N4148 Diode
  3. 3005P-1-502 Variable Resistor
  4. DC Power Supply
  5. Resistor
  6. Counter
  7. Oscilloscope
  • Fix first five components from the "Pick Library" at the working area.
  • Change the values of Resistor, Capacitors and variable Resistors according to the table given below:
    Component Values
    Resistor 1k ohm
    Variable Resistor 50k ohm
    Capacitor 1 10nf
    Capacitor? 1uF
    DC Power source 10V
     
  • Go to Terminal mode>Ground and set it at the end of the circuit.
  • Connect the components through the connecting wires according to the image given next:
  • To get the counting of the output, go to virtual Instrument Mode and choose the counter.
  • Go to Virtual instrument Mode and select the Oscilloscope.
  • Connect the counter with any terminal of the Oscilloscope.
  • Join both the instruments with pin 3 of 555 Timer.
  • Pop the play button and simulate the circuit.
  • Change the values of voltages and the frequency according to need.
  • We observe that the Oscilloscope shows us the width as:
Thus, Today we saw what is the pule Width Modulation, learned some important concepts about the 555 Timer, got some important concepts about Pulse Width Modulation using the 555 Timer and saw the simulation by the mean of Proteus ISIS. If you found it useful, give us your important feedback in the comment section.

Metal Detector using 555 Timer in Proteus

Hello Pupils! I welcome you to the board. I hope you are fine. In today's tutorial, we will design a project Metal Detector using 555 Timer in Proteus ISIS. All of us perceive the situations when at the public places such as on airports or in shopping malls where sharp metallic objects such as a knife or illegal guns or even a nail cutter are not allowed, there are walkthrough gates at every entrance so that any person with the forbidden material when passes through the gate, the alarming buzzer automatically switched on. This happened because the walkthrough gates have the Metal Detector circuit in them that works immediately when such a situation occurs. In this session, we'll learn:
  1. What are Metal Detectors?
  2. How does the 555 Timer collaborate with the circuit of Metal Detector?
  3. How does the circuit of the 555 Timer Metal Detector works?
  4. How can we implement the circuit of 555 Timer Metal Detector in Proteus?
In addition, you will also have some useful pieces of information in DID YOU KNOW Sections.
Where To Buy?
No.ComponentsDistributorLink To Buy
1555 TimerAmazonBuy Now
2LEDsAmazonBuy Now
3ResistorAmazonBuy Now

NE555 Timer Metal Detectors

Metal Detectors became the one of the necessary devices for many public Places either it is park or bank, airport or any supermarket. It is because they play a vital role in the maintenance of security. Most of the metal detectors We define the Metal Detector as:
"The Metal detectors are the specialized NE555 Timer gadgets that detect the presence of the metals when the metals enters in the range of Metal Detector Circuits."
The NE555 Timer Metal Detectors does not only have the application i the field of security but they are also used in a variety of situations. The NE555 Timer Metal Detector can be categorized into three basic Families:
  1. Very Low Frequency Detectors.
  2. Pulse Induction Detectors.
  3. Metal Detectors for specific Purpose.

DID YOU KNOW??????????????????????

"1960 was the year in which the 1st Metal Detector was established using simple devices in industrial and Mineral Prospecting. "
There are many kinds of NE555 Timer Metal Detectors that are used for different operations some of them are listed below:
  1. Diagnostic Purposes.
  2. Detecting myriad of foreign objects.
  3. Finding the presence of bullets.
  4. Detecting the intraocular metallic fragments.
  5. Finding Swallowed coins.

Working of NE555 Timer Metal Detector

When we talk about the working of the NE555 Timer Metal Detector, we must have a clear idea about the following concepts:
  1. Inductance
  2. NE555 Timer operational system

Inductance in NE555 Timer Metal Detector

Let's recall the idea of Inductance that we are learning from our physics class:
"The Inductance, in electromagnetism and electronics, is the ability of a conductor of electricity to negate the change in the electric current that is flowing through it. This flow of electric current produces a magnetic field around that electrical conductor."
In the NE555 Timer Metal Detector circuit, we use an inductor that senses the presence of the Metal near to it. More close a Metal Detector to it, the more electric field lines are produced and hence the speaker gives the sound more loudly indicating the distance between the NE555 Timer Metal Detector and the metal's distance. We denote the Inductance through "L". Hence the formula to find the Inductance through any Conductor can be find through: Inductance= Magnetic Flux of Current/Current.

DID YOU KNOW ???

"There are some Metal Detectors that are used to find the treasure or ancient metals underground. They are so powerful that they can detect the Metal many feet away.  Thus, many people have a life changing search due to these useful instruments."

NE555 Timer

NE555 Timers belongs to the Family of 555 Timers Integrated Circuits. These are highly utilitarian circuits that are considered as one of the most used Integrated Circuits in the world of Electronics. We introduce the NE555 Timer as:
"NE555 Timer Circuit is the widely used Integrated Circuit having 8 pins and used to have the output that have a uniform pulses that can be set according to need."
The 555 Timers are used to have a variety of pulses that depends upon the arrangement of the devices connected to their Pins. There are three kinds of NE555 Timer modes:
  1. Monostable Mode.
  2. Astable Mode.
  3. Bistable Mode.

Operations in the NE555 Timer Metal Detector Circuit

  • When we examine the Circuit of NE555 Timer Metal Detector, we find these operations:
  • The power of all the components is the Direct current that is provided by the battery.
  • This power enters the NE555 Timer circuit that produces the uniform Timer-based Pulse at its output pin.
  • This Pulse enters the resistor that controls the flow of current through the main Metal Detector circuit.
  • The Resistor passes this current to the Inductor. The Inductance of the inductor is the basic criteria of distance measurement.
  • As in Proteus, it is not possible to show the Movement of a Metal, so the value of the inductance represents the number of electric field lines around the NE555 Timer Metal Detector circuit. More is the Inductance, more numbers of lines passing through the inductor and hence it is assumed that metal is more near to the circuit. 
  • The DC current then passes through the speaker according to the strength of the electric field lines and hence we found the faint or hard sound.
[PostWiidget4]

Circuit design of 555 Timer Metal Detector in Proteus

  • Power up your Proteus Software.
  • Choose the following components from the Pick Library button "P".

Components Required

  1. NE555 Timer
  2. Inductor
  3. Capacitor
  4. Resistor
  5. Speaker
  • Take all the Components from the left section and arrange all of them on working screen according to the diagram given below:
 
  • Now, Change the values of some of the components one after the other by double clicking the components.
  • Inductor= 150mH, Capacitor 1=2.2uF,Capacitor 2=2.2uF,Capacitor 3 10uF, Resistor= 47k Ohm, Battery=9V.
  •  Connect the circuit components with the help of connecting wire so our circuit look like this:
  • As soon as the Circuit is simulated by hitting the Play button, the user sense a sound or buzzer from the circuit.
  • If you heard it then cool, otherwise look at your circuit once again.

Task

Change the value of inductor to 300micro Farad and more to hear the louder sound.
Hence today, we saw what are NE555 Timer Metal Detector, How do they are classified, how does the circuit of 555 Metal detector works and how can we design its circuit using simple devices in Proteus ISIS. Stay with us for more projects.

Police Siren Project using 555 Timer in Proteus

Hey Geeks! Welcome to The Engineering Projects. We hope you are having a reproductive day. We know that sirens are the special sounds that are the symbol that something unusual is occurring or about to occur. You may have experienced the Siren of the Walkthrough Gates at the airport when a person having the knife or other forbidden material pass through it. Or you have heard the Siren of the ambulance and seen that all the traffic gives the way to the ambulance when they hear the special Siren of the Ambulance. The same is the case with the police Siren. The Police sirens are the special sound and it is set with the help of 555 Timer Integrated Circuit. You will learn how can one design a Police siren using the 555 Timer circuit in this tutorial. Let's have a quick list of the topics that will be clear in our tutorial.
  1. What is the 555 Timer Police Siren?
  2. What are the 555 Timer and its modes?
  3. How does the circuit of 555 Timer police Timer Circuit works?
  4. How can you design the circuit of 555 Timer Police Siren in Proteus?
Where To Buy?
No.ComponentsDistributorLink To Buy
1555 TimerAmazonBuy Now
2LEDsAmazonBuy Now
3ResistorAmazonBuy Now

555 Timer Police Siren

The Police Siren we have seen many times in real life as well as in Television shows and Movies are made of the special arrangement of the 555 Timer. The Siren has a loud voice that can be heard at a distance of many feet. This Project has a very simple yet amazing arrangement of some basic electronic devices. The heart of Police Siren is the 555 Timer integrated circuit. In the police siren, two 555 timers are used. This is a Multi-functional chip that is widely used in different types of the industrial as well as household applications. If we look at the configuration of 555 Timer Integrated Circuit then we can generate a table just as shown next:
Pin Number Attachments
1 Ground
2 Trigger
3 Output
4 Reset
5 Control
6 Threshold
7 Discharge
8 Vcc
Technically, The 555 Timer works in 3 modes:
  • Monostable Mode
  • Astable Mode
  • Multistable Mode

Monostable Multivibrator Mode in 555 Timer

This mode of the 555 Timer contains a single stable state that can be used to get only one single output pulse of a specific width that may be high or low by applying an external trigger pulse. In this circuit, the 555 Timer uses only one resistor but two capacitors.

Astable Mode in 555 Timer

As the name shows, the Astable mode does not have any stable state. The Astable mode of 555 Timer has 2 quasi-steady states that change from one state to another one after the other. In this way, the 555 Timer in this state, alters the output from high to low and vise versa after the time settled by the user. It uses two capacitors and two resistors connected with the specific pins in a specific manner.

Bistable Mode of 555 Timer

In this mode of 555 Timer, the pins are connected with two resistors, one capacitor and two switches. The switches turn the state of 555 Timer to high and low and thus we obtained the high and low output waves at a time.

Working of the 555 Timer Police Siren

The working of the 555 Timer Police Siren starts from the Direct Current power supply that is supplied to pins 8 of the 555 Timer.
  1. Both of these 555 Timers are in the Astable mode that means their pulse output changes continuously.
  2. The 555 Timer at the left produces a pulse that is fed into the right 555 Timer as an input.
  3. The values of Resistors control the width of the pulses.
  4. The capacitors connected with the 555 Timers charge and discharge without any interval.
  5.  At the end, this DC power supply enters the speaker with a continuously varying pulses of the current and produces a special sound.
  6. If you want to change the output voice, you can change the values of Resistors and capacitors.

Circuit design of 555 Timer Police Siren in Proteus

To design this circuit, simply follow these step given next as it is.
  • Start the Proteus Software.
  • Choose the required devices from the pick library by clicking the "P" button and writing the names of the devices.

Required Components fpr 555 Timer Police Siren:

  1. NE555 Timer (We'll use 2 ICs)
  2. Diode
  3. Resistor
  4. Direct current power supply
  5. Speaker
  6. Capacitor
  • Get the 555 Timer from the library and arrange it at the working area.
  • Repeat the step above.
  • Choose Resistor, capacitor, Diode and speaker and arrange them on the screen.
  • Change the alignment of 4 resistors and diode by left click on screen> Rotate Clockwise and set the whole circuit as shown in the figure:
  • Go to Generation Mode>DC and fix it at above the working area.

DID YOU KNOW ???

"If you have the Proteus 8 software, then you can have a real time Siren sound by choosing the Speaker and a piano symbol with it."
  • Label the Components by double-clicking it because Proteus throws an error for the duplicate devices.
  • Double click the components mentioned below and change their values according to the table given next:
Device Value
R2 68k Ohm
R3 68K Ohm
R4 8.2K Ohm
R5 8.2K Ohm
C1 100uF
C2 100nF
C3 0.01uF
C4 10uF
Vcc 4V
 
    • Go to Terminal Mode>Ground and Set the Ground terminal just below the circuit.
  •  Join the 555 Timer's pins with the components as described above in the 555 Timer section.
  • Pop the Play button and simulate the circuit.

Task

Now, change the values of capacitor and resistor in different sequence to have the different voices as an output.
Have you heard the siren? If yes then cool. Yet, if no, then look at the circuit deeply and fix the mistake. Truss, today we saw that what is the Police Siren, how does the 555 Timer circuit works, what is the working mechanism of the 555 Timer Police Siren, how does we design the circuit of 555 Timer Police Siren in the Proteus. If you found it useful, give us feedback. If you faced any difficulty, share with us i the comment section. Stay with us with more Proteus Projects.

Interfacing of Arduino with 74HC595 & 74HC165

Hello friends, I hope you all are doing great. In today's tutorial, I am going to show you How to Interface Arduino with 74HC595 & 74HC165. I have already interfaced these shift registers separately with Arduino. In the first tutorial we have seen Arduino 74HC595 Interfacing in which I have discussed How to increase the output pins of Arduino using 74HC595. After that in second tutorial we have seen Arduino 74HC165 Interfacing where we have increased the input pins of Arduino. So, now we are gonna interface both of these shift registers with Arduino UNO and will increase both input and output pins of Arduino. I have also given the Proteus simulations for download at the end of this tutorial along with Arduino code. So, lets get started with Interfacing of Arduino with 74HC595 & 74HC165:

Interfacing of Arduino with 74HC595 & 74HC165

  • As you can see in above figure, I have used 74HC165 & 74HC595 and interfaced its pins with Arduino UNO.
  • I could use same clock for these shift registers but it would have made the code quite complex.
  • That's why I have used separate clock pins and I have used the below code to reflect the input on output.
#define NUMBER_OF_SHIFT_CHIPS   1
#define DATA_WIDTH   NUMBER_OF_SHIFT_CHIPS * 8
#define TotalIC 2
#define TotalICPins TotalIC * 8

int LoadPin    = 8;
int EnablePin  = 9;
int DataPin    = 11;
int ClockPin   = 12;

int RCLK = 5;
int SER = 6;
int SRCLK = 7;

unsigned long pinValues;
unsigned long oldPinValues;
boolean Data[TotalICPins];

void setup()
{
    Serial.begin(9600);

    pinMode(LoadPin, OUTPUT);
    pinMode(EnablePin, OUTPUT);
    pinMode(ClockPin, OUTPUT);
    pinMode(DataPin, INPUT);

    digitalWrite(ClockPin, LOW);
    digitalWrite(LoadPin, HIGH);
    Serial.println("Visit us at www.TheEngineeringProjects.com");
    Serial.println();
    pinMode(SER, OUTPUT);
    pinMode(RCLK, OUTPUT);
    pinMode(SRCLK, OUTPUT);

    ClearBuffer();
    
    pinValues = read_shift_regs();
    print_byte();
    oldPinValues = pinValues;
}

void loop()
{
    pinValues = read_shift_regs();

    if(pinValues != oldPinValues)
    {
        print_byte();
        oldPinValues = pinValues;
    }

}

unsigned long read_shift_regs()
{
    long bitVal;
    unsigned long bytesVal = 0;

    digitalWrite(EnablePin, HIGH);
    digitalWrite(LoadPin, LOW);
    delayMicroseconds(5);
    digitalWrite(LoadPin, HIGH);
    digitalWrite(EnablePin, LOW);

    for(int i = 0; i < DATA_WIDTH; i++)
    {
        bitVal = digitalRead(DataPin);
        bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));

        digitalWrite(ClockPin, HIGH);
        delayMicroseconds(5);
        digitalWrite(ClockPin, LOW);
    }

    return(bytesVal);
}

void print_byte() { 
  byte i; 

  Serial.println("*Shift Register Values:*\r\n");

  for(byte i=0; i<=DATA_WIDTH-1; i++) 
  { 
    Serial.print("P");
    Serial.print(i+1);
    Serial.print(" "); 
  }
  Serial.println();
  for(byte i=0; i<=DATA_WIDTH-1; i++) 
  { 
    
    Serial.print(pinValues >> i & 1, BIN); 
    Data[i] = pinValues >> i & 1, BIN;
    //if(BinaryValue == 1){Data[i] = HIGH;}
    //if(BinaryValue == 0){Data[i] = LOW;}
    UpdateData();
    if(i>8){Serial.print(" ");}
    Serial.print("  "); 
    
  } 
  
  Serial.print("\n"); 
  Serial.println();Serial.println();

}

void ClearBuffer()
{
    for(int i = TotalICPins - 1; i >=  0; i--)
    {
       Data[i] = LOW;
    }
    UpdateData();
} 

void UpdateData()
{
   digitalWrite(RCLK, LOW);
   for(int i = TotalICPins - 1; i >=  0; i--)
   {
        digitalWrite(SRCLK, LOW);   
        digitalWrite(SER, Data[i]);
        digitalWrite(SRCLK, HIGH);

  }
  digitalWrite(RCLK, HIGH);
}
  • In the above code, I have used Number_of_Shift_Chips 1 and it means I am using 1 chip each, so in total 2 chips.
  • Now get hex file from Arduino software and upload it in your Proteus software.
  • Run your simulation and if everything goes fine then you will get something as shown in below figure:
  • You can see in above figure that all those LED outputs are ON which has HIGH inputs.
  • I have also attached a Virtual Terminal with Arduino to have a look at the input bits.
  • Now let's add 2 chips of 74HC165 and 74HC959, so design a simple simulation as shown in below figure:
  • Now in your above code change the Number of Shift chips from 1 to 2, as now we are using 2 chips each.
  • Upload your hex file and if everything goes fine then you will get similar results:
  • So, that's how you can easily increase input and output pins of Arduino UNO.
  • I have just designed a simple code but you can work on it and can control these inputs separately as well.
  • You can interface different digital sensors on these input pins and can control motors, relays, solenoids etc. at output pins.
  • You can download both of these Proteus Simulations along with Arduino code by clicking the below button, but I would suggest you to dwsign it on yoru own so that you could learn from mistakes.

[dt_default_button link="https://theengineeringprojects.com/ArduinoProjects/Interfacing%20of%20Arduino%20with%2074HC595%20&%2074HC165.zip" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Simulation & Arduino Code [/dt_default_button]

So, that was all about Interfacing of Arduino with 74HC595 & 74HC165. I hope you can now easily simulate it. If you have any questions then ask in comments and I will try my best to resolve them. Thanks for reading. Take care !!! :)

Arduino 74HC595 Interfacing: Increase Output Pins

Hello friends, I hope you all are doing great. In today's tutorial, I am going to show you Arduino 74HC595 Interfacing and we will have a loook at How to Increase Arduino Output Pins with 74HC595. Suppose you are working on some project where you need to control 20 LEDs with Arduino UNO and you know we will 12 digital Pins so we can't control all of these 20 LEDs with Arduino UNO. We can use Arduino Mega as well but if we wanna stick to Arduino UNO then we need to increase its Output Pins and we will use 74HC595 for that purpose. You should read this basic Introduction to 74HC595, it will help you to better understand this shift register. It's a Serial In Parallel Out Shift register and we will give it value serially from single Pin of Arduino and it will output that data to 8 output pins. Moreover, we can also connect these registers in parallel to increase the output pins even further. So, let's have a look at Arduino 74HC595 Interfacing:

Arduino 74HC595 Interfacing

  • As I told earlier 74HC595 is a serial In Parallel Out Shift Register and is used to increase the output pins of Arduino.
  • I am gonna use Proteus software and we will design its simulation and then will check out How it works.
  • So, design a simple circuit as shown in below figure:
  • As you can see in above figure, I have done the following connections between Arduino and HC595:
    • Pin # 5 of Arduino ==> ST_CP
    • Pin # 6 of Arduino ==> DS
    • Pin # 7 of Arduino ==> SH_CP
    • All output pins of 74HC595 are connected to LEDs.
  • Now upload the below Arduino code and get your hex file.
int RCLK = 5;
int SER = 6;
int SRCLK = 7;

#define TotalIC 1
#define TotalICPins TotalIC * 8

boolean Data[TotalICPins];

void setup()
{
  pinMode(SER, OUTPUT);
  pinMode(RCLK, OUTPUT);
  pinMode(SRCLK, OUTPUT);

  ClearBuffer();
}              


void loop()
{
   for(int i = TotalICPins - 1; i >=  0; i--)
   {
      Data[i] = HIGH;
      UpdateData();
      delay(300);
      ClearBuffer();
   }

   for(int i = 1;i < TotalICPins - 1;  i++)
   {
      Data[i] = HIGH;
      UpdateData();
      delay(300);
      ClearBuffer();
   }
   
}

void ClearBuffer()
{
    for(int i = TotalICPins - 1; i >=  0; i--)
    {
       Data[i] = LOW;
    }
    UpdateData();
} 

void UpdateData()
{
   digitalWrite(RCLK, LOW);
   for(int i = TotalICPins - 1; i >=  0; i--)
   {
        digitalWrite(SRCLK, LOW);   
        digitalWrite(SER, Data[i]);
        digitalWrite(SRCLK, HIGH);

  }
  digitalWrite(RCLK, HIGH);
}
  • The code is quite simple but let me explain it a bit.
  • First of all we have given names to our 3 Pins connected to Arduino UNO.
  • After that we have made all those 3 Pins as OUTPUT as we are gonna send the data.
  • We are using single chip of 74HC595 that's why I have made it 1.
  • In the UpdateData function, you can see we have to make RCLK Low and after that we have sent our data.
  • But for sending each bit of Data we have to make SRCLK from LOW to High.
  • SER is our Serial IN from Arduino to 74HC595.
  • So, in loop section, I am simply sending HIGH from first Pin to Last and then from last Pin to first and we are getting below results:
  • Now let's have a look at How to connect two 74HC595 chips in parallel to increase the output pins to 16.
  • I have also given these Proteus simulations for download at the end of this tutorial but I would recommend you to design them on your own so that you got better understanding of this shift register.
Arduino 74HC595 Interfacing: 2 Chips in Parallel
  • Now we are gonna place two shift registers in parallel and we will be able to control 16 outputs from single Arduino Pin.
  • Although we are using 3 Arduino Pins but the data is sent through Pin # 6 of Arduino and Pin # 5 and 7 are CLK Pins.
  • Now design a circuit as shown in below figure:
  • Now in Arduino Code, you just need to change the TotalIC to 2 and as you have seen we have already multiplied it with 8 so now our for loop will move from 0 to 15.
  • Pin # 5 and 7 will simply connected to same pins of second shift register but DS will be connected to Q7' of first shift register.
  • Now get your hex file from Arduino software and if everything goes fine then you will get something as shown in below figure:
  • Now let's make it a bit more complex by adding 4 shift registers in parallel.
  • So, design a Proteus Simulation as shown in below figure:
  • We have followed the same principal, Q7' of second chip is connected to DS to 3rd chip and goes on.
  • I have placed these default Pins instead of connecting the wires, it works the same.
  • If this image is not clear then open it in new tab and zoom out to check the connections.
  • Now in your Arduino code, you need to change the TotalIC to 4, as now we are using four chips.
  • Get your Hex File and run Proteus simulation and if everything goes fine then you will get similar results:
  • So, that's How you can quite easily do the Arduino 74HC595 Interfacing and can increase Arduino outputs as much as you want.
  • You can download these Proteus Simulations along with code by clicking the below button:

[dt_default_button link="https://www.theengineeringprojects.com/ArduinoProjects/Arduino 74HC595 Interfacing.rar" button_alignment="default" animation="fadeIn" size="medium" default_btn_bg_color="" bg_hover_color="" text_color="" text_hover_color="" icon="fa fa-chevron-circle-right" icon_align="left"]Download Proteus Simulation & Arduino Code[/dt_default_button]

  • I have also designed this YouTube video to give you a better understanding of Arduino 74HC595 Interfacing:
So, that was all for today. I hope you have enjoyed this Arduino 74Hc595 Interfacing. If you have any questions, then ask in comments and I will try my best to resolve them. In my coming tutorial, I will show you How to increase the Arduino Input Pins. So stay tuned and have fun. :)

Introduction to Resistors

Hey guys! I hope you are doing good and having fun. Today, I am going to unlock the details on the Introduction to Resistors. Resistor is a two terminal component that is used to restrict the flow of current. Resistors are widely used in electrical circuits. They come in different forms ranging from variable resistors to fixed resistors. Depending on the feature of resistors, both are used in many applications. I am going to cover all aspects relating to resistors. Let's get started.

Introduction to Resistors

  • A resistor is a two-terminal device that is used to resist the flow of current. It is one of the most commonly used components in electrical circuits.
  • Resistance of any resister is described in ohms. Ohm is denoted by the Greek letter omega. Each resister has a different value of resistance which tells us how strongly it resists the flow of current. More the value of resistance more is the capability of resisting the current.
  • Resistance will be considered as one ohm if the potential difference between the two ends of the conductor is 1 V and a current flowing through it is 1 Ampere.
  • Resistance can be derived from Ohm's law which indicates voltage is directly proportional to the current flowing through the conductor.

V= I * R

  • Each resistor comes with two wires, also called as leads. Between these two leads there lies a ceramic part which actually resists the flow of current. Resistor consists of three colored strips that indicate the value of resistance.
  • Some resistors come with four colored strips. In such case, fourth strip indicates the value of tolerance. Tolerance is the value of the deviation of resistance from its given value on the resistor. Gold color of forth strip indicates tolerance is 5% and silver color indicates tolerance is 10%. Where there is no forth strip, tolerance is considered as 20%. Suppose, if resistance has 50-ohm resistance with no forth strip. Then tolerance of such resistor can be 50 ±20%.
  • Resistance of any resistor also depends on its resistivity, its length and cross-sectional area.
  • Resistors also indicate temperature coefficient. Temperature coefficient is known as a resistance due to the change in temperature. There are two types of temperature coefficients. Positive temperature coefficient and negative temperature coefficient. If resistance increases with the increase in temperature then it is called positive temperature coefficient and if resistance decreases with the decrease in temperature then it is called negative temperature coefficient.

How to Limit Current using Resistance

  • Main purpose of resistance is to limit the current flowing through the component.
  • Suppose, if we want to connect the LED with the direct DC source i.e. Battery, then it will burn out right away the moment you connect the LED with the battery.
  • Because battery will allow a large amount of current to flow through the LED which will burn it out.
  • LED can be avoided from any severe damage if we put the resistor between the battery and LED. It will control the amount of current flowing through the LED.
  • Value of resistance you use depends on the current rating of the battery. You need to use the resistor with high resistance if current rating of a battery is high.
  • We can calculate the resistance by using Ohm's Law. Suppose we have LED that comes with voltage rating of 12 voltage and current rating of 100mA or 0.1 A. From Ohm's Law

V=IR

R= V/I

R=12/0.1= 120 O

  • In order to avoid LED from damaging we need resistor with resistance of 120 O
 

Combination of Resistors

Resistors can also be used in combination. There are classified into two types according to their combination.
Resistors in Parallel
  • If resistors are connected parallel to each other, then total resistance will be equal to the sum of reciprocal of all resistance.

1/R= 1/R1+1/R2+1/R3............1/Rn

Resistors in Series
  • If resistors are connected in series, the total resistance will be equal to the sum of all resistance.

R= R1+R2+R3+R4..........Rn

Power Dissipation

  • The power consumed by any resistor at any moment is defined as
  • P= VI= V(V/R)= V²/R
  • Most of the resistors are classified on their ability of power dissipation. Resistors who dissipate a large amount of energy are called as power resistors and are mostly used in power supplies, power amplifiers, and power conversion circuits.
  • Power resistors are physically larger than normal resistors and their value cannot be directly identified by the reading color strip method.
  • Resistors pertain to severe damage if their average power dissipation is greater than thier power rating. It results in permanently alternating the resistance.
  • Excessive power dissipation can also damage the whole circuit. In order to avoid burning of the circuit, flameproof resistors are used that suddenly open the circuit before power dissipation gets too high.

How to Calculate Resistance of any Resistor

There are two different ways to calculate the resistance:
Reading the Color Bands
  • First method to calculate the resistance is by reading the color bands of the resistor.
  • Each strip of color on the resistor represents a specific digit.
  • Different colors corresponding to their digit values are given below.
  • In the above figure, the first strip is brown and corresponding digit to brown is 1.
  • The second strip is black, and the corresponding digit to black is 0.
  • The third strip is orange and the corresponding digit to orange is three which actually shows the number of zeros.
  • Forth strip is made of gold which indicates tolerance is ±5%.
  • So overall resistance of this resistor is 10,000±5 % ohm.
Using a Multimeter
  • Second method to measure the resistance is by using the multimeter as an ohmmeter. Mainly multimeter performs three functions. It is used to measure current voltage and resistance.
  • Put the black probe on the COM port of multimeter. And put the red probe into the VOmA.
  • You can measure the resistance of any resistor by holding the resistor with the two separate probes of the multimeter. Before calculating the resistance, you need to set the dial to ohm which is denoted on the multimeter by the symbol O.
 

Types of Resistors

Resistors come in different forms, sizes, and shapes. Resistors are used in different applications depending on the current rating voltage and resistance. Let's discuss resistor types and their applications. Resistors are mainly classified into two types:
  1. Linear Resistors
  2. Non-Linear Resistors
1. Linear Resistors
  • Resistors are termed as linear resistors where current is directly proportional to the applied voltage.
  • Resistance of these resistors changes with the change in temperature and voltage.
  • In order words, resistors which follow Ohm's law are linear resistors.
  • Linear resistors are further classified into two types
    • Fixed Resistors
    • Variable Resistors
1.1 Fixed Resistors 1.1.1 Carbon Composition Resistor
  • Carbon composition resistors comprise of rigid resisting element incorporated with lead wire. The resistor body is covered with plastic or paint.
  • The resistive element at the mid of the lead wires contains fine carbon and insulating material which is usually ceramic. The resistance of such resistors is measured as the ratio of ceramic to carbon.
  • Resistance value widely depends on the concentration of carbon value. More is the concentration of carbon, lesser will be the resistance.
  • Carbon composition resisters come with poor stability and 5% tolerance.
  • These resistors are become obsolete because of their high price but still they are used in wielding controls and power supplies.
  • Resistance of such resistors varies from few ohms to 22 mega-ohms.
1.1.2 Carbon Pile Resistor
  • A carbon pile resistor consists of layers of carbon discs that are placed between two metal plates.
  • Resistance between the plates can be changed by changing the clamping pressure.
  • These resistors are widely used in radio transmitters.
  • A carbon pile resistor can also be used in generators, where it adjusts the current to keep the voltage in certain state.
1.1.3 Carbon Film Resistor
  • A carbon film resistor consists of amorphous carbon which provides relatively large resistance.
  • These resistors encompass low noise as compared to carbon composition resistor.
  • A carbon film resistor comes with a power rating that ranges between 0.125 to 5 W with resistance 1 ohm to 10 mega-ohm. These resistors are used in areas where high stability is required.
1.1.4 Thick Film Resistor
  • Thick film resistors come in the shape of SMD(Surface mount device).
  • Both, think and thin film resistors are manufactured in a same way but main difference is the resistive element that is used in thick film resisters is relatively very large than used in thin films.
1.1.5 Thin Film Resistor
  • Thin film resistor consists of ceramic rod and resistive material.
  • A very thin layer of conducting material is being placed on the insulating rod that is made of glass or ceramic material. This method of making thin film is called vacuum deposition.
  • When thin film resistor is manufactured, it doesn't give an accurate value of resistance.
  • Resistance value can be made accurate by the process called laser trimming.
  • These resistors come in the tolerance range that lies between 1% to 5% and encompass much less noise level than thick film resistors.
  • Compared to thick film resistors, thin film resistors are highly expensive.
1.1.6 Wire Wound Resistors
  • Wire wound resistors are widely used in many electrical applications. They are manufactured by winding a metal wire around fibreglass core or ceramic material. Whole assembly is being formed where two ends of wire are welded with rings and are covered with high layer of molded plastic or paint.
  • These resistors have capability to bear high temperature upto 450 ºC.
  • As wire wound resistors are same like coil so they inherit high value of inductance as compared to other resistors.
  • Both, carbon composition resistors and wire wound resistors are used in same application except where high frequency is required. High frequency response of carbon composition resistors is better than wire wound resistors.
1.2 Variable Resistors
  • Resistors are termed as variable resistors whose values can be adjusted manually by screw, knob, or dial.
  • These resistors come with sliding arm that is attached to the shaft.
  • Resistance value can be changed by rotating the sliding arm.
  • They are mainly divided into two types:
    • Rheostats
    • Potentiometer
1.2.1 Rheostats
  • Rheostat resistors are also known as variable wound resistors or tapped resistors.
  • Rheostat is a manual operated three terminal device which is mainly used to restrict the current value.
  • In order to make rheostat, Nichrome resistance is being wound around a ceramic core, then they are placed in a covered shell.
  1.2.2 Potentiometer
  • A potentiometer is a three terminal device that consists of tapping points that are adjusted by a rotation of shaft.
  • It can be used to provide a potential difference between the two terminal connected to the tapping points.
  • They are widely used for volume control in many radio receivers.
  • Potentially there is no difference between rheostat and potentiometer, however, both are used for difference purpose.
  • Rheostat is used for controlling the level of current in the circuit while potentiometer is used for controlling the voltage in the circuit.
 
2. Non-Linear Resistors
  • Resistors are termed as non-linear resistors where they do not pertain to follow ohm's law but their value of resistances changes with the slight change in temperature or current.
  • Non-linear resistors are further divided into two types:
    • Thermisters
    • Varisters
2.1 Thermisters
  • Resisters are termed as thermisters, if current flowing through it changes with the change in temperature.
  • Thermister is basically a two terminal device which uses variable resister and indicates even a slight change in temperature.
  • In thermister, resistance and temperature are inversely proportional to each other.
2.2 Varisters
  • Resisters are termed as varisters if current flowing through it changes with the change in applied voltage.
  • These resistors are sensitive to voltage and avoid the circuits from getting high voltage spikes.
  • They are used to maintain the voltage to a required level.

Applications of Resistors

Resisters are widely used in many electrical circuits. Following are the main applications of resistors.
  • They are used to limit current in order to avoid short circuit
  • They are used to control voltage in order to avoid high spikes at the end of out put voltage
  • Used in many electronic industries
  • Temperature can also be controlled using these resistors
  • In home electronic appliances like heater and iron
That's all for today. I have tried my best to cover as many aspects as possible relating to resistors. However, if still you feel any doubt or query in understanding the concept of resistors, you can always ask me in the comment section below. I'll be glad to help you in this regard. Thanks for reading the article. Give your feedback, how do you like our articles what are the suggestions you would like to give that can help in crafting the articles in better way? Stay tuned for next article! Have a blessed day ahead!

Stepper Motor Speed Control using Arduino

Hello everyone! I hope you all will be absolutely fine and fun. Today, I am going to tell you that how to make a simple algorithm for Stepper Motor Speed Control using Arduino. I have already discussed with you about DC Motor Direction Control using Arduino, Matlab and NI LabVIEW. Moreover, I have also discussed the DC Motor Speed Control using Arduino,Matlab and LabView. If you are working on Stepper Motor, then you must have a look at Stepper Motor Direction Control using Arduino, Stepper Motor Direction Control using Matlab and Stepper Motor Direction Control using NI LabVIEW. Now, in this tutorial I will explain you about the program which will helpful for Stepper Motor Speed Control using Arduino. Before going into the details of this tutorial you must have go through my previous tutorials because I am using the same hardware. So, they will be a lot helpful for the better understanding of this tutorial. In this tutorial I will explain you about making an Arduino program for Stepper Motor Speed Control using Arduino with the help of the serial communication. If the stepper motor is rotating at its maximum speed and you are continuously sending the command through the serial port to reduce its speed, it s speed will be reduced in proportion to the number of command sent through the serial port. Similarly the same procedure will be followed to increase the speed of the stepper motor.

Stepper Motor Speed Control using Arduino

In the tutorial Stepper Motor Direction Control using Arduino, I will explain you about making an algorithm to run the stepper motor at different speed. If the stepper motor is already running at its maximum speed and you want want to accelerate it further then nothing will happen to the speed of the stepper motor. If the stepper motor is rotating slowly and you enhance its speed, then the speed of the motor will increase in proportion to the number of accelerating command sent through the serial port.
  • You can download the complete Arduino source code here by clicking on the button below.

Download Arduino Code

  • Download .rar file, extract it and enjoy the complete source code.
Flow Chart
  • I have made a flow chart so that you can easily understand the entire algorithm because sometimes it becomes difficult to understand the algorithm with the help of the source code.
  • Flow chart for the Stepper Motor Speed Control using Arduino is shown in the figure below.
  • First of all we need to start the serial port so that our communication could be started.
  • Then there is a method to check the speed, if the speed is greater than the maximum speed of the stepper motor then the program will wait for the next command.
  • If the stepper motor is not rotating with its maximum speed then we can increase its speed.
  • Similarly if the minimum speed of the stepper motor is reached then the program will rotate for the next commands.
  • If the minimum limit of the speed of the stepper motor is not reached then we have a option to reduce its further.
  • At the end we should close the serial port so that exchange of unnecessary commands through the serial port could be avoided.
Block Diagram
  • Block diagram will be helpful for use for the better understanding of the exchange of information.
  • It tells us that how the information is exchanged sequentially among all the components used.
  • Block diagram is shown in the figure below.
  • Arduino UNO communicates with the L298 motor controller to control the speed of the stepper motor.
  • L298 Motor controller manipulates the Arduino's commands and starts to control the speed of the stepper motor.
Arduino Code Description
In this section of the tutorial Stepper Motor Speed Control using Arduino, I am going to elaborate you about the Arduino source.
  • I have made two different functions for increasing (accelerating) the speed of the stepper motor and for decreasing (deaccelerating) the speed of the stepper motor respectively.
  • I have declared a variable named as count.
  • In Accelerate function, you have to send the command through the serial port to increase the speed of the stepper motor.
  • In this function, I am continuously increasing the value of the count i.e as many times you send the command the speed of the stepper motor will increase continuously.
  • The source code of the Accelerate function is given below.
   void Accelerate_Motor()
   { 
    count=count+10; //Speed will increase continuously as we continue to press H
    if (count>120)  //Speed must not be greater than 120
    {
      count=120;
      }
    Serial.println("Accelerating"); //printing on the serial port
    Serial.println("");//prints blank line on the serial port
    myStepper.step(stepsPerRevolution);//counter clockwise rotation
    myStepper.setSpeed(count); //Updating the speed of the motor
    lcd.setCursor(3,0);//setting LCD cursor
    lcd.print("Acelerating"); //printing on LCD
   }
  • In Deaccelerate function, you have to send the command through the serial port to increase the speed of the stepper motor.
  • In this function, I am continuously reducing the value of the count i.e as many times you send the command the speed of the stepper motor will reduce continuously.
  • The source code of the Deaccelerate function is given below.
void Deaccelerate()
{
  count=count-10; //reducing the speed of the motor
  if (count<20) //speed of the motor must not be less than 20
  {
    count=20;
    }
  Serial.println("Deaccelerating"); // prints on the serial port
  Serial.println(""); //prints blank line on the serial port
  myStepper.step(stepsPerRevolution);
  myStepper.setSpeed(count); //Updating the speed of the motor
  lcd.setCursor(3,0);  //setting cursor on LCD
  lcd.print("Deaccelerating"); //prints the command on LCD
  }
  • In the main source inside the loop I am calling both of these Accelerate and Deaccelerate functions.
  • The executed commands will also be printed on the LCD (Liquid Crystal Diode).
  • The main source code is given below.
#include <LiquidCrystal.h>//Library for LCD
#include <Stepper.h>     //Library for Stepper motor

const int stepsPerRevolution = 255;  

// initialize the stepper library on pins
Stepper myStepper(stepsPerRevolution, 4, 5, 6, 7);
char data;
int count = 120;
//LCD pins assigning
LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
void setup() {
  // set the speed at 60 rpm
  myStepper.setSpeed(60);
  // initialize the serial port:
  Serial.begin(9600);// rate at which the arduino communicates

lcd.begin(20, 4);//LCD type

lcd.setCursor(3,0);//setting LCD cursor and printing on it
lcd.print("Stepper Motor");
lcd.setCursor(6,1);
lcd.print("Speed");
lcd.setCursor(5,2);
lcd.print("Control");
lcd.setCursor(2,3);
lcd.print("via Arduino UNO");

delay(3000);

lcd.clear ();//Clearing the LCD screen

lcd.setCursor(0,2);
lcd.print("www.TheEngineering");
lcd.setCursor(4,3);
lcd.print("Projects.com");
}

void loop() {
  if(Serial.available())
  {
    data = Serial.read(); //Reading the data from serial port
  }
  
    if(data == 'C'){Clockwise();}      //Clockwise rotation
    if(data == 'A'){AntiClockwise();} //Anti-clockwise rotation
    if(data == 'S')                  //stopping the stepper motor
    {
      data = 0; 
      lcd.setCursor(3,0);
      lcd.print("No rotation");
      Serial.println("No rotation");//print on the serial
      }   
     if(data == 'H'){Accelerate_Motor();}
     if(data == 'L'){Deaccelerate();}
}
Complete Hardware Setup
  • In this section of the tutorial, I will show you the complete hardware setup that I have used for this project.
  • Hardware consists of 12V power supply, Arduino UNO, L298 motor controller.
  • When you upload the code to the Arduino board the system will look like the figure shown below.
  • When you press to increase the speed of the stepper motor, the statement accelerating will be printed on the LCD.
  • The printed executed command is printed on the LCD and is shown in the figure below.
  • When you press to reduce the speed of the stepper motor, the statement Deaccelerating will be printed on the LCD.
  • The printed executed command is printed on the LCD and is shown in the figure below.
That is all from the tutorial Stepper Motor Speed Control using Arduino. I hope you all have enjoyed this tutorial. If you face any sort of problem regarding anything you can ask me anytime without even feeling any kind of hesitation. I will try my level best to solve your issues in a better way if possible. I will explore Arduino by making further projects and I will share them with all of you as well in my later tutorials. So, till then, Take Care :)
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir