What is SLS (Selective Laser Sintering) used for?

Hello friends, I hope you all are doing great. In today's tutorial, we will discuss what is Selective Laser Sintering, why is it used for. Selective Laser Sintering is a popular 3D printing technology used to create durable prototypes and end-use parts from CAD files. Its one of the oldest and most popular forms of additive manufacturing techniques and thanks to further technological advances, its use is becoming widespread. In this guide, we will explore what SLS is and what it is used for. 

How does Selective Laser Sintering work?

SLS uses a nylon or polyamide powder which is spread successively in thin layers with a high-powered laser that selectively sinters the powder according to data derived from digital models. This process is repeated layer after layer, binding the powdered material together to produce a final, firm structure. Excess powder is removed manually to reveal the final shape before bead blasting is applied to further remove powder residue. 

What is SLS used for?  

SLS is used for high productivity manufacturing tasks thanks to the laser’s high power and capability to scan quickly and accurately. It is a technology able to produce durable prototypes from a broad range of nylon-based materials, and it is also capable of printing independently moving parts in a single build. SLS is known as the go-to technology for producing complex shapes. It does not require a support structure and utilises unused powder to further add to its strength. In industries where lightweight material is imperative to a successful design (for example, aircraft building and automotive) SLS printed parts are invaluable. 

What kind of products are made with SLS? 

Being able to produce high strength products at a low volume, using different materials, like glass, plastic, metal and ceramics, means SLS printing is used to create many different tailored products. Medical and dentistry products such as prosthetics, hearing and dental aids are made using SLS. SLS is often utilised in industries where high-volume production is not required, for example, end-use parts for aeroplanes where only small quantities are needed on an infrequent basis. Businesses are able to store the digital files needed for SLS printing inexpensively and reproduce designs as and when required, instead of spending money on the expensive storage of moulds used in traditional manufacturing.

Benefits of Selective Laser Sintering 

SLS has an impressive number of benefits. Primarily, it is a technology suitable for high productivity and quick turnaround times of less than 24 hours. The nylon powder used needs only a very brief exposure to the laser for sintering, making the process faster than other technologies. The associated cost of moulds is not required meaning it is ideal for rapid prototyping. Along with these benefits, SLS is a self-supporting technology, affording greater scope for more complex designs. This differs from the more widely adopted FDM (Fused deposition modelling) printing and stereolithography (SLA) which require structure support during printing. Laser adhesion is also stronger with SLS printing and the porous surfaces created to allow for a very effective dyeing process to final shapes and products. 

How does SLS compare to other technologies?

Although SLS has a huge array of advantages there are some limitations to its use, warranting the need for other forms of 3D printing technology. One of its key drawbacks is cost. Compared to FDM and SLA printers which are obtainable for around $500 or less, a desktop SLS printer is a few thousand dollars, thus compromising its appeal for hobbyists. SLS prints are excellent for prototypes but for end-use functional parts, there are some disadvantages because of the porous quality of the final product. Although this porosity lends itself to excellent dyeing and colouring potential, this is not the case for the structural integrity of the final product. In addition, because SLS prints go through a cooling process following sintering, there is the propensity for shrinking and warping leading to the production of inaccurate shapes.  Compared to SLA printing, where liquid resin is used instead of powder, SLS printing can generate more waste. This is because the resin in SLA printing can be reused whereas the quality of reused powder in SLS printing is compromised and needs to be disposed of. Coupled with this, the process of cleaning the powder from the finished product is messy. In an industrial setting, this does not cause a problem as cleaning chambers are often used, however, this necessary procedure can be off-putting for those using a small scale or desktop printers as the powder is difficult to control. 

Conclusion 

SLS is a proven and effective form of 3D printing and has been used in manufacturing for decades. Predominantly used in an industrial setting for rapid prototyping, it is difficult to envisage its use for smaller-scale activities as the inherent expense, poor recyclability of powder and complexity of use have so far formed a barrier for 3D printing novices. 

Automatic Plant Watering System using Arduino

Hello friends, I hope you all are doing great. In today's tutorial, we are going to design a Proteus Simulation for Automatic Plant Watering System using Arduino. We have designed this project for engineering students as it's a common semester project, especially in electrical, electronics and mechatronics engineering.

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.ComponentsDistributorLink To Buy
1BuzzerAmazonBuy Now
2LEDsAmazonBuy Now
3DS1307AmazonBuy Now
4LCD 20x4AmazonBuy Now
5Arduino UnoAmazonBuy Now

Software to Install

We are not designing this project using real components, instead, we are going to design its Proteus simulation. So, first of all, you should Install Proteus Software itself. Proteus software has a big database of electronics components but it doesn't have modules in it. So, we need to install Proteus Libraries of a few components, so that we could simulate them. So, these are the PRoteus libraries which you should install first, before working on this project: You can download this complete project i.e. Proteus Simulation & Arduino Code, by clicking the below button: Download Complete Project Note: You should also have a look at these other Proteus Libraries:

Project Overview:

Three main components of an autonomous watering system are:

  • Water Level Sensor: monitors the water reservoir level.
  • Moisture Sensor: monitors the soil moisture level.
  • RTC module: responsible for supplying water to the plant at predetermined intervals or at a predetermined time.
  • Arduino UNO: serves as a hub for connecting and controlling all these components.

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.

Components Needed:

  1. Arduino UNO
  2. Water Level Sensor
  3. Moisture Sensor
  4. RTC Module (DS1307)
  5. LCD
  6. 4 LEDs
  7. Buzzer
  8. Relay
  9. Water Pump
  10. PCF8574

Component Details:

Arduino UNO:

  • Arduino UNO is a programmable microcontroller board.
  • It contains Atmel's ATMega328 as is based on that microcontroller.
  • The Arduino board also contains an in-built voltage regulator to protect it from burning out and supports serial communication to help programmers.
  • The Arduino board is culturally programmed through the Arduino App designed by the board's developers and the programming is done in C language.
  • The Arduino App compiles code and interfaces the firmware into the Arduino hardware.
  • Arduino UNO has 14 digital I/O pins out of which 6 are PWM pins as well.
  • Arduino also takes analog inputs and has 6 analog input pins.

Figure # 1: Arduino UNO

Soil Moisture Sensor:

  • The soil moisture sensor is a resistive sensor that consists of two electrodes with a small charge and the resistance in those electrodes is measured and then the resistance in between the soil is used to find the moisture levels.
  • A soil moisture sensor normally comes equipped with an amplifier such as LM393. It has a VCC, GND and analog output pin.

Figure # 2: Soil Moisture Sensor

Water Level Sensor:

  • The water level sensor is a module that helps calculate the amount of liquid in a container.
  • When a liquid is present in the tank, the Submersible level sensor detects the hydrostatic pressure generated by the liquid.
  • Since hydrostatic pressure is a measure of two variables, the first of which is the density of the fluid and the second of which is the height of the fluid, it is a useful tool.

Figure # 3: Water Level Sensor

RTC Module:

  • RTC stands for real Time Clock and as the name suggests the module keeps track of time even when the external power supply is cut off.
  • It has a battery cell installed within it for that purpose, moreover, it is capable of communication with other devices such as Arduino too.

Figure # 4: RTC Module

Relay:

  • Relays are basically electrical or electromechanical switches that operate on the principle of magnetic field controlling the switching within the relay.
  • A relay has two modes of operation, normally open and normally closed.

Figure # 5: 12V Relay

PCF8574:

  • The PCF8574 is a silicon-based CMOS integrated circuit.
  • Using the two-line bidirectional bus enables general-purpose remote I/O extension for the majority of microcontroller families (I2C).
  • It is used in our project for I2C communication of LCD.

Figure # 6: PCF 8574

 

Proteus Simulation of Plant Watering System

Now, let's design the Proteus Simulation of Plant Watering System first and then will work on the Arduino Code.
  • First of all, make sure that Proteus is installed on your computer and download all the necessary libraries for Proteus beforehand.
  • For this project, you will need libraries for Arduino, LCD, RTC Module, Water Level Sensor and Soil Moisture Sensor. Make sure that you read how to use each library in Proteus as well.
  • Open a new project on Proteus, import all the components required and place them within the working area or the blue line of Proteus.
  • Select below components from Proteus Components' library:

Circuit Diagram and Working:

  • Now, place these components in your Proteus workspace, as shown in the below figure:
  • For the water level and moisture sensor, place a variable POT(potentiometer) at the test pin and place an RC filter at the output pins. (This is only for simulation purposes)
  • Start with the input side of Arduino and connect the soil moisture, water level output pins to the A1 and A0 pins of Arduino respectively.
  • To use the LCD for I2C communication, Place PCF8574 and connect with LCD.
  • Connect the SDA and SCL pins of PCF8574 and the SDA and SCL pins of the RTC module with the SDA and SCL pins of Arduino.
  • For the output side of Arduino, Connect the D7 to the relay controlling the pump.
  • Connect the buzzer at D2 and the LEDs to their respective Arduino pins as well.
  • Make sure appropriate power and ground are provided to each component. With that the making of the circuit on Proteus is complete.

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

Arduino Code for Plant Watering System

A normal Arduino code has two main segments:

  • void setup
  • void loop
We will look at both of them separately here.

Declaration Code

  • The first step in setting up our code is defining libraries, download if you don’t have any libraries already integrated in the Arduino App.

Figure # 12: Arduino Code

  • The next step in the code is tone definition for buzzer and pin definition of variables being used in the project.

Figure # 13: Arduino Code

  • After pin definition, the variables used must be defined so that Arduino knows where to find them and how to identify them.

