Parts are composed of a number of surfaces, each surface has a certain size and mutual position requirements. The requirements of the relative position between the surfaces of the parts include two aspects: the dimensional accuracy of the distance between the surfaces and the relative position accuracy (such as axes, parallelism, verticality and circular runout, etc.).
The study of the relative position relationship between the part surfaces can not be separated from the datum, and the position of the part surface can not be determined without a clear datum. In its general sense, the datum is the point, line and surface on the part on which the position of other points, lines and surfaces are determined. According to its different functions, the benchmark can be divided into two categories: design benchmark and process benchmark.
A datum is a point, line, or surface from which measurements are made. In the case of the piston, the design datum refers to the centerline of the piston and the centerline of the pinhole.
The datum used by parts in the process of machining like turning and assembly is called process datum. According to different uses, the processed datum is divided into positioning datum, measuring datum and assembly datum.
1) Positioning datum: The datum is the point of reference from which all other measurements are taken. When positioning the datum, it is important to take into account the size and shape of the workpiece, as well as the type of machining operation being performed. According to the different positioning elements, the most commonly used are the following two categories:
Automatic centering positioning: such as three-claw chuck positioning.
To make a positioning sleeve, such as a stop plate, into a positioning sleeve.
Others are positioned in the V-shaped frame, positioned in the semicircular hole, and so on.
2) measuring datum: A measuring datum is a physical reference point used to take measurements. The datum provides a starting point from which all other measurements are taken. without a measuring datum, it would be difficult to take accurate measurements.
3) Assembly datum: the datum used to determine the position of the part in the assembly or product during assembly, called assembly datum.
In order to produce a surface that meets the specified technical requirements on a certain part of the workpiece, the workpiece must occupy a correct position relative to the tool on the machine tool before machining. This process is often referred to as the "positioning" of the artifact. After the workpiece is positioned, due to the action of cutting force, gravity and so on, a certain mechanism should be used to "clamp" the workpiece so that its determined position remains unchanged. The process of holding the workpiece in the correct position on the machine tool and clamping the workpiece is called "installation".
The quality of workpiece installation is an important issue in machining, which not only directly affects the machining accuracy, the speed and stability of workpiece installation, but also affects the productivity. In order to ensure the relative position accuracy between the machined surface and its design datum, the design datum of the machined surface should occupy a correct position relative to the machine tool when the workpiece is installed. For example, in the precision turning ring groove process, in order to ensure the circular run out of the ring groove bottom diameter and the skirt axis, the design basis of the workpiece must be coincident with the axis line of the machine tool spindle.
[caption id="attachment_171666" align="aligncenter" width="800"]When machining parts on different machine tools, there are different installation methods. The installation methods can be summarized as direct alignment method, marking alignment method and fixture installation method.
The main results are as follows:
1) when using this method, the correct position of the workpiece on the machine tool is obtained through a series of attempts. The specific way is to install the workpiece directly on the machine tool, use the dial meter or the needle on the needle plate, visually correct the correct position of the workpiece, and correct it at the same time until it meets the requirements.
The positioning accuracy and speed of direct alignment depend on the accuracy of alignment, the method of alignment, the tools of alignment and the technical level of workers. Its disadvantage is that it takes more time, the productivity is low, and it has to be operated on the basis of experience and requires high skills of workers, so it is only used in single-piece and small batch production. Such as hard to imitate the shape of the alignment belongs to the direct alignment method. .
2) the method of line alignment this method is a method of using a needle on a machine tool to correct the workpiece according to the line drawn on the blank or semi-finished product, so that it can get the correct position. It is obvious that this method requires an additional marking process. The drawn line itself has a certain width, and there is a marking error when marking, and there is also an observation error when correcting the position of the workpiece, so this method is mostly used in the rough machining of small batch production, low blank precision, and large workpieces that are not suitable for the use of fixtures. For example, the determination of the pin hole position of the two-stroke product is to use the marking method of the indexing head to correct it.
3) fixture installation method: the process equipment used to clamp the workpiece and make it occupy the correct position is called machine tool fixture. The fixture is an additional device of the machine tool, and its position relative to the tool on the machine tool has been adjusted in advance before the workpiece is installed, so it is no longer necessary to find the correct position one by one when machining a batch of workpieces, which can ensure the technical requirements of machining, which saves both labor and trouble. It is an efficient positioning method and is widely used in batch and mass production. Our current piston processing is the fixture installation method used.
Surface roughness is a measure of the irregularities in the surface of a material. It can be caused by a variety of factors, including manufacturing defects, wear and tear, and environmental exposure. Surface roughness can have a significant impact on the performance of a material, as it can affect its resistance to wear, corrosion, and other forms of damage. The term "roughness" refers to both the size and frequency of the irregularities on the surface of a material. The size of the irregularities is typically measured in micrometers or nanometers, while the frequency is typically measured in cycles per inch (CPI).
Surface roughness can also be characterized by its wavelength, which is the average distance between adjacent peaks or troughs. The most common method of measuring surface roughness is with a profilometer, which uses a stylus to trace the contours of the surface and generate a profile. The profile is then analyzed to determine the roughness parameters.
[caption id="attachment_171667" align="aligncenter" width="800"]There are 3 kinds of surface roughness height parameters:
Within the sampling length, the arithmetic mean of the absolute distance between the point on the contour line along the measuring direction (Y direction) and the baseline.
It refers to the sum of the average peak height of the five maximum contours and the average valley depth of the five maximum contours within the sampling length.
The distance between the top line of the highest peak and the bottom line of the lowest valley within the sampling length.
Nowadays, Ra is mainly used in the general machinery manufacturing industry.
The surface quality of the machined workpiece directly affects the physical, chemical and mechanical properties of the machined workpiece, and the working performance, reliability and service life of the product depend to a large extent on the surface quality of the main parts. Generally speaking, the surface quality requirements of important or key parts are higher than ordinary parts, because the parts with good surface quality will greatly improve their wear resistance, corrosion resistance and fatigue resistance.
Surface roughness is an important consideration in many engineering applications, as it can have a significant impact on the performance of a component or system. For example, surface roughness can affect the tribological properties of a material, such as its friction and wear resistance. It can also affect the ability of a material to resist corrosion and other forms of damage.
In addition, surface roughness can influence the optical properties of a material, such as its reflectivity and transmittance. Surface roughness is also a concern in many manufacturing processes, as it can cause defects in the finished product. For example, surface roughness can cause problems with adhesion, machining, and metallurgy. Surface roughness can also make it difficult to achieve desired tolerances in manufacturing processes. As a result, surface roughness is an important factor to consider in the design and manufacture of components and systems.
There are many ways to reduce surface roughness, including using methods such as honing, grinding, lapping, and polishing. In addition, surface treatments such as electroplating, ion implantation, and vapor deposition can also be used to improve the surface smoothness of the material.
1) the function of cutting fluid.
Cooling effect: the cutting heat can take away a large amount of cutting heat, improve the heat dissipation conditions, and reduce the temperature of the tool and the workpiece, thus prolonging the service life of the tool and preventing the dimensional error caused by thermal deformation of the workpiece.
Lubrication: the cutting fluid can penetrate between the workpiece and the tool, forming a thin adsorption film in the tiny gap between the chip and the tool, reducing the friction coefficient, so it can reduce the friction between the chip and the workpiece, reducing the cutting force and cutting heat, reduce the tool wear and improve the surface quality of the workpiece, which is especially important for finishing and lubrication.
Cleaning function: the tiny chips produced in the cleaning process are easy to adhere to the workpiece and the tool, especially when drilling deep holes and twisted holes, the chips are easy to block in the chip-holding groove, affecting the surface roughness of the workpiece and the service life of the tool. The use of cutting fluid can wash away the chips quickly, so that the cutting can be carried out smoothly.
2) types: there are two kinds of common cutting fluids.
Emulsion: mainly plays a cooling role, emulsion is made by diluting emulsified oil with 15-20 times water, this kind of cutting fluid has high specific heat, low viscosity, good fluidity and can absorb a lot of heat. This kind of cutting fluid is mainly used to cool tools and workpieces, improve tool life and reduce thermal deformation. The emulsion contains more water and has poor lubrication and antirust function.
Cutting oil: the main component of cutting oil is mineral oil, this kind of cutting fluid has low specific heat, high viscosity and poor fluidity, and mainly plays the role of lubrication. Mineral oil with low viscosity is commonly used, such as engine oil, light diesel oil, kerosene and so on.
MIG welding is the process of joining metal parts by melting the base metal and fusing it with a filler metal. The name is derived from the phrase "Metal Inert Gas," which is commonly used. The process involves using an arc between an electrode and the workpiece, which melts the base metal and fuses it with the filler metal.
Mig welding is an extremely versatile process that can be used to create virtually any shape or configuration of the welded joint. You can also use it for many different metals, including low carbon steel, stainless steel, and aluminum alloys.
The MIG welding equipment you'll need includes:
The torch supplies the heat needed to melt the wire. It has a handle, an on/off trigger, and a tip where the wire feeds. The torch also has an air regulator that controls how much oxygen is mixed with natural gas going into the burner head (the part of the torch where you attach your wire). You need to use this setting depending on what type of metal you're working with.
This holds the compressed gas used as fuel for the welding process. Welding torch to combust inside and heats up when activated by pressing down on your trigger switch or button. You'll also see these bottles or tanks. Still, they're all essentially identical in function—they vary slightly in size based on their gas capacity.
Protects your eyes from any spark produced by friction during MIG welding processes such as spatter creation during stick electrode usage.
The thickness of welding wire is measured in thousands of an inch (thou) or mils. The most common sizes of welding wire are as follows: 22-gauge (0.023"), 24-gauge (0.024"), 26-gauge (0.025"), and 28-gauge (0.028")
The gauge refers to the thickness of the wire and the higher the number, the thinner it is and the less heat it can take before melting or burning out on you when you're trying to weld with it.
You can adjust these settings to improve the quality of your weld or reduce the amount of heat you apply to the weld.
This controls how much material is deposited in each pass and determines how much heat will be required to melt it. A smaller diameter wire requires less energy and produces a cleaner weld, but it also requires more passes to build up a good bead.
This is how quickly you move through the molten pool when welding; too fast and you'll get porosity; too slow and it may take longer than necessary for each pass due to poor cooling.
MIG welding is a great way to get started in welding. It's really easy, and it's safe for beginners. You can use Mig welding for various projects, including light steelwork, ironmongery, and aluminum.
Mig welders are versatile, meaning they can handle almost any metal you want to weld with their different settings. They also include gas supplies that provide the shielding gas needed during the process, which makes them good value for money compared with other welder types.
Mig welding is a skill that anyone can pick up with only a little time and practice. If you're interested in learning how to weld but don't know where to begin, here are a few options:
Yes, you can use a TIG welder as a MIG welder. If your TIG welder has adjustable amperage, you can follow the steps listed above. TIG welders tend to have higher amperage settings than MIG welders, but they still require the same power as a MIG welder. Since a TIG welder is more versatile, it's worth investing in one if you're regularly using welding equipment or want more control over your project.
The machine uses a hollow wire and is filled with flux. Flux is the material that covers the weld and protects it from contamination when welding. You can use a flux core welder outdoors because the wind doesn't affect the weld because of the flux inside the wire. A flux core welder can also be used indoors with no gas if the welding material thickness is 1/2" or less. It isn't recommended to use Flux Core Welding for thinner materials on higher amperage settings, as there will be too much spatter and smoke
This is a common question, and the answer is: yes, but it depends on the type of wire you are using. Flux core wire doesn't need shielding gas, while solid welding wire does need shielding gas.
The type of work you do will determine whether you need a machine that uses shielding gas or flux core wire. For example, if you are working outdoors or inside with wind, you can use flux core wire since it does not require an external gas cylinder.
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 :
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.
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
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-
Molecule ___gain/lose electron _______ molecular ion
There are two types of molecular ions:
They have charged positive ions because they lost the electron from the molecules.
For Example :
CH4+
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.
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.
There are important features that tell us how an electron is removed from bond pair:
The most important thing here arises is that,
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.
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.
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)
The total atomic mass of all elements present in a molecule is equal to that of a particular substance known as molecular mass.
We can measure the molecular mass of the molecule by using the following steps which are given below:
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
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 are electrostatic attractive forces between permanently or temporarily charged chemical species. They include
These forces are responsible for the formation of molecular ions.
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 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 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 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
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
By using molecular ions we can determine the following facts:
The most important question is what molecular ions how they are formed.
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.
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
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.
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.
The software and hardware components required to interface the DHT sensor with the Raspberry Pi Pico board are:
Fig. Required Components (hardware)
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
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
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.
Fig. 5 importing necessary library files
Fig. 6 declaring the ‘pin’ object
Fig. 7 Main loop
# 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
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.
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
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.
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.
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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
Depending upon the type of atom from which an ion is formed we can classify it as a monoatomic, diatomic, or polyatomic 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;
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.
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? ².
When an ion is made from more than one type of atom then it is referred to as a polyatomic or molecular ion.
Here below there are some common examples are provided;
There are several techniques one can use to create an ion. Here I explain two methods;
Here Na+ represent positive cation ionic specie. And Cl- represent anionic specie.
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.
Hello, friends today we will discuss the basic concept of chemistry it is our first tutorial series in which we will discuss:
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.
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
Hydrogen (H2)
Nitrogen (N3)
Helium(He)
We discuss different properties of atoms like:
The no of protons present in the nucleus of an element is called atomic number Or nuclear charge no.
. Its symbol is Z.
Examples
The sum of the numbers of neutrons and protons in the nucleus of an atom is called atomic mass or mass no.
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.
The distance between the nucleus and the outermost orbit of the electrons of an atom is called atomic radius or atomic radii.
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)
The atomic mass unit or Dalton is defined as the one-twelfth of the mass of a carbon atom.
Types of bonds
This type of bond is formed by the complete transfer of an electron from one atom to another.
Example
In this type of bond, electrons are mutually shared between two atoms.
Types
In which one bond pair of electrons is formed by the contribution of an electron by each bonded atom.
In which two bond pair is formed by the contribution of electron pair from each atom.
In which three bond pairs are formed by the contributions of three electrons from each bonded atom.
A bond is formed between the electron pair donor and the electron pair acceptor.
Example:
Those covalent bonds in which hetero atom takes part and one attracts the bond pair of an electron more strongly than the other.
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.
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.
Timeline: 400 BC.
Scientist: Democritus
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.
Timeline:1800s
Scientist: Jhon Dalton
Timeline: 1890s.
Scientist: Thomson
J.JThomson was a physicist who use cathode ray tube technology to discover electrons.
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.
Using her prediction, he discovered what an atom looks like?
Timeline: 1910’s.
Scientist: Ernest Rutherford
Sir Rutherford made a famous gold foil experiment and proved the Thomson atomic 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.
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.
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.
Atoms react for attaining the nearest noble gas configuration and become more stable by following the duplet or octet rule.
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.
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.
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.
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
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
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.
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
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.
Fig. 3 Importing necessary libraries
Fig. 4 declaring thread lock object
Fig. 5 Task for Core_1
Fig. 6 Core_1 thread
Fig. 7 Task for default core (core_0)
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()
Fig. 8 Enabling Shell
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.
Fig.10 importing necessary libraries
Fig. 11 declaring led objects
Fig. 12 Toggling LED with core_1
Fig. 13 toggling LED with core_0
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()
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)
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.
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.
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
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.
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.
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.
The following are the significant benefits that IoTA provides.
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.
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.
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.
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.
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.
There is a wide range of Industrial use cases of IoTA. We have discussed the most popular ones below.
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.
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.
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.
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.
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.
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.
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. | Components | Distributor | Link To Buy | |
1 | Raspberry Pi 4 | Amazon | Buy Now |
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.
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.
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:
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.
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.
Begin by obtaining a list of the most recent applications. Using the command: you can see if any installed programs are up to date.
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.
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:
During configuring the Raspberry virtual private network, you will select the level of encryption. What you need to remember is the following:
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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:
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.
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.
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.
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.
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:
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.
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.
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.
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;
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
(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.
(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.
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;
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.