Introduction to Molecular Ions

Hello friends, in the previous tutorial we learned about ions and now I am coming up with a new article Molecular ion. In this article, we will discuss the formation of molecular ions. When we discuss molecular ions many types of questions arise in our minds. I hope after reading this article you can answer these questions which are given below:

  • What are molecular ions?
  • How many types of molecular ions?
  • How molecular ions are formed?
  • Why is NH4 + not a molecular ion? Give a reason.
  • Which type of molecular ions structure exists etc.?
  • Which example is suitable for molecular ions or not?

Discovery

In 1794, molecules were considered a minute particles according to the French. Latin used vogue words for molecules until the late 18th century. Molecules have evolved as the knowledge of the structure of the molecule that retains their composition and Chemical properties according to the earlier definition was less precise. This concept breaks down because most rocks, salts, and metals are composed of a huge crystalline network of chemical bonded atoms or ions.

It reveals the existence of strong chemical bonding between the atoms of molecules in ionic form.

We are searching for many years on molecular ions, including helium hydride ion, the first molecular ion we discovered that was formed in the Universe by a chemical bond. We detect it in the laboratory by inserting a medium. It was first seen in a planetary nebula named NGC 7027 using the GREAT spectrometer aboard the Stratospheric Observatory for Infrared Astronomy.

I will make this topic very easy for beginners.

So first of all we see its overview :

Molecular Ion:

By gaining and losing electrons of an atom, the molecular ion is formed

The second name of the molecular ion is also known as polyatomic ion which is formed in radical cation by a covalent bond by sharing more than one electron.

It is an example of a radical cation.

An electron is a light particle as compared to a proton.

Molecule:

it is the smallest unit of a substance and is formed by the combination of atoms.

It may contain one or more atoms.

Some examples of molecules are

  • H2O (water)
  • N2 (nitrogen)
  • O3 (ozone)
  • CaO (calcium oxide)

Difference between molecules and molecular ions:

Ion:

ion is formed by the gaining and losing of electrons of an atom.

For Example :

To understand this topic we see the example of sodium chloride NaCl.

Na+, Cl-

Difference between ions and molecular ions

Molecular compounds

  • When an atom of two or more elements share electrons a molecular compound is formed
  • It is also known as covalent compounds.
  • In molecular compounds, the ambivalent bond is formed when atoms shared their electron pair.

Molecule ___gain/lose electron _______ molecular ion

  • Types of Molecular ion:

There are two types of molecular ions:

  • Cationic molecular ion

They have charged positive ions because they lost the electron from the molecules.

For Example :

CH4+

  • Anionic molecular ion

They have charged negative ions because they absorb the electron from the molecules.

For Example :

O2-I

The main differences between cationic and anionic molecular ions are categorized in the following table:

NOTE:

Cationic molecular ions are abundant in nature as compared to the Anionic molecular ions.

Rules of writing:

  • In the naming of molecular ions, caution is written first and the anion is written in second no.
  • Ion is written in the bracket if the formula unit contains two or more of the same polyAtomic ion with subscript written outside the bracket.

How molecular ions are formed?

These cations and anions are formed by the bombardment of high-energy particles such as electron beams in the form of alpha particles or X_rays. These rays or radiation knocked out the electron from gas molecules resulting in the formation of Cationic molecular ions.

Simply we can say that it is formed by the ionization of the molecules.

For Example :

N2 + 1e- ___x_rays/alpha rays______N2-1 (molecular anion)

CO ___alpha/x_rays_____ CO+ + 1e-1 (molecular cation)

Explanation :

In the first example, we deal with a nitrogen molecule in which it gains one electron in the presence of a beam of X_rays or alpha rays radiation and becomes a molecular anion. Molecular anions are less abundant in nature. To understand this topic we take the example of bags and clothes. If you put the clothes in a bag, if the bag is almost full then it is difficult to put more clothes in bags. This is the same logic apply to molecular anions.

That's why it is less abundant.

In the second example, we release electrons from CO, in the presence of X_rays then we format molecular cation because it is easier to remove electrons from more than one.

It is very abundant in nature.

  • Features of formation of molecular ion:

There are important features that tell us how an electron is removed from bond pair:

  • Electrons are easily removed from non_bonded pairs as compared to bonded pairs.
  • Because bonded pairs are at lower energy levels and most localized as compared to non_bonded pairs.
  • It is most difficult to lose electrons from bonded pairs.

The most important thing here arises is that,

Is Ammonium ion (NH4+ ) a molecular ion?

The ammonium ion is not a molecular ion due to its formation through the coordinate covalent bond between ammonia (NH3) and hydrogen ion (H+).

Because nitrogen of ammonia has electron lone_pair it can donate electrons to hydrogen ions resulting in the formation of ammonium ion by dative bond or co_ordinate covalent bond.

Hence, ammonium ion (NH4+) is not formed by the gain or loss of electrons. Therefore it is not a molecular ion.

NH4+ is a poly-atomic ion.

Is ozone a molecule?

Ozone is also a molecule that is bound by three atoms of oxygen. Which is symbolically represented by O3.

Its layer protects our environment or atmosphere from harmful ultraviolet rays which are emitted by the sun.

Identification of molecular ions:

If molecules have any species of the charge they will be molecular ions if we remove the charge from the molecule then it is simply a molecule, not a molecular ion.

CH4+ (molecular ion)

CH4 (Molecule not a molecular ion)

What is the molecular mass?

The total atomic mass of all elements present in a molecule is equal to that of a particular substance known as molecular mass.

How can we measure the molecular mass?

We can measure the molecular mass of the molecule by using the following steps which are given below:

  • First of all, we define the formula of a molecule.
  • We find out how many atoms are present in a molecule.
  • Then we multiply the atomic weight of an element by the number of atoms.
  • Similarly, the same process applies to all elements in a molecule.

Example:

See the example of calcium oxide (CaO).

Sum up all the values we obtain,

CaO = 1*40(atomic mass of calcium) + 1*16(atomic mass of oxygen)

= 56 g_mol-1

What is the formula mass?

The sum of the atomic mass of all the elements present in a formula unit of a substance is called formula mass.

For Example :

The formula mass of NaCl is 58.5 atomic mass.

Which type of force exists in molecular ions formation?

 

Intermolecular forces:

Intermolecular forces are electrostatic attractive forces between permanently or temporarily charged chemical species. They include

  • Van Der Waals forces (attractive forces)
  • Dipole-dipole forces
  • Ion_ion forces
  • Hydrogen bonding

Van Der Waals forces:

These forces are responsible for the formation of molecular ions.

Ion _ dipole forces:

Dipole-dipole or an ion-dipole force is an attractive force that resultantly comes from the electrostatic attraction between an ion and a neutral molecule that has a dipole.

A positive molecular ion (cation) attracts the partially negative end of a neutral polar molecule.

A negative molecular ion (anion) attracts the partially positive end of a neutral polar molecule.

Ion_ion forces:

Ion_ion forces are also known as ionic bonding. It is easy to understand this force is present between two oppositely charged ions. This force is not considered an intermolecular force but this force is helping us to understand this bonding.

A suitable example for this case is table salt, NaCl.

Hydrogen bonding:

Hydrogen bonding also plays a vital role in the formation of molecular ions. This force is stronger than all types of forces. Its best example is water in the formation of molecular ions.

How do you determine the molecular ions?

how to find the relative formula mass by using a molecular ion?

In mass spectroscopy, an electron is released from the molecule; then as a result we obtain a radical cation called the molecular ion (symbols: M•+, M+).

The molecules which removed the electrons resultantly gain molecular ions currently obtained the highest energy electrons

The Molecular Ion (M?) Peak:

We describe the molecular ion peak by using a graph:

In this peak, we can describe the relative formula mass (relative molecular mass) of an organic compound from its mass spectrum. It also gives us high-resolution mass spectra that can be able to find out the molecular formula for a compound.

In the mass spectrum, the ion which has the greatest m/z value is treated like a molecular ion. Some ionic compounds have mass spectra that don't contain a molecular ion peak because all the molecular ions break into fragments.

By the end of this article, you will be able to find out

Important Facts:

By using molecular ions we can determine the following facts:

  • Determination of the molecular mass.
  • Structure of a compound
  • Kinds of bond
  • Kinds of atoms

The most important question is what molecular ions how they are formed.

Significance/Applications:

Molecular ions obtained from the natural products on decomposition give information about the structure of the molecule.

I Hope, I cover all aspects of the molecular ions. It is the last topic of our first tutorial. If you want these trusting topics simply, give me good feedback for better results. If you have any questions, put them in the comment section. I will reply to you as soon as possible. Our next tutorial series is coming soon. Our platform tries to give the best and in trusting topics that clear your all concept. Thanks.

Interfacing of DHT11 with Raspberry Pi Pico

Hello readers, I hope you all are enjoying our Raspberry Pi Pico programming series. In our previous tutorials, we learned how to access Raspberry Pi Pico’s GPIO pins for both input as well as output operations. For demonstration, we used LED as an output component and a push button as an input component.

Now let’s learn how to interface sensor modules with the Raspberry Pi Pico module. So, in this tutorial, we will learn how to interface the DHT11 sensor with the Raspberry Pi Pico module and fetch the observed data (from its surrounding) using the MicroPython programming language.

Before writing the code for interfacing and fetching the data from the respective sensor, let’s first have a look at the working operation, features and properties of the DHT sensor.

Fig. 1 Raspberry Pi Pico and DHT11 modules

DHT11 Sensor

 

The DHT11 sensor (also known as a temperature and humidity sensor) is a sensor module that measures humidity and temperature in its immediate environment. The ambient temperature and humidity of a given area are monitored by this sensor module. The sensor is made up of an NTC (negative temperature co-efficient) temperature sensor and a resistive type humidity sensor. An 8-bit microcontroller is also built into the sensor module. The microcontroller converts analogue to digital and outputs a digital signal through the single wire protocol.

The following are some of the DHT11 sensor's technical specifications:

Table:1 DHT11 technical specifications

DHT11 sensors can also be used to create a wired sensor system with up to 20 meters of cable.

A DHT sensor is mostly used in weather monitoring systems and for research purposes. Although we have satellites to provide the status of weather conditions but, the data provided by satellites represent a larger area. In the case of research applications, the satellite provided data is not sufficient so in such applications, we need to use sensor modules like DHT.

DHT11 Vs DHT22

To measure temperature and humidity, two DHT modules (DHT11 and DHT22) are available in the market. Both of the DHT11 and DHt22 modules, serves the same purpose, but they have different specifications. The DHT22 sensor, for example, has a wider range of humidity and temperature sensitivity. The temperature sensitivity of DHT22 ranges from -40 to 80°C with +-0.5°C tolerance and on the other hand, the temperature sensitivity of the DHT11 sensor ranges from 0 to 50°C with +-2°C tolerance.

Similarly, the humidity sensitivity of the DHT22 sensor ranges from 0 to100% with +-2% tolerance and for DHT11 the humidity sensitivity rages between 20 to 90% with +-5% tolerance. Similarly other properties like resolution, sampling time etc are better in the DHT22 sensor module than in DHT11. But the only disadvantage or drawback of the DHT22 sensor module is its cost. The DHT22 is costlier than DHT11 sensor module. So you can use any of the modules as per your requirements and resources.

Software and Hardware components required

The software and hardware components required to interface the DHT sensor with the Raspberry Pi Pico board are:

  • Raspberry Pi Pico development board
  • DHT11 sensor
  • A resistor (10K)
  • Connecting wires
  • Breadboard
  • Data cable
  • Thonny IDE

Fig. Required Components (hardware)

DHT11 Pin-out

DHT11 is a three pin module and the pins include ‘+Ve’ for 3.3V, ‘-Ve’ for ground and the third one is ‘OUT’ for data output.

Fig. 3 DHT11 Pin-out

Interfacing DHT11 with Raspberry Pi Pico module

The connection for interfacing the DHT11 and Pico modules are shown in table 1. There are basically three pins in DHT11 sensor as discussed earlier. Two pins are to power up the DHT11 module i.e., VCC and ground and these two pins are connected to the 3.3V and GND pins of the Pico board. The third pin i.e., ‘OUT’ is used to provide data input to the Raspberry Pi Pico board. The data (‘OUT’) pin can be connected to any of the GPIO pins of the pico board. So here we are using GPIO_0 pin for data input.

Table 2 Interfacing DHT11 with Raspberry Pi Pico

Fig. 4 Interfacing DHT11 with Pico board circuit

Programming

The development environment we are using is Thonny IDE, to program the Raspberry Pi Pico board for accessing the dual core feature with MicroPython programming language.

So, before writing the MicroPython program user need to install the respective development environment to compile and upload the MicroPython program into the Pico board.

We already published a tutorial on how to install and access Thonny IDE for Raspberry Pi Pico programming using MicroPython programming language. Follow our previous tutorial, to install Thonny IDE for raspberry pi pico programming.