Figure # 14: Arduino Code

  • The next step is defining the system messages that will appear on the LCD.
  • It is not necessary to define those messages in the setup, they can be easily defined within the main code but it is an easier way to define those beforehand and call them whenever needed.
  • This is especially useful when a system message is used multiple times in the code.

Figure # 15: Arduino Code

  • Now we define the objects being used in the project.
  • The two objects being defined are the RTC module and LCD. In the syntax below we used 20x0 in the argument for the LCD, that is because there are no libraries for I2C LCDs and we had to turn a simple LCD into an I2C LCD by the means of PCF8574.

Figure # 16: Arduino Code

Void setup:

Now we start the programming of void setup.
  • At first is the initialization of various components, such as initializing the RTC module and setting the time and date of RTC with respect to our computer.
  • Wire initialization and library are used for I2C communication.

Figure # 17: Arduino Code

  • The next step is defining the digital pins of Arduino being used as input or output pins and displaying the initial message on our LCD.

Figure # 18: Arduino Code

 

Void Loop:

  • The first step in the loop is to read the date and time from the computer through the RTC and read the values from the sensor.
  • Since this part of the program runs in the loop, Arduino will keep reading and refreshing the sensor inputs every time the loop starts.

Figure # 19: Arduino Code

  • In the next segment of the code, we will check various conditions of the sensor values and RTC and actuate our outputs on the basis of these conditions.
  • At first, we check the water level of the container, if it is below the set level, Arduino will actuate the buzzer to alarm the user of low tank on LCD.

Figure # 20: Arduino Code

  • In the next step, we check the values of the moisture sensor and place the conditions in three categories, namely, moist soil, soggy soil and dry soil.
  • The Arduino will light up the respective LED whenever its condition is true. Red LED for dry soil, yellow LED for soggy soil and green LED for moist soil.
  • The LCD will also display respective messages for each of those conditions.
  • The following code is for the condition of dry soil.

Figure # 21: Arduino Code

  • The following code is for the condition of moist soil.

Figure # 22: Arduino Code

  • And finally the code for the condition of soggy soil.

Figure # 23: Arduino Code

  • In the next step of the code, we check the condition of time, whether it is time to water the plants or not and the condition of the water reservoir to see its level as well.

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.

Results/Working

  1. Open Arduino and generate a hex file for that program.
  2. Put the hex file in the Arduino UNO board placed in Proteus.
  3. Run the simulation.

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.

Databases and CRUD operations in C#

Are you here to learn about Databases and CRUD operations in the C# programming language? If so, then you will be an expert in no time. Learning Databases and CRUD operations in C# is not a piece of cake. But, if you know all the terms and steps of CRUD operations and databases in C#, it will not be rocket science for you. This article contains all the information you should know regarding databases and CRUD operations. So, keep reading till the end!

C# Programming Language: An Overview 

We know that you are already aware of the C# programming language. So, here is a quick overview of the C# programming language before we move to the actual topic:

C#, also known as C-Sharp, is an object-intended coding language that operates on the .NET Platform and is developed by Microsoft. ISO and ECMA have certified the C# programming language. C# is a broad programming language that can help accomplish hundreds of activities and purposes in different fields. It resembles Java, C++, and other programming languages but, it is truly one of a kind. The best thing is that it is object-oriented and is easy to use. It has an infinite list of advantages.

Some of the advantages of the C# are listed below:

  • C# programming language offers automated garbage pickup.
  • In C# programs, classes may be specified within domains.
  • No obligation to add the “.h” extension within header folders.
  • Because non-Boolean values are not utilized as conditionals, the scripts are less vulnerable to errors.
  • Multithreading is genuinely uncomplicated in C# as compared to other programming languages like C++ or Java.
  • All parameters in the C# are immediately set to their standard settings before being utilized.
  • C# offers reflection skills, which means it can look at and change its composition at execution.
  • With the help of the C# programming languages, many apps and programs have been built like KeePass, Banshee, Paint.NET, FlashDevelop, and many others. In fact, the application where I am writing this article is also an application of the C# programming language (Microsoft Word).

All the above advantages make the C# programming language stand out in other languages. It is undoubtedly the most contemporary and exceptional language out there!

What is a Database In C#?

Before we begin learning about CRUD operations in a database within the C# programming language, it is crucial to know what a Database is.

A database is basically a coordinated set of formatted data kept digitally within a computer network. A database administration tool is generally in charge of a dataset. The DBMS, the dataset, and the programs that interact with these are collectively called a database platform. Every database operation can access a single relational database. It is generated as an inclusion within the data catalog by the data proprietor (usually a database manager with authority for that collection), who gives it a title and a specification. Several databases utilize structured query language (SQL) when generating and accessing data.

What is CRUD?

Here is the most awaited section of the entire article: CRUD operations. Please grab a notebook to note every detail for your better understanding. And if you do not wish to write these, you can always read our article from the website. Let us begin:

The abbreviation CRUD refers to Create, Read, Update, and Delete in software coding. Permanent memory has these four primary functions. Additionally, every letter of the abbreviation may relate to every functionality within a relational network program that is linked to a standard HTTP service, SQL declaration, or DDS action.

It may also apply to consumer-interface standards that let users browse, explore, and alter data using computer-based documentation. Objects are viewed, produced, modified, and removed in this way. Furthermore, CRUD is data-driven, and HTTP operation verbs are regulated.

Standard CRUD Operations In C#

The CRUD feature is present in almost all programs. CRUD is something that every coder has to use at some stage. In the C# programming language, CRUD operations in the database are quite crucial to learn because they are a fundamental component of programming. CRUD is important because of its Create, Read, Update, and Delete features. A brief explanation of these features is listed below:

  • CREATE Operations: Inserts a fresh entry using the INSERT command. This operation is required when we wish to add new data to the database. It basically enables you to add extra rows to your table. When you use the INSERT INTO command, the system will show two possibilities. You can choose the one which is according to your requirement. The two possibilities are:
  • READ Operations: The READ operation retrieves table entries depending on the main key inside the given variable. It works in a similar way to the search feature.
  • UPDATE Operations: Performs an UPDATE assertion on the database depending on the main key provided for an entry in the WHERE statement. You must specify the destination table and attributes to be modified when using UPDATE. The corresponding variables and the rows are also required. Use the code below to make changes to a preexisting record:
  • DELETE Operations: Erases a specific order within the WHERE statement. Certain relational database systems may enable a final delete or a temporary delete, depending on the requirement. The DELETE code is:
  • Here's the table, showing all operations with their description:

Standard CRUD Operations In ASP.NET MVC Utilizing C#

In this section, we will discuss the steps required to operate the standard CRUD operations in ASP.NET MVC within the C# programming language. So, please pay extra attention to this section so that you do not have to face any difficulty while coding.

You must be thinking about the term MVC. Well, MVC abbreviates for Model View Controller. It is actually a development paradigm that isolates the business strategy from the display strategy and information. In a nutshell, it is a framework for designing online applications. According to MVC, the program can be divided into three layers:

  1. Model Layer: The Model element relates to everyone's data-associated reasoning. It will reflect the content being transmitted among the Display and Controlling portions, as well as any additional business logic-associated data. A Client class, for example, will receive client details from a server, change them, or utilize the content.
  2. View Layer: The View element is used for the UI functionality of the device. For example, the Client view will have all of the UI elements that the final user encounters, like input forms, dropdowns, and others.
  3. Controller: Controllers serve as a link among the Framework and View elements to execute all administrative functions and incoming applications, manipulating information with the Framework element, and interacting with Viewpoints to display the final result. For example, the Client manager would manage all activities and entries from the Client Page and use the Client Model to refresh the database.

Now that you know about the MVC, we can begin the discussion of the steps of CRUD operations in C#:

  • Construct A Database Using The Columns Listed Below: It is merely a demonstration to ensure that you comprehend the script. You may construct your custom database based on your requirements. You can also understand it better by the illustrations in each step like the one below:
  • New Project: Build a new project in Visual Basic.
  • Create a Fresh Record: Next, within the freshly formed controller, enter the following script to generate a fresh record within your dataset.

Afterward, select the initial activity outcome and select AddView. Choose to Generate as your theme, model type as your developed model, and info context category as your EDMX developed prototype. After that, execute the project.

  • Read: Next, to view the latest values on your display, use the code provided below.

Then, insert the View. However, make sure the style is set to List. After that, launch the project.

  • Update: Now, use the following code to modify the present record.

Next, insert a view in the same way you did before, but ensure to set the theme to Edit. After that, launch the project.

  • Delete: To erase an entry from the system, use the following code.

Now, just set the theme to Delete and execute the program.

Please remember that you can always change the HTML according to your needs. We hope that you understood how CRUD operations work in databases of the C# programming language.

CRUD Operations in C# Connecting SQL Database

We want our readers to have crystal clear concepts regarding CRUD operations in the C#. That is why we also included this brief section of CRUD operations in C# connecting the SQL Database. Let us begin:

  • Add DLL: First, you must include Dynamic Link Library (DLL).
  • Namespace: To link to a SQL system, you can utilize the System.Data.SqlClient; namespace.
  • Declaration: Next, you should specify the relationship string beyond the class.
  • Insert the Data: Enter data into the system as shown below:
  • Update: Afterwards, you have to update the record like the code mentioned below:
  • Display: Then, display the information like the code below:
  • Delete: Then, follow the code below to erase the record.
  • Use Clear Technique: Lastly, utilize the Clearing technique to remove all the text fields, as shown below:

Please remember these steps. If you mess up in one step, your program will not execute the right way. So, it would be great for you if you note the steps down!

