Hello friends, I hope you all are doing great. In today's tutorial, I will share a Proteus Library of another embedded module i.e. NodeMCU. NodeMCU is a microcontroller board and if you are new to this board, you should read Introduction to NodeMCU to get your hands dirty. NodeMCU is not present in the components library of Proteus and using this library you can easily simulate NodeMCU in Proteus.
We can't add WiFi and BLE capabilities to our module in the Proteus software, that's why it will just perform the basic functions i.e. sensors interfacing, PWM, I/O control etc. So, you can use it for simple code testing and can also use it to design circuit diagrams of your projects.
So, let's have a look at How to download NodeMCU Proteus Library and simulate it:
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Battery 12V | Amazon | Buy Now | |
2 | LEDs | Amazon | Buy Now | |
3 | Resistor | Amazon | Buy Now | |
4 | ESP8266 | Amazon | Buy Now |
Note: Look at How to add new Library in Proteus 8, if you don't know already.
So, we have successfully added the NodeMCU module to our Proteus software. Now let's simulate NodeMCU and for that, I am going to use the blink example:
Note: As you can see in the above code, we have selected Arduino UNO in the boards' section. As I have told earlier, this NodeMCU module is only going to use its pins, we can't add WiFi or BLE capabilities in the Proteus software. So, while compiling the code, select Arduino UNO board. Something is better than nothing.
So, that's how you can easily simulate NodeMCU in the Proteus software. If you have any questions, please ask in the comments. I will resolve them as soon as possible. In the next tutorial, we will share the ESP32 Library for Proteus. Till then take care and have fun!!!
Hi Friends! Hope you’re well today. Today, I am going to share the Proteus Library of Current Sensor WCS1600. This sensor is not available in the Proteus Components Library and we’re sharing it for the first time.
The Current Sensor WCS1600 is used to measure the current flowing through the circuit and is used in embedded systems and robotics projects. If you are new to this sensor, you must first design its simulation before playing with the hardware.
Before we move further, let’s have a brief overview of WCS1600 Current Sensor:
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Resistor | Amazon | Buy Now | |
3 | ACS712 | Amazon | Buy Now |
WCS1600 comes with a drift linear hall sensor IC which gives precise and accurate values. The hall sensor IC is 9.0 mm in diameter through the hole and is incorporated with a temperature compensation circuit. To measure the passing current, the electric wire of the system should pass through the hole of this sensor.
Using this design, the system designers can monitor the current path of any length without affecting the layout of the original system. The integrated hall IC senses the magnetic field generated when current flows through the wire. That magnetic field is then converted into a proportional voltage.
WCS1600 Current Sensor Library for Proteus
Note: You should read How to Add Library in Proteus 8, if you are having any issues finding the Library Folder.
In the components section, write ‘WCS1600 Current Sensor’ in the search bar and you’ll get the following result:
Now place this sensor in the Proteus workspace, as shown in the below figure:
You can see in the above figure, this current sensor carries 4 pins as follow:
Now double-click the sensor to open up its Properties Panel, as shown in the below figure:
Go to the ‘Program File’ section and browse for the file WCS1600TEP.HEX which you have already downloaded and placed in the Library Folder of Proteus.
That’s all for today. Hope you’ve found this Library for Proteus useful. If you’re unsure or have any queries regarding the simulation of this sensor and how to use it in your engineering projects, you are welcome to get in touch with me in the section below. I’ll help you the best way I can. Thank you for reading this tutorial.
Greetings, and welcome to today's tutorial. In the last tutorial, we learned how to construct a system for tallying individuals using Raspberry Pi, astute subtraction, and blob tracking. We demonstrated the total number of building entrances and exits. Feature computation and HOG theory were also discussed. The tests proved that a device based on the raspberry pi could effectively function as a people counting station. One of the many benefits of the Pi 4 is its internet connectivity, which is especially useful for home automation projects due to its low price and ease of use. We're going to see if we can use a web page's buttons to manage our air conditioner today. With this Internet of Things (IoT) based home automation, you can command your home gadgets from the comfort of your couch. The user can access this web server from any gadget capable of loading HTML apps, such as a smartphone, tablet, computer, etc.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Breadboard | Amazon | Buy Now | |
2 | Diodes | Amazon | Buy Now | |
3 | Jumper Wires | Amazon | Buy Now | |
4 | LEDs | Amazon | Buy Now | |
5 | Resistor | Amazon | Buy Now | |
6 | Transistor | Amazon | Buy Now | |
7 | Raspberry Pi 4 | Amazon | Buy Now |
The needs of this project can be broken down into two broad classes: hardware and software.
Raspberry Pi 4
Memory card 8 or 16GB running Raspbian Jessie
5v Relays
2n222 transistors
Diodes
Jumper Wires
Connection Blocks
LEDs to test.
AC lamp to Test
Breadboard and jumper cables
220 or 100 ohms resistor
We'll be using the WebIOPi framework, notepad++ on your PC, and FileZilla to transfer files (particularly web app files) from your computer to the raspberry pi and the Raspbian operating system.
As a good habit, I constantly update the Raspberry Pi before using it for the first time. In this project phase, we will handle the web-to-raspberry-pi connection by upgrading the Pi and setting up the WebIOPi framework. The python Flask framework provides a potentially more straightforward alternative, but getting your hands dirty and looking at how things operate makes DIY appealing. When you get to that point, the fun of DIY begins. Use the updated commands below to upgrade your Raspberry Pi and restart the RPi.
sudo apt-get update
sudo apt-get upgrade
sudo reboot
After this is finished, we can set up the webIOPi framework. Using, verify that you are in your home directory.
cd ~
To download the files from the google page, type wget.
wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz
Then, once the download is complete, unzip the file and enter the directory;
tar xvzf WebIOPi-0.7.1.tar.gz
cd WebIOPi-0.7.1/
Unfortunately, I could not locate a version of WebIOPi that is compatible with the Pi 4; thus, we have to download a patch before proceeding with the setup. Run the instructions below from within the WebIOPi directory to apply the patch.
wget https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch
patch -p1 -i webiopi-pi2bplus.patch
Once we have those things, we can begin the WebIOPi setup installation process by using the;
sudo ./setup.sh
Just click "Yes" when prompted to install more components during setup. Upon completion, restart your Pi.
sudo reboot
Before diving into the schematics and programs, we should power on the Raspberry Pi and ensure our WebIOPi installation is functioning as expected. Execute the command below;
sudo webiopi -d -c /etc/webiopi/config
After running the above command on the pi, open a web browser and navigate to http://raspberrypi.mshome.net:8000 (or HTTP;//thepi'sIPaddress:8000) on the computer that is attached to the pi. When logging in, you'll be asked for a username and password.
Username is webiopi
Password is raspberry
You may permanently disable this login if you no longer need it. Still, it's important to keep unauthorized users from taking control of your home's appliances and Internet of Things (IoT) components. After you've logged in, go to the GPIO header link.
Make GPIO 17 an output; we'll use it to power an LED in this Test.
Following this, attach the led to the Pi 4 as depicted in the schematics.
When you're ready to activate or deactivate the LED, return to the web page where you made the connection and select the pin 11 button. This allows us to use WebIOPi to manage the Raspberry Pi's GPIO pins. If the Test is successful, we can return to the console and exit the program by pressing CTRL + C. Please let me know in the comments if this arrangement has any problems. Once the pilot is finished, we can begin the actual project.
In this section, we will alter the WebIOPi service's standard setup and inject our code to be executed on demand. FileZilla or another FTP/SCP copy program will be the first tool we install on our computer. You'll agree that using the terminal to write code on the Pi is a stressful experience, so having access to Filezilla or another SCP program will be helpful. Let's make a project directory in which all our web scripts will be stored before we begin writing the HTML, CSS, and javascript programs for this Internet - of - things Home automated Web app and transferring them to the RPi.
First, make sure you're in your home directory using; next, create the folder; finally, open the newly constructed folder and make an HTML folder inside it.
cd ~
mkdir webapp
cd webapp
mkdir HTML
Make subfolders inside the HTML folder for scripts, CSS, and graphics.
mkdir html/css
mkdir html/img
mkdir html/scripts
Now that we have our files prepared, we can start coding on the computer and transfer our work to the Pi using Filezilla.
Writing the javascript will be our first order of business. An easy-to-use script for interacting with the WebIOPi server. Our four-button web app will only use two relays in the demonstration, and we only intend to control four GPIO pins for this project.
webiopi().ready(function() {
webiopi().setFunction(17,"out");
webiopi().setFunction(18,"out");
webiopi().setFunction(22,"out");
webiopi().setFunction(23,"out");
var content, button;
content = $("#content");
button = webiopi().createGPIOButton(17," Relay 1");
content.append(button);
button = webiopi().createGPIOButton(18,"Relay 2");
content.append(button);
button = webiopi().createGPIOButton(22,"Relay 3");
content.append(button);
button = webiopi().createGPIOButton(23,"Relay 4");
content.append(button);
});
Once the WebIOPi is ready, the preceding code is executed. To help you understand JavaScript, we've explained below:
webiopi().ready(function()
All this tells our system to make this function and call it once the webiopi is set.
webiopi().setFunction(23,"out")
We can instruct the WebIOPi program to use GPIO23 for output. Four buttons are now available, but you may add more if necessary.
var content, button
With this line, we're instructing the system to make a new variable called content into a button.
content = $("#content")
We will continue using the content variable in our HTML and CSS. As a result, the WebIOPi framework generates everything connected to #content when it is mentioned.
button = webiopi().createGPIOButton(17,"Relay 1")
WebIOPi can make several distinct types of push buttons. This code instructs the WebIOPi program to generate a GPIO key that operates on the GPIO pin identified as "Relay 1" above. The other ones are the same, too.
content.append(button)
Add this code to the button's existing HTML or external code. New buttons can be made that are identical to this one in every respect. This is especially helpful while coding or writing CSS.
If you made your JS files the same way I did, you can save them and then move them with Filezilla to webapp/HTML/scripts after you've finished making them. Now we can move on to developing the CSS.
With the aid of CSS, our Internet of Things (IoT) Rpi 4 home automation website now looks fantastic. So that the website will look like the one in the picture below, I built a custom style sheet called smarthome.css.
I don't want to paste the entire CSS script here, so I'll use a subset for the explanation. If you want to learn CSS, all you have to do is read the code. You can skip this and use our CSS code if you want to.
The first section of the script, displayed below, represents the web application's main stylesheet.
body {
background-color:#ffffff;
background-image:URL('/img/smart.png');
background-repeat:no-repeat;
background-position:center;
background-size:cover;
font: bold 18px/25px Arial, sans-serif;
color:LightGray;
}
The above code, which I hope needs no explanation, begins by setting the background colour to white (#ffffff), adds a background image to the document from the specified folder (remember the one we created earlier? ), makes sure the picture doesn't duplicate by setting the background-repeat to no-repeat, and finally tells the CSS to center the background. Next, we adjust the background's text size, font, and colour.
After finishing the main content, we styled the buttons with CSS.
button {
display: block;
position: relative;
margin: 10px;
padding: 0 10px;
text-align: center;
text-decoration: none;
width: 130px;
height: 40px;
font: bold 18px/25px Arial, sans-serif; color: black;
text-shadow: 1px 1px 1px rgba(255,255,255, .22);
-WebKit-border-radius: 30px;
-Moz-border-radius: 30px;
border-radius: 30px;
}
Everything else in the script is similarly optimized for readability and brevity. You can play with them and see what happens; this kind of learning is known as "learning by doing," I believe. However, CSS's strengths lie in its simplicity, and its rules are written in plain English. The button's text shadow and button shadow are two of the few supplementary features found in the block's other section. To top it all off, pressing the button triggers a subtle transition effect, making it look polished and lifelike. To guarantee optimal page performance on all browsers, these are defined independently for WebKit, firefox, opera, etc.
The following code snippet notifies the WebIOPi service that it is receiving data as input.
input[type="range"] {
display: block;
width: 160px;
height: 45px;
}
Providing feedback on when a button is pressed will be the last element we want to implement. As a result, the screen's colour scheme and button hues provide a quick indicator of progress. To accomplish this, the following line of code is added to each button's HTML.
#gpio17.LOW {
background-color: Gray;
color: Black;
}
#gpio17.HIGH {
background-color: Red;
color: LightGray;
}
The code snippets up top alter the button's color depending on the user's selection. The button's background is gray when it is inactive (at LOW) and red when it is active (at HIGH). Now that we have our CSS under control let's save it as smarthome.css, upload it to our raspberry pi's styles folder using FileZilla (or another SCP client of your choosing), and fix the remaining HTML code.
The HTML code unifies the style sheets and java scripts.
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="mobile-web-app-capable" content="yes">
<meta name="viewport" content = "height = device-height, width = device-width, user-scalable = no" />
<title>Smart Home</title>
<script type="text/javascript" src="/webiopi.js"></script>
<script type="text/javascript" src="/scripts/smarthome.js"></script>
<link rel="stylesheet" type="text/CSS" href="/styles/smarthome.css">
<link rel="shortcut icon" sizes="196x196" href="/img/smart.png" />
</head>
<body>
</br>
</br>
<div id="content" align="center"></div>
</br>
</br>
</br>
<p align="center">Push button; receive bacon</p>
</br>
</br>
</body>
</html>
The head tag contains several crucial elements.
<meta name="mobile-web-app-capable" content="yes">
The code line above makes it possible to add the web app to the mobile device's home screen when using Chrome or Safari. You can access this function using the Chrome menu. This makes it so the app may be quickly launched on any mobile device or desktop computer.
The following line of code provides a measure of responsiveness for the web app. Because of this, it can take up the entire display of any gadget on which it is run.
<meta name="viewport" content = "height = device-height, width = device-width, user-scalable = no" />
The web page's title is defined in the following line of code.
<title>Smart Home</title>
The following four lines of code all connect the Html file to multiple resources it requires to function as intended.
<script type="text/javascript" src="/webiopi.js"></script>
<script type="text/javascript" src="/scripts/smarthome.js"></script>
<link rel="stylesheet" type="text/CSS" href="/styles/smarthome.css">
<link rel="shortcut icon" sizes="196x196" href="/img/smart.png" />
The first line above directly connects to the WebIOPi framework JavaScript, which is stored in the server's root directory. This method must be invoked whenever WebIOPi is used.
The second line tells the HTML document where to find our jQuery script, and the third tells where to get our style sheet. The last line prepares an icon for the mobile desktop, which can be useful if we use the website as an app or a favicon.
To ensure that our HTML code displays whatever is contained in the JavaScript file, we include break tags in the body portion of the code. The definition of our button's content was made previously in the JavaScript code, and its id="content" should bring that to mind.
<div id="content" align="center"></div>
Everybody is familiar with the routine of saving an Html file as index.html and then transferring it to the Pi's HTML folder via Filezilla.
Before we can begin sketching out circuit diagrams and running tests on our web app, we need to make a few adjustments to the webiopi service's configuration file, instructing it to look for configuration information in our HTML folder rather than the default location.
Edit the configuration by executing the following commands as root:
sudo nano /etc/webiopi/config
Find the section of the configuration file labelled "HTTP" and look for the line that begins with "#" Modify the directory where HTML and resources are stored by default with doc-root.
Remove the # comments from anything below it, and if your folder is organized like mine, set the doc-root to the location of your project file.
doc-root = /home/pi/webapp/html
Lastly, save your work and exit. If you already have another server installed on the Pi utilizing port 8000, you may easily change it. If not, let's stop saving and call it a day.
It's worth noting that the WebIOPi service password can be changed using the command;
sudo webiopi-passwd
A new login name and password will be required. Getting rid of this entirely is possible, but safety comes first.
Finally, issue the following command to start the WebIOPi service.
sudo /etc/init.d/webiopi start
If you want to see how the server is doing, you can do so by;
sudo /etc/init.d/webiopi status
That's why there's a way to halt its execution:
sudo /etc/init.d/webiopi stop
Setup WebIOPi to start automatically with;
sudo update-RC.d webiopi defaults
To do the opposite and prevent it from starting up automatically, use the following;
sudo update-RC.d webiopi remove
Now that we have everything set up, we can begin developing the schematics for our Web-controlled home appliance.
Whereas I could not procure relay modules, which in my experience, make electronics projects simpler for do-it-yourselfers. So, I'm going to draw some diagrams for regular, single-relay, 5V-powered standalone devices.
Join the components as seen in the fritzing diagram. It's important to remember that your Relay's COM, NO (usually open), and NC (typically Close) contacts could be on opposite sides. Please verify this with a millimetre.
Relays can be found anywhere that electricity is being switched, from a simple traffic light controller to a high-voltage switchyard. Relays, in the broadest sense, are equivalent to any other switch. They can connect or disconnect a circuit and are frequently employed to activate or deactivate an electrical load. However, this is a comprehensive statement; there are many other relays, and each Relay behaves slightly differently depending on the task at hand; as the electromechanical Relay is one of the most widely used relays, we will devote more space to discussing it here. In spite of variations in design, all relays work according to the same fundamental concept, so let's dive into the nuts and bolts of relays and talk about how they function.
A relay is called an electromechanical switch that may either establish or rupture an electrical connection. A relay is like a mechanical switch, except that it is activated and deactivated by an electronic signal rather than by physically flipping a switch. It comprises a flexible movable mechanical portion controlled electrically through an electromagnet. Once again, this Relay operating concept is suitable exclusively for electromechanical relays.
A common and widely used relay consists of electromagnets typically employed as a switch. However, there are many kinds of relays, each with its purpose. When a signal is received on one side of the device, it controls the switching activity on the other, much like the dictionary definition of Relay. That's right, a relay is an electromechanical switch that can open and close circuits. This device's primary function is to establish or sever contact with the aid of a signal to turn it ON or OFF automatically and without human intervention. Its primary use is to allow a low-power signal to exert control over a circuit with a high power consumption. Typically, the high-voltage circuit is controlled by a direct current (DC) signal.
The following diagram depicts the internal structure and design of a Relay.
A coil of copper wire is wound around a core, which is then placed inside a housing. When the coil is electrified, it attracts the movable armature, which is supported by a spring or stand and has a metal contact attached to one end. This assembly is positioned over the core. In most cases, the movable armature is a shared connection point for the motor's internal components and the other wiring harness. The usually closed (NC) pin is linked to the common terminal, while the ordinarily opened (NO) pin is not used in operation. By connecting the armature to the usually open contact whenever the coil is activated, current can flow uninterruptedly through the armature. When the power is turned off, it returns to its starting position.
The picture below shows a schematic of the Relay's circuit in its most basic form.
In the images below, you can see the main components of an electromechanical relay—an electromagnet, a flexible armature, contacts, a yoke, and a spring/frame/stand. They have been thoughtfully placed into a relay.
The workings of a Relay's mechanical components have been outlined below.
Electromagnet
An electromagnet is crucial to the operation of a relay. This metal lacks magnetic properties but can be transformed into a magnet when exposed to an electrical current. It is healthy knowledge that a conductor takes on the magnetic characteristics of the current flowing through it. Thus, a metal can operate as a magnet and attract magnetic objects within its range when wound with a conductive material and powered by an adequate power source.
Movable Armature
A moveable armature is just one piece of metal that can rotate or stand on its own. It facilitates connection-making and -breaking with the contacts attached to it.
Contacts
Internal conductors are the wires that run through a device and hook up to its terminals.
Yoke
It's a tiny metal piece attached to a core that attracts and retains the armature whenever the coil is activated.
Spring (optional)
While some relays can function without a spring, those that do have one attach it to the armature at one end to prevent any snagging or binding. One can use a metal "stand" in place of a spring.
Let's examine the differences between a relay's normally closed and normally open states.
If no current flows through the core, there will be no magnetic field, and the device will not be a magnet. As a result, it is unable to draw in the flexible framework. So, the ordinarily closed position of the armature is the starting point (NC).
When a high enough voltage is supplied to the core, it begins to have a strong magnetic field around itself, allowing it to function as a magnet. The magnetic field produced by the core attracts the movable armature whenever it comes within its field of influence, changing the armature's location. As it has been wired to a normally open relay pin, any external circuits attached to it will no longer operate in the same way.
It is important to connect the relay pins correctly so that the external circuit can do its job. When a coil is powered, the armature is drawn toward it, revealing the switching action; when the power is cut, the coil loses its magnetic property, and the armature returns to its original location. The animation provided below shows the Relay in action.
There is nothing complicated about a transistor, yet there is a lot going on inside it. Okay, so first, we'll tackle the easy stuff. An electronic transistor is a small component that can switch between two functions. It's a switch that can also act as an amplifier.
An amplifier is a device that takes in a little electric current and outputs a significantly larger electric current (called an output current). It can be thought of as a current booster. One of the earliest applications for transistors, this is particularly helpful in devices like hearing aids. A hearing aid contains a microscopic microphone that converts ambient sound into electrical signals. These are then amplified by a transistor and used to power a miniature loudspeaker, which reproduces the ambient noise at a much higher volume.
It is possible to use a transistor as a switch. A transistor is a device that allows for the passage of one electrical current to induce a much larger current to flow through the next part of the device. What this means is that a relatively small current can activate a much larger one. All computer chips function in this general way. As an illustration, a memory chip may have as many as a billion individually controllable transistors. Due to the fact that each transistor can exist in either of two states, it is capable of storing either a zero or a one. A chip's ability to hold billions of zeroes and ones, as well as almost as many regular numbers and letters, is made possible by its billions of transistors.
Diodes can range in size from what's shown in the image up top. They feature a cylindrical body that is usually black with a stripe at one end and certain leads that protrude so that we may plug it into a circuit. The opposite terminal is called the cathode and is opposite the anode.
A diode is an electrical component that restricts current flow in one direction.
To illustrate, picture a swing valve fitted in a water line. The water pressure inside the pipe will force open the swing gate, allowing the water to flow uninterrupted. In contrast, the gate will be forced shut, and water flow will stop if the river alters its course. As a result, there is only one direction for water to flow.
Very much like a diode, which we also employ to alter the current flow through a circuit, it allows us to switch it on and off at will.
We have now animated this process using electron flow, in which electrons move from negative to positive. However, traditional flow, positive to negative, is the norm in electronics engineering. It's usually best to start with the conventional current because it's more familiar to most people, but feel free to use either one; we'll assume you're aware of the difference.
It's important to remember that the light-emitted diode will only light up properly if the diode is connected to the circuit in the correct orientation when adding it to a simple Light emitted diode circuit like the one shown above. Only one direction of current can travel through it. Accordingly, its conductive or insulating properties are determined by the orientation in which it is mounted.
So that it can conduct electricity, you must join the black end to the neutral and the striped end to the positive. The forward bias is the condition in which current can flow. If we invert the diode, it will become an insulator and stop the passage of electricity. The term for this is "the reverse bias."
You probably know that electricity is the transfer of electrons between atoms that are not bound. Because of its high number of unpaired electrons, copper is widely used for electrical wiring. Since rubber is an insulator—its electrons are kept very securely, so they cannot flow between atoms—it is used to wrap around the copper wires for our protection.
In a simplified form of a metal conducting atom, the nucleus is at the center, and the electrons are housed in a series of shells around it. It takes a specific amount of energy for an electron to be absorbed into each shell, and each shell has a max number of electrons it can hold. Those electrons that are furthest from the nucleus are the most energetic. Conductors have between one and three electrons in their outermost "valence" shell.
The nucleus acts as a magnet, keeping the electrons in place. However, there is yet another layer, the conduction band. If an electron gets here, it can leave its atom and travel to another. Because the valence shell and conduction band of a metal atom overlap, the electron can move quickly and easily between the two.
The insulator has a tightly packed outer layer. No free space for electrons to occupy. Because of the strong attraction between the nucleus and the electrons and the great distance between the nucleus and the conduction band, the electrons are trapped inside the nucleus and cannot leave. Because of this, electricity is unable to travel through it.
Of course, a semiconductor is also a different type of material. A semiconductor might be silicon, for instance. This material behaves as an insulator because it has one more electron than is necessary in its outermost shell to be a conductor. However, with enough external energy, a few valence electrons can generate enough momentum to hop across to the conduction band, where they can finally break free. Consequently, this substance can perform the roles of both an insulator and a conductor.
Due to the lack of free electrons in pure silicon, engineers must add a small number of materials (called "doping") to the silicon to alter its electrical properties.
This process gives rise to P-type and N-type doping, respectively. The diode itself is a combination of these doped materials.
Two leads connect the anode and cathode to various thin plates inside the diode. P-Type doped silicon is on the anode side of these plates, and the cathode side is N-Type doped silicon—an insulating and protective resin that coats the entire structure.
Consider the material to be pure silicon before it has been doped. There are four silicon atoms surrounding each one. Because silicon atoms need eight electrons to fill their valence shells but only have four available, they share one with their neighbours. Covalent bonding describes this type of interaction.
Phosphorus, an N-type element, can be substituted for a number of silicon atoms in a compound semiconductor. Phosphorus has a 5-electron valence shell because of this. This extra electron isn't needed because particles are sharing them to reach the magic number of 8. This means there's an extra electrons in the material, and it's free to go wherever it wants.
In P-type doping, a substance like aluminum is introduced. Due to its limited valence electron pool of 3, this atom is unable to share an electron with any of its four neighbours. An electron-sized void is therefore made available.
We now have silicon with either too many or too few electrons, depending on the doping method.
Upon joining, the two substances forge a p-n junction. This is a depletion region, and it forms at the intersection. Here, some of the surplus electrons on the N-type side migrate over to fill the vacancies on the P-type side. By moving in this direction, electrons and holes will accumulate on either side of a barrier. Holes are thought to be positively charged since they are the opposite of electrons, which are negatively charged. The resulting accumulation produces two distinct regions, one slightly negatively charged and the other slightly positively charged. This forms an electric field that blocks the path of any more electrons. In regular diodes, the voltage drop over this area is only 0.7V.
By applying a voltage across the diode with the P-Type anode linked to the positive and the N-Type cathode attached to the negative, a forward bias is established, and current can flow. The electrons can't get over the 0.7V barrier unless the voltage source is higher.
We can achieve this by connecting the positive terminal of the power supply to the cathode of an N-type device and the negative terminal to the anode of a P-type device. The diode functions as a conductor to block current because the barrier expands as holes are drawn toward the negative and electrons are drawn toward the positive.
A resistor is a two-terminal, non-active electrical component that reduces the amount of current in electric and electronic circuits. A certain amount can lower the current by strategically placing a resistor in a circuit. From the outside, most resistors will appear identical. But if you crack it open, you'll find a ceramic rod used for insulation within, with copper wire covering the rest of the structure. Those copper twists are crucial to the resistance. When copper is sliced thinner, resistance rises because electrons have more difficulty penetrating the material. We now know that electrons can move more freely through some conductors than insulators.
George Ohm investigated the correlation between resistor size and material thickness. His proof showed that an object's resistance (R) grows in proportion to its length. Because of this, the resistance offered by the lengthier and thin wires is greater. However, wire thickness has a negative effect on resistance.
Once everything is hooked up, you can start your server by browsing to the IP address of your RPi and entering the port you chose earlier (as mentioned in the previous section), entering your password and username and seeing a page that looks like the one below.
All it takes is a few clicks of your mouse to operate four AC home appliances from afar. This can be controlled from a mobile device (phone, tablet, etc.) and expanded with additional switches and relays. Thank you all for reading to the end.
This guide showed us how to set up a web-based control system for our home automation system based on the Raspberry Pi 4. We have learned how to utilize the WebIOPi API to manage, debug, and use raspberry Pi's GPIO, sensors, and adapters from an internet browser or any application. We have also implemented JavaScript, CSS, and HTML code for the web application. For those who thrive on difficulty, feel free to build upon this base and add whatever demanding module you can think of to the project. The following tutorial will teach you how to use a Raspberry Pi 4 to create a Line Follower robot that can navigate obstacles and drive itself.
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. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Arduino Uno | Amazon | Buy Now |
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:
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.
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.
As we know the required components which we are going to use in this project.
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.
Now we have completed our code and circuit, it's time to run the project.
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.
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. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Arduino Uno | Amazon | Buy Now |
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.
Following components will be required to design our Christmas Tree
Mostly it has not been damaged yet.
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 the connection of the circuit, let's start to code our Christmas tree:
? We have declared all the row and column pins in the output modes.
After completing the development side of the Christmas tree, it is time to test it.
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.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Resistor | Amazon | Buy Now | |
3 | LCD 16x2 | Amazon | Buy Now | |
4 | Arduino Mega 2560 | Amazon | Buy Now |
As you all already know the importance of traffic lights and their usage has solved a number of traffic problems, traffic is becoming denser on each road in the whole world by the hour. This leads us to consider traffic density at such roads as well. A number of different solutions have been developed in recent times to help with this problem such as roundabouts. This is done so to ensure the safety of vehicles on road and of people walking on pedestrian walks. With the world going towards automation and autonomous systems, this is the right time to switch traffic lights to an autonomous traffic light system too and make the system intelligent.
We will be going through how to make an autonomous traffic system by using Arduino as a microcontroller. However, we’re not making an actual system rather we will be making a simulation of the said traffic system on a circuit simulating software Proteus. So make sure you already have the latest version of Proteus installed on your PCs and laptops. If not, you should first install the Proteus Software by following the embedded link. Proteus is open database software, meaning people can easily make their own circuit simulating libraries for the software and can easily integrate those libraries. This helps in making the software versatile and easy to use. You can easily add your own components or download libraries of components and place them within the software.
To start working with this project, you need to install and include the following libraries on your Proteus software:
This is a smart 4-way traffic light system. The pedestrian lights work such that whenever a certain traffic light is green its opposite pedestrian lights turn on. An addition of ultrasonic sensors have been made in the traffic light sequence. One ultrasonic sensor is placed at each traffic light. Each ultrasonic sensor controls the time of their respective green traffic light. When the ultrasonic sensor output is high, the traffic light opens for one second, when the ultrasonic sensor output is intermediate the traffic light opens for two seconds and when the ultrasonic sensor output is low the traffic lights open for 3 seconds.
The main components and their use in this project is given below:
We will go through the details of some of the important components being used in this project.
Arduino is an open-source programmable board that serves as a microcontroller and processes information based upon inputs and gives information to actuators in terms of output. Arduino Mega is based upon the chip ATmegaGA2560 and has 53 digital I/O pins.
Liquid Crystal Displays used in electronics are of two basic sizes, 16x2 and 24x2. These represent the number of columns and rows of the LCD. Each pixel can store one character in it. It is also known as a character LCD. It comes equipped with a backlight. The intensity or glow of the backlight can be controlled by attaching a potentiometer at specified pins.
Figure 2: LCD display
An ultrasonic sensor uses SONAR technology to identify objects. It is basically used to find the distance of objects from the sensor. The ultrasonic sensor works by sending out ultrasonic waves and when these waves or parts of waves hit an object, they are reflected backward and the time from their propagation to their return is then noted. This time is then converted into the distance because we already know the speed by which those waves are traveling.
Figure 3: Ultrasonic Sensor
In order to simulate this project on Proteus software, we will first make the circuit diagram on Proteus. After that, we will write our code on Arduino IDE software and integrate it with the circuit made in Proteus.
Open Proteus and open a new project. Import the following components in your Proteus worksheet.
Place the component in your worksheet as illustrated in the figure below:
Figure 5: Placement of components
After placing the components, make the connections as follows:
With this, your circuit connections are complete and we will now move on to the firmware setup of this circuit.
We have divided the Arduino code in 3 segments:
We will look at these sections separately now.
The first step in the code is the declaration of variables that we will utilize in our program. At first is the declaration of ultrasonic sensor pins and setting them up with their respective pins of Arduino board. The syntax of this code is as follows.
Figure 6: Ultrasonic declaration code
Now we will include the library of LCD into our Arduino program, you can download this library from within the software. After that we will declare the LCD by defining the LCD pins. The syntax for which is as follows:
In the next step, we will declare traffic light variables and define their Arduino pins.
Figure 8: Traffic light variable declaration
Now, we will declare the variables of pedestrian LEDs and then allot them their Arduino pins being used in the circuit.
Figure 9: Declaration of pedestrian LEDs
Now, there are two variables being used for each ultrasonic sensor for the calculation of their distance and time duration. We will declare those variables now.
Figure 10: Declaration of variables being used for calculations
Void setup is the part of Arduino program that only runs once, in this section the program that only needs to run once is put, such as declaring pins as output pins or input pins.
Only the echo pins of ultrasonic sensor are input pins while all other pins are going to be output pins for this project.
We will first set up ultrasonic pins as follows:
Now we will declare traffic light pins as output pins. The syntax for this is given as follows:
Figure 12: Setup of Traffic light Pins as Output
Now we will setup our pedestrian LEDs.
Figure 13: Setup of Pedestrian LEDs as Output
Now we will initialize our LCD, this basically tells the microcontroller to start the LCD and give power to it. The syntax is given below.
Figure 14: Initializing LCD
This part of Arduino Program runs in a loop and consists of the main code of the program in which all the calculations are being done.
In the first part of the program, we will set the trigger pin of the first ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.
Figure 15: Syntax of 1st Ultrasonic Sensor
This distance calculation is for our first traffic light. Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
Figure 17: Arduino Code
After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.
Figure 18: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
Figure 19: Arduino Code
After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 21: Arduino Code
After that in our if loop, the yellow lights 1 and 2 will turn on to indicate transition.
Figure 22: Arduino Code
Now we will set the trigger pin of the second ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.
Figure 23: Arduino Code
This distance calculation is for our Second traffic light. Now we will use the if loop to check our distance value.
Figure 24: Arduino Code
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.
Figure 26: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
Figure 27: Arduino Code
After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.
Figure 28: Arduino Code
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 29: Arduino Code
After that in our if loop, the yellow lights 2 and 3 will turn on to indicate transition.
Now we will set the trigger pin of the third ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that, we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that we will calculate the distance from the duration of the wave.
Figure 31: Arduino Code
This distance calculation is for our third traffic light. Now we will use the if loop to check our distance value.
Figure 32: Arduino Code
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
Figure 33: Arduino Code
After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.
Figure 34: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.
Figure 36: Arduino Code
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 37: Arduino Code
After that in our if loop, the yellow lights 3 and 4 will turn on to indicate transition.
Figure 38: Arduino Code
Now we will set the trigger pin of the fourth ultrasonic sensor to low and high. This would generate a pulse and send out a wave. After that, we will read a pulse input from the echo pin. This will give us the duration in which the wave was propagated and returned. After that, we will calculate the distance from the duration of the wave.
Figure 39: Arduino Code
This distance calculation is for our fourth traffic light. Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop, the signal will turn green for three seconds. This will also be displayed on the LCD.
Figure 41: Arduino Code
After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.
Figure 42: Arduino Code
Now we will use the if loop to check our distance value.
If the value falls between our set limit for the loop of intermediate traffic, the signal will turn green for two seconds. This will also be displayed on the LCD.
After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.
Figure 44: Arduino Code
Now we will use the if loop to check our distance value again.
If the value falls between our set limit for the loop of low traffic, the signal will turn green for one second. This will also be displayed on the LCD.
Figure 45: Arduino Code
After that in our if loop, the yellow lights 4 and 1 will turn on to indicate transition.
Figure 46: Arduino Code
At first, after writing the code, generate its hex file and put that hex file on the Arduino board on your Proteus software. After that, run the simulation. The results of the simulation are shown below thoroughly.
At first, when sensor one gives the output within 500 cm, the traffic light will turn on for one second only.
Figure 47: Simulation Results
However, if the sensor one value is between 500 and 900 cm, the traffic light 1 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 48: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
When the sensor two gives the output within 500 cm, traffic light 2 will turn on for one second only.
Figure 50: Simulation Results
However, if the sensor two value is between 500 and 900 cm, the traffic light 2 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 51: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
Figure 52: Simulation Results
When sensor three gives the output within 500 cm, traffic light 3 will turn on for one second only.
However, if the sensor three value is between 500 and 900 cm, the traffic light 3 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 54: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
Figure 55: Simulation Results
When sensor four gives the output within 500 cm, traffic light 4 will turn on for one second only.
Figure 56: Simulation Results
However, if the sensor four value is between 500 and 900 cm, the traffic light 4 will be green for 2 seconds with the LCD displaying the remaining time.
Figure 57: Simulation Results
If the sensor values are above 900 cm, then the lights will be green for 3 seconds.
Figure 58: Simulation Results
Phew! I know that this was an extremely long project, but that is a part of an engineer’s life. Multiple receptions and running recurring patterns smoothly requires skill and patience only an engineer can possess. I hope you guys made it through. Kudos to your nerves of steel. Thanks for reading.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Arduino Mega 2560 | Amazon | Buy Now |
Traffic lights are an integral part of the world’s transportation systems. Over the years a number of different algorithms regarding traffic lights have been developed. The algorithm being used at any place for the purpose of controlling traffic takes into account of various factors, such as number of lanes, people that cross a certain road, etc. The most common usage of traffic lights is to control the flow of traffic, which means providing a steady flow for people to go about their daily business on the road. Traffic lights help reduce accidents by a large margin since they allow the flow of vehicles in only one direction at a time. Traffic lights also help in avoiding traffic jams. The most common traffic light pattern being used in the world today is a 4-way traffic control that accounts for pedestrians as well. This sort of pattern is used in main city blocks and squares since these possess both vehicular traffic as well as pedestrian traffic. Traffic lights have a universal color understanding that red light signals for the traffic to stop, yellow light serves as a transition light from going to stop and vice versa.
Since we are simulating this project instead of designing it using hardware components, you need to fill some requisites so that you can follow our procedure. At first, we need to have the simulating software. For simulation purposes, we will use the Proteus software, if you already have that installed, that is excellent. However, if you don’t, you should Install Proteus Software. Proteus is a circuit simulating software that has an open database that can be customized quite easily, leaving room to add new components along with their libraries. To start working with Proteus for this project, you need to add the following libraries:
The main components of a 4-way traffic light are:
In this certain design, we have used delays to control the ON and OFF time of the traffic lights. There are other ways around this as well but using delays with Arduino is the simplest and most effective way for small projects.
The pedestrian lights are set up so that whenever a certain traffic light is GREEN, its opposing pedestrian light on which there is no traffic is turned ON and signals for the pedestrians to walk.
Arduino Mega is a programmable microcontroller board.
Arduino Mega contains ATMegaGA2560 and is based on that microcontroller.
Every Arduino board is equipped with voltage regulators to make sure an excessive input does not burn components on the board.
Arduino Mega has 53 digital I/O pins.
This module consists of three lights, namely, Red, Yellow and Green.
All three lights have separate input pins through which each light is controlled independently.
Make sure you connect all three pins to the Arduino, even if you are not using a certain light. This is because Proteus simulation only works when all the pins of traffic light are connected.
Figure 2: Traffic Lights
We will first make the circuit on our Proteus software, after doing the connections of the circuit, we will work on the Arduino code based upon the circuitry and connections made.
First of all, make sure you have downloaded and installed Proteus software on your system and have downloaded and integrated the required libraries with the downloaded software.
Open Proteus and then open a new project, there is no need to change settings and simply select okay to default selected settings.
Import all the components of this project mentioned above and shown in the figure below:
Figure 3: Required Components
Place the components in the worksheet as illustrated below:
After placing the components in the worksheet, make connections as follows:
With this, your circuit connections are complete and we will now move on to the firmware setup of this circuit.
We have divided the Arduino code into 3 segments:
We will look at these sections separately now.
The first step in the code is the declaration of variables that we will utilize in our program. At first is the declaration of traffic lights and setting them up with their respective pins of Arduino board. The syntax of this code is as follows.
Figure 5: Arduino Code
The next declaration is of pedestrian lights. The syntax of pedestrian light declaration is illustrated as follows.
Figure 6: Arduino Code
This part of the code along with the declaration part is run only once, we will use this to define output and input pins. This helps Arduino to understand which pins to take data from and which pins to write data on.
Since there is no input, we will only define traffic lights and pedestrian lights as output pins. The syntax to do this is shown in figure 7.
Figure 7: Arduino code, Void Setup
This part of the code runs in a loop consistently and is used to write the main section of the code.
In the first section, we will turn on the green light of signal 1 while all other signals are red. The pedestrian lights are red for pedestrian signals 1, 2 and 3. While the pedestrian 4 light is green since it is opposite to traffic signal 1.
Figure 8: Arduino Code
After a delay of 2000ms, we will turn on the yellow light for signal 1 and signal 2 to indicate that a transition from signal 1 to signal 2 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety.
Figure 9: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
For the second signal, we will turn on the green light of signal 2 while all other signals are red. The pedestrian lights are red for pedestrian signals 2, 3 and 4. While the pedestrian 1 light is green since it is opposite to traffic signal 2.
Figure 11: Arduino Code
After a delay of 2000ms, we will turn on the yellow light for signal 2 and signal 3 to indicate that a transition from signal 2 to signal 3 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety.
Figure 12: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
Figure 13: Arduino Code
For signal 3, we will turn on the green light of signal 3 while all other signals are red. The pedestrian lights are red for pedestrian signal 1, 3 and 4. While the pedestrian 2 light is green since it is opposite to traffic signal 3.
After a delay of 2000ms, we will turn on the yellow light for signal 3 and signal 4 to indicate that a transition from signal 3 to signal 4 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety.
Figure 15: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
Figure 16: Arduino Code
For the final signal, we will turn on the green light of signal 4 while all other signals are red. The pedestrian lights are red for pedestrian signals 1, 2 and 4. While the pedestrian 3 light is green since it is opposite to traffic signal 4.
Figure 17: Arduino Code
After a delay of 2000ms, we will turn on the yellow light for signal 4 and signal 1 to indicate that a transition from signal 4 to signal 1 will be made shortly. We will also turn all pedestrian lights red in order to ensure pedestrian safety. This will also complete the loop and the sequence will keep running on its own.
Figure 18: Arduino Code
After a delay of 1000ms, all traffic and pedestrian lights will turn off for 100ms.
With this, the program of the void loop will end and start again from signal 1 on its own.
Generate a hex file from the Arduino program made above. Be sure to select
Integrate the hex file into your Arduino board on Proteus.
Run the simulation.
The results of the simulation should be something like our simulation results.
The simulation results for each scenario are illustrated in the figure below.
At first, traffic signal 1 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 4 is also turned ON since it is opposite to signal 1.
Figure 20: Signal 1 is ON while Pedestrian 4 is ON.
Then the yellow light of signals 1 and 2 are turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Then traffic signal 2 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 1 is also turned ON since it is opposite to signal 2.
Figure 22: Signal 2 is ON while Pedestrian 1 is ON.
Then the yellow light of signal 2 and 3 is turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Figure 23: Yellow light showing transition.
Then traffic signal 3 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 2 is also turned ON since it is opposite to signal 3.
Figure 24: Signal 3 is ON and Pedestrian 2 is ON
Then the yellow light of signal 3 and 4 is turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Then traffic signal 4 is turned ON and the green light is displayed for 2000ms. The green pedestrian light 3 is also turned ON since it is opposite to signal 4.
Figure 26: Signal 3 is ON and Pedestrian 2 is ON
Then the yellow light of signal 4 and 1 is turned ON showing transition is about to happen. The red pedestrian lights during this are turned ON to ensure pedestrian safety.
Figure 27: Yellow light showing the transition.
That is all for today’s tutorial, I hope you enjoyed learning with us. We wish you have a good day ahead of you. Thanks for reading.
The two most significant hazards to the agriculture industry are the need for extensive labor and a scarcity of water. According to the World Wildlife Fund (WWF) organization, water shortages might affect two-thirds of the world's population by 2025, putting both the ecosystem and human health at risk. The use of automatic plant watering systems eliminates both of these problems by watering plants at specified times and amounts while monitoring their hydration levels through measuring moisture in the soil surrounding the plants. Automatic plant watering systems can be used in homemade gardens and can also be deployed in fields for large-scale use. Whenever designing an automatic watering system, it is important to keep in mind that the system should be expandable, allowing for the simple integration of new devices in order to broaden the applicability of the system.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Buzzer | Amazon | Buy Now | |
2 | LEDs | Amazon | Buy Now | |
3 | DS1307 | Amazon | Buy Now | |
4 | LCD 20x4 | Amazon | Buy Now | |
5 | Arduino Uno | Amazon | Buy Now |
Three main components of an autonomous watering system are:
It is necessary to integrate the water level sensor with the microcontroller before it can be installed within the water reservoir. The location of the water level sensor within the reservoir is variable and is determined by the user and the application for which it is being utilized. The Arduino receives continuous data from the water level sensor and warns the user when the water goes below a certain level, either by an alarm or a buzzer, as appropriate.
The soil moisture sensor operates in a manner similar to that of the water level sensor. The tip of the sensor is inserted into the soil near the plant, and the sensor is activated. In the case of a moisture sensor, the closeness of the sensor to the plant is also variable, and the user may adjust it depending on the features of the plant for which it is being used. In vast agricultural fields, a single sensor may be used for numerous plants if they are closely spaced and their hydration levels can be determined by measuring the soil moisture at one location that overlaps with another spot on the soil surface.
The RTC module operates on the same concept of time monitoring in the background as other electronic devices such as computers and smartphones; even when these devices appear to be turned off, they continue to keep track of the current time. The RTC module, on the other hand, is capable of exchanging time information with the Arduino board. On a specific day of the week, at a specific time of day, the Arduino is pre-programmed to turn on the water pump and turn off the water pump after a specified length of time.
Figure # 1: Arduino UNO
Figure # 2: Soil Moisture Sensor
Figure # 3: Water Level Sensor
Figure # 4: RTC Module
Figure # 5: 12V Relay
Figure # 6: PCF 8574
Figure 7 shows the circuit diagram of the system. Proteus was used to simulate the circuit and Arduino App was used for the simulation of the Arduino code. The circuit was designed in a way that is easy to understand and further integrated easily. We will now go through a step-by-step guide on how the circuit was built.
Figure # 7: Proteus Circuit diagram
A normal Arduino code has two main segments:
Figure # 12: Arduino Code
Figure # 13: Arduino Code
Figure # 14: Arduino Code
Figure # 15: Arduino Code
Figure # 16: Arduino Code
Figure # 17: Arduino Code
Figure # 18: Arduino Code
Figure # 19: Arduino Code
Figure # 20: Arduino Code
Figure # 21: Arduino Code
Figure # 22: Arduino Code
Figure # 23: Arduino Code
Figure # 24: Arduino Code
If you see the code closely, you may see the function of the right hour, which is called various times in the main code. The function code in itself is written at the bottom of the main code. This function is used for displaying the time and date on the LCD and also for fixing the date and time.
Figure # 8: Proteus circuit simulation when soil is soggy
Figure # 9: Proteus circuit simulation when soil is moist
Figure # 10: Proteus circuit simulation when soil is dry
Figure # 11: Proteus circuit simulation when soil is dry and it is time to water the plant
As you can see from figure 8 that our simulation is running according to the program set at Arduino. You can increase or decrease the values coming from the sensors through the Potentiometer. So, that was all for today. I hope you have enjoyed today's lecture. If you have any questions, please ask in the comments. Thanks for reading.In this pH Sensor Library, I have added four different pH Sensors, which are used for the detection of the pH of any fluid. Since we can’t place real liquid and measure pH in this software, I have attached a test pin in the pH meter where you have to connect a potentiometer. The potentiometer will produce a reading from 0 to 1023, which will be mapped from 0 to 14 in the program code. We can predict the nature of the liquid. We will have a look at how to use these sensors below. So, here’s the list of all four pH sensors, I have added to this pH sensor library:
So, let’s start with downloading and installing the pH Sensor Library for Proteus.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Resistor | Amazon | Buy Now | |
3 | Arduino Uno | Amazon | Buy Now |
So, that was all for today. I hope you have enjoyed today's lecture. Thanks for reading !!!
Hi Friends! Hope you’re well today. Happy to see you around. In this post today, I’ll walk you through Latest Proteus Libraries for Engineering Students V2.0.
We have been designing proteus libraries for our blog readers for quite a while now. You might have visited our Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0. We keep working on those libraries and make sure the bugs are removed and you always get the updated version of those libraries.
We are going to share the most advanced and upgraded version of Proteus Libraries V2.0 we have designed for our readers. These libraries are more robust, fast, and efficient than previous versions. Moreover, we have converted some digital sensors to analog sensors, helping you pick from a wide range of libraries for your projects. If you think some sensors or modules are missing in the Proteus database that should be included, leave your valuable suggestion in the section below. We’ll try our best to design and simulate those in proteus.
Before further ado, let’s jump right in.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Resistor | Amazon | Buy Now | |
3 | ACS712 | Amazon | Buy Now | |
4 | DHT11 | Amazon | Buy Now | |
5 | DHT22 | Amazon | Buy Now | |
6 | DS18B20 | Amazon | Buy Now | |
7 | Flame Sensors | Amazon | Buy Now | |
8 | Arduino Mega 2560 | Amazon | Buy Now | |
9 | Arduino Nano | Amazon | Buy Now | |
10 | Arduino Uno | Amazon | Buy Now |
We’ll be covering both Arduino Libraries for Proteus V2.0 and Analog Sensors Libraries for Proteus V2.0.
Arduino boards are open-source electronic development boards that you can use in your projects. Arduino Libraries for Proteus V2.0 contain the following Arduino boards.
Arduino UNO is a microcontroller board based on the Atmega328 microcontroller. We have designed Arduino UNO Library for Proteus V2.0 which you can download from the link given below. We’ve previously designed the Proteus Library for the Arduino UNO V1.0 board and the below figure shows the comparison of both V1 and V2 Arduino boards. You can see the V2 board is more compact and small-sized compared to the V1 Arduino UNO board.
In this library, we’ve also interfaced LCD with the Arduino UNO. If you find any difficulty in interfacing the board with the LCD, you can approach me in the section below. I’d love to help you the best way I can.
Download the Arduino UNO Library for Proteus V2.0 by clicking the link below:
Download Arduino UNO Library for Proteus V2.0
Arduino Mega is an electronic board that features an Atmega1280 microcontroller. You can use this board to develop stand-alone electronic projects or you can also incorporate it into embedded projects. Again, the following figure shows a comparison between Arduino Mega 1280 V1 and V2. The V2 board is compact and small-sized compared to the V1 board.
We have developed the Arduino Mega 1280 library for proteus V2.0 which you can download to simulate Arduino Mega 1280 in proteus.
Download the Arduino Mega 1280 Library for Proteus V2.0 by clicking the link below:
Download Arduino Mega 1280 Library for Proteus V2.0
Arduino Mega 2560 is a sophisticated, application-type microcontroller board that features an Atmega2560 microcontroller. This board comes in handy when you require more input and output pins and more memory space to store the code for your electronic project. We have developed Arduino Mega 2560 Library for Proteus V2.0 to help you simulate this board in the proteus. Moreover, we’ve also interfaced LCD with this board so if you have any questions about it, you can ask me in the section below:
]TEPImg6]
Click the link below and download the Arduino Mega 2560 Library for Proteus V2.0.
Download Arduino Mega 2560 Library for Proteus V2.0
Arduino Mini is a small-sized, powerful open-source microcontroller board based on the Atmega328 microcontroller. The board is 1/6th of the size of the Arduino UNO board and can easily rest on hard-to-reach places. We have designed Arduino Mini Library for Proteus V2.0 that you can download to simulate Arduino Mini in Proteus.
Click the link below and download the Arduino Mini Library for Proteus V2.0:
Download Arduino Mini Library for Proteus V2.0
Arduino Pro Mini is a small-sized microcontroller board that includes an Atmega328 microcontroller. The Proteus library V2.0 is designed for Arduino Pro Mini, moreover, we have also interfaced the board with the LCD 20x4.
Click the link below and download the Arduino Pro Mini Library for Proteus V2.0.
Download Arduino Pro Mini Library for Proteus V2.0
Arduino Nano is a powerful and bread-board-friendly microcontroller board based on ATmega328p/Atmega168 microcontroller. We have developed the Arduino Nano Library for Proteus V2.0 which you can download to simulate Arduino Nano in the Proteus workspace.
Click the link below and download the Arduino Nano Library for Proteus V2.0:
Download Arduino Nano Library for Proteus V2.0
Analog Sensors Libraries for Proteus V2.0 contain the following Analog Sensors.
An analog vibration sensor, also known as a piezoelectric, is mainly employed to detect the vibration of industrial machinery. The sensor gets activated if the vibration of the machines goes above the standard value. Vibration sensors are used to monitor the small changes in temperature, acceleration, pressure, and force.
We have done a little work and designed Analog Vibration Sensor Library for Proteus V2.0. Earlier we designed the proteus library for V1 version analog vibration sensors. The V2 version is more robust, compact, and advanced compared to the V1 version. Four vibration sensors are included in the proteus library and they have both digital and analog output pins which you can interface with Arduino boards or microcontrollers.
You can download the analog vibration sensor library for proteus V2.0 by clicking the link below:
Download Vibration Sensor Library for Proteus V2.0
A sound detector sensor is used to detect the sound in the environment. This sensor is only used for sound detection, not for sound recognition.
We have designed the Sound Detector Sensor Library for Proteus V2.0 that you can download to simulate this sensor in proteus. An LC filter is used on the analog output of the sensor since we need to convert the peak to peak voltage into Vrms. Know that you don’t require this LC filter in the real sensor circuit. We have simulated two sound detector sensors in proteus as they have different outputs because of different voltages on the test pin.
Click the link below and download the Sound Detector Sensor Library for Proteus V2.0:
Download Sound Detector Library for Proteus V2.0
An Analog flex sensor, also known as a bend sensor, is a special type of sensor used to detect the value of bend in the application. This sensor is mainly employed indoor sensors, robot whisker sensors, and stuffed animal toys.
We have developed an analog flex sensor library for proteus that you can download to simulate this sensor in Proteus. Know that Test Pin is included in the pinout of this sensor in proteus only, you won’t find this pin in the real sensor. This pin will determine the value of the bend. The HIGH value at this pin will give the value of bend and the LOW value at this pin will indicate there is no bend. We have also interfaced the Arduino board with the sensor where the analog input pin of the board is connected with the voltage appearing across the voltmeter.
Click the link below and download the Analog Flex Sensor Library for Proteus:
Download Flex Sensor Library for Proteus
PIR (Passive Infrared) sensor is a small, inexpensive, low-power sensor used to detect heat energy in the surrounding. The sensor monitors if the human body has come in or out of the sensor’s range.
We have designed Analog PIR Sensor Library for Proteus that you can download to simulate this sensor in Proteus. Moreover, we’ve also developed a simulation of this PIR sensor with an Arduino board. Know that, besides Arduino boards, you can also interface this sensor with PIC or Atmel microcontrollers. We’ve added four PIR sensors file in the proteus that are the same in terms of working but they come in a different color. Again, a test pin is added in the pinout of this sensor in proteus only, you won’t find this pin in real. This pin is added to sense the motion in the proteus workspace.
Click the link below and download the Analog PIR Sensor Library for Proteus:
Download PIR Sensor Library for Proteus
A water sensor is a sensor used to sense the presence of water. The water’s electrical conductivity is measured using this sensor to sense the presence of water. This sensor is widely used in applications where we need to monitor rainfall, water level, and water leakage.
We have designed the water sensor library for proteus which you can download to simulate this sensor in proteus. The Test pin is added to detect the water in the proteus simulation. We’ve also interfaced this sensor with the Arduino board where we have connected the analog input pin of the Arduino board with the output of the water sensor appearing across the voltmeter.
You can download the water sensor library for Proteus by clicking the link below:
Download Water Sensor Library for Proteus
A soil moisture sensor is employed to analyze the water content in the soil. The sensor uses capacitance to monitor the dielectric permittivity of the soil which defines the function of the water content.
We have designed the Soil Moisture Sensor Library for Proteus where we have connected the test pin with the variable resistor. This resistor is used to define the soil moisture content in the proteus simulation. The maximum resistance on the test pin shows zero volts across the voltmeter, referring to the zero moisture value of the water content. The sensor is also interfaced with the Arduino board as shown below.
Click the link below and download the Soil Moisture Sensor Library for Proteus:
Download Soil Moisture Library for Proteus
The IR proximity sensor is used in robots to detect obstacles. This sensor is widely used for path navigation and obstacle avoidance in electronic projects.
We have designed the IR Proximity Sensor Library for Proteus which you can download to simulate this sensor in Proteus. The Test pin is used for hurdle detection. HIGH value on this pin means there is an obstacle in front and LOW value on this pin means there is no hurdle.
LC filter is included in the simulation which you don’t require in real. This filter is used to convert the Peak to Peak value we get on Proteus into the Vrms value.
[TEPImg16]
You can download the IR proximity sensor library for proteus by clicking the link below:
Download IR Proximity Sensor Library for Proteus
That’s all for today. Hope you find this article helpful. If you have any questions, you can approach me in the section below. I’d love to help you the best way I can. Thank you for reading this article.