Let’s write the MicroPython program to interface the DHT sensor with the Raspberry Pi Pico module and fetch the temperature and humidity data observed with the DHT11 sensor.

  • The first task while writing the MicroPython code for the DHT11 interfacing is importing the necessary classes and modules. Firstly we are importing the Pin class from the machine The Pin class is used to access the Raspberry Pi Pico’s GPIO pins to interface the data pin of DHT11 sensor module.
  • Next we are importing the utime module to add delay when required.
  • The third module we are importing is the dht module which is responsible for reading the temperature and humidity data from the sensor module.

Fig. 5 importing necessary library files

  • Next we are declaring a ‘pin’ object. This object represents the GPIO pin number to which the data pin of DHT11 is to be connected and also the mode of the GPIO pin. Here we are using GPIO_0 of the Pico board and the pin is configured at imput.

Fig. 6 declaring the ‘pin’ object

  • We are using a while loop to continuously read and print the sensor reading (temperature and humidity).
  • The sampling rate of DHT11 sensor is 1 second. So before reading the data from DHT sensor a minimum delay of 1 second is required. Here we are adding a delay of 2 second.
  • The temperature observed using ‘dht_input.temperaure’ The respective data is store inside ‘temp’ variable and then printed using print() command.
  • Similarly, for humidity the data is observed using ‘dht_input.humidity’ The respective data is stored inside ‘humidity’ variable and printed using the print() command.

Fig. 7 Main loop

Main program (main.py)

# importing necessary library files

from machine import Pin

import utime

from dht import DHT11, InvalidChecksum

while True:

utime.sleep(2) # adding delay of 2 seconds

pin = Pin(0, Pin.OUT, Pin.PULL_DOWN) # declaring pin object

dht_input = DHT11(pin) # defing the sensor pin

temp = (dht_input.temperature) # reading temperature

humidity = (dht_input.humidity) # reading humidity

print("temp(°C): {}".format(dht_input.temperature))

print("humidity(%): {}".format(dht_input.humidity))

You can use the above code as it is. But before compiling the code make sure you have uploaded the dht.py library file to your system/Raspberry pi pico module.

To upload the dht.py file into your system/pico board, go to File >> New, as shown below:

Fig. 8 create a new program

  • Paste the below attached code into the new program and save the program to similar location where the main program is saved.

DHT library (dht.py)

import array

import micropython

import utime

from machine import Pin

from micropython import const

class InvalidChecksum(Exception):

pass

class InvalidPulseCount(Exception):

pass

MAX_UNCHANGED = const(100)

MIN_INTERVAL_US = const(200000)

HIGH_LEVEL = const(50)

EXPECTED_PULSES = const(84)

class DHT11:

_temperature: float

_humidity: float

def __init__(self, pin):

self._pin = pin

self._last_measure = utime.ticks_us()

self._temperature = -1

self._humidity = -1

def measure(self):

current_ticks = utime.ticks_us()

if utime.ticks_diff(current_ticks, self._last_measure) < MIN_INTERVAL_US and (

self._temperature > -1 or self._humidity > -1

):

# Less than a second since last read, which is too soon according

# to the datasheet

return

self._send_init_signal()

pulses = self._capture_pulses()

buffer = self._convert_pulses_to_buffer(pulses)

self._verify_checksum(buffer)

self._humidity = buffer[0] + buffer[1] / 10

self._temperature = buffer[2] + buffer[3] / 10

self._last_measure = utime.ticks_us()

@property

def humidity(self):

self.measure()

return self._humidity

@property

def temperature(self):

self.measure()

return self._temperature

def _send_init_signal(self):

self._pin.init(Pin.OUT, Pin.PULL_DOWN)

self._pin.value(1)

utime.sleep_ms(50)

self._pin.value(0)

utime.sleep_ms(18)

@micropython.native

def _capture_pulses(self):

pin = self._pin

pin.init(Pin.IN, Pin.PULL_UP)

val = 1

idx = 0

transitions = bytearray(EXPECTED_PULSES)

unchanged = 0

timestamp = utime.ticks_us()

while unchanged < MAX_UNCHANGED:

if val != pin.value():

if idx >= EXPECTED_PULSES:

raise InvalidPulseCount(

"Got more than {} pulses".format(EXPECTED_PULSES)

)

now = utime.ticks_us()

transitions[idx] = now - timestamp

timestamp = now

idx += 1

val = 1 - val

unchanged = 0

else:

unchanged += 1

pin.init(Pin.OUT, Pin.PULL_DOWN)

if idx != EXPECTED_PULSES:

raise InvalidPulseCount(

"Expected {} but got {} pulses".format(EXPECTED_PULSES, idx)

)

return transitions[4:]

def _convert_pulses_to_buffer(self, pulses):

"""Convert a list of 80 pulses into a 5 byte buffer

The resulting 5 bytes in the buffer will be:

0: Integral relative humidity data

1: Decimal relative humidity data

2: Integral temperature data

3: Decimal temperature data

4: Checksum

"""

# Convert the pulses to 40 bits

binary = 0

for idx in range(0, len(pulses), 2):

binary = binary << 1 | int(pulses[idx] > HIGH_LEVEL)

# Split into 5 bytes

buffer = array.array("B")

for shift in range(4, -1, -1):

buffer.append(binary >> shift * 8 & 0xFF)

return buffer

def _verify_checksum(self, buffer):

# Calculate checksum

checksum = 0

for buf in buffer[0:4]:

checksum += buf

if checksum & 0xFF != buffer[4]:

raise InvalidChecksum()

Once both the main.py and dht.py are saved successfully we are ready to run the program. Click on the Run icon to test the interfacing setup and check the respective results.

Results

To see the sensor reading (temperature and humidity) observed with DHT11 sensor and Pico module we can either interface some peripheral device like LCD display or OLEDs. But for now we are just printing the sensor reading on Shell. We will create another tutorial for interfacing a peripheral display device with Raspberry Pi Pico module.

The sensor readings observed with DHT11 sensor are printed on the Shell. Image of the observed temperature and humidity values is attached below:

Fig. 9 DHT11 output

Conclusion

In this tutorial, we learned how to interface a peripheral sensor with the Raspberry Pi Pico module to observe temperature and humidity and display the data on Shell. This concludes the tutorial. I hope you found this of some help and also hope to see you soon with a new tutorial on the Raspberry Pi Pico programming series.

Introduction to Ions

Hello, students here in our previous tutorial we study molecules and now I am with a new topic “Ion” which might be possible for some of my readers this article seems to be new, and some of my readers may be familiar with this term. But no matter whether we know or not, in my article I try to cover all aspects of this term. Many questions arise in your mind such as you may think;

What is an ion?

How ions are formed?

What are the different types of an ion?

What methodology is utilized for assigning charge to an ion?

What are examples of an ion?

Which methods are used for the creation of an ion?

If my readers want to know the answers to these questions, hold copies and pencils in your hand and stick to my article till the end.

Brief description of an Ion

What is an ion?

Definition

An atom or group of atoms that brings a positive or negative electric charge as a conclusion of including lost or achieved one or more electrons

Or

A charged subatomic particle (such as a free electron)

By the word an Ion, it's not wrong to say that it is the type of chemical species which may hold two types of charges with some magnitude. These charges may be positive or negative with some magnitude. Those atoms or molecules that have unequal net charges associated with them simply say that charges on them are not involved in a factor of zeros, we use the term an ion for such types of atoms.

A short view over term atom.

Atom

As this term is the basis of chemistry everyone is familiar with this term. For understanding the article in a better way I explain it. Atom is the smallest component that constitutes the property of an element. An atom has a heavy central Part which is known as the nucleus. In the nucleus, two types of charges are present one is a proton carrying a positive charge and the other is a neutron neutral particle. Overall there is a positive charge in the nucleus. Around the nucleus, there are several circular orbits in which electrons keep moving the nucleus. In each orbit, electrons feel a nuclear pull that restricts their motion in a circular orbit.

Back to our statement that ions have a non-zero net charge. By non-zero net charges, it concluded that may an atom have more protons ( sub particle of an atom that consists of a positive charge. These charges are present inside a nucleus) than several electrons ( sub particle of an atom constituting a negative charge and present outside the nucleus, keep in motion in orbits around the nucleus) or secondly, maybe there are a greater number of electrons than the number of protons in their atomic or molecular structure. Thus we can say that a charged atom or molecule is named an ion. It is charged because we see that the number of protons and electrons is unequal.

Different types of an ion

Two conditions of inequality of charges between sub-particles of an atom are mentioned. Depending upon these two conditions we can categorize an ion into two different types either positive ion (cation) or negative ion(Anion).

What is a cation?

According to the first condition, when the number of protons is greater than the number of the electron in an atom, then the atomic structure is knowns to be positively charged. Such positively charged atoms are known as cations or positively charged ions. The charge on a cation depends upon the tendency of an atom to lose electrons from the shell. If one electron is removed then the charge is +1, if two electrons are removed from the shell then the cationic charge is +2 as illustrated in the given below example.

  • It has been seen that the formation of cation is an endothermic reaction.

What does mean by term Endothermic?

The word endothermic means heat absorbing. Endothermic reactions or processes are those in which there is a need for absorption of heat to carry out the reaction.

Why it is an endothermic reaction let’s allow me to explain:

  • Cation is formed when an isolated atom loses one or more electrons from its valance shell. As we know that there is the existence of a strong force of attraction in an atom. Due to this force of attraction nucleus strongly attract the valance electron, to remove an electron from a strong grip of the nucleus a sufficient amount of energy is required. This sufficient amount of energy is given to the electron which energies it and helps it to kick off from the strong field of the nucleus. As soon as the electron removes from the nucleus field it left behind a positive charge. Which is named cation. That’s why the formation of cations is an endothermic process.

Ionization energy:

The amount of energy that is required to pull out an electron from the valance shell of an atom is named ionization energy. An example is given below to illustrate the above statement:

Here 496 KJ/mole energy is required to form positive cation sodium from an isolated sodium atom.

  • If we compare a cation with a parent atom by their size we concluded that A Cation is smaller than the parent atom. Why does this so happen?

When a positive cation is formed then the number of protons increases as compared to the number of electrons. As one or more electron are removed from the valance shell, there is the removal of the shell from an atom result in an increase in the nuclear pull on the remaining valance electron. That’s why the cation is less than the parent atom by its size.

How does a cation Represent symbolically and what charge does it constitute?

  • It possesses a positive charge and suffix (ium) is used for cation. Such as Hydronium (H+)

What is Anion?

  • Secondly when an atom has more electrons than the number of protons then the charged atom is referred to as an Anion or negatively charged ion. In other words, we can also say that an anion is formed when an isolated atom gains an electron.
  • It has been seen that the formation of anion is an exothermic process.

What is meant by the word Exothermic?

An exothermic process is a process that occurs with the liberation of heat or energy. An anion or negatively charged ion is formed when an extra electron is gained by an isolated atom, this addition of extra electrons increases the energy of the atom resulting in instability of an atom. To attain stability, as the atom earlier it loses energy in form of heat. Thus the formation of uni-negatively ion is an exothermic process. Given below there is an example mentioned to explain the above statement:

Here when an electron is added to an isolated atom of chlorine, an amount of energy 349 KJ/mole is liberated. Which makes the reaction exothermic reaction.

  • Size of an anion is always greater than the parent atom. As we see that during the formation of an anion one or more electrons are added to the atom. This extra addition of electrons increases the electron-electron repulsion in the valance shell of an atom which results in an extension of the electronic cloud. Due to an increase in some electrons in the outermost shell, the pull of nuclear on valance electron also Decreases. That’s why the size of an anion is always greater than the parent atom.

How does a cation Represent symbolically and what charge does it constitute?

It possesses a negative charge and the suffix (ide) is used for monoatomic anion and (ate) for the polyatomic anion. Such as hydride and hydrate.

Ionic bond and ionic compound:

As there is two type of charged ions one is a positively charged cation and the other is a negatively charged anion, due to their opposite polarity an electrostatic force of attraction arises between them. This electrostatic force worked as a driving force in the formation of an ionic bond. When two charges formed an ionic bond then a compound is formed which is named an ionic compound.

Classification of Ions:

Depending upon the type of atom from which an ion is formed we can classify it as a monoatomic, diatomic, or polyatomic ion.

Mono-atomic ion:

If an ion is formed from one type of atom it is referred to as a monoatomic ion. Examples of monoatomic cation and anion are;

  • Aluminum cation is represented by the empirical formula Al?³.
  • Proton is a commonly known caption of the hydrogen atom. This hydrogen caption is denoted by H ?¹
  • Another example of a mono-atomic ion is manganese cation which is represented by the formula Mn ?². It also can form Mn ?³ and Mn ?4.