Benefits Of Using CRUD Operations

Now that you know about the launch of CRUD operations in databases within the C# programming language, it is time to know the benefits of using CRUD operations. You must have this question that why do programmers prefer CRUD? In simple words, developers use CRUD because of its exceptional productivity. Additionally, performing CRUD operations protects against SQL manipulation attacks. Because all SQL Entries utilize saved methods rather than string synthesis to generate flexible queries from client input info, everything entered into a variable is quoted.

It would not be wrong to say that CRUD is just too crucial to be overlooked. Mastering it initially can help you feel more confident when working with unknown stacks. CRUD Operations help in our daily desktop tasks. Some of these are:

  • Signing up for a webpage
  • Saving a hyperlink in your account
  • Modifying configurations
  • Deleting a Facebook status

These are just some of them. CRUD is a part of everyone’s life whether one is a programmer or not.

CRUD Restricts Casual Surfing and Changes

Program permissions are a SQL Administration feature that allows code to alter credentials without requiring the person's permission. Individuals should have the necessary rights on the relational records to execute ad hoc SQL queries. Clients can view and change data in apps like Microsoft Excel, PowerPoint, and others after authorization is allowed. Customers can even ignore the app's corporate rules.

However, it is an undesirable scenario that may be avoided by using the Application Authority. Such kind of flaws can be prevented by combining database access protection with an Application License. Because Application licenses are uploaded to the system via a recorded method, CRUD is required. It can also be done by providing authorization to run the CRUD saved methods and removing immediate table entry.

After an Application Account is established, authorization and passcode are granted. The passcode is also hard to change because it is programmed into the program. CRUD is indeed the procedure to utilize while modifying data. Thus, the world of programming would be incomplete without CRUD Operations.

Summing Up

In this article, we discussed the CRUD operations in databases within the C# programming language. We also discussed Standard CRUD Operations In ASP.NET MVC as well as in Connecting SQL Databases Utilizing C#, with some benefits of using CRUD. These might seem complicated to you. Once you become an expert, all the CRUD operations in the C# will not be rocket science for you. Just make sure to follow all the steps correctly to avoid any mistakes.

Happy Programming Precious Readers!

ESP32 Programming Series: Install ESP32 in Arduino IDE

Hello everyone, I hope you're all doing well. In the previous lecture(Chapter 0: ESP32 Pinout), we discussed the ESP32 features & specs in detail. Today, we are officially starting this ESP32 Programming Series. In this ESP32 Programming Series, we will start with basic concepts and will gradually move towards complex topics. I will try to keep this ESP32 series as simple as I can. But still, if you encounter any issues, please ask in the comments, will try to resolve the issues as soon as possible.

As ESP32 has numerous features & applications, so I have divided this series into different sections. I have named the 1st section "ESP32 IDEs". In this section, we will discuss different IDEs used to program ESP32 boards. In each Chapter of this section, we will install one of these ESP32 IDEs and will test a simple LED Blinking Code in it. We will set up the ESP32 Development Environment for Windows, Mac, and Linux users.

As I am sharing the 1st Chapter today, so first we will unbox the ESP32 board, set up the most commonly used ESP32 IDE i.e. Arduino IDE, and test a simple WiFi Scan Code on the ESP32.

Here's a video lecture for better understanding:

Where To Buy?
No.ComponentsDistributorLink To Buy
1ESP32AmazonBuy Now

ESP32 IDEs

IDE is an abbreviation of Integrated Development Environment. IDE is a software package used to write & compile the code. As ESP32 is one of the most popular microcontroller boards, there are numerous third-party IDEs available to program it, and each IDE supports its own programming language. So, if you are a C# developer or an Arduino expert, you can quickly and easily get your hands dirty with ESP32. The below table shows the most commonly used ESP32 IDEs along with their supported programming language:

ESP32 IDEs
No.
ESP32 IDEs
Programming Language
1
Arduino IDE
Arduino C
2
Thonny IDE
MicroPython
3
Visual Studio Code
Arduino C
4
PlatformIO IDE
C++
5
ESP-IDF(official IDE by EspressIF)
C
6
nanoFramework
C#

In today's lecture, we will install the Arduino IDE and configure it for ESP32 Programming. So, let's get started:

Install ESP32 in Arduino IDE

First of all, we need to install the Arduino IDE itself. To program ESP32 with Arduino IDE, we need to install the ESP32 Boards in Arduino IDE. Before installing the ESP32 Boards, we first need to add a JSON File containing information about ESP32 Boards. JSON format is used to share information between two computers. So, this JSON file will add the information of ESP32 boards in the Arduino IDE. So, let me summarize these 3 steps in proper order:

  1. Installing Arduino IDE
  2. Adding ESP32 JSON File
  3. Installing ESP32 Boards
  4. Installing COM Port Driver for ESP32(if COM Port not detected automatically)

Installing Arduino IDE

We need to first download & install the Arduino IDE.

After installing the Arduino IDE, we need to add the ESP32 JSON File in it. So, follow the below steps:

Adding ESP32 JSON File in Arduino IDE

Steps to install ESP32 JSON File in Arduino IDE:

  • In the Arduino Preferences Window, you will find a textbox named "Additional boards Manager URL".
  • Add the ESP32 JSON File link(provided above) in it, as shown in the below figure:

  • If you have already added any third-party board URLs, then add a comma (,) between the JSON links OR click on the button and it will open up a new window, add URL in the new row, as shown below:

  • Click "OK" to close the Preference Window.
  • Once you close the Preference Window, Arduino IDE will extract the information of all ESP32 boards by downloading the ESP32 JSON file.

Now, we are ready to install the ESP32 Boards in Arduino IDE:

Installing ESP32 Boards in Arduino IDE

  • In the Arduino IDE, click on "Tools > Board > Board Manager", as shown in the below figure:

  • It will open up a Board Manager Window in Arduino IDE.
  • From this Board Manager, we can install the packages for third-party modules.
  • In the Board Manager, make a search for "ESP32" and you will get many third-party ESP32 packages.
  • Here, we need to install the "ESP32 by Espressif Systems" as it's the official package, I have highlighted it in the below image:

  • So, click on the Install button to install ESP32 boards in Arduino IDE.
  • Arduino IDE will take some time to install the ESP32 package.

  • Once installed, click on "Tools > Boards > esp32" and you will find a list of newly added ESP32 boards, as shown in the below figure:

  • From this list, we will select "ESP32 DEV KIT V1", it's the most commonly used ESP32 board.

  • In the COM Port, select the available COM Port, in our case, it's COM5:

In some cases, the Arduino IDE won't automatically detect the ESP32 COM Port, so here we need to install the COM Port driver for ESP32. Let's do it:

Installing ESP32 COM Port in Arduino IDE

If you don't find the ESP32 COM Port in the Port Section of Arduino IDE, then you need to install the COM Port Driver manually. So, follow the below steps:

  • Download the Windows COM Port Driver by clicking the below button and install it on your computer:

CP210x_Windows_Drivers

  • If you are using 32-bit Windows, then install the x86 version and if working on 64-bit Windows, then install the x64 version.

After installing this COM Port Driver, restart your Arduino IDE and it's recommended to restart your computer as well.

So, we have successfully installed the ESP32 Boards in the Arduino IDE. Now, let's upload a simple LED Blinking Code in the ESP32:

Code Upload to ESP32 from Arduino IDE

Now that the Arduino IDE is ready to handle the ESP32 Dev Kit module, you can write the code for the ESP32 module. We will just upload a simple WiFi Scan Code to verify that our ESP32 installation is correct.

  • Open Arduino IDE and navigate to "File > Examples > WiFi > WiFiScan".

  • Click on the Tools and verify that you have selected the correct ESP32 board and the COM Port.
  • Now, click the "Upload " button to upload the code to the ESP32 board.
  • If the code is uploaded successfully in the ESP32 board, you will get the confirmation message in the Output pane, as shown in the below figure:

Now open the Serial Terminal and you will start receiving the List of all available WiFi connections, as shown in the below figure:

That concludes today's discussion. We hope you found this post informative. In the next tutorial, we will install the ESP32 Boards in the Visual Studio Code. If you have any questions, please ask in the comments. Take care. Have a good day.

I2C communication with STM32

Hello friends, I hope you all are doing great. In today's lecture, we will have a look at the I2C Communication with STM32 Microcontroller board. I am going to use the Nucleo board for today's lecture. In the previous lecture, we have discussed STM32 Serial communication both in Interrupt Mode and polling Mode. Today, we will study another way of communication(i.e. I2C) with STM32. So, let's first have a look at what is I2C Communication:

Where To Buy?
No.ComponentsDistributorLink To Buy
1STM32 NucleoAmazonBuy Now

What is I2C Communication?

I²C (Inter-Integrated Circuit) is a two-wire serial communication system used between integrated circuits. Like any serial protocol, one of its advantages is that of using only two lines that transmit or receive a sequence of bits, the limit is the communication speed which has been improved over the years.

The bus was conceived and developed by Philips (now NXP) It was designed to overcome the difficulties inherent in the use of parallel buses for communication between a control unit and various peripherals.

Serial transmission is a mode of communication between digital devices in which bits are sent one at a time and sequentially to the receiver in the same order in which they were transmitted by the sender. Although the communication modules are more complex than the parallel transmission, the serial mode is one of the most widespread especially in communications between chips that must communicate with each other over great distances, because:

  • it requires fewer wires and pins available on the integrated circuit with a consequent reduction in costs and space on the board;
  • is more tolerant of interference and transmission errors;
  • up to 128 devices can be connected to each other

