Arduino UNO Library for Proteus V3.0

Hi friends! I hope you are having a good day. Today, I am presenting the Arduino UNO library for Proteus V3.0. You should have a look at the previous versions of this library i.e. Arduino UNO library for Proteus(V2.0) and the Arduino UNO library for Proteus(V1.0). The warm response of the students to these libraries has motivated them to upgrade the library. The latest version of this library has better design and functionality, which I will discuss in detail with you. 

In this article, we will discuss the basic introduction to the Arduino UNO library, its simulation, and its working. Moreover, we will discuss a small project to show you the functionality of this library. Here is the introduction to the library:

Where To Buy?
No.ComponentsDistributorLink To Buy
1Battery 12VAmazonBuy Now
2LEDsAmazonBuy Now
3ResistorAmazonBuy Now
4Arduino UnoAmazonBuy Now

What is the Arduino UNO?

  • The Arduino UNO was released in 2010 by Arduino. cc and it is a microcontroller board that is mostly used in embedded systems.
  • This board is baked on a Microchip ATmega328P and is equipped with digital and analog input/output pins.
  • This board has 14 digital and 6 analog I/O pins, a type B USB cable,  and can be programmed with the Arduino IDE.

Now, let’s see the Arduino UNO library in Porteus. 

Arduino UNO Library for Proteus V3.0

The Arduino UNO library for Proteus V3.0 can be easily installed by following these simple steps. First of all, download the library by clicking on the following link:

Arduino UNO Library for Proteus V3.0

Adding Proteus Library File

  • The file will be downloaded in the zip folder. Extract the file and open the folder named “Proteus Library Files”.
  • There, you will find the following files:
  • ArduinoUNO3TEP.IDX
  • ArduinoUNO3TEP.LIB
  • Copy these files and paste them into the library folder of Proteus software. For this, follow the path C>Program files>Labcenter electronics>Proteus 7 professional>Library
  • If you are facing any issues with the installation, you can read How to Add a New Library File in Proteus .

Note: The procedure to use this library in Proteus 8 Professional is the same. 

Arduino UNO Library in Proteus

  • Once the library is installed, if your Porteus software is open, restart it to read the functionality of the library.
  • Click on the “P” button of the library and search for "Arduino UNO V3.0 TEP,” and it will show you the library. The screen will look like the following image:

  • Pick the Arduino UNO V3.0 by double-clicking on it.
  • From the component window, click on the name of Arduino and then place it on the working sheet to check the look and pinouts of this Arduino UNO V3.0.

Arduino UNO V3.0 Simulation in Proteus

It is time to check the workings of the Arduino library. Here, we will create the simple project of blinking the LED with an Arduino. It is a basic project and the best example of Arduino working for beginners. Follow the steps to create the project:

LED with Arduino UNO V3.0

  • Go to the “Pick library” button and choose LED and resistor.
  • Connect one side of the resistor to pin 13 (or any) of the Arduino.
  • Connect the LED to the other end of the resistor.
  • Double-click on the resistor and change its value to 330 ohms.
  • Go to the terminal mode from the left side of the screen and choose the “Ground” terminal.
  • Connect this terminal to the end of the LED.

Code for Arduino UNO V3.0

  • Open your Arduino IDE to write the code in it.
  • Select the Arduino board from the drop-down menu of the boards.
  • Create your own code or simply paste the following code into it:

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

}

  • Compile the code by clicking on the tick mark. The loading will start at the bottom of the screen.
  • Copy the address of the hex file from the bottom of the screen.

Add Hex File in Proteus

  • There is a need to create a connection between Arduino in Proteus and the Arduino IDE.
  • Double-click on the Arduino UNO V3.0 in Proteus to open the properties panel.
  • Paste the address of the hex file copied from the Arduino IDE.

Arduino UNO V3.0 Simulation Results

  • Click on the run button to get the results of the simulation.
  • If you have correctly followed all the instructions, then the LED will start blinking.

I hope your project is working fine. This is the most basic project, and you can see the Arduino UNO library for Proteus V3.0 has perfect functionality. If you are facing any issues regarding this library, you can ask in the comment section. 

Arduino Library For Proteus V3.0

Hello friends! I hope you are having a good day. Today, I am sharing a new version of Arduino Library for Proteus(V3.0). I have already shared the previous versions of this library i.e. Arduino Library for Proteus(V1.0) and Arduino Library for Proteus(V2.0). This newer version is way better than previous versions because of its realistic design and better performance. I will discuss the comparison in detail in just a bit. This Proteus Library zip file has the following types of Arduino microcontrollers in it:

We will move towards the installation, but before this, let me share the basic introduction of Arduino.

Where To Buy?
No.ComponentsDistributorLink To Buy
1Battery 12VAmazonBuy Now
2ResistorAmazonBuy Now
3LCD 20x4AmazonBuy Now
4Arduino NanoAmazonBuy Now
5Arduino Pro MiniAmazonBuy Now
6Arduino UnoAmazonBuy Now

What is Arduino?

  • Arduino is an open-source family of microcontroller boards that is designed mainly for interactive projects by engineers.
  • It was presented to hobbyists, students, professionals, and developers for the experimentation of electronic and embedded systems.
  • Multiple sensors are interfaced with Arduino microcontrollers, and they can also drive the motors and switches for different circuits.
  • These are flexible, provide the platform for many types of embedded elements, and work as the heart of a project to control the work and automate the flow of the project.

Now, have a look at how to download and install this library in Proteus.

Comparing Arduino V3.0 with Other Versions

The latest version of Arduino is different from the previous ones because of the following reasons:

  • We have removed the website's link from these Arduino boards, as we received a lot of complaints from engineering students regarding it.
  • Reduced the boards' size to fit more components in the space.
  • We have used the original color for these Arduino boards to make them look more realistic and identical to real-world Arduino boards.
  • We have improved the layout of the pins for better wiring/routing.
  • Removed the unnecessary pins i.e. Power Pins & Reset Pin.
  • We have placed the Arduino logo on the boards.

Here are all the V3.0 Arduino boards:

Arduino Library for Proteus V3.0

  • The first step is to download the Proteus library for Arduino. For this, click the below link:

Arduino Library for Proteus

Adding Proteus Library Files

  • Once the download of the zip file is complete, extract the files from the zip folder.
  • Go to the “Library Files” folder, where you will find the following files:
  • ArduinoV3TEP.IDX
  • ArduinoV3TEP.LIB
  • Copy these files and paste them into the folder by following the path C>Program files>Lab centre electronics>Proteus 7 Professional>Library.

In case you don't know how to install the library, you can see How to Install the New Library in Proteus. Moreover, the installation process of this library in Proteus 8 is the same; you simply have to paste the files into the library folder of Proteus 8.

Arduino V3.0 in Proteus

  • Open your Proteus software, and if it was already opened, restart it. Now your Proteus can read the library files.

  • Click on the P button to pick the library from the system and the search bar, and type “Arduino V3.0 TEP”. All six libraries in Arduino V3.0 that you have just installed will be shown to you on the screen. 

  • Choose all of these by clicking them and closing the search window. 

  • Now, if you want to see the design of all of these, click on the name of the library, and then click on the working sheet to place the board.

  • Here is a simple view of all the files in the Arduino V3.0 folder.  

Arduino V3.0 Simulation in Proteus

Now, let us make a simple project with the Arduino UNO V3.0 to show you the workings of these libraries. All other boards can be connected to the components in the same way. So follow the steps to learn the workings:

LCD with Arduino V3.0

Let us create a simulation where the LCD display is controlled using Arduino V3.0. For this, we are using the LCD for Proteus V2.0. If you do not have this, you have to download and install the New LCD library for Proteus V2.0. Follow the instructions below to design the simulation:

  • Go to the pick library and get the following components:
    LCD TEP V2.0 (20X4)

    • POT-HG

    • Button

  • Set all the components on the working sheet. 

  • Go to Terminal mode>Default pin and set them with the components. 

  • Choose the ground and power terminals and connect all the components according to the image:


Code for Arduino V3.0

Open your Arduino IDE and paste the code given next into the Arduino. I have added the same code to the zip file. 

#include

//Setting the LCD pins

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

const int buttonPin = 0;

boolean lastButtonState = LOW;

boolean displayMessage = false;

void setup() {

  pinMode(buttonPin, INPUT);

  //Printing the first message

  lcd.begin(20, 4);

  lcd.setCursor(1, 0);

  lcd.print("Press the button to see the message");

}


void loop() {

  int buttonState = digitalRead(buttonPin);

// Using if loop to create the condition

  if (buttonState != lastButtonState) {

    lastButtonState = buttonState;

    if (buttonState == LOW) {

      displayMessage = true;

      lcd.clear();

      lcd.setCursor(1, 0);

      //Printing the message on screen when button is pressed

      lcd.print("www.TheEngineering");

      lcd.setCursor(4, 1);

      lcd.print("Projects.com");

    } else {

      displayMessage = false;

      lcd.clear();

      lcd.setCursor(1, 0);

      lcd.print("Press the button to see the message");

    }

  }

}

Add HEX file in Proteus

  • When the code is verified in the Arduino IDE, it will provide the hex file. Simply copy the main path of the hex file. 

  • Go to the Proteus and double-click the Arduino. It will open the properties panel. 

  • Paste the path to the hex file in the program file and click OK. 

Arduino with LCD Output

The code prints the link to the website on it. You can see the LCD gets power only when the button is pressed. 

When the button is unpressed:

When the button is pressed:

I hope you found this article useful. The Arduino library for Proteus V3.0 is more stylish, error-free, and easy to use. I have created other libraries, such as the Raspberry Pi 4, that are useful for embedded engineers. Feel free to ask any questions if you have any confusion.

Top Embedded Proteus Libraries V1.0 for Engineering Students

Hi readers! I hope you are having a creative day. Today, I am sharing the list of the top embedded proteus libraries in V1.0 especially designed for engineering students. Till now, you have seen blogs on different projects, components, libraries, and simulations. Yet, I am sharing the list of the first versions of these embedded libraries that will help the students throughout multiple projects. These libraries are highly useful in multiple domains of engineering, and if you don’t know how to download the new libraries , then you must see the link provided. 

This is the list of all new proteus libraries for engineering students . The zip files are present in the link to the related manual, which has details on how to download, install, and use these libraries. Now, let’s start learning about these libraries. 

Where To Buy?
No.ComponentsDistributorLink To Buy
1Battery 12VAmazonBuy Now
2ResistorAmazonBuy Now
3LCD 20x4AmazonBuy Now
4DHT11AmazonBuy Now
5DHT22AmazonBuy Now
6Flame SensorsAmazonBuy Now
7HC-SR04AmazonBuy Now
8Arduino NanoAmazonBuy Now
9Arduino Pro MiniAmazonBuy Now
10Arduino UnoAmazonBuy Now

Arduino Libraries V1.0

The involvement of microcontrollers like Arduino makes the embedded system more versatile and easy to use. Users can now install the Arduino library for Proteus and design multiple types of embedded system projects. The zip file of the Arduino library contains multiple Arduino versions. Here is the list of Arduino boards designed by TEP:


Geniuno Boards

The Arduino has developed another class of microcontroller named Geniuno that is sold under the umbrella of Genuino Labs. These are Arduino-compatible microcontrollers and have more affordable working mechanisms. These can be used with the Arduino software and hardware platforms and have a variety of models, as you can see in the below link:

Genuino Library for Proteus

Once installed successfully, you can access the following boards:

  • Genuino UNO
  • Genuino Mega 2560
  • Genuino Mega 1280
  • Genuino Mini
  • Genuino Pro Mini
  • Genuino Nano

Embedded Module Libraries

The embedded system libraries are highly useful for engineering students for projects related to the actuation, display, sensing, and communication of data. These libraries act like real components and help the students design real-time projects easily. Here is a list of the embedded libraries that you can download instantly:

LCD Library

There are multiple options to present the output of a circuit in an embedded system, but among these, an LCD is the most presentable and easy to understand. Proteus has multiple built-in libraries, but this LCD library provides the users with the best experience because it is easy to use and its pinouts are clean and easy to design. In the zip file, there are two versions of LCDs:

  1. LCD display (16x2)
  2. LCD display (20x4)

Both of these are extensively used in embedded circuits. Here is the download link for the new LCD:

New LCD Library for Proteus

This library can be easily programmed with Arduino code and hardware for embedded system projects. It is an alphanumeric LCD; therefore, it can show the numbers and alphabets based on the programming in the Arduino software. 

GPS Library

The Global Positioning System library is a useful component that provides versatility in embedded systems. Real-time GPS systems use satellites in space to provide information about the position of a particular object. In Proteus, the GPS allows the user to design projects, such as testing the performance of real GPS-based projects or simulating projects where the position of an object like a vehicle or a person is to be identified. Here is the link to download and install the GPS library:

GPS Library for Proteus

The design of this GPS system resembles the real GPS module. This library provides the system with two pins:

  1. TX pin
  2. RX pin

When the circuit is designed and the simulation starts, the module starts sending the NMEA data to the TX pin. At this moment, this data can be seen in the virtual environment connected to the GPS module. This is just a simulation module, so it does not provide clear longitude and latitude values. Therefore, there are some dummy values, but these are helpful to test the simulations. 

GSM Library

The GSM module is used for communication between the devices within the GSM network. This library allows users to work on projects related to the positioning and communication between the devices. The working of this GSM module is controlled with the help of Arduino software, where it can be programmed according to the requirements. The Arduino has the IDE manager library to be programmed with this module. Here is the download link for this:

GSM Library for Proteus

This library is designed in three colors and the user can choose any one or more than one according to the complexity of the project. 

XBee Library

It is another communication module that is used for wireless communication and configuration. This is a trending topic for engineering projects; therefore, I have designed it. This does not work exactly like the real XBee, but it helps a lot to provide the basic functioning in the simulation. Here is the link to download this library:

XBee Library for Proteus

This has two pins, TX and RX, and these are used to send and receive the data within XBee. The RX is usually connected to the output device, or Arduino, according to the circuit.

Bluetooth Library

The Bluetooth library has been one of the most demanding components of embedded systems for years; therefore, I have designed this to make it easy for students to use in Proteus. These modules are used for Bluetooth connectivity. This is the zip file for the module:

Bluetooth Library for Proteus

This has two modules of Bluetooth, which are:

  1. HC-05
  2. HC-06

Both of these have a similar structure, but their work is a little bit different. These modules have a limited range; therefore, they do not work well where communication is required for long distances. 

DS1307 Library 

This library provides the functionality of a real-time clock (RTC). it is used in projects where the current time is required, so it is a clock in the circuit that can be programmed once and used throughout the project implementation. This is the download link for the zip file in this library:

DS1307 Library for Proteus

Proteus has such libraries by default, but I have designed this library because it is more suitable for embedded projects and has different ways of working. The design is very similar to the real DS1307 library as it has a total of seven pins and a bright red colour with details on it. Out of these seven pins, X1 and X2 are used to add the crystal oscillator. This is used with devices like Arduino and PIC controllers. 

L298 Motor Driver Library

The L298 motor driver is designed to accept standard TTL logic levels and to drive the inductive loads. It is a dual full bridge driver that can bear high voltage and high current. It can drive relays, solenoids, stepping motors, etc. 

The module has been designed with bright colours and has small details just like the real driver. It is designed to control two motors at a time just like the real module. The link to download the zip file is given here:

 L298 Motor Driver Library for Proteus

Two sets of output pins are on the left and right sides used to connect the motors, while the input pins are at the lower right corner. Some other pins are also there to connect this module to the power source. 


SIM900D in Proteus

The main purpose of the SIM900D module is to control the GSM module with the help of a microcontroller so make sure you install all of these. This library has multiple functions that help provide the functionality of sending and receiving SMS messages, setting up the calls, and managing the GPRS data. Here is the link to install and use the SIM900D:

SIM900D in Proteus

It is relatively more complex than other experiments and requires more information about the component to work properly. 

C945 Library for Proteus

The C945 is a transistor library and as you expect, it has three legs named emitter, collector, and base. The first letters of these pins are mentioned on the module, and one must know it is an NPN transistor. It is a general-purpose transistor and is the main component of several electronic components. The installation of this module can be done through the following link:

C945 Library for Proteus

The simplest way to see the workings of this transistor is through the simplest output devices, such as an oscilloscope or LED.  

PC817 Library for Proteus

It is a safety component used with the microcontrollers and prevents the burning of the microcontroller because of the back EMF. It is an optocoupler/optoisolator that is used for the isolation of signals in electronic circuits. It is an important safety component of multiple embedded systems. Here is the download source for this library:

PC817 Library for Proteus

Just like the real PC817, the library has four pins, but to indicate the difference and directions of the pins, I have shown the symbols, so you will see the design is different from the real PC817. 

Embedded Sensors Libraries

Embedded sensors are devices that are used to interact with the physical world by sensing changes in the environment. The students can download multiple types of proteus sensors that are useful for creative engineering projects. These libraries have multiple pins; one is a TestPin through which the user can stimulate the sensor. Some of these are digital sensors, and some are analogue. We have made digital and analogue versions of sensors to provide more versatility in the student’s projects. These are the Version 1.0 of all the sensors:

Ultrasonic Sensor

The ultrasonic sensor is a device that measures distance with the help of sound waves. These send the sound waves in a particular direction and then measure the time it takes for them to strike any object, which is then reflected. The module is designed on the same principles. It is an analogue sensor, and usually, it is controlled with the help of a microcontroller. Here is the download and installation process:

Ultrasonic Sensor Library

This library allows the students to create more creative projects because it can be used for projects like proximity detection, distance measurement, liquid level measurements, etc. 

Flame Sensor Library

Now we are moving towards the specialized sensors particularly important for the Internet of Things (IoT) projects. The flame sensor is a basic need for almost every project of home automation. This sensor provides the signal at the output when it senses the flame. As a result, it can alarm the users, and it may be lifesaving. With the help of this library, it is now possible to test the simulation of such projects in Proteus. Here is the link to download it:

Flame Sensor Library

During the simulation of the project, the indication of flame is done with the testPin and the sensor responds according to the signals at this testPin. 

Vibration Sensor

This sensor detects the vibration and is useful in projects like security management because any vibration in a particular object can be sensed well. These are also used with mechanical products such as heavy machines because the continuous vibration can cause errors in performance or create other issues. This is the link to get this library:

Vibration Sensor Library

It is a digital sensor, and as soon as the input of this sensor is turned HIGH, it indicates the presence of the sensor. 

Capacitive Touch Sensor

The capacitive touch sensor is named so because it can detect the presence of the human finger on an object by sensing the change in the capacitance of the sensor. We know that capacitance is the measure of the ability to save charges, and when the finger touches the sensor, the values of the capacitance change, and as a result, the sensor indicates this change. Here is the link to get this library:

Capacitive Touch Sensor Library

I have made this digital sensor because, in real time, the capacitive sensor is very sensitive and can detect a slight change in the capacitance when the user touches it. 

HeartBeat Sensor

The purpose of these libraries is to enhance creativity and allow students to reach more domains. This is an important sensor in medical science because it counts the heartbeat of humans and provides the results. The starting and ending points of the heartbeat testing are controlled with the help of digital input. Here is the download and install link:

Heartbeat Sensor

The output of this heartbeat sensor can be shown with the help of an LCD or other suitable output devices. Students can use this output in different components of the projects. As a result, the output of the sensor may be used to stimulate other components such as when the heartbeat is high. The results are sent to the user or a document that displays the preventive measures. 

Gas Sensor Library

This is another ideal sensor library for projects like the automation of places. This module senses the presence of harmful gases in the surroundings and is one of the most important sensors for safe living standards. These are used in homes, offices, industries, and other places where there is a risk of gas leakage so they may indicate the danger. This library has a simple structure with all the basic pinouts. Here is the way to download and install the library. 

Gas Sensor Library

I have designed eight sensors for gases ranging from MQ2 to MQ9 because I have followed real gas sensors. The design and working of each of them resemble those of real sensors, as you can see the colour and components are the same. 

Magnetic Reed Switch

This library is particularly suitable for engineering students who have to create projects related to the magnetic field. This library is used to detect the presence of magnetic fields in the surrounding area. Magnetic fields affect the working of sensitive components; therefore, this library can save the whole circuit in some cases. To install this library, follow the link below:

Magnetic Reed Switch Library

Just like the real magnetic reed switch, it has two versions with red and blue colours. The real magnetic reeds have a difference in the number of pins, but I have designed them to work perfectly in the simulation and provided all the necessary features. 

Infrared Sensor Library

The working principle of an infrared sensor is similar to that of an ultrasonic sensor, but here, infrared waves are used to detect any obstacle or object in the way of these waves. A transmitter and a receiver are used in the structure of these sensors. This is a digital library; therefore, there is no need to attach the Arduino to test the basic workings of this library. Check the details of the infrared library through the link given below:

Infrared Sensor Library

This sensor can be used in various projects with a microcontroller because the coding process allows the student to use the output of this sensor for multiple processes. 

IR Proximity Sensor

This is another sensor that uses the waves to measure the distance to the presence of the object at a particular distance. The transmitter sends the infrared radiations to a certain direction and when these strike an object, these reflect to the receiver and it measures the distance between the object and itself through multiple calculations. Here is the link to approach this sensor:

IR Proximity Sensor

I have designed the same sensor in two colours and tried to make it easy to use. This is the digital sensor; therefore, the emission of infrared rays and their receiving time are controlled by the TestPin. 

Infrared Tracker Sensor

This is another infrared sensor that does not simply sense the distance; it measures the movement. The infrared waves are emitted from the sensor when it touches the object; it remembers the values and emits the waves again. In this way, the multiple emissions of the waves and their reflected angles are measured and compared. As a result, it can measure the change in the position of the same objects. Here is the download and install process:

Infrared Tracker Sensor

This is an important sensor that can be used in robotic line followers, security systems, gesture recognition, etc. 

Rain Sensor

The automation of places like homes, agriculture, and security systems are important Internet of Things( IoT) projects, and this is one of the most basic sensors in all the projects related to the same princess. This is a digital sensor and can detect the presence or absence of rain. Here is the link to fetch this sensor:

Rain Sensor Library

The process to use this sensor in the projects is simple and easy, and students wanted to use it in their projects; therefore, I created this to provide them with more options in the Proteus simulation. 

Sound Sensor Library

The sound sensor is one of the most basic sensors in embedded systems and other branches of engineering that catches sound signals and converts them into electrical signals. As a result, these electrical signals are then presented as the output of the sensor. Here is the link to download and install this library:

Sound Sensor Library

This sensor may be part of many interesting and trending engineering projects such as voice recognition, sound level measurement, robotics, etc. 

Soil Moisture Sensor

This is the most basic sensor of the IoT projects related to agriculture, landscape, and related fields. This sensor measures the amount of water in the soil and indicates the values. The basic principle of working with this sensor is to measure the electrical conductivity of the soil because water is the best electrical conductor. As a result, it provides information about the amount of water in the soil. Here is the link to get this sensor:

Soil Moisture Sensor

There are multiple types of such sensors, and the one I designed has the exact design of a soil resistance measurement. It has two probes and is an analogue sensor; therefore, it provides the exact amount of moisture in the soil. 

Analog Vibration Sensor

Just like the digital vibration sensor, this version also measures the vibration in an object, but I have tried to provide a more versatile working method; therefore, I made this analogue vibration sensor. The working of an analog vibration sensor is a little bit complex but it can be used with great versatility. Have a look at the installation process for this sensor:

Analog Vibration Sensor

Projects like musical systems, game controllers, robotics, and other such projects influence vibration. Students can easily design the limits of values using the microcontroller. 

Water Sensor Library

The water sensor is the basic sensor in different engineering projects. Water has the best electrical conductivity, and this sensor works by measuring the electrical conductivity of the water. As a result, it provides the amount of water in a tank or any other container. 

Water Sensor Library

Students are using this sensor in different creative projects such as water leakage detection, pool level monitoring, automatic irrigation systems, etc. 

Analogue PIR Sensor

It is the passive infrared sensor that detects the infrared radiation around it. The main job of this sensor is to sense the IR and then convert these signals into voltage. I have designed the digital PIR sensor as well, but this sensor has more functionalities. The following is the link to download and install this library:

Analog PIR Sensor Library

It has applications in different fields and projects like security systems, motion detection systems, and multiple medical devices. 

Flex Sensor

The flex sensor is used to measure the bend of an object and is useful in multiple fields of mechanical engineering. Another use of this sensor is in the field of robotics where it is used with multiple components and provides basic information about the bend. You can download and install it from the link below:

Flex Sensor Library

This is a digital library, and it simply checks for the presence of a bend in an object containing this sensor. The checking of the basic workings of this sensor does not require a microcontroller, but a simple LED is enough.  

Analogue Flex Sensor

The analogue flex sensor is the second version I have just discussed. This can measure the values of a bend of the component, and it is important information in multiple projects. As a result, this sensor has great scope in multiple fields. Download and install this through the link below:

Analog Flex Sensor Library

Just like other analogue sensors, students can provide the limits of the flex values and automate the project to work on a particular value of flex. 

Magnetic Hall Effect Sensor

This sensor is used to measure the magnetic fields around the sensor. For this, it uses the Hall effect and successfully measures the density of the magnetic field. The basic sensor in this regard is KY-024 and it is used in multiple types of sensors related to the detection and measurement of the magnetic field. I have used the same sensor in this design; you can see it in the link given below:

Magnetic Hall Effect Sensor(KY-024) Library

This library is present in four different colors but the design and other specifications are the same. 

Current Sensor 

This library is particularly useful for embedded systems and robotic projects that measure the total current flowing through the circuit. The electrical and electronic circuits use this module in their projects but require the module in Proteus to test the possibilities. Therefore, I have designed this library, and here is the link to use it in the Proteus simulations:

Current Sensor Library

The drift linear hall sensor in the real current sensor WCS1600 allows it to provide precise and accurate results. In this sensor, I have used the same design and worked to provide the best output. 

pH Sensor Library

The chemical properties of the liquid are important to know when dealing with liquid experiments. Therefore, I decided to create a pH level sensor in Proteus to provide the chance to enhance the domain of projects for engineering students. As it is a simulation, the input will be provided by the user, but this can be designed as a project to show the results on the output device. Here is the download and installation process for this library:

pH Sensor Library

This file has four versions of the pH levels with different colours. A potentiometer has to be connected to the pH sensor, and the programming through the microcontroller will allow you to set the range between 0 and 14 pH levels. This library works the same as the real pH meter and can be used to create a simulation of checking the pH of any liquid project. 

Power Module Libraries

The power electronic systems use multiple power modules to complete their circuits, and we have designed these sensors to complete and test the simulations. All the basic features of real-time power modules and their connection with other components are possible with these libraries. Here is the introduction to each module and their download manuals:

Solar Panel Library

The solar panel is one of the most trending sensors because students are moving towards renewable energy sources, and the solar panel is the need of the time. This library can provide the chance to convert the electrical generation components into solar panels and make the project modern. The download and installation process is mentioned in the link below:

Solar Panel Library

Just like the revolution made in the electrical industry with solar panels, this module has changed the trends in electrical and electronic projects for engineers. 

Lipo Battery Library

Lipo stands for lithium polymer battery, and it has the same workings as the batteries in Porteus but has a different basic structure. The real-time lip batteries are made with lithium-ion technology using a polymer electrolyte and are different from the liquid electrolyte batteries. Click the below link to download and install this library

Lipo Battery Library

Real-time lipo batteries have multiple advantages over normal batteries, such as high specific energy, low self-discharge rate, etc. 

Single Cell Battery

Single-cell batteries are one of the most common sources of portable batteries, and they are used for small electronic projects. Proteus has multiple types of batteries, but these libraries have a better representation of the cells and a better output. Here is the link to check out these batteries:

Single-Cell Battery Library

These designs make the circuit more presentable. The default setting allows these batteries to run on 3.7V, but students can change the voltage level through the properties of these batteries. 

CR2023 Lithium Coin Library

It is a lithium coin battery, and we have seen it in several small electronic projects, such as watches, calculators, and several wearable devices. The real CR2023 comes in different shades of silver. I have created three versions of this battery. You can see these at the link given next:

CR2032 Lithium Coin Library

It has a simple cell, a cell with silver casting and lead, and a cell with golden casting and leads. This provides the students with a chance to enhance the attraction of the project and get to know the workings of the cell at the same time. 

Conclusion

The embedded system requires a lot of components, and we have designed the basic and useful libraries for the engineering students so that they may design and practice real-time simulations of their circuits. These are the first versions of all the sensors, but the team is working on more improvements and functions according to feedback and trying to bring more libraries for you. We will discuss these soon; till then, happy learning.

Top Embedded Proteus Libraries V2.0 for Engineering Students

Hi readers! I hope you are doing great. Today, I am going to share the second version of the top embedded libraries designed for the proteus. Before this, we shared the first version of many libraries that engineering students are using in their projects. The interest of the students in these libraries has motivated us to design even better versions of them. These versions have a more realistic design and error-free working and are ideal for engineering students to use in their simulation in Proteus. 

If you don’t know how to download and use these libraries, then you must learn how to add a new library in Proteus . Moreover, if you are interested in learning the details of all the libraries, you must see the new proteus libraries for engineering students . The installation and application process of these libraries is simple, and we will share all the details through links in this article. So let's know about the first library. 

Where To Buy?
No.ComponentsDistributorLink To Buy
1Battery 12VAmazonBuy Now
2ResistorAmazonBuy Now
3LCD 20x4AmazonBuy Now
4DHT11AmazonBuy Now
5DHT22AmazonBuy Now
6Flame SensorsAmazonBuy Now
7HC-SR04AmazonBuy Now
8Arduino NanoAmazonBuy Now
9Arduino Pro MiniAmazonBuy Now
10Arduino UnoAmazonBuy Now

Arduino Libraries V2.0 for Proteus

Arduino is one of the most important microcontrollers that makes embedded systems more versatile and interesting. Installation of the Arduino board provides the facility to use these boards in multiple types of projects in proteus simulations. Here is the list of the Arduino libraries  V2.0.

Download the zip file and follow the procedure mentioned in these articles to use Arduino in the simulations. 

Sensors Libraries V2.0 in Proteus 

Sensors are the most important components to make the embedded project versatile. Real-time sensors are used to detect changes in the environment and provide the output in different forms. Just like the first version of these sensors, there are multiple pins to connect the sensor to the circuit. The most important one is the TestPin which is used to make changes to the sensors. Here is a list of some sensors with a brief description of each:

Sound Detector Sensor

The sound detector is used to detect any kind of sound frequency and then convert it into electricity. The real-time sound detector has a mic that converts the vibrations of the sound into electrical signals. These signals go through the amplification process, and as a result, these sounds are detected. In proteus, the presence of the sound or the change in the surrounding frequency is indicated by changing the values on the input pin of the detector. Following is the link to download the sound detector library:

Sound Detector Library for Proteus V2.0

Heartbeat Sensor

Embedded systems have applications in all fields, and those who want to create projects in the medical field can use the heartbeat sensor in the simulation to provide versatility and uniqueness to their projects. This sensor is a little bit difficult to deal with as compared to the other sensors on the list, but when the circuit is designed carefully, it can be used in multiple projects. This is an analogue sensor; therefore, the student can set the limits of the heartbeat to indicate any emergencies or alerts. Here is the download link for this:

Heart Beat Sensor Library V2.0 for Proteus

Soil Moisture Sensors

Students seem interested in emerging fields like the Internet of Things (IoT); therefore, we have designed one of the most important sensors for Porteus that will give them chances to work on agricultural automation projects. This is a versatile sensor that can be used in several projects related to agriculture and related fields. The zip file for this sensor has three types of sensors, and version 2.0 has a little bit of a fluctuating design to make it more realistic.

Soil Moisture Sensor Library for Proteus V2.0

These are the analogue sensors, and the design of these sensors is very similar to the real-time moisture detectors. We have chosen the best colours and details for each component to make it more user-friendly. 

PIR Sensor Library

The first version of the PIR sensor was digital; therefore, to provide more room for creativity, here is the second version, which has an analogue sensor with relatively better working. This sensor library has four sensors that are the same in functionality but have different colours to make them attractive. 

Analog PIR Sensor Library for Proteus

The properties of all these sensors can be changed through the property panel. Just like all other analogue sensors, the variable resistor is used at the input pin to change the values of the sensor and get the required output. 

Vibration Sensor Library

The vibration sensor detects the vibration of an object by sensing the change in mechanical energy. The real-time vibration sensors convert the change in mechanical energy into electrical energy that is fed into any type of indicator, such as light or sound. The sensor in the proteus is an analogue sensor that closely resembles, in design, the real vibration sensor. In vibration sensor V2.0, there are four types of designs available for the students. Here is the download link for the zip file:

Vibration Sensor Library for Proteus V2.0

The components in each sensor are the same, but the base and capacitor colours are changed.

LCD Library for Proteus V2.0

There are multiple ways to display the results, and Proteus and the LCDs are the easiest and most effective ways to do so. This version of LCD resembles the real LCD used in embedded projects. The pinouts are more clean, and the size and display are better than any other LCD libraries in Proteus. This version has two sizes of LCD, which are:

  1. LCD 16X2 V2.0
  2. LCD 20X4 V2.0

As a result, when students use it in their simulation, they are able to get the required output with minimum effort. Here is the link to the description for downloading and using the LCD V2.0 in Proteus. 

LCD Library for Proteus V2.0

The installation process for this library is the same as it was for the LCD library V1.0. 

Solar Panel Library for Proteus V2.0

Next on the list is the solar panel library, which helps the students work on more creative projects with renewable energy sources. The solar panel V2.0 has a better design and is easier to design. The students have to simply download the zip file, follow the instructions given in the following link, and connect it to the project. 

Solar Panel Library for Proteus V2.0

There are two designs for the solar panel in this version. Both of these work alike, but students can choose the best design according to their circuit. By default, both of these work on 12V because it is standard, but the user can change the voltage values from the properties panel. 

Conclusion

The embedded system is an important field in engineering, and we have designed the second version of some proteus libraries. These libraries are extremely useful in testing the designed simulations related to multiple fields. The Arduino, solar panel, LCS, and different sensors are loved by the students, and we have made these versions with better design and results. I hope you like it. Stay with us for more useful libraries.

PIR Sensor Library for Proteus V3.0

Hi learner! I hope you are doing great. Today, I am sharing version 3.0 of the PIR sensor library for Proteus. We have already shared V1.0 and V2.0 of the PIR Sensor Library. PIR Sensor V1.0 Library for Proteus adds a digital PIR Sensor in Proteus, while the PIR Sensor V2.0 Library adds an analog PIR Sensor to simulate. These libraries were loved by the users and this motivated us to work more on it.

PIR V3.0 is analog in nature, has an error-free structure and the Pinout structure is better organized. Moreover, the design is improved a little bit and we have omitted the website link from the sensor to make it look professional.

Same as the previous version, this PIR has four pins and the details of each of them will be discussed in detail later. Therefore, don’t worry if you have no experience with the sensors in Proteus. Let's discuss the basic introduction of the PIR sensor:

Where To Buy?
No.ComponentsDistributorLink To Buy
1Battery 12VAmazonBuy Now
2ResistorAmazonBuy Now
3LCD 20x4AmazonBuy Now
4PIR SensorAmazonBuy Now
5Arduino UnoAmazonBuy Now

Introduction to PIR Sensor

  • A passive infrared sensor or PIR is a motion detector that detects the changes in the infrared light radiating from the bodies.
  • When the body moves in the range of the PIR Sensor, the change in the environmental infrared waves is sensed by the PIR.

  • In the PIR Sensor, two pyroelectric sensors are placed behind the lens to detect the change in IR level.
  • PIR Sensors are called “Passive” because they don’t create any infrared light but are only used to detect it.
  • PIR sensors may be digital or analog. In the digital sensor, the output is always in the form of only two conditions ON or OFF (1 or 0) and gives only the detection of motion.
  • On the other hand, analog sensors give the degree of motion.

Here are a few of the Embedded Projects in which we have used PIR sensor, you should have a look:

PIR Sensor Pinout

Generally, the real-time PIR sensor has three pins and these are used for different purposes. It is important to connect all of these correctly to get the output. Here is the description of each pin:

  • The VCC pin is connected to the positive voltage supply, normally +5V.
  • The GND pin is attached to the negative voltage supply.
  • The output pin generates the signal only when the motion is detected.

If these pins are set properly, the circuit works fine. The sensor we have designed has a fourth terminal called TestPin. Proteus is the simulation software therefore, it is not possible to provide the motion. TestPin is used to provide the motion by the user.

PIR Senosr Library in Proteus

We know that Proteus does not have a built-in PIR sensor therefore, we have created this library so that you may use it in the circuits. For this, you have to download and install the PIR Sensor library in your proteus software. Here is the download link for the installation, simply download the zip file.

PIR Sensor Library for Proteus V3.0

Adding Proteus Library Files

  • Once the library is installed, go to the file location and extract the content.
  • Go to the folder named “Proteus Library Files” and open it.
  • Here, you will get two files for the library named:
    • PIRSensorV3.0TEP.IDX
    • PIRSensorV3.0TEP.LIB
    • PIRSensorV3.0TEP.HEX
  • Copy these files and paste in the Library folder of Proteus software. You will find it at C drive>Programming files>LabCenter Electronics>Proteus Professional>Library.
  • If you are facing any difficulty in installing the library, you can see the How to install a new library in Proteus.

The zip file has another folder named “Proteus simulations” where you can find the resources of projects containing simple working of PIR Sensor and PIR Sensor interfaced with Arduino UNO and LCD. 

PIR V3.0 in Proteus

Now, open your Proteus software and if was opened already, restart it to index the PIR sensor library with it.

  • Click on the “P” button to pick the components.
  • Write PIR sensor in the dialogue box, it will show you the options to select. I have downloaded the previous versions as well so I am getting all the options:

  • I am choosing all the PIR Sensor V3.0 by clicking on it one after the other. You can choose according to your choice.
  • Now, click on the PIR sensor and double-click on the working area Where you want to place the PIR sensor.
  • All the types of PIR Sensor V3.0 are the same but the color is different to make them more attractive. I am placing all of these on my working sheet to show you the difference.

Here, you can see it has the minimum text on it and the size is smaller than the previous version so that you may fix it in your large and complex projects without any problem. Now, I am deleting two sensors and will work only on the remaining two.

Providing HEX File for PIR Sensor V3.0

This sensor will not work unless you add the HEX file to it. For this, follow the steps given:

  • Double-click the sensor to open the properties panel.

  • Here, click on the folder sign. It will prompt you to the folders of your system. You have to provide the path for the PIRSensorV3.0TEP.HEX you have just extracted from the zip file.

PIR Sensor V3.0 Simultion in Proteus 

Now, we will design two circuits of PIR sensor V3.0. The first will be simply made with the basic components and the other one will have the Arduino UNO interfaced with the LCD so that we may get the more user-friendly results. Let's hover over your Proteus workspace to make the simple PIR circuit.

Components Required

The following Components are required for setting the PIR sensor.

  • PIR sensor
  • Inductor
  • Capacitor
  • Potentiometer

Go to the “Pick library” button type the names of the components one by one and select them.

Setting the PIR Sensor

  • Set the inductor and capacitor with the PIR Sensor’s output pin.
  • Take a potentiometer and set it with the TestPin.
  • Go to the terminal mode and get power and ground terminals. Attach these with the respected elements.
  • To check the output, we have to insert an AC voltmeter from the “virtual instrument mode”.
  • Connect all the components with the help of connecting wires.
  • Now your circuit must look like this:

The real-time PIR sensor does not require the LC circuit but in Proteus, the peak-to-peak values are generated which needs to be converted into RMS values and that's why we used this LC filter.

  • Now, hit the play button to check the values of the PIR sensor.

Interfacing Arduino with PIR Sensor V3.0

Now, if you want to make your project more user-friendly, an LCD is the best option. To link these, I have used the Arduino UNO and through the code, the values of the PIR reading are shown on the LCD. I have interfaced the TEP LCD 20X4 with the Arduino and simply connected the output of PIR with the analog pin of Arduino. The circuit now looks like the following image:

Arduino Code for PIR Sensor

Once your simulation is ready, you have to paste the code into Arduino.exe.Open your software and paste the given code there. 

#include

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

int SensorPin = A0;

void setup() {

  // set up the LCD's number of columns and rows:

  lcd.begin(20, 4);

  // Print a message to the LCD.

  lcd.setCursor(1,0);

  lcd.print("www.TheEngineering");

  lcd.setCursor(4,1);

  lcd.print("Projects.com");

  lcd.setCursor(0,2);

  lcd.print("Analog Value: ");

  lcd.setCursor(0,3);

  lcd.print("Voltage: ");

}

void loop() {


  int SensorValue = analogRead(SensorPin);   

  float SensorVolts = analogRead(SensorPin)*0.0048828125;   

  lcd.setCursor(14, 2);  

  lcd.print(SensorValue);

  lcd.setCursor(9, 3);  

  lcd.print(SensorVolts);     

  lcd.print(" V");

  delay(1000);

//  sensorValue = analogRead(sensorPin);

//  lcd.setCursor(4,2);

//  lcd.print(sensorValue);

//  delay(1000);

}

The same code is also given in the zip file you have downloaded.

Inserting the HEX File in Proteus 

When the code is run on the Arduino.exe, it provides the HEX file in the compilation details. You have to copy the address of the HEX file and insert it into the Arduino in Proteus. For this, follow these steps:

  • Verify the code by clicking on the check button. The compilation will start if there are no errors.
  • Go to the black compiler window at the lower area of the screen.
  • Copy the address of the HEX file.

Go to the Proteus and double-click on the Arduino to open the properties panel. Now paste the path of the HEX file here. The circuit is now ready to work. If you are stuck at this step, you should have a look at How to get Hex File from Arduino.

PIR Sensor V3.0 Results

Now it's time to run the simulation. So hit the Play button and you will see that the output is shown on the screen.

The analog values can be changed through the potentiometer of the testPin. The analog values of the motion sensor along with the voltages are shown on the LCD.  I hope your circuit worked the same as mine. If you are facing any type of issue, you can contact us.

LCD Library for Proteus V2.0

Hi learners! I hope you are doing great. Today, I am going to share the second version(V2.0) of the LCD library for Proteus. We have already shared the LCD V1.0 Library on our blog. Along with appreciation, we also get some complaints/suggestions about that library. So, we have designed a better version of the LCD library by keeping the suggestions in mind.

Version 2.0 has error-free working, better pinout prints, and is identical to the real-world LCD. We have also removed our website link from the LCD. This library includes two alphanumeric LCDs in it i.e. LCD 16x2 and LCD 20x4.

If you don't have any experience with the LCD, no need to worry as we will guide you from scratch. Before installing the LCD, let's first have a look at its brief introduction:

Where To Buy?
No.ComponentsDistributorLink To Buy
1Battery 12VAmazonBuy Now
2ResistorAmazonBuy Now
3LCD 16x2AmazonBuy Now
4LCD 20x4AmazonBuy Now
5PIR SensorAmazonBuy Now
6Arduino UnoAmazonBuy Now

What is Liquid Crystal Display?

  • A liquid crystal display or LCD is a flat board of liquid crystals that are sandwiched between polarizers. When the electric field is applied to it, this material rotates according to the polarization and allows the light to pass through it. As a result, the display is shown on the LCD board.
  • A simple 16x2 LCD is shown in the below figure:
  • The LCD is used in electrical/electronic projects to display sensors' data, statuses, alerts, notifications etc.
  • We can interface this LCD with any microcontroller i.e. Arduino, PIC, Atmel, Raspberry Pi, STM32 etc.
  • Some of the advantages are low power consumption, durability, and long life.

Let's have a look at the pinout of LCD:

LCD Pinout

Both of these LCDs(16x2 and 20x4) have similar pinouts and a simple basic circuit needs to be designed in order to operate them. There are a total of 16 pins present in LCD used for different purposes. The below table has the complete description of LCD Pinout:

Serial

Pin

Functionality

Description

1

VSS

Ground

This pin is connected to the ground terminal of the circuit. 

2

VDD

Power Supply

It is connected to the positive voltage(+5V) and is responsible for the power supply to all pins. 

3

VEE

Voltage Emitter

It is used to control the contrast of LCD. it applies the negative voltage and thus controls the electric field of the LCD. 

4

RS

Register Select

It selects the LCD register. LCD has two registers: an instruction register and a data register. 

5

RW

Read or write

The read-and-write operation is done through this pin. if set to HIGH then LCD is in reading mode and LOW means it is writing the data. 

6

E

Enable

Enables the working of LCD. If HIGH then allow the display and if LOW then disable it.

7-14

D0-D7

Data bits (Pins to deal with the data)

Data is sent to the LCD in a parallel manner. These pins send this data and out of these, D0 is the least significant and D7 is the most significant.

LCD Library For Proteus

The installation of the LCD V2.0 is simple. The first step is to download the library files. I believe you have Proteus installed. So, click the below button to download the Proteus Library zip file.

LCD Library for Proteus V2.0

Adding Proteus Library Files

  • Once downloaded, go to the file location and extract content from the zip file.
  • Open the folder named "Proteus Library Files" and here you will find two library files in it, named:
  • LCDLibraryTEPV2.0.IDX
  • LCDLibraryTEPV2.0.LIB
  • Simply copy these files in the Library folder of Proteus software. Go to your C drive>Program Files>LabCentre Electronics>Proteus Professional> Library.
  • If you are having any difficulty installing the library, you should a look at How to install a new Library in Proteus.

The zip file also contains the project, where we simply connected both the LCDs with Arduino, so that you could check their working. Moreover, code is also present in the file.

LCD V2.0 in Proteus

Once the Library is installed, you need to open your Proteus software. If it's already open, you have to restart it. Now follow the instructions.

  • Go to the pick library by clicking on the “P” button.
  • In the dialogue box, type "LCD TEP" and you will get the below results:

I have installed both versions therefore, I am getting four options. I will choose the LCD 20X4 V2.0 and LCD 16X2 V2.0.

  • Click on the components and simply place them on the working sheet of Proteus, it will appear as shown below:

  • I hope you guys will enjoy this new look without the site's link.

Now, let's design an LCD simulation in Proteus:

LCD Simulation in Proteus

Now, let's design a simple LCD simulation, where we will interface it with an Arduino UNO board. We will display our website's link on the LCD. So, let's design the circuit:

Interfacing LCD with Arduino

Go to the pick library and select the following components:

  1. LCD 20X4
  2. LCD 16X2
  3. Arduino
  4. POT-HG
  • Place the Arduino and other components in the working area, as shown in the below image:
  • Go to Terminal mode and select the Power & Ground terminal for both LCDs.
  • In order to design a neat circuit, I have connected the “Default” terminal with each pin, instead of wires.
  • The complete circuit diagram is shown in the below figure:

Now let's design the Arduino code to display data on these LCDs:

Arduino Code for LCD Simulation

Now, open your Arduino software, I hope you have it installed. Paste the below code in it, I have also added this code in the zip file.

#include

// initialize the library with the numbers of the interface pins

LiquidCrystal lcd(13, 12, 11, 10, 9, 8);

void setup() {

  // set up the LCD's number of columns and rows:

  lcd.begin(16, 2);

  // Print a message to the LCD.

  lcd.setCursor(1,0);

  lcd.print("www.TheEngineering");

  lcd.setCursor(4,1);

  lcd.print("Projects.com");

}

void loop() {

}

Add HEX File in Proteus

The next step is to get the Hex File from Arduino IDE and add in the Proteus. For this, follow these steps:

  • Verify the Arduino Code by clicking the "Verify" button and the output pane will give the location to the hex file, as shown in the below figure:
  • In the proteus software, double-click on the Arduino board to open its Properties Panel.
  • Paste the HEX file in the program file section and press OK.

LCD Simulation Results

  • Now, the LCD simulation is ready to run.
  • You can see in the code, we have printed the TEP link on the LCD screen.
  • Once you play the circuit, the LCDs will display the message, as shown in the below figure:

If you have followed all the steps, I am sure your project will run successfully. I hope it was helpful to you. You must practice it more and try to make different projects. So, that was all for today, will meet you guys in the next tutorial. Take care!!!

RF Communication with nRF24L01 and Raspberry Pi 4

Where To Buy?
No.ComponentsDistributorLink To Buy
1BreadboardAmazonBuy Now
2Jumper WiresAmazonBuy Now
3LCD 16x2AmazonBuy Now
4nRF24L01AmazonBuy Now
5Arduino UnoAmazonBuy Now
6Raspberry Pi 4AmazonBuy Now

Introduction

We're glad you could join us for another lesson in our series on programming for the Raspberry Pi 4. The previous chapter covered how to interface the USB barcode scanner with raspberry pi 4. We looked at different types of barcodes and what each stripe represents as well as the different types of barcode scanners available today. We also built a python program for the intelligent shopping cart and now our familiarity with barcodes and scanners and how they function has significantly increased. The benefits and drawbacks of its use were also discussed, but what we're interested in for this article is the transmission of radio frequency signals using the nrf24l01 Module in a raspberry pi 4.

Components

  • nRF24L01 RF module

  • Raspberry pi 4

  • Arduino Uno

  • Jumper wires

  • Power supply

  • 16x2 liquid crystal display

Wireless communication systems, such as ESPS266 WiFi modules, are widely used in the design process. Further, the media chosen is determined by the function it will serve. It's no secret that the nRF24L01 is a widely used wireless channel for local area network communication. These modules have a band rate of 250Kbps to 2Mbps and transmit on the 2.4GHz (ISM band), which is permitted in many states and suitable for usage in industrial and healthcare settings. There is also the claim that these modules can communicate at a distance of up to 100 meters with the correct antennae.

This tutorial demonstrates how to set up wireless communication between an Arduino UNO and a Raspberry Pi by utilizing the nRF24L01 - 2.4GHz RF Transceiver module. Raspberry Pi will broadcast data via nRF24L01, and Arduino Board will receive the data and display it on a 16x2 LCD. In addition to its built-in WiFi and Bluetooth Low Energy (BLE) capabilities, the nRF24L01 is also capable of wireless communication via BLE.

Both parts of the tutorial are equally important. In the first, we'll see how to connect the nRF24L01 to an Arduino so that it can function as a receiver, and in the second, we'll do the same thing with a Raspberry Pi can send out signals.

The meaning of "wireless radio frequency."

There are many different types of electromagnetic waves. Still, the ones utilized for radar signals and communications fall into roughly 3 kHz to 300 GHz range, known as "radio frequencies."

The term "radio frequency" is more commonly used to refer to electrical than mechanical oscillations. There are, however, examples of mechanical RF systems. Although radio frequency (RF) refers to an oscillation rate, the term "radio frequency" (RF) is sometimes used interchangeably with "radio" to describe the practice of communicating without the need for wires.

Numerous wireless technologies rely on RF fields, including cordless and cell phones, radio and television broadcasting stations, satellite telecommunication networks, Bluetooth communication modules and WiFi, and two-way radios.

External communications include various products like garage doors and microwave ovens, which use radio frequencies. The infrared frequencies of various wireless devices, like TV remote controllers, computer mice, and some wireless computer keyboards, have shorter electromagnetic wavelengths.

So, How Exactly Does Radio Frequency Operate?

The frequency of radio transmission is expressed in hertz (Hz) units, which stand for the count of cycles per second. Radio waves can travel from one thousand hertz (kHz) to several gigahertz (GHz). Microwaves, a form of radio wave, operate at much higher frequencies. Because of this, we can't see radio frequencies (RFs).

The wavelength' of a radio wave is proportional to the square root of the frequency 'f.' The relationship between frequency and wavelength can be expressed in megahertz and meters, respectively.

s = 300/f

At higher frequencies, electromagnetic radiation is manifested as infrared (IR), ultraviolet (UV), visible (Visible), X-ray (XR), and gamma-ray (GJ).

Traits of Radio Frequency

The following are some of the defining features of RF:

  • Low energy consumption

  • It has an excellent operational range (three to thirty meters), a data rate of up to two megabits per second, the ability to pass through walls, and can transmit in any direction.

The nRF24L01 Radio Frequency (RF) Module

Due to their half-duplex design, the nRF24L01 modules can only send or receive data but not do both. The Module's data transmission and reception are handled by the generic Nordic semi-conductor nRF24L01 IC. The IC uses the simple serial peripheral interface (SPI) protocol for communication, making it compatible with virtually all microcontrollers. Arduino makes things much simpler because there are numerous library resources available. The following table depicts the pin configurations of a typical nRF24L01 module.

The Module is battery efficient, as its operating voltage ranges from 1.9V to 3.6V, and it draws minimal current (only 12mA) during regular operation. Most pins can be connected directly with 5V chipsets like Arduino, even though the voltage rating is 3.3V. Each Module also includes 6 Pipelines, which is a huge time saver. Simply put, each Module can exchange information with up to six others. Therefore, the Module can be used for IoT applications requiring the creation of star or mesh networks. With an extensive network address of 125 unique IDs, we may use 125 such components in a contained space without worrying about them interfering with one another.

Mechanics of Operation

Given that the Module supports 125 separate channels, creating a network containing 125 fully available modems at a single location is theoretically possible. Each device can simultaneously interface with up to six others on the same channel.

Transmission with this Module only uses about 12mA of power, less than a single display LED screen. The Module requires a voltage of 1.9V to 3.6V to function. Still, the other pins are 5V logic compatible, allowing us to connect it directly to an Arduino without needing logic-level converters.

Three of these terminals are used for SPI communication and must be hooked up to the SPI pins on the Arduino; however, the SPI pins on different Arduino boards are labelled differently. Connecting the CSN and CE pins to any input pin on the Arduino board toggles between standby and active modes and transmit and command modes for the Module. The last connector is an interrupt pin, which is optional.

Variations in Modules

The NRF24L01 modules can be found in a wide range of versions. The model with a built-in antenna is the clear frontrunner. This reduces the transmission range of the Module to around 100 meters but allows for a smaller module size.

In the second variant, an SMA connector replaces the onboard antenna, allowing us to use a duck transmitter for enhanced signal strength.

The third variant displayed here also features the duck antenna with an RFX2401C microprocessor with an integrated Power Amplifier and Low-Noise Amplifier). This can increase the NRF24L01's transmission range in open areas by 1000.

Circuit Schematic

Integrating nRF24L01 with Arduino

The components in the circuit design for linking nRF24L01 to Arduino are few, and the process is straightforward. SPI will be used to link the nRF24l01, and I2C will connect the 16x2 LCD.

Integrating nRF24L01 on a Raspberry Pi

Because only the SPI adapter is required to link the Raspberry Pi and the nRF24L01, the corresponding circuit schematic is pretty straightforward.

How to Use nRF24l01 with Raspberry Pi to Communicate

Python3 will be used for Raspberry Pi's programming. The Arduino platform is not the only one that can use C/C++. However, if you're programming in Python, you can get a library for nRF24l01 that's already been made. Keep in mind that the library and the python program must be in the same folder for the python program to use it. Create a folder to house your applications and library files after you have downloaded and extracted the library. After the necessary libraries have been installed, you can begin coding immediately. Importing libraries like the GPIO library for communicating with the Raspberry Pi's GPIO pins and the time library for using the Pi's clock and date functions are the first steps in writing any program.

import RPi.GPIO as GPIO 

import time     

import spidev

from lib_nrf24 import NRF24

It would be best if you switched to the "Broadcom SOC channel" for the GPIO setting. Pins are referred to by their "Broadcom SOC channel" numbers, which follow the letters "GPIO" (GPIO01, GPIO02, etc.). The Board Numbers are not these.

GPIO.setmode(GPIO.BCM)

After that, we'll assign a permanent address for the pipe. To send data to Arduino, you'll need to use this address. There will be a hexadecimal representation of the address.

pipes = [[0xE0, 0xE0, 0xF1, 0xF1, 0xE0], [0xF1, 0xF1, 0xF0, 0xF0, 0xE0]]

Start the radio with the CE pin (GPIO08) and the CSN pin (GPIO25).

radio.begin(0, 25)

Change the power levels to minimal, the channel address to 76, the data rate to 1 Mbps, and the payload size to 32 bits.

radio.setPayloadSize(32)  

radio.setChannel(0x76) 

radio.setDataRate(NRF24.BR_1MBPS)    

radio.setPALevel(NRF24.PA_MIN)

Start the data writing process by opening the pipes and displaying some nRF24l01 basics.

radio.openWritingPipe(pipes[0])     

radio.printDetails()

Get your message ready to send as a string. Arduino UNO will receive this message.

sendMessage = list("Hi..Arduino UNO")  

while len(sendMessage) < 32:    

    sendMessage.append(0)

Send the string's first character to the stereo and continue doing so until the radio is ready to receive it. In addition, a debug statement detailing the time and date the message was delivered should be printed.

While True:

    start = time.time()      

    radio.write(sendMessage)   

    print("Sent the message: {}".format(sendMessage))  

send

    radio.start listening()


A timed-out error message should be printed if the thread is finished and the conduit is closed.

while not radio.available(0):

        time.sleep(1/100)

        If time.time() - start > 2:

            print("Timed out.")  # print error message if radio disconnected or not functioning anymore

            break

If you want to send another message, turn off the radio and disconnect from the connection for three seconds.

radio.stopListening()     # close radio

    time.sleep(3)  # give a delay of 3 seconds

If you know the fundamentals of Python, you can easily comprehend the Raspberry program. You will find a fully functional Python program at the end of this tutorial.

Putting the Python Code for the Raspberry Pi to Work