Illustration of monoatomic anion:

  • Common example of a uni-negative ion is the fluoride ion which is represented by Fl ?¹.
  • Along with this other examples are chloride ion, bromide ion, iodide ion, sulfide ion represented by chemical formula Cl?¹,

Br? ¹, I ?¹, S ?². As these belong to the 7th group, to complete their outermost shell they always prefer to gain an electron to form an anion.

Di-atomic ion:

If from two types of atoms an ion is made then it is referred to as a diatomic ion. An example of a diatomic ion is an Oxide ion denoted by the chemical formula O? ².

Polyatomic ion:

When an ion is made from more than one type of atom then it is referred to as a polyatomic or molecular ion.

Illustration of polyatomic cation:

Here below there are some common examples are provided;

  • H3O? is the chemical formula of hydronium cation.
  • Hg2?² is a mercurous cation.
  • NH?4 is the chemical formula of ammonium cation.

Illustration of polyatomic anion

  • A nitrate ion is a common example of a polyatomic anion. It is represented by the chemical formula NO3?.
  • Cr2O3? is the chemical formula of chromium oxide anion.
  • Another example of a polyatomic anion is the Sulfate ion which is represented by the chemical formula SO4?².

Ways one can create an ion;

There are several techniques one can use to create an ion. Here I explain two methods;

  • Spontaneous collision
  • Chemical interaction

Spontaneous collision:

  • We can create an ion from a spontaneous collision. Byword spontaneous means an event occurs without any apparent external cause. Collision is a process in which two bodies violently interact with each other. Through spontaneous collision among molecules of the liquid, an electron or group of electrons may be knocked off from an atom resulting in the formation of an ion. This ion is positively charged. Along with a positively charged ion, a free electron is also formed. This type of ionization is commonly named physical ionization. The free-electron that comes into the process during the collision may stick to itself or another atom resulting in the formation of a negatively charged ion.

Chemical interaction

  • One can create an electron through another process which is commonly known as “ chemical interaction”. For example when we dissolve an ionic compound in any form of a solvent such as water. The atom that comprises salt undergoes the process of separation to form a negatively charged anion & positively charged cation. A common example one can see to understand this process is the dissolving of common salt (sodium chloride) in water. When sodium chloride is dissolved in water then NaCl disassociates into positive sodium cation and negative chlorine anion.

Here Na+ represent positive cation ionic specie. And Cl- represent anionic specie.

  • Another process that can be carried out for the formation of ions is the passage of direct current from a dissolved solution which can conduct. As the current is passed through the solution the liquid molecules break and positive and negative ions are formed.

That’s All today. In this article, we learn about ion, its type, and the representation of charges on the ion. I try to explain aspects that make cation and anion quite different from each other. And in last we studied techniques which normally used to create an ion. I hope the given material for the term “Ion” is helpful for your academic requirement. If you have any queries regarding this article. Mention your question in the comment session. In the next tutorial, we will learn about molecular ions. Our platform tries its best to satisfy you. Keep tuned.

Introduction to Atoms

Hello, friends today we will discuss the basic concept of chemistry it is our first tutorial series in which we will discuss:

  1. Atom
  2. Molecule
  3. Ion
  4. Molecular ion

Now in this article, we will discuss atoms. Its definitions, examples, properties, its evolutionary history, and also some important facts in the form of questions.

Atom

Definitions

A tiny particle that cannot be seen with a naked eye so-called atom.

Or

Atom is the lowest unit of matter and is often divided without the discharge of electrically charged particles.

Or

Atom is the introductory structure block of chemistry.

Examples

From molecule;

Hydrogen (H2)

  • It has two atoms.

Nitrogen (N3)

  • It has three atoms

From elements;

Helium(He)

  • It has two electron

Properties

We discuss different properties of atoms like:

Atomic no:

The no of protons present in the nucleus of an element is called atomic number Or nuclear charge no.

. Its symbol is Z.

  • Always a whole no
  • No effect of neurons on atomic no.
  • Always give a smaller value than atomic mass.

Examples

  1. Carbon has 6 protons in its nucleus so its atomic no is Z=6
  2. Sodium has 11 protons .so Z= 11

Atomic mass

The sum of the numbers of neutrons and protons in the nucleus of an atom is called atomic mass or mass no.

  • It is represented by A and calculated as A=Z+n
  • Where n is no of neutrons and Z is no of protons
  • It always is greater than atomic no.
  • It is affected by the addition of neutrons.

Example

Sodium has 11 electrons = 11 protons and 12 neutrons in an atom. So its mass no is

A= 11+12= 23

Periodic table

In this table, we can see atomic numbers, atomic mass, and symbols of atoms. Above the symbol is atomic no and below is the atomic mass.

Atomic size.

  • We can not measure the size of an atom because atoms have no boundaries and they are very tiny, so can assume spherically
  • It decreases if the atomic no is decreased from left to right in a period.
  • In groups, atomic size gradually increases from top to bottom.

Atomic radius

The distance between the nucleus and the outermost orbit of the electrons of an atom is called atomic radius or atomic radii.

Relative atomic mass

The relative mass unit or atomic weight open element is defined as the number of atoms of an element in grams contained in 12 grams of carbon _12(isotope)

Atomic mass unit

The atomic mass unit or Dalton is defined as the one-twelfth of the mass of a carbon atom.

  • It is also called Dalton.
  • Its symbol is amu.

Interactions between atoms ( bonds)

Types of bonds

  • Ionic bond
  • Covalent bond
  • Dative covalent bond
  • Metallic bond

Ionic bond:

This type of bond is formed by the complete transfer of an electron from one atom to another.

Example

  • Only valence electrons( electrons in the last shell) can take part in ionic bonding while others are not.
  • In ionic bond formation, heat is released.

Covalent bond:

In this type of bond, electrons are mutually shared between two atoms.

Types

  1. Single covalent bond
  2. Double covalent bond
  3. Triple covalent bond
  4. Metallic bond

Single e covalent bond:

In which one bond pair of electrons is formed by the contribution of an electron by each bonded atom.

  • Indicated by a single line

Double covalent bond:

In which two bond pair is formed by the contribution of electron pair from each atom.

  • Indicated by double lines

Triple covalent bond:

In which three bond pairs are formed by the contributions of three electrons from each bonded atom.

  • It is indicated by three lines.
  • Each bonded atom attains octet by sharing of bond pair of electrons and attaining the nearest noble gas configuration.

Dative covalent or coordinate covalent bond:

A bond is formed between the electron pair donor and the electron pair acceptor.

  • The atom which invests a pair of electrons is called a donator.
  • The atom that receives that electron pair is called the acceptor.
  • Those valence electrons that are not taking part in bonding and available on an atom like the one available on nitrogen in ammonia.

Example:

Polar covalent bond:

Those covalent bonds in which hetero atom takes part and one attracts the bond pair of an electron more strongly than the other.

None polar covalent bond:

If a covalent bond is constituted in which two similar atoms shared pair of the electron is excited by the both equally. such a type of bond is called a nonpolar covalent bond.

Predominantly covalent:

If the electronegativity between two elements is more than 1.7 the bond between them will be predominantly ionic and if it is less than 1.7 the bond between two atoms will be predominantly covalent.

Metallic bond:

A metallic bond is formed due to free electrons.

Evolutionary history of the atom

Timeline: 400 BC.

Scientist: Democritus

Theory of universe:

A first-person who uses the term atom(mean individual derived from atoms) was a Greek philosopher. He says that if you divided a piece of matter and divide and continue dividing, at any moment reach when you can’t divide it more, that fundamental unit was Democritus called an atom.

  • Atom is made from matter and can not be seen by the necked eye.
  • Between atoms, there is a space.
  • Atoms are in the form of a solid-state.
  • There is no internal structure in an atom.
  • Every atom has a different shape, size, and weight.

Timeline:1800s

Scientist: Jhon Dalton

  • The first person presents an atomic model of the behavior of the theory of the behavior of atoms consisting of small particles.
  • Atoms cannot change their shape and are indestructible.
  • By the weight of atoms, their elements can be characterized.
  • Atoms combined to firm a compound.

Timeline: 1890s.

Scientist: Thomson

J.JThomson was a physicist who use cathode ray tube technology to discover electrons.

  • In this tube, the air has been sucked out.
  • An electric charge travels from cathode to anode
  • Florescent gas light up the whole tube and the charge in it is invisible. When a charge hits the beam, a dot will appear on the screen.
  • A beam of light travel in a straight line in a fluorescent tube.
  • Each coil has a specific charge on a deflection.
  • From a negative coil, the charge would defect away as Thomson shows.
  • So he formed that charge this a negative charge.

When he found that negative charge, he did not stop and did a series of experiments, he discover the mass of the electron. He found that the mass of an electron is 1000 times lighter than a hydrogen atom. He made a statement saying that an electron must be inside an atom. Before it, he says the negative charge corpuscles later his name was changed and named as an electron.

Thomson’s atomic model

Using her prediction, he discovered what an atom looks like?

  • His model was named plum pudding model his name.
  • Each atom has a spherical shape and is inserted with positively charged fluid. He says it sticky jam part of a pudding.
  • In this fluid, corpuscles (electrons) are the negatively charged particles suspended. He compared it to plum in the pudding.
  • The movement of these electrons is not discovered by Thomson.

Timeline: 1910’s.

Scientist: Ernest Rutherford

Sir Rutherford made a famous gold foil experiment and proved the Thomson atomic model.

  • He fired positively charged alpha particles at a gold foil.
  • He estimated the deflection came out the other side.
  • Every particle has not been deflected. Every particle would deflect back in all the ways.
  • He assumed that the center of the foil must be positive. He called his nucleus.

Rutherford's Atomic model

  • The nucleus consists of positively charged particles.
  • The electrons revolve around the nucleus.
  • He faces one problem: Why nucleus can’t attract the electrons?
  • He compared the atom with a mini solar system in which electrons revolve around the nucleus in a fixed orbit due to this he called his planetary model

Timeline:1910’s

Scientist: Neils Bohr

Niels obeys the planetary model but he found some disadvantages. He could answer the Rutherford question

Why electrons do not fall into the nucleus?

He replies with a perfect answer to the question because of his knowledge of quantum physics and energy.

Bohr's atomic model:

  • Electrons have fixed energy and size in orbits of the nucleus.
  • The energy of an electron depends on the orbit in which the electron revolves.
  • Electrons fill the lower orbit first.
  • If the first energy level(orbit) is filled then the next will began to fill.
  • When an electron moves from one orbit to another, the radiation process occurs.

There is a problem with this theory: Electrons could not move in a specific path or orbit.

Timeline:1920’s

Scientist: Erwin Schrodinger

He was a revolutionary physicist and he presented the atomic model by using Heisenberg’s uncertainty principle.

Schrodinger’s atomic model(Aka the cloud model)

  • An electron would not revolve in a fixed orbit.
  • We can find out where it likely is.
  • Energy level depends upon the type of probability of orbit described by Bohr.

Facts

What is not an atom?

By the definition, atoms are the units of matter, so those are not atoms that do not consist of matter.

Parts of atoms that are not associated with a proton are not atoms.

An electron is not an atom, also neutrons bonded to other neutron is not an atom.

Why does an atom react?

Atoms react for attaining the nearest noble gas configuration and become more stable by following the duplet or octet rule.

Why the shape of the atom is spherical?

We can say that an atom “has the shape of the sphere” because a positively charged nucleus is at the very center, and the negatively charged electrons are distributed around it. The electrons are attracted to the nucleus and repel each other. A nucleus, the mass of neutrons and protons within an atom, arranged itself in a roughly spherical shape.

Why the revolving electron does not fall into the nucleus?

Electrons revolve in fixed energy levels around the nucleus. It can not befall into the nucleus because electrons do not radiate energy and move in a circular orbit due to necessary centripetal force.

Why neutrons are neutral and do they exist in the nucleus?

We have an idea from its name, the neutron is the neutron. In other words, the interaction between protons and electrons can cause the formation and destorarion of neutrons. As electrons are negatively charged and protons are positively charged particles. So they cancel each other charge and that’s why neutrons carry no charge and they are neutral. They exist in the nucleus for the stability of nuclei.

Why carbon 12 is used in the references of all atomic mass units?

At the start, hydrogen is used to measure but it gives a fraction. so it would be changed into oxygen, Scientists used a mixture of natural oxygen but it led to confusion. So again changed the reference and turned it into carbon – 12. We use this because it gives all the atomic mass units in exact no. The reason is the different ratio of the mass of proton and neutron performing the change of nuclei.

I Hope, I cover all aspects of the atom, in the next tutorial we will learn about the molecules. If someone has any questions about the atom I will try to answer them. write it in the comment box. Thanks

Raspberry Pi Pico Dual Core Programming with MicroPython

Hello readers, I hope your all are doing great. We know that a Raspberry Pi Pico module comes with multiple inbuilt features for example onboard memory, processing units, GPIOs or General Purpose Input Outputs (used to control and receive inputs from various electronic peripherals) etc.