I2C Pinout

  • SDA (Serial Data) is the line where master and slave send or receive the information (sequence of bit);
  • SCL (Serial Clock)  is the line dedicated to the clock to synchronize the data flow.

SDA and SCL lines need to be pulled up with resistors. The value of these resistors depends on the bus length ( ie the bus capacitance) and the transmission speed. The common value is 4.7kO. In any case, there are many guides to size them and we refer their reading to the more attentive reader.

The transmission mode is Half-duplex ie the transmission between devices is alternated.

As shown by the previous image, we can use this communication to put in communication different peripherals as Analog-Digital Converters (ADCs), Digital-Analog Converters (DACs), EEPROM memories, sensors, LCD screen, RF module, Real-Time Clock, etc.

I2C Communication in STM32

The Nucleo boards provide one or more I2C interfaces that can be quickly configured with STCube Tool.

There are four modes of operation:

  1. Slave Transmitter
  2. Slave Receiver
  3. Master Transmitter
  4. Master Receiver

The first two are used to operate in slave mode, while the last two are in master mode. By default, the interface is configurated in slave mode.

By default, the I2C interface operates in Slave mode, but it is possible to switch to Master mode to send a Start condition message. Furthermore, it needs to write in I2C_CR2 register the correct clock configuration to generate the expected timings.  The Master sends a Stop condition when the last data byte is transferred, and the interface generates an interrupt.

I2C Packet Message

In general, the packet message is as follow:

  • Start condition: the master pulls SDA low and SCL is High to inform slave devices that a transmission is ready to start.
  • Address frame: the master sends the address of the slave, each device has an address of 7-10bit, then sends the Read (R) or Write (W) bit, which are respectively 1 and 0. Finally, the master waits that the slave sends the Acknowledge bit (ACK).
  • Data frame(s): Send (master) / Receive (slave) Data Byte (DATA) and then Waiting (master) / sending (slave) the Acknowledge bit (ACK)
  • Stop condition: the master sends the stop conditions pull SDA to High defined by a low while SCL remains high.

I2C Modes in STM32

Furthermore, there are three ways to exchange data, named:

  1. Polling Mode
  2. Interrupt Mode

STM32 I2C Polling Mode

  • In polling mode, also called blocking mode, the application waits for the data transmission and reception.
  • This is a simple way to communicate between devices when the bit rate is not very low, for example when we can debug the board and we want to display the result on screen console.

HAL library provides the following functions to transmit and receive in polling mode:

I2C Master Reciever

  • The function to receive data in master mode is as follows:
HAL_I2C_Master_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
The parameters are:
  • hi2c is a pointer to an I2C_HandleTypeDef structure that contains the configuration information for the specified I2C.
  • DevAddress is device address: The device 7 bits address value in the datasheet must be shifted to the left before calling the interface.
  • pData is a pointer to data buffer.
  • Size is the amount of data to be sent.
  • Timeout is the timeout duration.

I2C Master Transmitter

  • Master transmits in master mode an amount of data in blocking mode.
HAL_I2C_Master_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)

I2C Slave Reciever

  • The function to receive data in slave mode is as follows:
HAL_I2C_Slave_Receive(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)

I2C Slave Transmitter

  • The function to transmit data in slave mode is as follows:
HAL_I2C_Slave_Transmit(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)

I2C Memory Read

  • Master reads an amount of data in blocking mode from a specific memory address.
HAL_I2C_Mem_Read(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)
The additional parameters are:
  • MemAddress is the internal device address.
  • MemAddSize is the size of the internal device address.

I2C Memory Write

  • Master reads an amount of data in blocking mode from a specific memory address.
HAL_I2C_Mem_Write(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size, uint32_t Timeout)

STM32 I2C Interrupt Mode

  • In interrupt mode, also called non-blocking mode, in this way the application waits for the end of transmission or reception.
  • It is used when the transmission is not used continuously with respect to the activity of the microcontroller.