If you follow the steps below, running the software will be a breeze.

  • You should keep the Python source code and library files together.

    • My Sender program file is nrfsend.py, and all the related files are in the same directory.

      • Access Raspberry Pi's command prompt. Use the cd command to get to the directory containing the python script.

        • Navigate to the directory, type "sudo python3 your program.py," and hit enter to run the program. In less than a minute, you'll likely see nRf24's essentials laid out, and the broadcaster will begin broadcasting its bulletins at three-second intervals. Once the send is complete, the debug message will appear.

        The Arduino UNO will now display the same code as the receiver.

        The nRF24l01 and Arduino UNO: Message Reception Programming

        The Arduino UNO can be programmed in a manner not dissimilar to that of the Raspberry Pi. Our procedures will be very similar; however, we'll use a different language for programming and other processes. The procedure will incorporate the nRF24l01 readout. Download the nRF24l01 Arduino library from GitHub. To get started, make sure all required libraries are installed. We're using a 16x2 I2C LCD, so we need to include the Wire.h library; the nRF24l01 communicates via SPI, so we also need the SPI library.

        #include<SPI.h>                   

        #include <Wire.h>

        Don't forget to add the RF24 and LCD libraries so you may use them.

        #include<RF24.h>                  

        #include <LiquidCrystal_I2C.h>

        Put the LCD's I2C address—27 in this case, as it's a 16x2 display—into the appropriate function.

        LiquidCrystal_I2C lcd(0x27, 16, 2);

        Pin 9 serves as the RF24's Common Emitter, and pin 10 serves as its Common Source Negative.

        RF24 radio(9, 10) ;  

        Turn the radio on and tune in to channel 76. In addition, open the pipe for reading by setting the address to that of the Raspberry Pi.

        radio.begin();        

          radio.setPALevel(RF24_PA_MAX) ;   

          radio.setChannel(0x76) ;            

          const uint64_t pipe = 0xE0E0F1F1E0LL ;    

          radio.openReadingPipe(1, pipe) ;

        Start the I2C data transfer and initialize the LCD screen.

        Wire.begin();                 

          lcd.begin();                    

          lcd.home();                       

          lcd.print("Ready to Receive");

        Turn on the radio's receiver and enter a message length of 32.

        radio.startListening() ;        

          char receivedMessage[32] = {0}

        The message will be read and saved immediately if a radio is connected. Display the message on the screen and send it to the serial monitor till the following message is received. Put the radio on hold while you tune in, then try again later. Right this way, in ten microseconds.

        if (radio.available()) {       

            radio.read(receivedMessage, sizeof(receivedMessage));        

            Serial.println(receivedMessage) ;    

            Serial.println("Turning off the radio.") ;   

            radio.stopListening() ;   

            String stringMessage(receivedMessage) ;     

            lcd.clear();    

            delay(1000);    

            lcd.print(stringMessage);   

          }

        Copy and paste the code below into your server and allow time for the response to arrive.

        NRF Transmitter Side Code (Raspberry Pi)

        import RPi.GPIO as GPIO  # import gpio

        import time      #import time library

        import spidev

        from lib_nrf24 import NRF24   #import NRF24 library

        GPIO.setmode(GPIO.BCM)       # set the gpio mode

          # set the pipe address. This address should be entered on the receiver to

        pipes = [[0xE0, 0xE0, 0xF1, 0xF1, 0xE0], [0xF1, 0xF1, 0xF0, 0xF0, 0xE0]]

        radio = NRF24(GPIO, spidev.SpiDev())   # use the gpio pins

        radio.begin(0, 25)   # start the radio and set the ce,csn pin ce= GPIO08, csn= GPIO25

        radio.setPayloadSize(32)  #set the payload size as 32 bytes

        radio.setChannel(0x76) # set the channel as 76 hex

        radio.setDataRate(NRF24.BR_1MBPS)    # set radio data rate

        radio.setPALevel(NRF24.PA_MIN)  # set PA level

        radio.setAutoAck(True)       # set acknowledgement as true 

        radio.enableDynamicPayloads()

        radio.enableAckPayload()

        radio.openWritingPipe(pipes[0])     # open the defined pipe for writing

        radio.printDetails()      # print basic detals of radio

        sendMessage = list("Hi..Arduino UNO")  #the message to be sent

        while len(sendMessage) < 32:    

            sendMessage.append(0)

        While True:

            start = time.time()      #start the time for checking delivery time

            radio.write(sendMessage)   # just write the message to radio

            print("Sent the message: {}".format(sendMessage))  # print a message after succesfull send

            radio.startListening()        # Start listening the radio

            while not radio.available(0):

                time.sleep(1/100)

                if time.time() - start > 2:

                    print("Timed out.")  # print error message if the radio disconnected or not functioning anymore

                    break

            radio.stopListening()     # close radio

            time.sleep(3)  # give delay of 3 seconds

        NRF Receiver Side Code (Arduino):

        #include<SPI.h>                   // spi library for connecting nrf

        #include <Wire.h>                             // i2c libary fro 16x2 lcd display

        #include<RF24.h>                  // nrf library

        #include <LiquidCrystal_I2C.h>     // 16x2 lcd display library

        LiquidCrystal_I2C lcd(0x27, 16, 2);         // i2c address is 0x27

        RF24 radio(9, 10) ;  // ce, csn pins    

        void setup(void) {

          while (!Serial) ;

          Serial.begin(9600) ;     // start serial monitor baud rate

          Serial.println("Starting.. Setting Up.. Radio on..") ; // debug message

          radio.begin();        // start radio at ce csn pin 9 and 10

          radio.setPALevel(RF24_PA_MAX) ;   // set power level

          radio.setChannel(0x76) ;            // set chanel at 76

          const uint64_t pipe = 0xE0E0F1F1E0LL ;    // pipe address same as sender i.e. raspberry pi

          radio.openReadingPipe(1, pipe) ;        // start reading pipe 

          radio.enableDynamicPayloads() ;

          radio.powerUp() ;          

          Wire.begin();                 //start i2c address

          lcd.begin();                    // start lcd 

          lcd.home();                       

          lcd.print("Ready to Receive");  // print starting message on lcd 

          delay(2000);

          lcd.clear();

        }

        void loop(void) {

          radio.startListening() ;        // start listening forever

          char receivedMessage[32] = {0} ;   // set incmng message for 32 bytes

          if (radio.available()) {       // check if message is coming

            radio.read(receivedMessage, sizeof(receivedMessage));    // read the message and save

            Serial.println(receivedMessage) ;    // print message on serial monitor 

            Serial.println("Turning off the radio.") ;   // print message on serial monitor

            radio.stopListening() ;   // stop listening radio

            String stringMessage(receivedMessage) ;     // change char to string

            lcd.clear();    // clear screen for new message

            delay(1000);    // delay of 1 second 

            lcd.print(stringMessage);   // print received mesage

          }

          delay(10);

        }

        Features That Have the Most Impact on RF Module Efficiency

        The RF module's performance will be affected by the same factors as any other RF component. For instance, a transmitter's output power can be increased to extend the range of a transmission. However, this will cause a greater consumption of electricity by the transmitters (TX) device, reducing the useful life of battery-operated gadgets. Increasing the system's transmit power also makes it more vulnerable to interference from a second RF source.

        Similarly, boosting the receiver's sensitivity increases the usable communication range but increases the risk of an error brought on by interference from other RF equipment. Matching antennas on both ends of a communication link can potentially boost the overall system's performance.

        Finally, the regarded remote distance of any given system is typically measured in an open-air line-of-sight outline without any interference; nevertheless, problems such as floors, walls, and dense structures will frequently grasp the radio wave signals; thus, the actual operational distance will typically be less than specified.

        Uses for Radio Frequency Communication

        The most common uses of radio frequency communication are in the areas of wireless data and voice transfer, home automation, and remote control, as well as in the industrial and commercial sectors.

        RF-controlled switches can be used in home automation applications as an alternative to traditional switches. An RF remote allows one to operate lights and other electronics without leaving their current location. Those with mobility issues will benefit the most from this app. RF communication is helpful in industrial settings for directing autonomous robots and motorized vehicles. These robot vehicles are often employed in hazardous tasks humans cannot undertake. A data transmission unit is required to direct the motion of the robotic vehicles.

        Multiple factors make radio frequency (RF) transmission preferable to infrared (IR) (infrared). The more extended range of RF signals makes them ideal for long-distance communications. Unlike radio frequency (RF), which can go across obstacles, infrared (IR) generally requires a clear path from transmitter to receiver. The reliability of RF transmission is far greater than that of infrared remote communications. While radio frequency (RF) communications require other IR-emitting devices that can disrupt a precise frequency range, infrared (IR) communications.

        Problems with Radio Frequency

        These are some of RF's drawbacks.

        • Preschoolers, expectant mothers, the elderly, those with pacemakers, little birds, flora, wildlife, insects, etc., are all negatively impacted by unregulated RF radiation.

        • More lightning has been seen in nearby cellular towers that use radio frequency than in other areas.

        • Some fruit crops in the vicinity of RF towers are also negatively impacted.

        • Because RF waves are accessible in both line-of-sight (LOS) and non-LOS zones of the transmitter, hackers can easily break into the system and decode sensitive personal or government data.

        • This problem can be avoided by employing highly protected methods like AES, WEP, WPA, etc., while transmitting data over radio frequency waves. Spread spectrum and frequency hopping modulation methods can also be applied to RF signals to prevent such eavesdropping.


        Conclusion

        This concludes the comprehensive instruction on wireless communication between a Raspberry Pi and an Arduino UNO via nRf24l01 modules. The 16 * 2 liquid crystal display will show the message. Pipe addresses are crucial on the Arduino UNO and the Raspberry Pi 4. In the following tutorial, we will learn how to Call and Text using Raspberry Pi and GSM Module in pi 4.

        Up Down Counter using Arduino & 7-Segment Display

        Hello geeks, welcome to our new project. In this project, we are going to make a very interesting project which is an Up-Down counter. Most of us who have an electronics background or studied digital electronics must know the counter. Counter is a simple device which counts numbers. As per the digital electronics, there are two types of counter, the Up counter which counts in increasing order and another is Down counter which counts in decreasing order. And every counter has a reset limit, on which the counter resets to its initial value and starts the counting again. The limit of every counter depends on the bits of counter. For example, we have a 8 bit Up counter which means it will count upto 255 and afterwards it will reset and will start again counting from zero.

        Where To Buy?
        No.ComponentsDistributorLink To Buy
        17-Segment DisplayAmazonBuy Now
        2Arduino UnoAmazonBuy Now

        Software to install

        In this project, we will need two softwares first is the Arduino IDE which is used for Arduino programming. As we are going to make this project in simulation, we will use Proteus simulation software. Proteus is a simulation software for electronics projects. In this software, we can run the real time simulation of electronics circuits and debug them without damaging any real components.

        And it is a good practice to make any circuit in the simulation first if we do that for the first time.

        And Proteus has a very large database for electronics components but it lacks some new component libraries, for that we have to install some libraries for those components. In this, we have to install a library for the Arduino UNO module.

        We should first download the Arduino UNO library.

        Components required

        We will need the following components for this project

        • Arduino UNO
        • 7 Segment LED display
        • Two push buttons
        • 2 Resistors

        Components details

        Arduino UNO

        • Arduino UNO is an open source development board developed by Arduino.
        • It uses the ATmega328 microcontroller made by ATMEL.
        • ATmega328 has an 8 bit RISC based processor core with 32Kb flash memory.
        • Arduino UNO has 14 digital input/output pins and 6 analog input/output pins.
        • It has 1 UART, 1 SPI and 1 I2C communication peripheral on board.
        • It has a 10 bit ADC which can give value from 0 to 1023.
        • Operating voltage of ATmega IC is 5 volts but on the Arduino board, using the DC power jack, we can connect upto 9-12 voltage power supply.
        • We can power Arduino UNO using the DC power jack or Vin on the Arduino UNO module.
        • Here, we used the Arduino UNO as the main controller which works as a counter here and displays the same on the 7 segment LED display.

        7 Segment LED display

        • It is an LED display module, in which there are seven LEDs arranged in the rectangular form on which we can display single digit numbers from 0-9 and some alphabets as well.
        • It has two types, one is common ground and another is common Vcc.
        • There are 7 different pins for each LEDs and one common pin, this pin can be common ground or common Vcc depending upon type of the display.
        • The pins on the display are noted as a,b,c,d,e,f,g.
        • Common ground is also known as Common cathode, and common Vcc is also known as Common anode .
        • In Common cathode type display, the LEDs will glow when LEDs pins are connected to logic HIGH.
        • In Common anode type display, the LEDs will glow when the LEDs pins are connected to logic LOW.
        • As they are simple LEDs so while using them in the circuit, it is mandatory to use some protection resistors with each of them if we are using Common ground type display and single resistor with the Common Vcc pin if we are using the Common Vcc type display.
        • For the counter, we will follow the truth table of display for showing the numbers.

        Push buttons

        • In this we have used a simple momentary push button for setting the counter in UP counting or in DOWN counting.
        • There are two pins in the push button.
        • As we will use the push buttons in active low condition which means one side will be connected to ground and other terminal will be connected to the Arduino.
        • So when we press the push button, it will close the circuit and set the pin.
        • While using any push button, it is mandatory to use a pull-up or pull-down resistor with it, otherwise there will be some glitches in the operation.
        • Because when the button is released, the circuit will be open and if there is no pull-up or pull-down connected to the other pin of the push button, then that pin will be in floating state and will give any random voltage, which will create an issue.
        • Here, in this project we have used the pull-up resistor so that when the push button is released, the pin state will be in logic HIGH state.

        Project overview

        As we know counters are simple electronic circuits which count some values and after reaching the maximum value they will reset. In this project, we will make an Up-Down counter which means our counter will count from 0-9 and again after 9-0.

        We will use the 7 segment display for showing the counter values. In this project, we have used the common ground type of LED display. And two push buttons to start the counter in up counting or in down counting. When we press the UP push button, then the Arduino will activate the pins as per the up counting and LED will display numbers from 0-9 and when we press the DOWN push button then the Arduino will activate the pin as per the down counting and LED will display numbers from 9-0.

        To control the LEDs, Arduino will set the pins as HIGH and LOW as per the truth table for the common ground display.

        Arduino will set the pins and LED will display the numbers.

        Circuit diagram and working

        Now we know the working of our counter so let’s make the circuit for the same:

        • Open the new project in the Proteus and import all the required components in the workspace.
        • Now let’s connect the push buttons with Arduino, for the push button we will use Arduino UNO’s digital pins D11 and D12.
        • Connect the one side of the push buttons with the Vcc and another side with the Arduino UNO and on that side we will connect the pull-down resistors.
        • Connect the pull down resistors with the Ground.
        • Now, connect the pins of the 7 segment display with the Arduino UNO.
        • Connect the pins of the LED display in the same order as A-2, B-3, C-4, D-6, E-7, F-8, G-9 and DP -5. Otherwise it will show the wrong data on the display.

        Arduino Code for Up-Down counter

        Now we will start writing the code of the Up-Down counter. The code of this project will be divided into three major parts. In the first part, we will declare all the required variables and pins. In the second part, we will set the modes of pins and set the initial states to pins and do the required configuration if needed and the last part we will write our main functionality of our project which we want to run continually.

        • So let’s declare all the required variables. First of all, declare the variables for pins of the seven segment display and Up counter push button and down counter push button.
        • Now declare all the required variables which we will use in this code.
        • Now we declared all the required variables and pins so let’s start with the void setup function.

        Void setup()

        • It is one of the most important functions in the Arduino code structure. Without this, our code will not compile successfully and will show the error.
        • In this, we will set the pin mode of each pin and set them to their initial values.
        • This function only runs once every time when we restart the code so that we will write the part of code which we want to run only
        • We will set the pinmode of seven segment LEDs to output mode as we want to control the LEDs from them.
        • And set the pinmode of push buttons as input as we want to read their state in the application.
        • For debugging purposes initialise the serial monitor also.
        • After this, we will write the void loop function.

        Void loop()

        • This is also one of the most important functions as per the structure of the Arduino code, we can not write the code without using this function.
        • In this function, we will write the code which we want to run in the continuous loop, so we will write our main application code in this section.
        • As per the application of our code first of all, we will read the Up and Down counter push button states and when the state changes we will trigger the counter.
        • Write the condition for the Up counter button, when the button is pressed then the state of the button changes and we will check the state of the push button. If it is HIGH then we will start incrementing the counter variable and using the “changeNumber()”, we will display the numbers on the seven segment LED display.
        • Similarly, for the down counter push button, when the push button is pressed then the state changes and when the state of the button is high then we will start decrementing the counter variable and display the number on the seven segment display using the “changeNumber()” function

        Void changeNumber(int buttonpress)

        • This is a user defined function.
        • We will use this function to display the number on the seven segment LED display.
        • This function will set the state of the LED’s pins as per the number we want to display.
        • It takes an argument as the number and with the help of switch-case, it will set the state of pins as per respective number.
        • The state of pins is decided by the truth table of the seven segment LED display mentioned in the above image of the truth table.

        Result and test

        After the circuit and the coding part, we are all set to run the simulation:

        • To run the simulation, we have to add the hex file of our application code.
        • We have to generate the hex file from the Arduino IDE.
        • To generate the hex file , goto “Sketch >> Export compiled binary” after that it will compile our application code and the hex file will be generated and will be saved in the same folder of the project.
        • Now include that to the Arduino UNO module in the simulation.
        • To add the hex file, click on the Arduino UNO module, then a window will be opened, from there browse to the location of the hex file and add that.
        • Now run the simulation.
        • At the start the LED display will show ‘0’.
        • So, when we press the Up push button, then the counter variable will be incremented by one on every press and when we push the Down push button, then the counter variable will be decremented by one on every push and the same will be displayed on the Seven segment LED display.

        Conclusion

        I hope we have covered all the points related to this project. I think it will be a useful project for learning purposes and gives an understanding about working of counters. Please let us know in the comment section if you have faced any issues while making this project.

        Thanks for reading this article. See you in the next project.

        Water Level Indicator using Arduino

        Hello geeks, welcome to our new project. Here, we are going to make a very useful project which we can use for ourselves or we can use this as a product as well on an industry level.

        In this project, we are going to make a water level indicator. We all know it is one of the most essential products because there are many water tanks in every house or office, and most of them are not easily accessible to check the level of water in it and I think most of us faced the problem such as shortage of water as we do not have anything to monitor the exact amount of water available in the tank and this causes many problems on our daily lives.

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

        Software to install

        As we are going to make this project in the simulation first, for that, we will use the Proteus simulation tool. It is a tool used for electronic projects in which, we can run the real-time simulation of any electronic project and we can debug it in real-time without making any damage to real components.

        Proteus has a very big database for electronic components which comes in the installation package of Proteus, but still, sometimes we have to install packages or libraries for some modules which are not pre-installed in it.

        As in this project, we are going to use Arduino which is not pre-installed in the Proteus software. So we can download the Arduino module package from the link given below:

        Components Required

        In this project, we will use the following components
        • Arduino UNO
        • LEDs
        • Water level indicator

        Components details

        Arduino UNO

        • Arduino UNO is an open-source microcontroller of the Arduino family.
        • We have used this as the main controller of this project.
        • Using this we can measure the readings of the water level sensor and indicate the user accordingly.
        • It has 14 digital input/output pins which can be used for controlling any digital components or can be used to read digital sensors.
        • It has 6 analog input /output pins which are used for analog read and write functions.
        • The ADC used for analog pins is 10 bits which range from 0-1023.

        Note- While uploading the code on the Arduino UNO, disconnect any wire which is connected to Rx(D0) and Tx(D1) pins, otherwise it will give an error while uploading the code.

        Water Level Sensor

        • The water level indicator works on the principle of the potentiometer.
        • It has three pins as Vcc, Gnd, and Signal.
        • There are two kinds of exposed copper strips on the sensor which are Vcc and sensor line.
        • When it emerges in the water tank, the conductivity increases and the resistance decreases due to that, it increases the output voltage on the sensor pin of the water level sensor.
        • The output value of the sensor changes with the height of the water level in the water tank.
        • And this gives the analog output so that we will use the analog pin of the Arduino UNO for reading the sensor value.
        • As this will have analog values, we have to calibrate the sensor before using it in the project.
        • We will talk about calibration later in the article.

        LEDs

        • LED stands for light-emitting diode.
        • They are used for indication purposes in this project.
        • LEDs are like normal diodes, they will allow the current to pass from only one direction.
        • They come in different colors and the color of LEDs differs as per the used material in its manufacturing.
        • There are two terminals in the LEDs, the larger one is the cathode and another one is the anode.
        • Using the length of the terminals, we can figure out the polarity of the LED but if in case both terminals are the same size then there is a flat side on the LED, that side is the negative terminal and another is the positive terminal.

        Project overview

        The water level indicator works on the principle of change in the resistance of the water level sensor due to a change in the amount of water in the container.

        Basically, there are two parallel strips in the water level sensor, one for the power supply and another is for the sensor strip. As we know, water is a conductor of electricity so when we increase the amount of water in the container then more length of the sensor emerges in the water and that will increase the conductivity between the strips therefore, it increases the voltage on the sensor pin as well. We will read that voltage on the Arduino UNO.

        To get the exact amount of water level in the container, we have to calibrate the sensor with the water because we can not be assured that the output voltage will be the same for every water because we know that there are lots of materials dissolved in the water so it will vary for a different source of water, therefore, we have to calibrate it first.

        For calibration of the sensor, we will take a container with the water and we will read the values from the sensor by changing the level of water in the container. We will perform this action till the container gets filled with water and we will note down all the reference values and mark them as thresholds for each level.

        As in this project, we are making it in the simulation so it would not be possible for changing the values as per the water level therefore we have used the potentiometer and we have chosen the threshold values randomly.

        No need to worry while making this project with the real components as the sensor values from the water level sensor will be in the same format as the output of the potentiometer.

        Now that we know the working principle of the water level indicator let’s go for the circuit diagram of the project.

        Circuit diagram

        As we know the required components which we are going to use in this project.

        • First of all, start a new project in the Proteus simulation software.
        • Import all the listed components in the Proteus workspace.
        • For sensor simulation, we will import one potentiometer.
        • Connect the output pin of the potentiometer with the analog pin of the Arduino UNO. In this project, we are using the A0 pin.
        • And other pins with the ground and 5volt Vcc.
        • Now start connecting the LEDs, for controlling the LEDs, we will use the digital pins of Arduino and they are D2, D3, D4, D5 pins.
        • While connecting the LED pins, keep the sequence the same otherwise there will be an error in the indication of levels.
        • Connect the positive terminal of the LED with the digital pins of the Arduino and the negative pins with the ground.
        • Now we have completed the connection of our project. Let’s move to the coding side of this project.

        Arduino code of water level indicator

        For coding, we will use the Arduino IDE. It is a built-in IDE for Arduino developments.

        Arduino code is divided into mainly three parts: declaration of function and variables, second is void setup section, and third is void loop.

        First of all, declare the variables and pin number which we are going to use in this project.

        • Declare five variables for storing the pin numbers of LEDs and one variable for storing analog pins for reading the sensors.

        Void Setup()

        • This is the most important function in Arduino programming because our code will not compile successfully without using this function in the code.
        • When Arduino code starts this is the first function that runs.
        • This function runs only once when the code restarts.
        • So here, we will write the code which requires only one time to run.
        • In this function, we will basically declare the pin modes of the pins which we will use in the project.
        • Declare the pin mode of LEDs as output mode and sensor pin as input mode. Because we want to control the LEDs so that they must be in output mode and to read data from the sensor as input then it should be declared as input mode.

        Void loop()

        • This is the second most important function of Arduino code structure.
        • This function also must be in the code without it our code will not compile successfully.
        • In this function, we will write the main application code which we want to run continuously.
        • First of all, we will read the sensor value because we will make the decisions on the sensor values.
        • And for debugging purposes, we will print that value on the serial monitor.
        • As the sensor will give the analog output data, we will use the analogRead function for reading the sensor data.
        • After reading the sensor value, set the LEDs as per the threshold which we have calculated while calibrating the sensor for each level.
        • We will divide the values into five conditions for each level we set the LEDs accordingly.
        • First, we write the condition for when the container is full then, let’s assume the value will be more than 760. Then switch on all the LEDs.
        • After that, set the condition for the second level when the sensor value is lesser than 760 but greater than 720. Here we will set the 5th LED to low state and other LEDs to a high state.
        • Next check the condition for the third level when the sensor value is in the range of 615 to 720 and here we will set the 5th and 4th LED to low state and other LEDs to a high state.
        • Next check the condition for the fourth level when the sensor value lies in the range of 615 to 410. Here we will set the 3rd, 4th, 5th LEDs to low state and the rest two LEDs to a high state.
        • After that, check the condition for the fifth level when the sensor value lies in the range of 410 to 250, and here we will set 5th, 4th, 3rd, 2nd LED to low state and remaining one LED to a high state.
        • Last check the condition for when the container is almost empty when the sensor value lies in the range of 250 to 0. Here we will set all five LEDs to a low state.
        • After that give a delay of 1 second for settling of sensor values and calibration.

        Results and working

        Now we have completed our code and circuit, it's time to run the project.

        • To run the simulation, we have to include the hex file of the Arduino code.
        • We will generate the hex from the Arduino IDE.
        • To generate the hex file, go to the Sketch >> Export compiled binary, after that, it will compile the code and in the project folder, there will be two files one is binary and the other is hex file.
        • Now we have to include the hex file in the Arduino module in the Proteus software.
        • Click on the Arduino UNO module, then a window will pop up where you can add the hex file of the project.
        • Now we are all set to run the project, click on the Run button in the software to start the simulation.
        • To change the water level in the simulation, we will change the value on the potentiometer and as the values from the potentiometer change then the LEDs will also respond accordingly.
        • First check the condition when the water level is very low, mostly when the container is empty.
        • When the water level is very low then there will be very less conductivity or maybe no conductivity, in this case, the output voltage from the sensor will be very less.
        • So in this condition, all LEDs will be off.
        • In the image, we can see that the voltage at the analog pin is 0.5 volts.
        • Now when the water level increases then in that condition the conductivity will also increase so does the output voltage from the sensor.
        • So let’s increase the water level to the first level.
        • Here we can see the output voltage increased to 1.5 volts and the first led is glowing.
        • Now similarly increase the water level for next levels.
        • Check water for the second level. The output voltage is iincreased to 2 volts.
        • Now check for the next level.
        • Now check for when the container is filled. Then all LEDs will glow.

        Conclusion

        I hope we have covered all the points related to this project, and I think it will be very useful in daily life and it will give us ease of monitoring water in our water tanks. After this project, we don’t have to take the headache of how much water is available in our tank. And please let us know in the comment section if you have faced any issues while making it and also how you are going to use it in real life.

        Thanks for reading this article. All the best for your projects.

         

        Christmas Tree using Arduino

        Hello Geeks, I hope you all are doing great and enjoying your festive seasons. This time, we have come up with a new project which will make your festival a bit brighter so here comes a Christmas tree.

        It is said that Christmas is the center of all the celebrations. Did you guys know the scientist who discovered the light bulb, Thomas Edison and his friends were the first to put up the light bulbs on the Christmas tree, and here we are going to keep that tradition forward? Well, it’s time to gear up for the next season of Christmas being tech-savvy. Hence we have decided to brighten up a Christmas tree with the usage of Arduino Uno and LEDs in real life.

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

        Software to Install:

        To make our festival a little safer, we will first make our Christmas tree in the simulation and for that, we will use the Proteus simulation software. Making it in the simulation will give us a good understanding of how it is going to work, and how we are about to design the Christmas tree such as the placements of lights and lighting patterns.

        Proteus is a simulation tool for electronic projects. In this software, we can make approximately every type of electronic circuit and run the working simulation. It will show the real-time working simulation of the circuit and errors as well if any occurs.

        It has a large database of mostly all types of electronic components but still, for some, we have to install libraries. In this project, we are using Arduino UNO and it is not pre-installed so we have to download it first.

        Project Overview:

        Following components will be required to design our Christmas Tree

        • Arduino UNO - It works as the main controller in the project. We have used this to make different types of lighting patterns and using this, we will have a scope to make interesting lighting effects.
        • LEDs - We will need LEDs for our Christmas tree. We have used different colors of LEDs to make the matrix shape circuit for the Christmas tree.

        Components required:

        • Arduino UNO
        • Different colors of LEDs

        Components Details:

        Arduino UNO

        • Arduino UNO is an open-source development board that we will use in this project.
        • There are many types of Arduino development boards available but as per our requirement, we will be using Arduino UNO.
        • It uses the ATMega328P processor.
        • This microcontroller has a RISC-based architecture.
        • It has 32KB flash memory, 2KB of SRAM and 1 KB of EEPROM.
        • Talking about the communication peripherals, it has 1 SPI, 1 I2C and 1 UART on board.
        • It comes with 6 individual PWM channels and 6 channels of ADC.
        • There are 14 digital pins starting from D0-D13 and 6 analog pins starting from A0-A5 in this.
        • D10-D13 can be used for digital I/O and SPI communication pinouts.
        • A4 and A5 can be used for analog I/O and I2C communication pins.
        • To power the Arduino, we can use the USB or Vin pin of the Arduino UNO board.
        Note - It is recommended to disconnect any connection which is connected with the D0 and D1 pin of Arduino UNO before uploading the code otherwise it will cause issues in communication with the Arduino UNO and there can be an error for the same.

        LEDs

        • In this project, we have used different colors of LEDs for our Christmas tree.
        • LED stands for light-emitting diode.
        • It is one of the most efficient light sources compared to all other types of lights or bulbs.
        • They are used mostly in all types of electronics projects such as display, indicators or works as a light source.
        • Due to the long range of applications, LEDs come in a variety of shapes and colors.
        • There are two poles for connecting it, one is short and the other one is longer.
        • Talking about the connection, the longer side pole will be connected to positive voltage and the shorter side will be connected to the ground.
        • As LED is a type of diode, the current will flow in only one direction. In case, if we connect the wiring incorrectly, it will not work.
        • But still, if we have connected the LED wrong, no need to worry, just flip it over.

        Mostly it has not been damaged yet.

        • LEDs come in different voltage working ranges but here we have used 5v operating

        Circuit Diagram and Working:

        Now let's start with the circuit diagram of our project. The first step would be to import all the components to the workspace of Proteus software.

        We will be using one Arduino UNO for controlling the LEDs and six different colors of LEDs. Here we will make 6 rows and 6 columns of LEDs for our Christmas tree, so we will be using 6 Aqua color LEDs, 6 Green color LEDs, 6 Orange color LEDs, 6 White color LEDs, and 6 Yellow color LEDs.

        • After importing all the components to the workplace, it’s time to start connecting them.
        • We will use 6 pins of Arduino UNO for rows and 6 pins for columns. As we know, Arduino UNO has 14 digital pins but as suggested we should not connect any connections with D0 and D1 pins.
        • We will connect from D2 to D7 with the rows and D8 to D13 for columns.
        • While connecting the LEDs, we must be very careful in case, if we connect any wrong terminal or any wrong connection, our whole tree will not work because all of them are connected in series with each other and that is the drawback of series connection.
        • In case any connection is loose or wrong then all of the connected components will not work.
        • Keeping this in mind, when we will use the real components, make sure all the LEDs are working fine otherwise we will not get the desired output.
        • Don’t leave any loose connections or hanging wires.
        • It would be easy if we would connect it in steps therefore we will divide it into three steps.
        • First, connect all LEDs and make a 6x6 matrix. For connecting those we can use the simple twisted copper wires.
        • While connecting the LEDs, mind the terminals.
        • Now we will connect the column pins.
        • After connecting the pins, we will connect the row pins.
        • We have divided the connections in different pictures so that it would be easy to understand.
        • After completing all the connections, our circuit will look like as shown in the picture below.
        • Here, we have adjusted the wires, so that it will be in shape as the Christmas tree.
        • After completing the connections, there may be a doubt about the working of this circuit.
        • It is a little tricky, we have to make sure from the coding side that whenever we want to glow any LED, its ground terminal should be logic LOW and the positive terminal should be logic HIGH.

        Arduino Coding:

        After the connection of the circuit, let's start to code our Christmas tree:

        • For writing the code, we will be using the Arduino IDE.
        • In this application, we will not require any external library.
        • So our code will be divided into three parts: first declaration of variables, pin definition and setup and the last main application logic.

        Code declaration

        • First, declare two arrays for rows and columns.
        • In those arrays, we will store assigned pins for each row and column.
        • As we are using D8 to D13 for columns, that will be stored in the “column” array and D2 to D7 for rows, similarly, that will be stored in the “row” array.

        Void setup function

        • This is one of the most important functions as per the structure of the Arduino sketch.
        • As we are using the GPIO pins to control the LEDs, we will set the pin modes of LEDs to be in output mode.

        ? We have declared all the row and column pins in the output modes.

        Void loop function

        • In this function, we will write our main application code for our Christmas tree.
        • Here we will write the interesting patterns to glow the LEDs of the tree.
        • While making patterns, we only need to focus on two points, first, if we want to glow LEDs sequentially from rows, in this case, set all the pins of the column to logic HIGH state and if we want to glow the LEDs sequentially from columns then we need to set all the row to logic LOW state.
        • Keeping the above-mentioned points, we can glow any pattern on our tree.
        • For blinking the LEDs in a row-wise direction. We have to set all the column pins to HIGH state and then toggle the rows pin to HIGH-LOW.
        • For blinking the LEDs in a column-wise direction. We have to set all the row pins to LOW state and then toggle the column pins to HIGH-LOW.
        • To turn off all the LEDs, either set all the pins of columns and rows to logic HIGH or set all the pins of columns and rows to logic LOW.
        • To turn off the LEDs by setting all column and row pins to a HIGH state.
        • To turn off the LEDs by setting all column and row pins to LOW state.
        • We can use either of the above-mentioned logic depending upon the next pattern.
        • Using these simple logics, we can write various patterns.
        • Here in this code, we have written some interesting patterns that would be easy to understand while running the code.

        After completing the development side of the Christmas tree, it is time to test it.

        Results and Working:

        • As we have successfully completed the coding and the wiring part of our project, let's start the real fun of running it.
        • In the Proteus, to run any application code, it requires a hex file of the application code.
        • First of all, we need to generate the binary or hex file of our application code using the Arduino IDE.
        • To generate the hex file, we need to go to the toolbar and then click on the “Sketch” option. Thereafter click on the “Export compiled binary”.
        • After that, it will compile the code and a hex file will be generated.
        • Now add this hex file to the Proteus project.
        • To do so, click on the Arduino UNO module and go to the “Program File” option, then browse to the folder containing the hex file.
        • Now we are all ready to test our project.
        • Click on the “Play” button in the Proteus software.
        • As per our code, first, all the LEDs will blink column-wise, after every 100 milliseconds of delay.
        • Then all the LEDs will blink row-wise similarly after every 100 milliseconds of delay.
        • After that, all the LEDs will be off and it will start glowing in the column-wise pattern from both sides towards the center.
        • Thereafter, it will start glowing from the center towards the sides.
        • Each row will glow and after that, all the LEDs will be off, thereafter each will blink sequentially.
        • The working logic of this circuit is pretty simple. We just have to maintain the appropriate switching of the pins.
        • Using the same we can have different types of interesting patterns.

        Here is the working demo of our Christmas Tree

        I hope we have covered all the points related to this project and you have enjoyed reading it. We can use this with the real component and decorate the Christmas tree or we can use some cardboard and insert the LEDs on them in the same way.

        If you have any doubts regarding the project. And we will be glad to read about how you made your Christmas tree using this project and if you try any interesting new patterns with it, please let us know in the comment section.

        Merry Christmas.

        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