In our previous tutorials, we discussed how to access GPIO pins of the Raspberry Pi Pico module for both input as well as output operations.

In this tutorial, we are going to discuss another important feature of the Raspberry Pi Pico module (RP2040) which is Dual Core Processor. The Pico board features with 133MHz ARM Cortex-M0+, Dual Core Processor. This dual-core feature makes the Pico module capable of multiple thread execution or multithreading.

Now before writing the MicroPython program let’s first understand the concept of the dual-core processor in the Raspberry Pi Pico module.

Fig. 1 raspberry Pi Pico dual-core programming

Raspberry Pi Pico Dual Core

A core is the basic unit of any processor which is responsible for executing program instructions. A multi core processor comes with the features of executing multiple tasks at a time. Multithreading is the ability of a processing unit to provide multiple threads of execution simultaneously (operating system supported). In multithreading, threads share their resources with each other. So this dual-core processor feature results in increased processing speed.

Raspberry Pi Pico (RP2040) module is having two processing cores, Core0 and Core1. In the default mode of Raspberry Pi Pico program execution, Core_0 executes all the tasks and Core1 remains idle or on standby mode. Using both the cores of RP2040 provides us with two threads of execution and hence a more powerful project with better processing speed.

Both core0 and core1 execute their assigned tasks independent of each other while sharing all the resources like memory space and program code with each other. Sharing the memory location between two cores can create race conditions and hence can cause trouble when mutual memory accessing is not assured. On the other hand, sharing program code with each other (core0 and core1) may sound troublesome but practically it is not. The reason is fetching code is a read instruction that does not create a race condition.

Core0 and Core1 communication

Fig. 2 Core_0 and Core_1 communication

As we mentioned above, sharing memory space with two cores simultaneously can cause race conditions. So, to make the cores to communicate with each other the Raspberry Pi Pico module is featured with two individual ‘First In First Out’ (FIFO) structures. Each core can access only one FIFO structure so both core have their own FIFO structure to write codes which helps in avoiding race condition or writing to the same memory location simultaneously.

You can follow the given link for detailed study on Raspberry Pi Pico: https://www.theengineeringprojects.com/2022/04/getting-started-with-raspberry-pi-pico.html

Software and Hardware components required

  • Raspberry Pi Pico development board
  • Thonny IDE
  • Data cable
  • Connecting wires
  • Breadboard
  • LEDs

Programming

The development environment we are using is Thonny IDE, to program the Raspberry Pi Pico board for accessing the dual core feature with MicroPython programming language.

So, before writing the MicroPython program user need to install the respective development environment.

We already published a tutorial on how to install and access Thonny IDE for Raspberry Pi Pico programming using MicroPython programming language. You can find the details at the given link address: https://www.theengineeringprojects.com/2022/04/installing-thonny-ide-for-raspberry-pi-pico-programming.html

Now let’ write a MicroPython program with Thonny IDE to access raspberry Pi Pico’s both cores:

In this example code we using just a simple “print()” commands to print the messages from each core for testing purpose.

  • The first task while writing a code is importing necessary libraries. Here we are importing three libraries, “machine”, “utime” and “_thread”.
  • utime library provides the access to internal clock of raspberry Pi Pico module which is further used to add delay when required.
  • _thread library is responsible for implementing the threading function provided by “Raspberry Pi Pico” community.
  • As we are using a dual core processor and accessing both the cores simultaneously means we are using two threads (one thread from each core). This _thread module allows a user to work with multiple threads and also allow them to share global data space.
  • For more details on _thread module follow the given link: https://docs.python.org/3.5/library/_thread.html#module-_thread

Fig. 3 Importing necessary libraries

  • Semaphores or Simple locks are provided with “_thread” module which is responsible for synchronization between multiple threads. The allocate_lock() function provided with _thread module is responsible for returning a new lock object.
  • Here we are declaring a “spLock”

Fig. 4 declaring thread lock object

  • Next, we are creating a function where we are assigning the task to core_1.
  • The “spLock.acquire()” function “acquires the thread lock without any optional argument”. The reason for using the this “acquire()” function is to make sure that only one thread of execution is acquiring the lock at a time until the lock is released for other thread. Here we using the “print()” command as a task assigned or to be executed by core_1 along with a delay of 0.5sec or 500us.
  • Next, is the release() command, which is used to release the lock acquired earlier. So that other threads can execute their respective tasks.
  • The task assigned to core_1 will be executed continuously because it is written in “while loop”.

Fig. 5 Task for Core_1

  • The function core1_task() defined earlier which is containing the task assigned to core_1 will be passed as an argument inside start_new_thread() function. As per the official documentation from python.org, this function is responsible for “starting a new thread and returning its identifier”. The thread will execute the assigned function (as an argument). The tread will automatically exit when the function returns. We can even assign more than one argument in this “-thread.start_new_thread()” function.

Fig. 6 Core_1 thread

  • As we mentioned earlier, Raspberry Pi Pico uses core_0 as default a core for processing purpose. So here we do no need to use the _thread.start_new_thread() function to start a new thread for Core_0. Core_0 will automatically start a thread for code execution. But we still need to call the acquire(a lock) and then release functions, just to ensure only thread is acquiring the lock at a time. Here again we are using the print() command to print a message from core_0 like we did in case of Core_1.

Fig. 7 Task for default core (core_0)

Code

The MicroPython code with thonny IDE for Raspberry Pi Pico is written below:

import machine

import utime # access internal clock of raspberry Pi Pico

import _thread # to access threading function

spLock = _thread.allocate_lock() # creating semaphore

def core1_task():

while True:

spLock.acquire() # acquiring semaphore lock

print( "message from core_1")

utime.sleep(0.5) # 0.5 sec or 500us delay

spLock.release()

_thread.start_new_thread(core1_task, ())

while True:

spLock.acquire()

print( "message from Core_0 ")

utime.sleep( 0.5)

spLock.release()

  • Copy the above code and paste in your Thonny IDE window.
  • Save the code either on Raspberry Pi Pico or your computer and once it is successfully saved click on the ‘Run’ icon to run the code.
  • Now go to Shell section to check the result. If the Shell is not enabled then go to View >> Shell and check ‘Shell’.
  • Now in the shell section you should see the message printed from both the cores.

Fig. 8 Enabling Shell

Result

The result obtained from the above code is attached below. Where we can see the messages received or executed by both the cores as per the instructions provided in the micropython code.

Fig. 9 output printed on shell

Let’s take another example where we will interface some peripheral LEDs and will toggle those LEDs using different threads of execution or cores.

  • Most of the instructions are similar to the previous example with some additional ones. Here we are importing one more library ‘Pin’ (along with the previous ones) to access the GPIO pins of raspberry Pi Pico module.

Fig.10 importing necessary libraries

Fig. 11 declaring led objects

  • Next task is assigning the task for each core. Core_1 is assigned to make the led_1 (GPIO_14) to toggle along with printing the given message.

Fig. 12 Toggling LED with core_1

  • Core_0, which is the default one is assigned to make the led_0 (i.e., GPIO_15) toggle with a delay of 0.5sec. Rest of the programming instructions are similar to the previous example code so we are not explaining them again.

Fig. 13 toggling LED with core_0

Code

from machine import Pin

import utime # access internal clock of raspberry Pi Pico

import _thread # to access threading function

# declaring led object

led_0 = Pin( 14, Pin.OUT ) # led object for core_0

led_1 = Pin( 15, Pin.OUT ) # led object for core_1

spLock = _thread.allocate_lock() # creating semaphore lock

def core1_task():

while True:

spLock.acquire() # acquiring semaphore lock

print( " message from core_1" )

led_1.value( 1)

utime.sleep( 0.5) # 0.5 sec or 500us delay

led_1.value(0)

spLock.release()

_thread.start_new_thread( core1_task, () )

while True:

spLock.acquire()

print( "message from Core_0" )

led_0.value(1)

utime.sleep( 0.5)

led_0.value(0)

spLock.release()

Result

In the results attached below we can that two LEDs are attached with raspberry Pi Pico boar. Green (GPIO14) and Red (GPIO15) LEDs represent the output of Core_1 and Core_0 respectively.

Fig. 14 Core_1 output (GPIO 14)

Fig. 15 Core_0 Output (GPIO15)

Conclusion

In this tutorial, we learned how to access both the cores of the raspberry pi Pico module and to execute task or control peripherals with individual cores. We also learned the concept of threading and multithreading.

This concludes the tutorial. I hope you found this of some help and also hope to see you soon with a new tutorial on raspberry Pi Pico programming.

Role of IoTA in Industrial IoT- Industry 4

The Industry 4.0 market size will reach $267.01 billion by 2026. Industry 4.0 depends on the secure, fast, and cost-effective data transfer between IoT devices. IoTA is designed to ensure secure communication between two devices within the IoT(internet of things) framework. Let's have a detailed look at the role of IoTA in industrial IoT.

Understanding IoTA- how it's different from blockchain

The terms MIOTA and IoTA together make up the term IoTA. While MIOTA is a cryptocurrency, IoTA is a non-profit foundation. Since its inception in 2015, IoTA has formed joint ventures with firms like

  • Fujitsu
  • Samsung
  • Telekom
  • Volkswagen

IoTA is technically different from blockchain in terms of the underlying technology. IoTA works on a technology called DAG (directed acyclic graph). Under the DAG technology, two transactions need to be validated to send one transaction. Apart from this, a proof of work needs to be submitted to validate the transaction. You will find a lot of boxes in the figure given below. Each box represents a transaction. This system of boxes is known as an IoTA tangle.

One of the most distinguishing features of the IoTA tangle is that, unlike blockchain, it can work offline. The data can be synchronized later. The ability to work offline happens to be an essential feature to consaider while developing IoT applications. This is because IoT devices often work in scenarios wherein there is no guarantee of a strong internet network.

Now that we have had a look at the basics of IoTA, let's now see why IoTA is important for industry 4.0.

Why is IoTA important for industry 4.0?

The first industrial revolution was industrialization through water and steam power. The second industrial revolution consisted of mechanization through electricity. The third industrial revolution started with the wide-scale adoption of computers in manufacturing. The fourth industrial revolution will be built on what started in the third industrial revolution.

Products will be produced automatically by machines that will talk with each other. All this will be fuelled by machine learning and data science.

The success of Industry 4.0 relies a lot on IoT devices. The IoT devices need a base layer to connect the different industries.

The base layer should have the following characteristics.

  • Able to cater to the entire IoT market
  • Already has successful partnerships
  • Battle-tested products

If there is one technology with all these characteristics, it's IoTA. IoTA is a highly scalable technology that enables fast transactions. Unlike blockchain, there are no fees or mining costs with IoTA.

Key Benefits of IoTA

The following are the significant benefits that IoTA provides.

Tangle properties

IoTA allows for the secure transmission of data. Data sent through other communication channels only proves that someone sends data. With IoTA, it is possible to ascertain whether the same data was sent to everyone else or not and when the data was sent. This feature of IoTA is important because fraudsters can send one set of data to one person and another set of data to another person. The “Notarization" feature of IoTA can be used to prove that an electronic document existed in a physical form earlier and the document has not been changed since its creation.

Lean system

IoTA is a system that is designed specifically for IoT devices like sensors. IoTA is an energy-efficient system that can easily participate in a low-energy network. An IoTA system allows nodes with low hardware resources to participate in the IoTA network.

Fairness

An IoTA system is a fair system as nobody can gain a higher priority in processing by paying more money. Unless the system is congested, all the transactions in an IoTA system are treated equally.

Cost-effective

Unlike blockchain, no mining is required in an IoTA system. This makes IoTA transactions feeless. The ability to conduct feeless transactions is an essential feature of the IoTA system as it enables micropayments to be done easily. Using an IoTA system, you can build a machine-to-machine economy and implement consumption-based payments.

Open-source

The IoTA is an open-source communication protocol. As it is an open-source protocol, everyone can collaborate on the code. Being open-source, the growth of IoTA is exponential as many companies come together in the Tangel EE Working Group and work on solutions for commercial uses.

Industrial use cases of IoTA

There is a wide range of Industrial use cases of IoTA. We have discussed the most popular ones below.

Mobility

Mobility is one area where IoTA can prove helpful. According to research, by 2025, there will be 8 million consumer vehicles that will have self-driving capability.

IoTA tangle allows for secure data transmission between cars and other machines. The vehicles can transact data about weather conditions, traffic congestion and road conditions using IoTA.

IoTA can also enable cars to automatically pay for tolls, parking, battery charging and other services. IoTA makes cars safer and reliable through real-time software updates.

Using IoTA, trucks can do platooning. In platooning, the trucks drive semi-autonomously, with minimum distance between them. Consistent speed creates fuel efficiency and safety, improving the profitability of truck owners.