HAL library provides the following functions to transmit and receive in interrupt mode:
HAL_I2C_Master_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Master receives in master mode an amount of data in non-blocking mode with interrupt.
HAL_I2C_Master_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Master transmits in master mode an amount of data in non-blocking mode with interrupt.
HAL_I2C_Slave_Receive_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Slave receives in master mode an amount of data in non-blocking mode with interrupt.
HAL_I2C_Slave_Transmit_IT(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Slave transmits in master mode an amount of data in non-blocking mode with interrupt.

STM32 I2C DMA Mode

  • DMA mode is the best way the exchange data, especially when we want to exchange data quickly and continuously that often require access to memory.
HAL library provides the following functions to transmit and receive in DMA mode:
HAL_I2C_Master_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Master receives in master mode an amount of data in non-blocking mode with DMA.
HAL_I2C_Master_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Master transmits in master mode an amount of data in non-blocking mode with DMA.
HAL_I2C_Slave_Receive_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Slave receives in master mode an amount of data in non-blocking mode with DMA.
HAL_I2C_Slave_Transmit_DMA(I2C_HandleTypeDef *hi2c, uint16_t DevAddress, uint8_t *pData, uint16_t Size)
Slave transmits in master mode an amount of data in non-blocking mode with DMA. In the STCube tool, the I2C can be configurated fastly and easily as follow.

In Pinout & Configuration, widow selects Connectivity and selects one of the available I2C (I2C1, I2C2, etc). In parameter settings, the master and slave features can be set. Master features are I2C speed mode (standard mode by default and fast mode) and the I2C clock speed (Hz). In standard mode, the device can send up to 400kbit/s while in fast mode up to 1Mbit/s. In general, like clock speed, the STM32 supports 100kHz, 400kHz and sometimes 1MHz.

The main feature of slaves is the primary address length that in general, as previously said, is 7-Bit. Furthermore, the slave can have a secondary address.

Then need to configure the GPIO, as follow:

Now the I2C configuration is terminated and can be possible to generate the code initialization and finally be ready to write our application.

Solenoid Valve: How They Work

In several domestic, commercial, or industrial settings where gases or liquids have to be distributed or mixed, solenoid valves are used to ensure the accuracy and precision of all the control aspects. To help you understand the types and working principles of solenoid valves, selection criteria, and everything in between, we’ve covered all you need to know about these electrically controlled valves. You should also have a look at the Linear Solenoid.

What are Solenoid Valves and How Do They Work?

Solenoid valves are electromechanical devices that feature two major components: a valve body (G) and a solenoid (Figure 1). The solenoid is an electric coil (A) with a movable magnetic core that’s centrally located, also called a plunger (E). It’s also made up of an armature (B), a shading ring (C), a spring (D), and a seal (F).

For a normally closed valve in the resting position, the plunger closes a small hole or orifice that allows the fluid to flow. As soon as the electric current passes through the coil, it’s energized, and an electromagnetic field forms and exerts a force on the plunger, opening the orifice.

That said, it’s worth noting that solenoid valves are only used to control clean liquid and gases. This is because dirt can easily block the orifice, causing performance issues.

Types of Solenoid Valves

Before we look at the working principles of solenoids, we’ll first look at the two popular solenoid valve configurations. These are the normally closed (NC) and the normally open (NO) solenoid valves.

For NC solenoid valves, it is closed when the coil is de-energized, i.e., when there’s no electric current flowing through it. This means that the orifice is closed, and no medium can flow through it. Once the solenoid is powered, the current flows through the coil and energizes it. This creates an electromagnetic field with a resultant force that pushes the plunger upwards to overcome the resistive spring force. This opens up the orifice and allows the fluid media to flow through the valve. NC valves are good for fail-safe applications that need the media to stop flowing if power is lost.

With NO solenoid valves, the valve is always open when the coil is de-energized. Once an electric current passes through the coil, an electromagnetic field is created, and the resultant force pushes the plunger to the downward position to overcome the resistive spring force. Here, the seal will be seated right on the orifice, closing it and preventing any fluid from flowing via the valve. Often, a NO solenoid is best used for applications, which require the solenoid valve to be on or open for a longer period since it becomes more energy and cost-efficient.

Besides the normally closed and normally open solenoids, there’s also another type called the latching or bi-stable solenoid valve. Unlike the previous two, this type is switched on and off using an instantaneous or momentary power source. The solenoid will stay in its recent/current position provided there’s no power supplied. This is accomplished by replacing a spring with permanent magnets.

Working Principles of Solenoid Valves 

There are three main ways in which solenoids work. These are:

Direct-acting

A direct-acting solenoid can either be NO or NC, and its mode of operation is simple. The maximum flow rate and operating pressure are directly proportional to the hole size (diameter) and the solenoid valve’s magnetic force. With this operating principle, the solenoid doesn’t require a minimum pressure or any pressure difference. Direct-acting solenoids are therefore used for small flow rates.

Indirect-acting, Pilot-operated or Servo

Solenoid valves in this category use the pressure difference of the medium to assist in the opening and closing of the valve. The typical minimum pressure required for the valve to operate is nearly 0.5 bar.

In between the outlet and inlet ports is a rubber layer called a diaphragm, which has an orifice through which the fluid medium can easily flow.

Above the membrane is a pressure chamber that serves as an amplifier. This chamber allows a smaller solenoid valve to control a larger flow rate. They are used in industrial or domestic applications that require a higher flow rate and enough pressure differential.

Semi-direct Acting 

With this type of solenoid valve, you enjoy the benefits of both direct-acting and indirect-acting valve operations. Semi-direct acting solenoids operate at zero bar for low flow rate applications and also at pressure differential for high flow rate applications.

Solenoid valves with this working principle have a construction similar to the indirect operating valves except that it has two holes on either side of the membrane, and the plunger is connected directly to the rubber layer. That way, when the electromagnetic force pushes the plunger, the membrane is lifted, opening the valve.

Simultaneously, the second hole is opened if the plunger has a larger diameter compared to the first hole in the rubber membrane. The result is that the pressure inside the chamber above the rubber layer will drop. Hence the membrane isn’t lifted just by the solenoid plunger but also the differential pressure.

Solenoid Valve Use Cases and Approvals  

Solenoids are used in industrial, commercial, and domestic applications to close, open, mix or divert fluid medium. Common domestic applications of solenoids include irrigation systems with automatic control and refrigeration systems to control refrigerants.

Other domestic use cases include air conditioning systems to control air pressure, washing machines and dishwashers to control water flow, and water tanks to control the inflow/outflow of water. In commercial settings, solenoid valves find applications in car washes to control soap and water flow.

And since solenoid valves find different applications in various industries, they must have certain approvals to ensure they conform to industry standards and regulations. Some of the common approvals include:

 
  • UL/UR – this is the popular Underwriters Laboratory certification focused on the safety of the solenoid valves.
  • Drinking water – there are several approvals that solenoid valves must meet to control water flow used for drinking purposes. Common approvals include the FDA, Kiwa (i.e., a drinking-water approval in the Dutch market), and KTW, which approves plastic and non-metallic consumer materials in Germany.
  • CE certification – shows conformity with environmental protection and health requirements for consumer products within the EU economic region.
  • ATEX certification – this is an approval for explosion protection.
  • IP rating – determines the valve’s protection against dust and water.

Choosing a Solenoid Valve

Now that you know what a solenoid valve is, the types, working principles, use cases, and approvals, what follows is to choose the right type for the right applications. When choosing solenoids, you always want to pay attention to the specific applications and the environment in which they will be installed. From here, you can pay attention to the housing material, the seal material, and the degree of protection as far as temperature and pressure considerations are concerned. Other factors to consider are the operation type, valve function, i.e., whether NO or NC, the voltage type (DC or AC), and the solenoid’s response time.

STM32 Serial Communication in Polling Mode

USART is the acronym for Universal Synchronous-Asynchronous Receiver-Transmitter, and is the advancement of the old UART that was unable to handle synchronous communications; in computers, it deals with the management of communication via the RS-232 interface.

Generally, in the communication between devices, there is a transmitter and receiver that can exchange data bidirectionally, thus it happens for example in the communication between the microcontroller and third-party peripherals.

Where To Buy?
No.ComponentsDistributorLink To Buy
1STM32 NucleoAmazonBuy Now

What is Serial Communication?

In serial communications, the transmitting device sends information (bitstream) through a single channel one bit at a time. Serial communications are distinguished from parallel communications where the bitstream is sent over several dedicated lines altogether. Over the years, serial communication has become the most used as it is more robust and economical. On the other hand, serial communication requires, compared to the parallel case, a more complex management and control architecture, think for example how a trivial loss of a bit during a communication could irreparably corrupt the content of the final message. To this end, various communication protocols have been introduced over the years in order to improve speed, reliability and synchronization. In detail, three different communication modes can be found: synchronous, asynchronous, and isochronous.

Synchronous Mode

  • In synchronous communication, the transmitter sends the data one bit at a time at a certain frequency (constant frequency), so you have the channel on which the data travels and another on which a clock signal travels. Thanks to the clock signal, the receiving device (receiver) knows when one bit ends and another start, or rather a bit starts and ends on a rising or falling edge of the clock signal.

Asynchronous Mode

  • In asynchronous communication, there is no channel dedicated to the clock signal so there is no type of synchronization between receiver and transmitter.
  • When the transmitter is ready it starts to send the bits serially which are read directly by the receiver.
  • The sent packet always contains a start bit, which signals the start of transmission to the receiver, the start of transmission.
  • Generally, the sent packet is made up of 8 bits plus any parity bit which has the purpose of verifying the correctness of the data transmitted and of the stop bits that signal the end of the packet to the receiver.
  • In the case of sending a large flow of data, this type of communication is less efficient than synchronous as bits that do not contain information such as start and stop bits are sent several times.

Isochronous Mode

  • Isochronous mode is a hybrid mode, that is obtained by making a synchronous device communicate with an asynchronous one, this can only happen under certain conditions.

UART communication on STM32 Microcontrollers using HAL

The microcontrollers from the ST family are equipped with at least one USART, for example, the NUCLEO-L053R8 Board has two (USART1 and USART2). It is possible to configure the dedicated pins easily directly from the STCUBE tool, as we will see in the example, and the dedicated HAL libraries allow you to easily write functions and algorithms to transmit or receive data. There are three ways to exchange data via serial port in STM32, which are:
  1. Polling Mode
  2. Interrupt Mode
  3. DMA Mode
Let's discuss these serial communication modes of STM32 in detail:

Polling Mode

  • In polling mode, also called blocking mode, the application waits for the data transmission and reception. This is a simple way to communicate between devices when the bit rate is not very low, for example when we can debug the board and we want to display the result on screen console.
HAL library provides the following functions to transmit and receive in polling mode:
  • HAL_UART_Transmit(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);
  • HAL_UART_Receive(UART_HandleTypeDef *huart, uint8_t *pData,uint16_t Size, uint32_t Timeout).

Interrupt Mode

  • In interrupt mode, also called non-blocking mode, in this way the application waits the end of transmission or reception. it is used when the transmission is not used continuously with respect to the activity of the microcontroller.
HAL library provides the following functions to transmit and receive in polling mode:
  • HAL_UART_Transmit_IT(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);
  • HAL_UART_Receive_IT(UART_HandleTypeDef *huart, uint8_t *pData,uint16_t Size, uint32_t Timeout).

DMA Mode

  • DMA mode is the best way the exchange data, especially when we want to exchange data fastly and continuously that often require access to memory.
HAL library provides the following functions to transmit and receive in polling mode:
  • HAL_UART_Transmit_DMA(UART_HandleTypeDef *huart, uint8_t *pData, uint16_t Size, uint32_t Timeout);
  • HAL_UART_Receive_DMA(UART_HandleTypeDef *huart, uint8_t *pData,uint16_t Size, uint32_t Timeout).
In the next example, we will see the polling mode communication using NUCLEO-L053R8.

Using USART in Polling Mode for STM32

In this example, we will write a project using USART in a polling mode to transmit text on the laptop monitor. To do that we need:
  • NUCLEO-L053R8 board.
  • Windows Laptop
  •  The ST-Link USB connector needs both for serial data communications, and firmware downloading and debugging on the MCU.
  •  A Type-A to mini-B USB cable must be connected between the board and the computer.
The USART2 peripheral is configurated to use PA2 and PA3 pins, which are wired to the ST-Link connector. In addition, USART2 is selected to communicate with the PC via the ST-Link Virtual COM Port. A serial communication client, such as Tera Term, needs to be installed on the PC to display the messages received from the board over the virtual communication Port.

Creating New Project in STM32CubeMX

Now we create a new STM32CubeMX project with the following steps:
  • Select File > New project from the main menu bar. This opens the New Project window.
  • Go to the Board selector tab and filter on STM32L0 Series.
  • Select NUCLEO-L053R8 and click OK to load the board within the STM32CubeMX user interface.
  • Then the tool will open the pinout view.
  • Select Debug Serial Wire under SYS, for do it click on System Core (on the top right) and then select SYS and finally flag on “Debug Serial Wire”.
  • Select Internal Clock as clock source under TIM2 peripheral. To do this click on Timers and then select TIM2. Now go to clock source and select through the drop-down menu “internal clock”.
  • Select the Asynchronous mode for the USART2 peripheral. Click on connectivity and select USART2. Now go to Mode and select through the drop-down menu “asynchronous”.
  • Check that the signals are properly assigned on pins :
    • SYS_SWDIO on PA13
    • TCK on PA14
    • USART_TX on PA2
    • USART_RX on PA3
  • Go to the Clock Configuration tab and no change the configuration in order to use the MSI as input clock and an HCLK of 2.097 MHz.
  • Come back to Pinout&Configuration and select Connectivity -> USART2 to open the peripheral Parameter Settings window and set the baud rate to 9600. Make sure the Data direction is set to “Receive and Transmit”.
  • Select Timers -> TIM2 and change the prescaler to 16000 and the Counter Period to 1000.
  • Go to NVIC Settings tab and flag TIM2 global interrupt to enable the interrupt related to TIM2.
  • In the Project Manager tab, configure the code to be generated and click OK to generate the code.
  • Our project has been initialized by STCubeMX. In  /UsartEx/Core/Src/main.c we will find our main where we will write the main body of our program.

Understanding STM32 Code for Serial Communication

Now let’s see what the code generator did:
  • First of all, we find the “Include” section we can add the library needed.
  • In our case, we can add also a string.h library to handle and send text data.
  • In “Private variables” has been defined two private variables htim2 and huart2; - htim2 as the first parameter an instance of the C struct TIM_HandleTypeDef; -huart2 as first parameter an instance of the C struct UART_HandleTypeDef.
/* Private variables ---------------------------*/ TIM_HandleTypeDef htim2; UART_HandleTypeDef huart2;
 
  • In “Private function prototypes” we find the prototype of function to initialize the System Clock, GPIO, timer and peripheral:
/* Private function prototypes -----------------------------------------------*/ void SystemClock_Config(void); static void MX_GPIO_Init(void); static void MX_TIM2_Init(void); static void MX_USART2_UART_Init(void);
  • This function has been generated automatically by STCubeMx with the parameter selected as shown below:
  • It is important to highlight that the WordLength parameter of huart2 is UART_WORDLENGTH_8B, since we are sending 8-Bit ASCII chars.
  • We can easily adjust the baud rate with the BaudRate parameter.
  • Now we are ready to write our code in main():
  • As shown in the code below, two strings, str1 and str2, are declared. Then the string concatenation function ( strncat() ) is used and finally, the HAL_UART_Transmit function is used to display them on the monitor through UART2.
Now we are ready to compile and run the project:
  1. Compile the project within IDE.
  2. Download it to the board.
  3. Run the program.
In order to show the text on display needs to Configure serial communication clients on the PC such as Tera Term software, CoolTerm, Putty etc. In our example, we will use CoolTerm, but not change the aim if you will use another one.
  • On the computer, check the virtual communication port used by ST Microelectronics from the Device Manager window.
  • To configure Tera Term to listen to the relevant virtual communication port, adjust the parameters to match the USART2 parameter configuration on the MCU.
You must be careful to configure the correct com port and use the same setting which has set the USART2. After that we click on connect and run the program.
  • The CoolTerm window displays a message coming from the board at a period of a few seconds.
So, that was all for today. I hope you have enjoyed today's lecture. In the next tutorial, we will discuss Serial Communication using Interrupt Method. Till then take care and have fun !!!

Introduction to Ladder Logic Programming Series

Hello friends, I hope you all are fine. Today, we are starting a new tutorials series on Ladder Logic Programming, used in PLC. It's our first tutorial in this series, so we are going to have a look at the detailed introduction to PLC and ladder logic. After welcoming every one of engineers, technicians, students, and hobbyists who have come to read this article willing to learn PLC programming, I would like to introduce one of the most used programming languages of PLC. The language we introduce here is a visualized language that connects and combines graphical symbols in logical flow same as the way we wire electrical circuits and that is the secret behind its simplicity not only in implementation but also in diagnosing problems.

Ladder Logic Programming has been derived from relay logic electrical circuits. This language of PLC programming is called ladder logic or LD as it looks like a ladder of many rungs. Each rung represents a line of logic by connecting inputs logically to form a condition on which the output is determined to be on or off. By completing this article, you will have enjoyed understanding the basics of the LD programming language. Consequently, you will have been able to read a ladder logic code and translate the logic in your mind or the electrical circuit between your hand into ladder rungs.

Relay Logic Control vs PLC

Relay logic control was the old fashion classic control in which input switches and sensors are connected between the hot voltage and relays’ coils to energize these coils and in turn, activate their contacts and thereby connect or disconnect the actuators i.e., motors, lamps, valves etc. You cannot imagine how complicated that control was besides its limitation in functionalities. In addition, it has a huge number of wires and components to achieve a simple logic. Furthermore, there are no chances to change the logic or the sequence of operation without destroying, rebuilding, and rewiring everything from scratch. When it comes to troubleshooting and maintenance, you should be very patient and generous for your time and efforts to pay to keep tracking hundreds of wires and checking up a bunch of components to figure out the problem.

To image the difference between old fashion classic control and PLC, figure 1 shows the case of a very simple process that contains four motors, and four sensors that are connected via four relays and a timer for performing a very simple logic. Let’s say we need to run motor 1 at the start and after a while, we plan to run motor 2 and 4, and at last run motor 3 considering one constraint that no more than two motors can run simultaneously. In addition, sensors will be used as protection to emergency stop motors at any time. Now on the left of the figure, you can see the relay logic control. you can imagine how many components and punch of wiring work for connecting sensors, timers, relays, and motors. On the other hand, PLC-based control shown on the right, you can notice only the PLC and input devices and output actuators are connected to the PLC. To sum up, the number of wires is reduced significantly, the effort of wiring is immensely reduced. In addition, when it comes to modification of logic or process sequence you need to destroy all old wiring and start over rewiring according to the new requirements while you can do this by modifying the program in PLC without touching the wiring. To sum up, PLC reduced the number of components, wires, time of implementation. In addition, the processing is faster thanks to PLC processing and modification becomes programmatically.

How PLC works?

Before opening the door to enter our tutorial on ladder logic programming, let’s have a brief idea about how PLC works and what ladder logic program has to do with PLC. Well! Let me briefly say that PLC has input modules, output modules, and a processor. The input modules are connected to input switches and sensors while the output modules are connected to actuators i.e., motors, valves, lamps. And for sure processor runs the ladder logic program that we going to learn here! In the below figure, I have tried to clear it visually.

The processor works in scan cycles, in each scan cycle, it gazes into all inputs and records them in its memory and then executes the ladder logic to determine the new status of outputs and update them and go to the next cycle, and so on. So now you can tell me what ladder logic has to do with this? That is great to hear you say that it is the logical connection between inputs to determine the output status. I really can not wait to go ahead and hit the nails on the head and open the door to let us get started with our tutorial about ladder logic programming. In the below figure, I have shown PLCs of different manufacturers:

Ladder Logic Programming

Each programming language has a structure and building blocks. The building block of a ladder program is a rung. Yes, rungs of a ladder go step by step to do the designed logic and repeat every scan cycle. Each rung forms a complete piece of logic like one complete circuit. so let us go to know how to form this rung and get to know what components of these rungs and how they are connected logically.

Understanding Rung in Ladder Logic

  • In the below figure, I have shown a single rung of ladder logic programming.
  • It's the simplest ladder logic rung and it has Input on the left side and Output on the right side.
  • The ladder logic rung is composed of two parts:
    • The Left Part represents the condition on which the output is determined to be true or false. This part is a combination of contacts or inputs in series for making AND logic or in parallel to perform OR logic.
    • The Right Part is the output coil or a trigger signal to start timer or counter as we going to elaborate later.
  • Ladder Logic works from left to right and thus according to this rung, if Input is LOW, the output will remain LOW, and if Input gets HIGH, the Output will also get HIGH.
  • So, you can say the above rung is actually representing a simple electrical switch i.e. if we turn ON the switch, Lamp(Output) will get lightened up and vice versa.
  • In this tutorial, I am just giving the overview, so if you are not getting all the things, don't worry, as, in the upcoming tutorial, we will design them on the simulator again & again.
  • Inputs in LAdder Logic PRogramming are normally coming from switches, pushbuttons, sensors etc.
  • Inputs come in two configurations:
    1. Normally Open (NO): shows the input initially at a LOW state and gets HIGH by pressing or activating.
    2. Normally Closed (NC): It's initially is at a HIGH state and gets LOW when it is pressed.

Multiple Rungs in Ladder Logic

In the above section, we have designed a simple ladder logic program, where we have used just a single input to control our output. These contacts/inputs in their two configurations can be connected in series (AND logic), parallel (OR logic), or negation (NOT) to form logical combinations. In the below figure, I have designed three rungs of Ladder Logic, let's understand them one by one:

  • 1st Rung: I have used two Normally Open Contacts in the first rung, so you can think of it as an electrical line having two switches in series. So, the output will get current, only if both switches are on/closed. So, it's actually an AND Gate in Ladder Logic i.e. output will get HIGH only if all the inputs are HIGH.
  • 2nd Rung: In the second rung, I have used both normally open and normally close contacts, so if Input1 gets pressed, the output will get HIGH, but if Input2 gets pressed(actually open/off) then Input1 won't be able to turn ON the Output. So, you can think of Input2 as a master switch.
  • 3rd Rung: Now you must have understood by now that I have designed an OR Gate in this rung, so if any of these inputs get HIGH, the Output will get HIGH as well, because Inputs are connected in parallel.
Note:
  • When two or more inputs are connected in parallel in order to design OR logic, it's called rung branches.

Slightly Complex Project in Ladder Logic

In the below figure, you can see a slightly complex Ladder Logic Program, having different components, let's discuss them one by one:

  • The output coil may have the character “S” to show the output going to be set to true until a reset signal is received.
  • Furthermore, it could have the character “R” to show the reset status of the output to false.
  • Character “P” in the middle of contact shows this is the rising edge of input when it changes from false status to true.
  • On the other hand, character “N” in the center of contact shows the falling edge of the input when it changes from true to false.
  • And the timer and counter blocks are shown in the last two rungs to show the initiation of timer and counter.
  • All these components will be described in detail when the tutorial train reaches its station. So do not worry about them at this point.

Logic Gates & Ladder Logic

If we define the ladder and its building blocks which are rungs how about the word “logic” the second word in ladder logic? Well! Table 1 reviews the logic gates and their truth table. For you to expect the incoming status of your output based on the status of the inputs and the logical combination pattern. to decide the results logic output ( RLO) which is the status of the logical combination of contacts that precede the output coil. For instance, the AND gate/logic function is applied between two or more inputs when all of the inputs should be true to get the output to be true. On the other hand, the OR gate/logic function between two or more inputs is used when we need at least one of the inputs to be true to get the output to be true.

Reading ladder logic rung

  • The reading starts from left to right to complete one rung and then from up to down rung by rung till the end of the program.
  • You can imagine that you read the ladder program instead of PLC.
  • First, you scanned the input and update the input memory and then scan each rung from most left to right to evaluate the RLO and set the new status of the output based on the determined RLO.
  • After completing one rung, plc move to the next rung from top to bottom till the last rung in the program at that point one scan cycle is done and move to the next scan cycle and so on.
  • You can compare Ladder Logic with electrical wiring logic, as both follow the same pattern.

Let’s see one simple example to understand the reading ladder logic program. Figure 3 shows a very simple complete ladder logic rung that connects a normally open pushbutton to start a motor and another normally closed pushbutton to stop the motor. You can see each component of the inputs and outputs should have an address to be uniquely identified by PLC. For instance:

  • The normally open push button named “Run” takes an address of I0.0 which is linked to the first input channel of the first input module in PLC.
  • The normally closed push button to stop the motor called “stop” takes the address I0.1 which is physically connected to channel 2 in the first input module of the PLC.
  • On the other hand, the output coil takes address Q0.0 which is the first output channel of the first output module in PLC.
  • So clearly when you press your push button "RUN" it will connect the motor output coil to the positive line and hence get energized.
  • But when press the "STOP" button, you will disconnect the motor coil from electricity and hence stop it.

What’s next ???

Now, how do you see your progress so far? I can see you are doing progressively and that’s great. However, we still have a lot to learn to master ladder logic programming. However, we need to set up the environment for simulating a Ladder logic program to be able to validate our programs and enjoy seeing its execution typically as if we have a PLC controller and to verify how far our designed ladder performance matches the real-time execution on the simulator.

 Components of Internet of things

As you saw within the previous article, the applications for IoT extend across a broad kind of use cases and verticals. However, all complete IoT systems area unit an equivalent therein they represent the combination of 4 distinct components: sensors/devices, property, processing, and a computer program. Just like the web has modified the approach we tend to work & communicate with one another, by connecting us through the globe Wide net (internet), IoT conjointly aims to require this property to a different level by connecting multiple devices at a time to the web thereby facilitating man to machine and machine to machine interactions. People who came up with this idea, have conjointly realized that this IoT scheme isn't restricted to a selected field however has business applications in areas of home automation, vehicle automation, plant line automation, medical, retail, attention, and a lot of.

Introduction of IoT components

We’ll define what each suggests that within the sections below and the way they are available along to create an entire IoT system. every one of those sections also will function the structure of the remainder of this e-book, and we’ll dive into these parts a lot deeper within the chapters to follow.

Sensors/Devices

First, sensors or devices collect information from their setting. This information may be as easy as a temperature reading or as complicated as a full video feed. We use “sensors/devices,” as a result of multiple sensors may be bundled along or sensors may be a part of a tool that will over simply sense things. as an example, your phone could be a device that has multiple sensors (camera, measuring instrument, GPS, etc), however, your phone isn't simply a detector since it also can perform several actions. However, whether or not it’s a standalone detector or a full device, during this commencement information is being collected from the setting by one thing.

The latest techniques within semiconductor technology are capable of manufacturing small good sensors for varied applications.

Common sensors are:

  • Temperature sensors and thermostats
  • Pressure sensors
  • Humidity/wetness level
  • Light intensity detectors
  • Moisture sensors
  • Proximity detection

Temperature sensing element

A Temperature sensing element senses associate degreed measures the temperature and converts it into an electrical signal. they need a serious role in the atmosphere, Agriculture, and Industries. as an example, these sensors will find the temperature of the soil, which is a lot useful within the production of crops. There square measure many sorts of temperature sensors and therefore the common use is square measure NTC semiconductor unit, Resistance Temperature Detectors RTDs, Thermocouples, and Thermopiles. they're economical, simple to put in and reliable that respond to human action. The RTDs work on the correlation between the metals and therefore the temperature because the resistance of the device is directly proportional to the temperature. The wide used  DHT eleven is that the temperature and wetness sensing element, that is that the basic, low-cost, digital, and electrical phenomenon sensing element. No analog pins are needed for this sensing element. you'll get the sensing element from Adafruit that has several offers on this.

Pressure sensing element

A pressure sensing element senses the pressure applied id est, force per unit space, associate degreed it converts into an electrical signal. it's high importance in prediction. Their square measure varied Pressure sensors obtainable within the marketplace for several functions. as an example, if there square measure any water leaks within the residential or industrial areas, a pressure sensing element must be put in to see if there square measure any leaks and measures the pressure. Another e.g., all smartphones, wearables have these air pressure sensors integrated into them.

Connectivity

Next, that information is shipped to the cloud, however, it desires the way to induce there!

The sensors/devices may be connected to the cloud through a range of ways including cellular, satellite, Wi-Fi, Bluetooth, low-power wide-area networks (LPWAN), connecting via a gateway/router, or connecting on to the net via LAN (don’t worry, we’ll justify a lot of regarding what these all mean in our property section). Each possibility has tradeoffs between power consumption, range, and information measure. selecting that property possibility is best comes all the way down to the particular IoT application, however, all of them accomplish an equivalent task: obtaining information to the cloud.

Gateway

IoT entranceway manages the bidirectional information traffic between completely different networks and protocols. Another operate of the entranceway is to translate completely different network protocols and conformability of the connected devices and sensors.

  • Gateways will be organized to perform pre-processing of the collected information from thousands of sensors domestically before transmitting it to a consecutive stage. In some situations, it'd be necessary because of the compatibility of TCP/IP protocol.
  • IoT entranceway offers a sure level of security for the network and transmitted information with higher-order cryptography techniques. It acts as a middle layer between devices and the cloud to safeguard the system from malicious attacks and unauthorized access.

Cloud Computing

  • Internet of things creates large information from devices, applications associate degreed users that should be managed in an economical approach. IoT cloud offers tools to gather, process, manage and store a Brobdingnagian quantity of knowledge in real-time. Industries and services will simply access this information remotely and build vital selections once necessary.

IoT cloud may be a subtle high-performance network of servers optimized to perform high-speed processing of billions of devices, traffic management, and deliver correct analytics. Distributed management systems square measure one in all the foremost vital parts of the IoT cloud.

  • Cloud system integrates billions of devices, sensors, gateways, protocols, information storage and provides prophetical analytics. firms use this analytics information for the improvement of products and services, preventive measures sure as shooting steps, and building their new business model accurately.

Processing

Once the info gets to the cloud (we’ll cowl what the cloud suggests that in our processing section)), the package performs some reasonable process on that. This could be easy, like checking that the temperature reading is among an appropriate vary. Or it may even be complicated, like victimization laptop vision on the video to spot objects (such as intruders on a property). But what happens once the temperature is simply too high or if there's an associate trespasser on the property? That’s wherever the user comes in.

Data Processing Cycle

So however will processing work? the method typically follows a cycle that consists of 3 basic stages: input, processing, and output.

To keep this text straightforward, we tend to don't seem to be progressing to dive deep into the technical details of the stages of the knowledge process. Instead, we’ll offer you a general and straightforward rationalization of every stage.

Input

Input is that the 1st stage of the info process cycle. it's a stage within which the collected information is born-again into a machine-readable type so a laptop will method it. this is often a vital stage since the info process output is captivated with the input file (“garbage in – garbage out”).

Processing

In the process stage, a laptop transforms the information into data. The transformation is administered by victimization completely different information manipulation techniques, such as:

Classification

 Information is classed into completely different teams.

  • Sorting: information is organized in some reasonably associate degree order (e.g. alphabetical).
  • Calculation: Arithmetic and logical operations square measure performed on numeric information.
  • Output: In the last stage, the output is received. this is often the stage wherever the processed information is born-again into the human-readable type and bestowed to the tip user as helpful data. Also, the output of the knowledge process will be kept for future use.

Analytics

Analytics is that the method of changing analog information from billions of good devices and sensors into helpful insights which may be taken and used for careful analysis. good analytics solutions square measure inevitable for IoT system for management and improvement of the complete system.

  • One of the foremost benefits of an associate degree economical IoT system is a real-time good associate degree that helps engineers to search out irregularities within the collected information and act quickly to forestall an unsought situation.  Service suppliers will brace themselves for additional steps if the data is collected accurately at the proper time.
  • Big enterprises use the large information collected from IoT devices and utilize the insights for his or her future business opportunities. Careful analysis can facilitate organizations to predict trends within the market and arrange ahead for implementation.
  • Information is extremely important in any business model and prophetical analysis ensures success in the involved space of line.