Supply chain

Around 10% of goods transferred in the global supply chain are fraudulent. The supply chain industry faces trackability, and transparency of goods being transferred is the most prominent issue. IoTA can help resolve these issues.

The logistics companies can keep an immutable and encrypted audit trail of logistical updates with IoTA.

An IoTA-enabled tracking system includes real-time data about weather conditions and geo-location. It also verifies transfer of ownership/custody of goods. Thus, an IoTA-enabled system helps logistics companies improve their trackability and traceability.

Healthcare

IoTA helps healthcare service providers secure patient data. IoTA also helps in democratizing access to healthcare data.

Healthcare researchers can verify the integrity of research data through an IoTA ledger. IoTA can also help companies conduct better pharmaceutical trials. IoTA does this by logging every step and test result of the trial process into the IoTA tangle.

The MAM protocol helps healthcare providers and patients securely exchange patient data.

Smart energy

IoTA can open up doors toward a decentralized peer-to-peer energy trading system.

An IoTA-enabled system can help users to control energy assets remotely. The energy companies can achieve better grid stability and peak shaving through an IoTA-enabled system.

An IoTA-enabled system can provide seamless EV smart charging based on M2M micro-payments.

Industrial IoT

An IoTA enabled smart factory system securely stores the factory data in an IoTA tangle. The IoTA-enabled factory system stores only the encrypted hash in the tangle, thus creating a tamper-proof audit trail.

Through an IoTA-enabled system, the machine owners can lease out entire production lines to people who want to produce products.

Once the products leave the factory, they automatically become part of the smart supply chain. This way, an IoTA-enabled system brings a significantly higher efficiency into the industry.

Closing thoughts

Industry 4.0 is the next leap forward in the growth of mankind, and IoTA will play an important role in deciding the future of industry 4.0. Businesses that want to be a part of the industry 4.0 growth story need to leverage the power of IoTA to achieve exponential business growth.

How to Use a Raspberry pi as a VPN Server

Welcome to the next tutorial of our Raspberry Pi programming course. Our previous tutorial taught us how to use a raspberry pi as a DNS server. We also looked at the benefit of this DNS server. This tutorial will teach us to set up Raspberry pi as a VPN server.

This is an excellent method for increasing your network security and getting access to your local area network from the world wide web, but setting up your VPN server might be a challenge. Pi VPN uses a guided install to turn your Raspberry into a low-cost, high-performance VPN server.

Where To Buy?
No.ComponentsDistributorLink To Buy
1Raspberry Pi 4AmazonBuy Now

What is Pi VPN?

It is an OpenVPN server optimized for all Raspberry platforms above pi 2. It allows you to access your home network over the internet safely and securely. Smart devices and your network can be connected via a "bridge" created by connecting a Raspberry Pi to your router.

A virtual private network (VPN) is a secure option if you frequently use your router to forward traffic. Anyone can gain access to your network through any of the ports you forward. For maximum network security, use Pi VPN, which only exposes a single port and employs industry-standard encryption algorithms.

How can we choose a VPN service provider?

Selecting a virtual private network service is critical before you begin this project. It would be best to bear in mind cybersecurity, bandwidth, and delay when making this decision.

Ensure that your Virtual private network supplier doesn't record how you use their services. Nevertheless, speed and delay are critical here.

As a result, we've decided to go with IPVanish in this project. When it comes to network latency and network bandwidth, IPVanish is among the best.

Preparation for Pi VPN

The Raspberry Pi can get the best out of the device with a wired or wireless connection.

Use the Interfacing settings menu to turn on the secure shell service in RPi Settings. The configuration tool can be launched from the Pi menu or with the following command:

Activate the secure shell server and then restart your Pi

You can disconnect your display and switch off your desktop once your Pi hooks to your local network via a secure shell. It's simple to use a program like Putty or the terminal on your Mac to access your RPi.

Connect to the Raspberry Pi

You will not have to use a monitor to manage your Pi virtual private network server. A Raspberry Pi can be accessed from another device using SSH.

Use the ifconfig command to display your Raspberry IP address before unplugging it from the monitor.

If you configure your Raspberry Pi VPN server on Windows, you should use Putty.

Login to the RPi using the Internet protocol address noted earlier when Putty runs. Check to see if the secure shell is for the connection type. To save this connection to your profile, click the Save button.

You don't need a secure shell client if you're using a Macintosh or Linux computer to install Pi VPN. SSH is in your operating system's terminal, so you don't need to do anything extra.

A security key is saved on your Raspberry Pi the first time you access the raspberry pi. Accept the key and store it on your computer by pressing the Yes option on the screen.

Your password must be entered next. You'll be logged in as Raspberry Pi as long as you haven't changed the default password on your Raspberry

The prompt pi@hostname shows a successful login.

Update Raspbian for Pi VPN

Begin by obtaining a list of the most recent applications. Using the command: you can see if any installed programs are up to date.

Set a static IP address

When it comes to network services, you will have to locate your RPi, implying that you will set up a static Ip before you begin using the app. Also, modify your hostname at this point. When you get access, you'll notice a difference in the prompt. It's a simple way to distinguish between several Pis, but you can always change your hostname.

To establish a static Ip, you'll have to update the configuration file /etc/dhcpcd.conf. Before opening the file, know your router's Internet protocol address and Domain name system. This data is available using the ifconfig utility.

Take advantage of this command when you're ready to edit its config script:

To find an example of static IP configuration, look for the line with the label Sample static IP config inside the file. Simply remove the example comments and replace your Ip, routers, and gateway with your own to get started.

If you prefer a static IP address, remove the comment from it and replace it with the desired value.

Your custom values should be provided for static IP and DNS.

To alter your hostname, run the command below as superuser to open /etc/hostname in nano:

When finished, use Ctrl+X to close the editor. Then, press Yes to save the changes.

The /etc/hosts file must be edited in the same way. The file editing command is:

Change your hostname from 127.0.0.1 to whatever you've selected. Use the command below to force a reboot of your Raspberry Pi:

You should always change your connection's IP address after restarting your Raspberry Pi to reflect its new static address.

How can we figure out Raspbian’s firewall?

In Linux distributions, firewalls are embedded in kernels and will activate by default in Raspbian. The default setting for a new installation is to leave it unlocked.

There are no restrictions on inbound or outbound packets, and the firewall forwards any requests. Before securing the firewall, make sure it is entirely accessible.

Use iptables -L to see if your firewall protocols match. It's possible to return the firewall to its default settings using the following commands:

Choose an encryption

During configuring the Raspberry virtual private network, you will select the level of encryption. What you need to remember is the following:

  • Generally, 2048-bit encryption is the best for download and streaming. However, 4096-bit is ideal for emailing and browsing, giving better security.

Allowing 4096-bit is enticing for those who stream film or music; however, it will add a significant amount of overhead and slows down your connection significantly. For the most part, we use 2048-bit encryption, which is the industry standard.

Timing out during lengthy procedures

You'll inevitably stumble across a peculiarity in a secure shell. For more prolonged operations, if you are using SSH to communicate with the Raspberry, the connection is lost whenever the desktop hibernates. Any pi commands running stop working whenever a secure shell connection is lost; therefore, you must re-enter it.

A screen is an excellent tool for dealing with long SSH processes. One task might be the only focus of your screen sessions. Afterwards, you'll be able to join and disconnect at will and return to your session to see how it progresses.

Once Screen installs, you will need only a handful of commands to get the most out of it. Use apt to install screen utility as a starting point:

Once Screen installs, run it by typing the following command into your terminal window:

Even if nothing has changed, the commands you issue will continue to run even if you disconnect.

Whenever your Raspberry Pi connection stops, simply re-SSH in and type:

If only one secure shell session is open, you'll immediately get reconnected.

Installing Pi, the virtual private network

The Pi VPN works once you have your Raspberry working. It's the first step in a multi-part installation that will grant you access to Pi's virtual private network backend capability. Setting up an outgoing virtual private network tunnel connection for privacy will be done in the following steps.

Launch the installer

Configure the Pi VPN via a command-line utility called curl, which you download from the company's website. You don't even need a browser to use curl to download from the internet.

Pi VPN installs using the following command:

You can obtain the installation package and feed it into bash for execution using this command.

Instantly, the procedure of installation begins. It begins by scanning for any packages that need updating on your system. Your system should be the latest version

to proceed.

Launch the pi VPN installation after meeting a few pre-requisites.

The Pi VPN installer

To get the most out of your SSH session, you should use the Pi Virtual private network Installer. We can get started when the Screen changes colour to blue, and an installer notification appears.

Start by pressing Enter to begin the VPN setup procedure.

Static IP addresses are required, and in case you do not have any, you will get a notice. If you have not already done so, head back to the previous section and finish configuring a static IP address.

The Ip that Raspberry Virtual private network detects displays to you. Click the Yes if it is correct.

IP address conflicts display for your attention. Static IP addresses outside the dynamic host configuration protocol range are the safest method of avoiding conflicts with other devices on your network.

To continue, simply press the OK button.

Set the raspberry user, then click the OK to proceed with installing your preferred software.

If you want your Raspberry virtual private network server to get automatic security upgrades, you should select Yes when prompted. Because port forwarding makes your Pi vulnerable to the internet, Pi VPN must be updated.

Make sure you conduct frequent updates manually if you select "No."

After activating automatic updates, it's usual to see the console for some time. You can expect another installation attempt in the next few seconds.

You'll want to use the UDP protocol while setting up a Pi VPN for most circumstances. If you're going to use a VPN subscription service to establish a highly secure two-hop connection, stick with TCP instead of UDP.

The default port you're using for the virtual private network will come in handy later.

UDP uses port 1194 by default, whereas TCP uses port 443. Do not use port 443 when configuring the double-hop virtual private network because it will end up causing a conflict afterwards. Instead, we use TCP port 4430.

Set up an encryption

Select the encryption type you want at this point. Earlier, we explained why you might choose each option and why you should do so. If you're still undecided, refer back to what we discussed.

Using the space bar, choose the encryption you want to employ and press OK. Streaming video is only possible with 2048-bit encryption.

It may take some time to generate these keys. It will take significantly longer if you're encrypting at a high level. Wait for Pi VPN to produce your server keys.

Installing the final piece

The Raspberry Virtual private network setup procedure is nearly complete once the server key generates. After a few more stages, you'll be able to establish a connection.

If you do not have a domain Name system account, choose the public IP. In this case, we will need to input your hostname and domain name system account settings as usual if we are using a Dynamic domain name system.

You will need to select a domain name server provider for your virtual private network. Google is recommended to most people because it is free and straightforward. If you're concerned about DNS leakages, OpenDNS offers safe DNS solutions. If you plan to use Pi-hole to handle DNS requests, you may want to select Custom.

The installation will guide you through the process of adding additional users using the command line. Install a web app for managing users in the following phase. Additionally, pivpn add is an option.

Select Yes and restart your Raspberry Pi.

Setup of the Pi Virtual private network GUI

There is a Pi Virtual private network Graphical interface for Pi VPN. Using it simplifies the process of adding new devices and users.

When you add a new user to the VPN, a *.ovpn profile generates. In addition to creating a user account, you may efficiently utilize the Pi Virtual private network GUI to download the profiles.

If you don't want to utilize the Pi Virtual private network GUI, you can use the following to add or delete users.

Preparing to install the GUI for Pi VPN

Adding a repository is necessary if you want the Pi VPN GUI's required software to be easily accessible. Let me show you how.

Edit apt's source list with nano. The directive is:

Add the lines below to the sources. Make a list of everything you can find:

This will inform apt that Raspberry can install packages. Debian stretch repositories do not currently contain some of the required third-party software Pi Virtual private network GUI uses.

It's not good to include a link to a previous build in the sources.list script, even though we currently need it. Once additional software installs, it may interfere with it. Once these software packages install, you can delete the line in the sources.list you just added.

Next, save the changes and exit the Nano application. Then update with the command below:

Once the check is complete, use the following command to install any new or updated packages:

All you have to do now is tell apt about the new repository. The Pi VPN Graphical interface pre-requisites can now install using the command:

When prompted, select "YES" and allow the setup to begin. Before using the Pi Virtual private network GUI, you must change some config files.

Make sure all of your pre-requisite software install before running the apt update.

Updating the web configuration

The Pi Virtual private network GUI relies on an apache server to function effectively as a web application. However, we need to make a few adjustments before the Pi Virtual private network GUI start operating.

To begin, modify the user’s account under which apache executes. It runs as an unsupported account by default; therefore, we need to change it to the user pi. Use the following command to make changes to the Apache configuration file:

Find the line with $(APACHE RUN USER)

To exit and save, use Ctrl+X.

You'll also want to give yourself complete control over the /var directory, where Apache stores all of its web pages. Use the following command to grant pi complete control over the webroot directory:

Run the following command to move to the /var/www/HTML folder:

The raspberry pi should install the Pi Virtual private network Interface from that location.

Obtaining and installing the GUI for Pi VPN

After troubleshooting, downloading and installing the raspberry virtual private network graphical user interface is a breeze. You only need to use git to check out the project. You've already installed the git software if you've been following along.

Then run the following command from the HTML folder.

The command below will utilize git to copy the Pi Virtual private network GUI project folder into the directory of your apache server so that it is accessible as a web page. With a quick check-in of your browser, you can verify that the installation went smoothly.

Connect to Pi virtual private network GUI

You can now launch the Pi Virtual private network GUI from your internet browser and manage Pi Virtual private network users.

Use the Internet address that matches your setup and launch the Pi Virtual private network GUI from your internet browser.

Once a login screen appears, you've successfully connected to the network. For the time being, simply save a link to the Pi Virtual private network GUI for quick access. Setting up an outgoing VPN connection is the next step in protecting your online activity. If you don't want to utilize IPVanish, you may set up your router and add users without signing up for anything.

Establish outbound virtual private network connection

In the absence of an outbound Virtual private network, all traffic from all connected devices will use the public IP address of the local network to reach the worldwide web. The websites think that you are in the home network whenever you are connected. For example, you may wish to watch Netflix while away from home.

We recommend creating a "double-hop" connection with a VPN service outside the Pi virtual private network for the best results.

VPN connections with two hops allow for complete encryption whenever you access a site using HTTPS. Since the outgoing virtual private network server never notices the request source, the additional security offered by using two tunnels goes far beyond standard Virtual private network solutions.

If your Vpn service provider retains logs, they will not identify the devices from which each specific request was made. This additional layer of anonymity further obscures anything you do online.

Do not bother with this step if all you need is remote access to your local network via Pi's virtual private network. In contrast, if you're looking for safe and anonymous internet access for your mobile device, you can use an outgoing virtual private network connection and Raspberry virtual private network.

Outbound VPN with IPVanish

Due to its low latency, IPVanish is an excellent choice for establishing a double-hop virtual private network connection, requiring two separate virtual private network servers. Any OpenVPN profile-publishing VPN service will follow the same procedure.

Your VPN service's digital certificate and an autologin profile can be obtained below.

SSH onto your Raspberry Pi VPN server, then use wget to obtain the resources you need from the internet. Take a look at your Pi Virtual private network server and ensure it is online before using these instructions to obtain the data you require:

If you want to access the IPVanish server, you'll need to alter the uniform resource locator in the second field.

Make sure you rename the *.ovpn to use the OpenVPN service when connecting to IPVanish. Only profiles ending in *.conf can be connected to the network. Change the name of the file with the command below to outgoing.conf:

Establish the IPVanish connection

You can easily track two concurrent virtual private connections by renaming each interface.

The connection names will not change to or from between the two interfaces when renaming interfaces. To effectively configure your firewall, you must know the device's name.

If you go into the connection settings for each interface, you can modify the name. There is a *.config file for each OpenVPN connection linked with it. By altering the first few lines of each file, you can rename the network's graphical user interface.

To begin, run the command below to edit the Pi Virtual private network settings:

You should change the first line to:

Add a new line to the following:

Save your modifications by pressing Ctrl+X, then Y. /dev/tun-incoming will be created the next time the Pi Virtual private network is online.

Also, edit the OpenVPN outgoing configuration file.

Modify the first statement and add another at the start of the configuration file like before. In this case, the text should be as follows:

In addition, the outbound Virtual private network will need to be updated as well. Enter your name and password so that the Virtual private network can immediately connect to the server's cert you obtained in the previous stage.

To use the IPVanish server SSL certificate, make the necessary changes to the outgoing.conf file. Replace the word ca with:

Please use the following command to direct IPVanish to the password file we will create shortly: auth-user-pass

In addition, you must instruct your outbound virtual private network connection not to relay Local traffic. Your outgoing.conf file must have the following line added to it to allow access via Pi virtual private network to your home network:

Password files are now generated for use with IPVanish by OpenVPN.

Click Ctrl + X followed by the key to save the changes after entering your password and email address. You should encrypt the file because it holds your login details. With chmod, you can prevent anyone from accessing the password file in the OpenVPN configuration directory:

The root user can modify the password script file, which is the bare minimum level of protection required when keeping your login information in the clear text form.

Update the routing table of the Raspberry Pi

Your Rpi should be configured correctly for the outgoing Virtual private network to encrypt your internet connection. The static IP address of your Raspberry Pi must be substituted if it is different.

You'll need to update or generate the file below and add some lines. The command is as follows:

Include the following two lines in your script:

We require only one change to the routing table of your Raspberry Pi. We can use incoming and outbound VPN connections simultaneously when you save the adjustments and restart your Raspberry Pi computer.

Keep your DNS requests safe and secure

To ensure that your connection is genuinely safe, you must prevent DNS leaks. Using a Domain name server that isn't part of your virtual private network encrypted network results in a Domain name server leaks. For example, domain name server login and perform a man in the middle attack on your Virtual private network customers.

Forcing all incoming Virtual private network users to utilize the safe Domain name server from your outbound Vpn service provider is the solution.

OpenVPN config file is updated to change your domain name server without reinstalling the Pi Virtual private network. Use the following command to open the config file for editing:

The lines that send the Domain name server to your virtual private network clients are found by scrolling in the file.

When utilizing IPVanish, you need to replace these lines:

To identify the Domain name servers of a different Virtual private network, you'll need to research online. Save the file after editing it. As soon as the OpenVPN server starts up, your Virtual private network clients will connect automatically to secured servers provided by IPVanish.

Connect to IPVanish

OpenVPN should not connect automatically to the outbound virtual private network provider unless the connection is tested and verified. Type the following into the Run window:

The virtual private network connection status displays in the text on your screen. If you're having trouble connecting, double-check the outgoing configuration file and ensure your user information is in the password file on different lines. Hit Ctrl + C to exit the VPN once you've established a connection.

How can we connect to the virtual private network automatically?

After the connection is tested and found to be working, you should automate the startup for your VPN tunnel. You can connect to every connection using OpenVPN by its configuration file name.

This command will edit the OpenVPN global config file, which you'll need to begin.

Undo this line's comments.

Change it to:

Afterwards, save your modifications and reboot your Raspberry virtual private network server:

Pi VPN router settings

A virtual private network is a tunnel from the wide-area network to the local area network. Consequently, your router must be configured to accept specific connections. If you have a router that doesn't support port forwarding, you may have to perform this manually.

VPN port forwarding

If you didn't specify a port forward before, no Virtual private network clients would be able to access the network. We have to apply an exception to the security of our router's policies to allow these requests.

To access your router, copy its Internet address into your internet browser.

After logging in, go through the menus and select it from the list to enable port forwarding.

You'll have to remember the port number you previously chose in this process. Additionally, you'll need to know the static IP of your Raspberry Virtual private network server.

When you've completed port forwarding, click Save. VPN users can now access their accounts even if they are not in the local network.

Conclusion

This tutorial taught us to set up Raspberry pi as a virtual private network server. We also learned how to set up port forwarding and improve our network security. In the following tutorial, we will learn how to use a raspberry pi as a DNS server.

Ideal diode vs practical Diode

Hello, Students here I am present to cover an article on a series of Electronic devices and circuit theory. The foremost article of this series is Ideal diode vs practical diode. I try to elaborate on basic to modern theory related to the diode. This component act as fundamental to many important circuit devices such as rectifiers, transformers, etc. The question which we cover in this article are;

  • What is a diode?
  • How a diode is formed? Which methodology manufacturer utilized while the formation of the diode?
  • What is the concept of doping and PN junction in diode theory?
  • How does a Diode work?
  • What type of biasing allows a diode to conduct? Under which situation of biasing diode offers a restriction while conducting?
  • Upon which characteristics do we categorize the diode as an ideal diode and practical diode?
  • Which factor makes a diode ideal? And how practical diode is different from an ideal diode?

Along with these questions, numerous questions may arise in your mind related to diode because it is a very vast concept in circuit theory. If you want to know the answer to these questions, keep sticking with our article. The best step taken by our platform for the easiness of our readers is to provide two things in a single platform. A short video of this article is also tried to cover on our YouTube channel. You may visit. The link is given at end of the article.

What is a diode?

A diode is a two-terminal device that worked as a one-way conductor. A diode may assume as a simple solid-state component. This solid-state component is formed when the intrinsic semiconductor such as germanium or silicon Crystal is grown in such a way that one end is doped with pentavalent and the other end is doped with a trivalent impurity. It is also referred to as PN-junction Diode. Here word doped comes from techniques of doping which is used during the manufacturing of diode.

Doping

The process of adding an impurity to an intrinsic semiconductor I.e germanium and silicon. Semiconductors are those materials whose conductivity lies between a conductor ( good to conduct electricity) and an insulator ( bad to conduct electricity). To enhance the conducting capacity of semiconductors they are doped with different Impurities. Here the word impurity is used for those elements which are doped to pure semiconductor, after they are doped the germanium or silicon Crystal no longer remains pure.

Which element is used for doping?

Basically, elements from a fifth and third group of the periodic tables are commonly used in this process. Which refer to as pentavalent impurity (5the group) and trivalent impurity. Byword pentavalent means there are five electrons present in the outermost shell they lose one electron to complete their Octate and to become stable. That’s why these impurities are also named Donor impurity examples of such impurity are phosphorus, bismuth, etc. When we add such impurity to a semiconductor then N-type material is formed. Trivalent are those which have 3 electrons in the outermost shell and they need 1 electron to become stable due to this reason they are also named acceptor impurities. Examples of such impurities are Aluminum, Boron, etc. When they are doped with pure semiconductors then P-type material is formed.

How a diode is formed?

When intrinsic semiconductors is doped with two different Impurities then a junction is formed which I explain you in video of our Engineering prove t channel and I try to explain this also in my article;

When an N-type material is combined with P-type material then a PN junction is formed. In N-type material, there is the availability of a large number of free electrons which act as a majority charge carrier and holes act as minority charge Carriers. While in P-Type materials the doped material belongs to a trivalent group, they need 1 more electron to complete their covalent bond tendency. To complete one hole an electron jump from one shell to another. This creates another hole in the second shell which results in more than holes these holes act as majority charge carrier and electrons act as a minority charge carriers in P-Types material. As soon as these material are combine electrons from the N-side start to attract toward holes in P-side where they both diffuse and as soon as electron diffuse in the P-side this leave behind a positive ion and holes from the P-side move toward N-side and leave behind a negative ion result information depletion layer where there is lack of Carrier but still, there is the availability of negative and positive ions. This creates a natural potential difference between the two sides, thus forming a junction which refer to as PN-junction. Given below energy diagram and other pictorial representation helps to understand my concept.

Symbolic representation of a PN junction diode.

Symbolically a diode is represented as follows: Here N-side of the diode acts as the cathode and the P-side of the diode act as the anode. Current flow in direction to the arrow. There is a positive charge on the p-side and a negative charge on N-side.

How diode works

Under which biasing diode conduct and which biasing make diode poor to Conduct?

Biasing;

Biasing is a process in which to obtain the desire mode of operation we apply potential to both sides of the diode. This potential also helped us to control the width of the depletion layer.

Forward Biasing;

As shown in figure when biasing is applied in such a way that we provide the positive potential to cathode or P-Side of diode which makes it positive and negative potential of battery is connected with N-side of diode this makes the N-side more negative than P-side. This meets the necessary condition for a diode to conduct. This allows the flow of charges with little opposition almost negligible along with the depletion layer which reduces its width. Once a diode starts to conduct, there is slight opposition faced by carriers. This opposition is a referee to as bulk resistance. It combines the resistance of N-type and p-type. Its value is a most 5 ohm or less.

R(B)= R(N) + R(P)

As the value of R(B) is very low therefore there is little voltage drop across the resistance. Thus negligible in circuitry calculations. When the diode conduct fully the forward voltage becomes greater than the barrier potential. Typically the value of barrier potential or forward voltage for silicon and germanium are;

V(f) =0.7V for silicon

V(f)= 0.3V for germanium

Thus we can drive a diode to conduct by making the N-side more negative than the P-side of a diode.

Reverse Bias

When the potential is applied in such a way that the N-side is connected to positive terminal and P-side of diode is connected to the negative terminal of the battery then no electron and hole move through the junction they attracted toward their own attached pole side of the battery thus enhancing the width of depletion layer, junction current becomes reduces to zero. This means that there is large opposition faced by carriers in reverse biasing. However, there is a small few Milliampere current drawn in reverse biased condition due to some thermal agitation process which causes electron and hole pair combination. We can set a reverse biased condition by applying a potential to the N-side such that it drives more positively than the P-side of diode.

The conclusion which we drawn from these two biasing methods is;