User Interface

In the previous discussion, we've got lined however information is collected by sensing element devices, sent to a cloud service via a network answer, and reworked into helpful data. The very last thing we'd like to try to do is to deliver the data to the tip user. this is often done via program (UI).

The program consists of the options by that a user interacts with an automatic data processing system. This contains screens, pages, buttons, icons, forms, etc. the foremost obvious samples of user interfaces square measure software and applications on computers and smartphones.

A program doesn’t essentially need a screen, however. as an example, a TV remote contains a program that consists of varied buttons, and devices like Amazon Echo will be controlled with voice commands. A term that relates closely to the program is that user expertise (UX). The distinction between the 2 is that, whereas UI should do with the items a user truly sees and interacts with, a married woman is that the overall expertise a user has with a product. It includes the website, application, packaging of hardware, installation, etc. married woman may not even be concerning your UI style.

Ways to act with associate degree IoT answer

There square measure some ways by that a user will act with associate degree IoT answer. Again, as we tend to see with sensing element devices and property, the selection depends on the utilization case. Here, we’ll take a glance at a number of the foremost usual choices. The most usual case in IoT applications is that we would like to receive notifications or alerts if one thing uncommon happens. as an example, if a producing machine’s temperature exceeds a threshold limit, we might prefer to get notified of this. the data may be delivered via email, SMS, phone call, or push notification.

Monitoring data Proactively

We might wish to be ready to monitor data proactively. as an example, if we tend to have an associate degree plus chase answer keeping track of our vehicles, we would wish to observe the vehicles’ location even though nothing uncommon happens. we tend to might use a mobile or laptop application to observance the data.

Controlling the System Remotely

The program also can enable the user to regulate the IoT system remotely. as an example, the user might modify lights or put off heating via a mobile application. this might even be done mechanically by applying itself in step with the rules given thereto.