Under forward biased conditions n-type is more negative then p-type, depletion layer width, junction Resistance are at minimum value. And device current is at peak value. Under reverse bias every situation becomes reversed p-type is more negative than the n-side. The width of the depletion layer increase and junction resistance meet to peak value we can say it becomes infinite and the device current become negligibly zero.

Want are the characteristics that make a diode ideal?

Ideal diode act as switch. There might be two possibilities which we attain while studying ideal diode. One is open switch and other is close switch. Let’s put a through back on some characteristics which a switch possess:

Ideal diode have following properties, which I also explain in my video whose link is given below of our article source.

Ideal diode can acts as a good conductor and good insulator under varying biasing schemes.

Under reverse biased condition it act as open switch;

In such situation a diode have;
  • Infinite Resistance
  • There is no flow of current across the junction. And diode acts as prefect insulator.
  • All voltage dropped across terminal component.

Under forward biased diode act as close switch

which have following properties;

  • Zero forward resistance
  • Maximum current is dream from diode. AMD Diode acts as perfect conductor.
  • No voltage drop across the components.

Characteristics curve of ideal diode

Now consider a characteristics algorithm for an ideal diode;

Characteristics curve of a circuit is the curve which is dream between the current and voltage to explain the manner in which device work under different situation.

Forward voltage is measured along positive x- axis and reverse voltage along negative x-axis. Similarly forward current and reverse current are measured along positive y-axis and negative y-axis respectively. 1st quadrant represent the forward bias region and 3rd quadrant represent reverse biased operating system. For vertical line in forward bias region the value of forward voltage increases with increase in forward voltage. For horizontal line in reverse bias mode we see that value of reverse current remains at zero level no matter what the value of reverse voltage. This implies diode act as perfect Insulator or open switch under reverse bias condition.

Now we discuss

how practical diode is different from ideal diode and what characteristics it posses?

(a) A practical diode can’t act as a perfect conductor and perfect insulator.

(b)Under reverse bias conditions there are a few milli-ampere current flows. Its value is very low. Now the question is why its Draws a small amount of current when reverse biased, it might be due to some thermal agitation process. Let’s try to explain this query. Consider the characteristics curve of the diode in both situations ideal and practical. in an ideal diode under reverse bias, the curve starts from the origin and there is no reverse current. And knee voltage is zero. Byword knee voltage we consider a point on the current-voltage curve at which there is a sudden increase or decrease of current. When a reverse voltage is increased beyond a limit then a breakdown occurs. Which break the electron-hole pair, and provides us a flow of free charge carrier due to this reason a small current is drawn even under reverse condition for practical diode due to electron-hole pair recombination. The value of knee voltage for silicon PN-junction is 0.7 V.

( c) In an ideal diode under forward biasing there is no voltage drop. While in practical diode there is a finite voltage drop across the terminal component whose value is different for silicon and germanium PN-junction.

(d) Piratical diode offers some finite Resistance under forward biasing which can’t be ignored and under reverse biased conditions there is no infinite Resistance.

The result we obtained about the Practical diode are:

(a) As Long as the knee voltage is not reached, the diode current is zero.

(b) When the knee voltage is achieved the diode begins to work and draws forward current.

Comparison between characteristics curve of ideal diode and practical diode

Lastly, there is an observable difference between the characteristics curve of both diodes.

In an ideal diode for forward biasing the forward current is maximum and the voltage drop is zero. And under reverse conditions no matter what’s the voltage, the reverse current is zero.

While in practical diode under forwarding biased, no current is drawn until the knee voltage that is 0.7 V is reached. Once this voltage is reached and the diode start to conduct the value of knee voltage is approximately equal to forward voltage I.e 0.7 regardless of the value of forwarding current.

The comparison between voltage and current values calculated in both diodes is summarized in below pictorial representation.

Some other considerations which we should make while dealing with practical diode are;

  • Peak reverse voltage
  • Average forward current
  • Forward power dissipation

This is the article from the series of electronic devices and circuit theory. I hope this material might be helpful for you. If you have any queries you may mention your problem in the comment section. Thanks to All.

How to Use a Raspberry Pi as a DNS Server

Welcome to the next tutorial of our Raspberry Pi programming course. Our previous tutorial taught us to set up a free media server on Raspberry Pi. We also learned how to connect with different devices and stream media files. This tutorial will teach us how to use a Raspberry pi as a DNS server.

Prerequisites

You must have access to the following resources to follow this tutorial:

  • Raspbian Pi OS on Raspberry Pi (2-4).
  • Internet access is required.

There must be a unique identifier for every machine on the Internet to speak with each other Using IP addresses; clients can identify the servers they need to contact. However, no one is expected to remember the digits of an address; thus, DNS names are used instead. This DNS can be built on a Raspberry. It's a number-to-domain converter. Clients first need to get the internet address by querying Domain name servers. This can take up valuable time. As a result, it is possible to accelerate Internet connection by configuring a dedicated Domain name server.

What is a DNS server?

The DNS helps you navigate IP-based networks. You typically type in a domain name like www.example.org in your browser's address bar. Computers use iPv4 and IPv6 addresses to communicate across the Internet. However, the server must transform the memorable domain for the transmission to work. Domain name servers are utilized for name resolution. Using a cache first is necessary for this. It may not be necessary to look for the individual system's IP address in some cases.

As a result, DNS queries are routed to single or multiple servers. The internet service provider's DNS server is the first to be called upon most of the time. This DNS offers an optimum result by comparing the search with its database. Otherwise, a request is sent directly to one of the Thirteen Internet core nameservers. This database contains all of the URLs on the Internet.

Static IP addresses are rare among internet users, especially those who aren't the owners of their routers. This property goes hand in hand with the use of dynamic DNS. Internet service providers only assign IP addresses for up to 24 hours. This assignment is followed by a brief forced separation, network disconnection, and a new IP address assignment for the user. Since clients are rarely addressed from outside the home network and only make an HTTP request to the server– rather than vice versa – this usually is not an issue.

However, setting up a DNS server may be necessary for the following situations: Remote desktops and mini-game servers are two examples of this type of technology. As a result, dynamic DNS is employed. A DDNS server assigns a domain name to the domestic server, allowing it to be accessed. DynDNS is a good option if you want a web-based Domain name server that clients from anywhere in the world can access at any time.

What is the purpose of a DNS server?

For several reasons, users prefer to use Domain name servers instead of manually looking up external IP addresses. When you have a large family, numerous roommates, or an office, having your server is a no-brainer when everyone uses the same devices and shares the same network.

  • Speed: A website query may have to traverse numerous gateways and servers before reaching the user's browser. If connecting to the internet service provider's Domain name server is not required, this process can hasten the procedure.
  • Privacy: Queries must be directed to external servers to maintain the DNS functionality. Many people don't like the idea of having to follow a trail on the Internet. Much of the information is kept in your possession when using a dedicated domain name server.
  • Security: Control of Domain name server entries is available to everyone operating their server. Cyber crooks frequently try to tamper with Domain name server requests to return wrong IP addresses. Instead of displaying the intended webpage, a different one gets displayed. You can never be too careful with internet banking. Fraudsters can quickly gain control of your funds and bank account by entering your personal information on a replica of the bank's website.
  • Adblocking:Using several commercial servers to avoid advertisements blockers working around the web. Individual Domain name servers can also perform this task. Even your entire home network is untethered from the Internet.
  • Child filters:Setting up child filtering functions makes sense, like in adverts. Networks can use domain name servers to prohibit servers that deliver content inappropriate for minors.
  • Learning curve: Installing one's Domain name server is a popular approach for curious Internet users to learn more about how things work on the Internet. Wall outlets provide power, and online browsers provide content. However, like many other Raspberry projects, this one has a lot of potentials if anyone wants to get to the bottom of the technology.

How can we use a Raspberry to create a domain name server?

Step 1 - Update raspbian

To begin, use the commands below to update the software packages:

Step 2 - Installation of the DNSMasq package on Pi 4.

Once the DNSMasq tool installs, the Domain name server is configured. The Domain name server forwarder is configured with the aid of DNSMasq.

Several devices on the same network can use it to get their Domain name server queries answered. It also manages limited resources utilized while configuring the Domain name server on a Raspberry.

Step 3 – Configure DNSMasq

Increasing the DNS server's responsiveness is the goal of this stage.

Modify the dnsmasq.conf file by following the steps outlined below:

CTRL plus W will locate and delete any # symbol from the lines:

  • domain-needed ensures the Domain name server will not send out any wrong names. The local network is kept up to date by looking for names without a dot.
  • bogus-priv prohibits the server from relaying requests inside local Internet protocol ranges to extern servers. It serves as a safeguard to keep local IPs from being leaked to external services.
  • no-resolv instructs the Domain name server to utilize DNSMasq rather than /etc/resolv.conf when resolving addresses.

To remove the line displayed below, press CTRL followed by W to locate it.

Then, add these lines:

We will ensure the upstream is the Google Domain name server by completing the preceding steps.

If you want to increase the size of the cache to 1000, delete the # symbol and do the following:

It is possible to speed up response times by increasing the cache's capacity. Performance is also boosted by storing more domain name server responses.

Next, save the changes, then run the following command to reboot DNSMasq:

Use the following command to see if the DNS is up and running:

Step 4: Test the domain name server

Dig is used to verify the server's functionality. If you want to gather info about DNS servers, static IP, and other things, you can use dig in Linux.

For example:

The query execution time is shown in the preceding image.

Keep in mind that the server's response time of 1091 msec is all that matters here.

The time it takes to make a query is reduced since the address is saved in the cache. The image below makes this quite evident.

Keep in mind that the Request Time is all that matters.

Step 5 – Configure the domain name server on your device

Ifconfig is used to get the raspberry network address.

For example, our server Ip is 10.0.2.15.

The next step is to configure devices to use this Ip as their Domain name server. To make this happen on your Windows PC, follow these steps:

Press Windows key Plus R to access run, access the Control panel by typing control, and press Enter.

In the control panel, select Network and Internet.

Afterwards, click on the View networks option in the newly opened window that appears.

Choose adapter configuration from the left-hand menu of the new pane.

You may do this by right-clicking on the interface you're using, such as Wlan0 or Eth0, and selecting Preferences.

Right-click on TCP/IPv4 and choose Preferences once more.

Then choose those Domain name server addresses from the drop-down menu that appears inside the new window.

Using a Raspberry, you can maximize the speed of the network. Domain name server query response times can be sped up by storing IPs in a local cache.

Keeping a Domain name server safe is essential since it is a common target for fraudsters.

Ensure that the upgrades automatically keep it running smoothly. Use the following command to upgrade.

DNS Query Resolution by DNS Servers

Whenever you enter a web link into the browser's address bar, a Domain name server searches for the desired address. As a result, various Domain name servers are queried, and each of them performs a translation of the domain you entered. The following are the several servers that are contacted:

  • DNS Resolver: Converts the domain name to an IP address when a request is made. When looking for a specific website, this server conducts the heavy lifting of determining its location on the Internet.
  • Root Server: After receiving a request, the server tells Domain name server resolvers where to find information about the top-level domain server of the site. In another way, the .com part of your domain is known as the top-level domain.
  • TLD Server: As a result, the Domain name server resolvers query this server, which returns the actual authorized name server.
  • Authoritative Name Server: Lastly, the Domain name server makes a query to this server to get the unique IP of that website you are attempting to access.

You'll see the web page you were looking for after the Ip has been found in the internet browser. Even while it sounds complicated, the process is relatively simple and takes only a few seconds to get you back to the website of your choice.

Types of DNS attacks that are most common

A denial-of-service

A single denial of service assault can overwhelm a web server with just one machine and one internet connection. When it comes to overloading the high-capacity systems today, they don't work very well.

Domain name server amplification attack

Another sort of Cyberattack known as a DNS magnification is where attackers exploit open Domain name servers to overwhelm domain name server responses. As part of an attack, the intruder spoofs the user's Domain name server source address and sends another request to the open DNS. The Domain name server response is sent to the destination rather than the Domain name server.

Domain name server hijacking

Domain name server hijacking can take place in three ways:

  1. A registrar domain account can be hacked, and the DNS can be modified to one that the intruders have control over.
  2. Malicious people target you by changing the A record on the IP of your domain.
  3. The router is compromised when an intruder modifies the Domain name server that is automatically dragged down to every device whenever a user connects.

Domain name server tunnelling

Domain name server tunnelling uses the Domain name server protocol, which is used to determine the network id to transfer data.

When a client sends a domain name server request, the only info included is that which is necessary for the server and the client to communicate. By using Domain name server tunnelling, an extra set of data is routed over the network. Communication can proceed unhindered by filtering, firewall, or sniffing software.

As a result, it is challenging to identify and trace its origins. It is possible to establish command structure and control via Domain name server tunnelling. It is also capable of leaking data. When information travels via a Domain name server, it is often broken down into smaller bits and reconstructed.