UI Concept

It is a challenge to make associate degree intuitive UI (and UX) for one app alone, however, IoT applications take the complexness to an entirely new level. Let’s take a glance at a number of the problems we've got to require into consideration once planning UIs for IoT.

Summary

An IoT system consists of sensors/devices that “talk” to the cloud through some reasonable property. Once the info gets to the cloud, package processes it so may conceive to perform associate action, like causing associate alert or mechanically adjusting the sensors/devices while not the necessity for the user. But if user input is required or if the user merely desires to visualize in on the system, a computer program permits them to try to thus. Any changes or actions that the user makes area unit then sent within the other way through the system: from the computer program to the cloud, and back to the sensors/devices to create some reasonable modification.

Our “How IoT Works” series is returning to associate degree finish, however, let’s take an additional example that covers the total method.

Let’s imagine we tend to square measure managing the grocery cold chain. we would like to form positive our groceries square measure unbroken in a very appropriate temperature, and that we conjointly wish to trace the placement of the truck transporting the groceries. The steps (1–4) of our IoT workflow square measure are pictured below.

First, we tend to collect information concerning the temperature and therefore the location with our sensing element devices (step 1). at the moment we tend to use a network answer to send the info to a cloud service (step 2), wherever the info is reworked into helpful information via processing (step 3). Finally, the data is delivered to the tip user via the program (step 4).

We hope you have got enjoyed our “How IoT Works and its component” series!

Introduction to Double Layer PCB

Hello! Friends I hope you are all fine. In today's article, we tend to unlock the details on the double sides of PCB which is a type of PCB. It comes with a conductive copper layer on both sides of the board, unlike single layer PCB which has only layer one side of the board. I will try to elaborate on each and everything about double-sided PCB with the best of my effort. So you do not need to move your attention to another source for elaborating this article. In this article, we illustrate the double-layer PCBs, their advantages and disadvantages. We will also study double-layer construction methodology, its applications. In termination, we will discuss the conclusion of today’s article. Let’s start our article by exploring PCB and its main applications. Let’s start to absorb the basic and advanced information about double layer PCB.

Before discussing the double layer PCB. we must have an idea about what’s PCB.

PCB and its classification

 PCB is an abbreviation of printed circuit boards. PCB may be a sleeky chip created by compound epoxy glass fiber or laminated completely different substances. It includes a plate of insulated substantial and a sheet of copper foils coated to the substrate.

Criteria of Classification of PCB

PCBs are classified according to their number of layers and holes on them.  There are three types of PCB depending on the number of their layers.

  • Single-layer PCB
  • Double-layer PCB
  • Multilayer PCB

Now to move our attention back to our article which is double layer PCB

Introduction to double-layer PCB

A double-sided PCB is also known as a Two-layer PCB is a kind of PCB that has a copper layer on both sides aboard. Here copper layers means the conductive layers. Simply we can say that it Comes with two conductive patterns on two sides of the base material which is called the substrate. The pattern on the sides is connected using a connection bridge which is known as VIA.

2-Layer PCB Pricing

  • Let's have a look at the pricing of 2 Layer PCB, so I am going to take the example of PCBWay Fabrication House.
  • If you have a look at the below figure, you can see that, if we place an order of:
    • Size: 150x100mm
    • Quantity: 10
    • Layer: 2
  • It will cost us $41 in total, and it's quite affordable.
  • The price per PCB board decreases as you increase the quantity.

What is via?

 Via is a hole in the vertical direction on the PCB board which is filled with metal foils due to which we connect the writing patterns.

  • The area of double-sided PCB is twice that of single-layer PCB that allowing it to be used in vast applications with high-density components

Purpose of double-sided PCB 

  • The main purpose of this board over single layer PCB is that on this board we can connect components on one side with the other due to the presence of the hole on it. We can easily tackle with connections on this board although it is no easy task to develop a double layer PCB.

Types of double-layer PCB 

 There are two types of double-layer PCB.

  • Without through-hole metallization (non-PTH)
  • With through-hole metallization ( PTH)

PCB Manufacturing Process

 Following steps are included in making a PCB:

  1. Initialization
  2. Optical lithographic
  3. Etching
  4. Stripping
  5. Plating of tin
  6. Drilling
  7. Testing
  8. Component loading
  9. Soldering

Initialization

  • First of all, we must have a print of layout which may be obtained from Computer-aided machine, then cut the copper layer according to requirements and make sure that board is clean and free from any dust than mounting holes on it.

Optical lithographic

  • In this step, we may transfer the copper tracks by exposing them to radiation sources like UV radiations

Etching

  • This is used to remove the copper-clad which is unnecessary.  For this purpose the board is  dipped in the etching solution  and remains in solution for 6 to 7 minutes at 40° C . There are  many types of etching solutions like
  1. Ferric chloride
  2. Cupric chloride
  3. Alkaline ammonia

Stripping and tin plating

  •  In this step final touch is given to the copper layer on board and plating is optional which protects the copper from being oxidizing.

Drilling and testing

  •  In this step, components are created on board of different widths. This may be done by using manually operating drill machines by using CNC drilling machines.

Techniques for interconnecting components onboard

Technically two methods are used for this task.
  • Through-hole technology
  • Surface-mounted technique

Through-hole technology

  • It is a technique in which we can make an electric circuit by using a wire which passed through holes and bored into PCB. In the late 1980s, every component was pointed through this technique on PCB.

 Surface-mounted technology 

  • In this technique, there is no separate use of Wire. In its place, we can join components straight to chips which reduces space requirements.

Construction of double-layer PCB 

  • The construction of this board is alike to single-layer PCB, its construction is delineated here with elaborate.
  • In this circuit substrate is factory-made by the fiber or epoxy resins, the sort of base material depends on rigidity and adaptability of aboard.
  • In the double layer PCB, PCB over base substances copper lamination is done to supply a semi-conductive method for parts.
  • To protect From setting each side of the Board contains a solder mask over copper covering.
  • There exists a silkscreen on top of the sides whose purpose is to able a person to add symbols and character on board so that a standard person will perceive the Board function.
  • Double-sided PCB area units are terribly like single-sided PCB except that they need two-sided traces with high and bottom layers. These boards will mount conductive copper on either side of the card that permits the trace to cross over one another. This leads to the next density of circuit while not the Requirements of point to point fastening. These kinds of circuit boards area units are a lot of advanced than single-sided PCBs that are often harder to supply. However, the advantage of victimization double-sided PCB so much outweighs the con’s

Double-sided circuit boards are one of the foremost well-liked kinds of PCBs. They allow makers to supply a lot of advanced circuits which may have profit uses in higher technology applications.

Advantages of double-layer PCB over single layer PCB 

  • The most important point is that number of interconnection are approximately double that of single-sided PCBs
  • They are more flexible and have easier electrical interconnections.
  • Single-layer PCB has only one conducting layer over base material while double layer PCB has two conductive layers on both sides of base material known as a substrate which is made of fiberglass and is compact in its sense.
  • Both double layer PCB and single layer PCB  works as an electronic catalyst to deliver power to other components
  • Double-sided PCB tends to increase the circuit density and reduce the overall cost.
  • Although double-sided PCBs have complex circuits as compared to single-sided PCBs they are perfect and more suitable for advanced electronics because they can be used on both sides which reduces the side of the board in return reduces the overall cost.•The most important advantage of double-sided PCB is that we can repair and rework their connections.

Disadvantages of double-layer PCB 

  • We need very careful attention for manufacturing of layout of double-sided PCBs especially in the distribution of power across the different components.
  • As they have the open structure of circuit loop there may be a chance of EMI radiations which may change the crosstalk between closely spaced tracks overboard

Application of double-layer PCB 

  • Due to the availability of flexibility in their structure, Double-sided PCBs are used in many applications for various purposes.
  • High low temperature and solder coating are one of few important applications of Double-layer PCB.
  • Double-sided PCBs are used in merchandising machines, amplifiers, automotive dashboards, and plenty of lots.
  • Double-layer PCBs are used in the red lightning circuit which makes the light circuit.
  • Double-layer PCBs are used in printers.
  • Double-sided PCBs are used in Industrial controls for various purposes.
  • Double-sided PCBs are used for instrumentation.
  • Double-sided PCBs are used for testing the types of equipment.
  • Double-sided PCBs are used in power supplies and hard drives.
  • Double-layer PCBs are used in converters.
  • Double-layer PCBs are used for control relay purposes.
  • Double-layer PCBs are used in the Automotive dashboard for controlling the different functions.
  • Double-sided PCBs are used in traffic systems
  • Double-sided PCB has wide use in vending machines.
  • Double-layer PCBs are used in inline reactors.

Conclusion

In the end, we concluded that double-layer PCBs have two layers than a single layer which has one layer. Due to advanced technology requirements, we need double-layer PCBs. Double layer PCBs are less costly but they have innovative features than single layer PCBs. This worthy feature is the demand of the modern era. Double layer PCBs have worthy applications. It also has some drawbacks which demanded that we have to develop PCBs that are effective than double-layer PCBs. You always need to opt for which kind of PCBs you would need.

That’s all for today’s article. I hope you've got enjoyed the article and built a grip on the understanding points. However, if you continue to face any skepticism concerning double-sided PCB then please be at liberty to depart your queries within the comment section. I'll give a solution to those inquiries to the simplest of my data and researching skills. Also, give North American country along with your innovative feedbacks and suggestions you improve the standard of our work and supply you content in keeping with your wants and expectations. keep tuned! thanks for reading this text.

 
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