poisoning of DNS and the poisoning of the cache

Web traffic can be redirected to infected sites using security holes in the domain name server protocol known as domain name server poisoning or server spoofing.

When you visit a website, your internet browser first asks for a local Domain name server for the Ip. The local domain name server will contact the root servers of the domain and authoritative name servers to obtain the address of your domain.

How can we avoid, identify, and respond to domain name server attacks?

  1. You should be familiar with your complete domain name server infrastructure. To begin, safeguarding a network necessitate familiarity with all of your company's DNS records. Occasionally, network administrators lack total visibility due to Domain name server silos, orphan zones, or shadow technologies.
  2. Domain name server responses and queries should be logged and monitored—first, spot anomalies by logging in and monitoring outgoing and incoming requests. An in-depth forensic investigation might be aided by collecting more responses.
  3. Secure your Domain name server recursive servers.Recursive servers can be protected from unauthorized access and modification with DNSSEC and other design changes.
  4. Secure your Domain name servers by limiting administrator privileges.

What are DNS servers used for?

For the Internet to function, a company's ICT department must support the DNS servers as a critical piece of infrastructure. A well-maintained authoritative Domain name server is required for this.

The most important thing to remember is that a server going offline is impossible with an adequately designed anycast Domain name server. It is possible to maintain each server at a time while providing a fast and reliable Domain name server by connecting geographically distributed endpoints with redundancy servers at every station.

Do you need a "perfect" domain name server? Yes, Outages to your external Domain name server can have a direct impact on the following departmental activities:

  • Primary websites
  • Marketing campaign website
  • Email server
  • Client support website
  • Online resource library
  • Webinar service
  • Instant message tool
  • IoT devices

This is an extensive list, but there are likely many more devices and programs that rely on the Domain name server to work correctly. Although outages and poor performance can harm your bottom line, the ROI is robust and measurable. As long as a Domain name server outage spares your team from having to meet with the above departments, the service will pay for itself.

Conclusion

This tutorial taught us how to use a raspberry pi as a DNS server. We also learned the possible attacks on a domain name server and how to prevent these attacks. In the following tutorial, we will learn how to use a raspberry pi as a VPN server.

How to Use a Raspberry Pi as A Media Server

Welcome to the next tutorial of our Raspberry Pi programming course. Our previous tutorial taught us to set up a webserver in raspberry pi. We also looked at configuring addclient and deploying apps to our repositories. This tutorial will teach us to set up a free media server on Raspberry Pi.

Where To Buy?
No.ComponentsDistributorLink To Buy
1Raspberry Pi 4AmazonBuy Now

Using a Raspberry Pi as a multimedia server requires:

  • An operating system and miniDLNA program installed on your Raspberry Pi,
  • You can attach various cleanly formatted and fragmented hard disks to your Raspberry Pi for storing and streaming media files.
  • A basic understanding of how to use a computer, Client-server architecture skills, familiarity with Unix terminal and Secure shell, and a passion for computing and the media are a must!

Even if you lack some of the expertise mentioned above and experience, we can still attempt to accomplish this task, and you will gain new knowledge in the process!

This can be done in a variety of ways. It's a mix of free and paid options. While we're here, we'll learn how to use the DLNA protocol to run a public media server on a Raspberry Pi. Let's get right down to business right away.

What Exactly Is a Multimedia Server?

It's possible to store information in the form of files on a media server at a central location. It doesn't matter if it's a document, image, film, ebook, or scripting file stored on a conventional media server; everything it contains is a file. It merely allows you to store data in a more orderly fashion. Accessing data should necessitate you navigating it on your own.

A media server sits on top of the file server. Media items such as photos, music, and videos can be accessed with this application. In addition, it enables network playback. There's no need to worry about where the video files are kept. You don't have to do anything more than type in your questions and wait for the results to appear. For example, you can search for all the music by a particular artist or musician. These new features improve the media server's usability, manageability, and overall appeal.

What is DLNA?

Let's have a look at the DLNA, shall we? When it comes to digital living, DLNA (Digitized Living Network Alliance) is the acronym. SONY with Intel collaborated to create a multimedia transfer protocol standard. Its primary purpose is to set guidelines for media distribution via the Internet. Smart gadgets like android Tv, smartphones, and set-top boxes that can share multimedia content are all DLNA-compliant. Microsoft Media Player, VLC, and Plex will all be DLNA-enabled in the future.

Computers can now be used as multimedia servers thanks to the DLNA standard. A DLNA server and a DLNA client are necessary for DLNA to function. Media sharing is a server-to-client process that occurs at all times. Servers and clients cannot independently share material. Clients and servers are two terms you may hear used interchangeably. What do you think about their appearance? Any DLNA-enabled device can serve as a DLNA client. Smart devices that can stream media over the Internet are one example. Setting up a DLNA server does not necessitate a large server. Any of your friends can access it and set up their server with it. The Windows Player is capable of serving as a Digitized Living Network Alliance server. In addition, many NAS devices are equipped with DLNA server programs that allow users to view multimedia files stored on them. Free multimedia services can be built on the Raspberry Pi using the miniDLNA software.

How Do We Setup MiniDLNA on a Raspberry Pi?

Because of its small size, it can be run on any Raspberry model. Let us set up a miniDLNA service on our RPi and transfer multimedia files to external smart devices via the network.

A better grasp of the setup procedure is gained by splitting this topic into four primary subsections.

  1. Install miniDLNA on your Raspberry Pi.
  2. Create directories for the storage of databases and logs.
  3. Configuring of miniDLNA for media files to be picked up.
  4. Rebooting the miniDLNA service.

Install miniDLNA on your Raspberry Pi

Install miniDLNA:

It's as easy to set up as any other application. Let's do an apt installation.

Minidlna's DB and logs should be stored in this directory:

/mnt/data-ext4/ is where we'll create all of the directories we need for our demonstration purposes.

Adding the group and user to the minidlna directory ownership list:

Inside the minidlna folder, we can write to a folder instead of root, as shown by the permissions below. In general, it's not a good idea to offer complete access to everyone. s Instead, new users and groups are created, and the ownership is transferred to them. Therefore, the database and logs are stored in this folder.

Ownership can be changed with the command shown. In the chown command, the user and the group are permitted to access the folder.

MiniDLNA directories must have the necessary permissions set.

Minidlna folder ownership after the chown command is shown here.

Create directories for the storage of databases and logs

Set up an entirely new subdirectory named "Music" inside the "public" folder you just created. The 'public' folder has all permissions for all the users, so the sudo word isn't necessary anymore. This folder is owned by 'user' and group 'pi,' and no one else has to write access to this folder.

The write permissions of the Music directory need to be fixed:

You can use the same 'chown' command to make the Music folder owned by everyone and grant write access. Everyone acknowledges the file/directory because nobody and no group are users.

Organize multimedia content by creating a few additional folders:

Likewise, you can reorganize your multimedia files in any way you see fit by creating new folders. For demonstration, we will establish a couple of extra subdirectories.

Add a few extra subdirectories inside the /mnt/NTFS public folder. Then, add some audio and video files to each of these folders.

The miniDLNA configuration file should be set up as follows:

Now tell miniDLNA where to find the media files. Modify the configuration file in your preferred text editor.

The media directories should be configured at this point:

Make a list of all additional folders you've made to contain multimedia files in the line where you see 'media dir.' Just after the equal sign is a letter, ',' include the location of the files.

A: Audio

P: Picture

V: Video

PV: Pictures and Videos

Use the following steps to set up a database and log storage location:

Navigate a little farther down the page to specify where the DB and logs will get saved. Quit the editor and save the modifications you've just made.

Restart the minidlna service:

Restart your minidlna server for the modifications to be reflected in the database and take effect. If everything is okay, the program should be functioning. Please check the status of the server.

Allow only a limited number of users to watch at once:

Analyze the logs to confirm that everything is functioning as intended.

Just keep an eye out for warning logs. There are claims it can manage up to 8192 folders and subfolders. If you have a more extensive selection, you can change the value of your collection to make it more valuable.

/proc/sys/fs/inotify/max_user_watches. But, this will not survive a reboot.

Permanently limit the number of people who can watch a video:

To keep the value set indefinitely. Modify the document /etc/sysctl.conf.

At the very end, add the following sentence:

Restarting the minidlna service is as simple as configuring it to do so.

This can be accomplished in a variety of ways. Here's an easy one:

It's done. However, keep in mind that indexing and cataloging massive data will take longer. The cataloging process might take a little longer at times.

Use Plex to set up a media server for your home.

Download the Plex Media Server Package

Choose Plex Media Server from the menu button of the official website, then Linux from the left-hand platform drop-down, and select the Choose Distribution button there.

If you're looking for an ARMv7-based distribution, choose Ubuntu (16.04+) or Debian (8+), then save the image. Then follow the steps below to install.

Method 1:Using the WinSCP utility on a Windows Pc.

Installing WinSCP is as simple as going to the official website and downloading the software. Run the program you downloaded and installed after it has finished downloading and installation.

  1. First, go to the Session > New Site option.
  2. File Transfer Protocol: SFTP
  3. Enter the hostname
  4. Enter username
  5. Enter password
  6. Login

Once you've logged in, you should see the local Computer system files on your left side and the Raspberry Pi system files on the other side.

Locate the Plex Storage Server you already downloaded, right-click on it, and select Upload. On the raspberry home directory, the file will be stored there.

Method 2: Use a secure shell to access the wget command in raspberry pi.

Using a secure shell, you may download plex with the wget command from your Raspberry Pi. Direct access to the application file is required to download the entire package. Copy the link address of the application by right-clicking on it and selecting "Copy Link Address."

To download a specific package, run wget accompanied by the URL link and press return on your pi terminal.

The package is saved to the current working directory after downloading.

Install Plex on the Raspberry Pi

Connect to the Pi through a secure shell using PuTTY. You should be in the root directory. The program 'ls' output will reveal the file that was previously.

We'll now use the dpkg tool to complete the installation.

IMPORTANT: The filename must match exactly what appears in the secure shell terminal. The reference name of the command is just for illustrative purposes.

Press the return key then you'll be prompted for additional verification. Please accept them, and it'll be deployed as intended. Once the server has been set up, it may be found at:

Whenever you launch the service for the first time, it will prompt you to check in to the Plex account. Once you've entered your username and password, the page should reroute to the local server.

Setting up an external HDD for use with Plex

The OS makes it more difficult to mount a hard drive in headless mode. Using this method, you should be able to get everything you need to get this working.

Use the following command to make a new directory in the media directory:

To make a copy of your system's /etc/fstab, type the command:

To identify the external HDD, type the command:

The name may differ if you're looking for the sda2 (/dev/sda2).

Type the command below to obtain the partition Block ID:

There is a LABEL to identify this drive and its type as NTFS, which you can see by looking at the printout. You may also get it as ext4, depending on the format.

The following command is used to modify the /etc/fstab file:

Insert this line in the file:

This UUID is the one that we acquired when we checked the id of the block in the steps above. Ntfs or ext4 should be the file system on the attached drive.

Hit Ctrl + O to save the file, followed by Ctrl + X to quit; the file is saved.

Reboot the Pi while the HDD is still plugged, and then run the df program once more to make everything work as it should. A working /media/HDD mount is still required.

If something goes wrong during this stage, getting the server up and running again will be more challenging.

How can we upload media to the Plex server?

The Plex app can is found on the Internet by browsing the following address:

Then, click the settings button displayed below.

 

Navigate to MANAGE > LIBRARIES from the left menu. Libraries are now clearly visible. Select "Add Library" from the drop-down menu. You should now be able to select a media type from a new popup:

Click Next, then Browse for a Multimedia Folder to select the files you want to use. The hard drive will be as seen in the image below. To upload media, click Add and then choose the media directory from which you want to add it.

At this point, the service should begin searching for your files. Depending on the content and the volume of data in the folder, this could take a while to accomplish.

How can we stream on smart devices?

The server-side plex setup is now complete and operational. You can now choose from a variety of ways to consume your media.

  1. If you have a Smart TV, you can use the Plex client application for streaming. Get the plex application installed, and sign in. In your Wireless connection, the application will find the server for you. You can now begin streaming and listening to the files.
  2. You can download the mobile application from the google play store and log in with your details. The server on your local wireless network should be detected automatically by the application. Is it possible to begin viewing the media? However, it is required that you purchase either a plex pass or a one-time unlock the key to consume the multimedia files using your Android phone. If you expect to stream a lot, this is a good investment.
  3. If you have a desktop or laptop computer, you can access the application through the internet browser at:

You'll be able to watch movies, web series, and live TV through the client application and your local media files.

Conclusion

This tutorial taught us to set up a free media server on Raspberry Pi. It is now possible to stream and organize your media files attractive and portable manner. In the following tutorial, we will learn how to use a raspberry pi as a DNS server.

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