Hey, pupils welcome to the next session about the Fourier transform. Till now, we have learned about the basics of Fourier transform. It is always better to understand all the properties of a mathematical tool to understand its workings and characteristics. You will observe that most of its properties are similar to the topics that we have discussed before, and the reason is, that all of them are transforms, and the core objective of these transforms is the same. We have learned about the simple and easy discussion of the Fourier Transform, but when dealing with complex problems, it involves the usage of different properties so that we do not have to repeat the calculations all the time to get the required results. Have a look at what you are going to learn today:
What are the basic properties of the Fourier transform?
How can you ding the inverse Fourier Transform?
How to implement inverse Fourier transform in MATLAB?
What are some applications of the Fourier transform?
So let’s start with the properties of this transform.
First of all, the Fourier transform is linear. It means if we have two expressions of the Fourier transform that are denoted by G(t) and H(t) then combining them with the help of mathematical operations such as multiplication or addition results in an expression that is also linear.
It is an attractive property of the Fourier transform that says when a discrete-time signal is transformed into the frequency domain, then it can be regenerated into its time domain form by multiplying it with a negative factor, but in this way, we will get the reverse of the original signal.
The modulation of the Fourier transform occurs only when both the signals, that are to be modulated are in the form of functions of time.
This property of Fourier transform says that if we are applying it on a function g(t-a) then it has the same proportional effect as g(t) if a is the real number. If you have a clear idea of the procedure of time scaling, it will be easy for you to understand the situation here.
This theorem is related especially to the Fourier transform. It says that the sum of the squares of a function x(t) is equal to the Fourier transform of the function x(t).
It is an important theorem because once we have this clear theorem, we do not have to calculate the square of the whole series of Fourier transforms. So, it becomes easy to deal with these quantities with the help of this theorem.
Scaling of the signal is the process in which there is a change in the independent variable or the data features in the form of a range of the signal. This property says that if the values of the signals on the x-axis in the time domain are inversely proportional to the values on the x-axis when we convert them into the frequency domain. In other words, the more stretched a signal is in the time domain means less stretched and a taller signal in the frequency domain and vice versa.
If
f(t) = F(w)
Then,
f(at) = (1/|a|)F(w/a)
Convolution is the process in which two signals are overlapped on each other in such a way that we obtain a third signal that is different from the first two. When we talk about the convolution of the two signals, we get results that are equal to the convolution of the same function in the Fourier transform.
Mathematically,
If
f(t) = F(w) and g(t) = G(w)
Then,
f(t)*g(t) = F(w)*G(w)
In this way, it becomes easy to predict the result if we know the value of one function and are interested in knowing the other.
We all know the procedure of differentiation, and when we are differentiating the Fourier transform, we may get confused about following the rules of both these procedures. So, with the help of using this property, you can easily guess the results. This property says that:
If
f(t) = F(w)
Then,
f'(t) = jwF(w)
Where j is the variable and w is the function based on which the differentiation is occurring.
So far, we have learned how DFT is used to obtain the signal in the frequency domain. But what if we want the inverse results? What if we want our original signal back? Well, it is the requirement of a large number of applications, and then the inverse Discrete Fourier Transform is used. It is not a new concept to use the inverse methods, as we have also read it when we were discussing the previous transforms.
To perform the inverse method, we just have to simply follow the formula given below:
All the other variables are the same. We just have to remember the formula and we are good to go.
Code:
clc;
x=input('Enter the Input')
N=length(x);
m=zeros(1,N)
for n=0:N-1
for k=0:N-1
m(n+1) = m (n+1)+((1/N)*(x(k+1)*exp(((i)*2*pi*k*n)/N)));
end
end
disp('m=')
disp(m)
Output:
Let’s understand this code. There are a few things that we have used for the very first time in this series, and therefore, I want to describe them all.
It is a very common and useful command that you will often see in the first place of almost every MATLAB code. The purpose of using this line is to clear all the data that you are looking at on the screen of your display window.
There is a window just below the working area of MATLAB called the “command window." main reason why we are discussing this line here is that we have not used the input function till now in this series, and therefore, I do not feel any need for this clear screen command here. This will be more clear when you learn about input functions.
In MATLAB, when we want to input the values of a particular quantity on our own, we use the following function:
input(x)
Where x is the quantity that we want to have the input of. Moreover, you can also use it to provide the statement on your own (as we have done in our program), but the statement should be enclosed in inverted commas if you want to print the statement as it is.
This is another function that we have used for the first time in this series. Well, this is the display function, and it is used to display the result or quantity that we want. Here in this code, for instance, we wanted to show the value of the result that we have stored in “m”. Therefore, we first displayed the m in inverted commas so that it was printed as it was, and after that, when we used the same function without the inverted commas, we got the value of the m that was stored before.
Loops are used in many programming languages, and if you have the basic concepts of programming languages, then you must know that “for loops” in MATLAB are used when we want that compiler to stay at a particular line and repeat the same line until a particular condition is fulfilled.
In our case, we started the first loop when m=0 and it stayed at that particular line till the value was one less than N. The same case was with the second loop. Once the condition was met, the compiler moved toward the next line.
The syntax of the for loop in MATLAB is:
for x:y
Statement
end
Where x is the starting point of the for loop and y is the ending point of the for loop, both of these are specified by the programmer, and a statement is a calculation that we want to perform again and again.
Clc clears the screen of the command prompt in case you are using the code for the second or more time.
The input function displays a message to the user that input is required from him/her.
The input by the user is stored in the variable x.
Now, we are introducing another variable, m, that stores the result calculated by the length function. It is the total number of values provided by the user.
Here, we are calculating the number of zeros between the number 1 and the length of the input by the user that was stored in N.
The interesting part starts here. We are using two for loops, which means we are nesting the loops. The condition of both of them has been discussed before. The formula that we have hardcoded inside these loops is used till the conditions provided by us are met. To perform the functions on the series of signals, loops are used in this way so that we do not have to write the same lines again and again.
In the end, when we have the results stored in the variable m, we just display it with the label m, and our program is completed.
As we have mentioned that Fourier transform has great importance in many fields of education and science and therefore, great work has been done by using this technique. Some important fields and applications of the Fourier transform are discussed in this section.
In medical engineering, where we get complex and hard results. The Fourier transform is an old technique and therefore, it is used in the field of medical engineering for a long time. The impulse response and delicate results in the form of the signal are fed into the compilers where these signals are tested and examined deeply in a better way.
Here is an interesting application of the Fourier transform. We all know that cell phones work with the help of signals and therefore, there is a lot of work that can be done by using the Fourier transform. If you are wondering how the Fourier transform is performed in the cell phone then you are at the right point. Actually, while making, testing, and designing cell phones and other such products, the rules and calculations of Fourier transform are used widely because of its precise result and research.
As we discussed from the beginning, the Fourier transform works great with the signals. The optic is the field that works in the waves and delicate signals and therefore, the Fourier transform is used to sum all the results in a great way and to find the results according to the need. Most of the process occurs in the optics when the light or other rays are merged into one point, and with the collaboration of other techniques, the Fourier transform works great to make all the procedures easy and accurate. Moreover, the Fourier transform is also useful for the smoothness of the signals and filtering of the results as well.
So, today we learned interesting information about the Fourier transform, and now we can say that we have all the basic information about the Fourier transform. We have seen the properties of the Fourier transform and also learned about the inverse Fourier transform, along with the MATLAB code for a perfect concept. The concept of the for loop, clc, and input method was new to us. In the next session, we are going to talk about the comparison of all these transformations. So be with us.
Hey fellows, Welcome to another lecture in the signal and systems series in which we are moving towards another transform. Till now, we have studied the Laplace and z transform and we, therefore, know the basic purpose of transforms, that is, to convert the signal from one domain to another. In today's lecture, we will be discussing the Fourier Transform, and you will enjoy its information because now we have a clearer idea of what we are doing and what the purpose of this transformation of a signal is. Here are the key points that we are going to consider:
What is the Fourier transform?
What is the journey Fourier transforms from start to end?
How do you define the types of Fourier transform?
Why is the Discrete Fourier transform important?
Why is the fast Fourier transforms named so?
How can you implement a fast Fourier transform in MATLAB?
Just like the Laplace transform, the Fourier transform is also named so because of the name of its inventor. It is a 200 years old transform that is still in use in mathematical subjects in which there are minute calculations and the user wants to have accurate results in a simple way. The name of this transformation is taken from the French mathematician Jean-Baptiste Joseph Fourier. From 1807 to the current age, people found this transform useful, and when we talk about subjects like signals and systems, it becomes necessary to learn this because it is majorly used in the field of practical work. We define the Fourier transform as:
“The Fourier transform is a mathematical tool or model that is used to generalize the Fourier series in a simple way and is used to represent the calculator in the frequency domain.”
The definition must be clear in your mind because we have read about the transform before, but for a clear discussion, let me say that this transform is used to convert complex calculations into a simpler way by changing the domain of the values so that we may get the best results accurately in less time.
The complex Fourier series is converted into the one with the limit from minus infinity to plus infinity. The mathematical formula for this transform is given below:
At first, this formula may be confusing for you. But do not worry, when we discuss the details, you will get a clear idea. For now, keep in mind. This is also called the forward Fourier transform. We will also learn about the inverse FFT in the coming session.
You can see that we have taken the name of the Fourier series in the introduction given above. If you are new to this, let us recall.
“A Fourier series is the one in which the decomposition of periodic functions occurs and we get the sinusoidal components that have an infinite sum of sinusoidal functions.”
It is important to introduce the Fourier series when solving the Fourier transform. Whereas a periodic function is the one that follows the formula given below:
f(t+T) = f(t)
It means that a periodic function has the same value before and after a certain period, and no change occurs after that period.
The story of Fourier's transform starts in 1807 when Jean-Baptiste Joseph Fourier found that he could represent the summation of sinusoidal functions that are sine and cosine. He worked hard on the same topic, and his work was published under the title "Analytic Theory of Heat" because he used his work to find the calculations of heat. Moreover, after this publication, scientists found that this theory can also work in other ways. It is possible to use the Fourier series of the amplitude of a sinusoidal function when the integer is used in this work. Hence, other studies were also used with the Fourier series and, as a result, many useful invasions and calculations occurred.
In computer-based applications, you will hear a lot about two types of Fourier Transforms:
Discrete Fourier Transform or DFT
Fast Fourier Transform or FFT
We will discuss both of them in detail.
We all know that discrete quantities are those with a non-continuous sequence. These are different ways to deal with signals, but when we talk about DFT, one must know that it is one of the most accurate and powerful tools to find the spectrum when dealing with finite duration signals.
For instance, take the case in your mind, when we get the output of the LC oscillator, we get a sinusoidal wave, and we want to know the amount of noise in the output to find an accurate result, then we use the Discrete Fourier Transform. Just like digital filters, DFT is also a powerful tool to analyze the signals in the best way.
Mathematically,
To make a clear difference between DFT and DTFT (you will learn more details soon), we have shown this equation with the variable X(k). Here,
N =Total number of samples
j, k = variables
Pay heed to the formula and you will see that it consists of some finite numbers. Therefore, we can say that DFT is used to determine the spectrum of the sequence with a finite number of samples.
Here is another type of Fourier transform that, as the name implies, is a fast method of performing Fourier transforms. Have a look at the simplest definition of this simple Fourier transform:
“FFT is the type of Fourier transform that converts the signal into a single spectrum and, therefore, it provides the information about the frequency of that signal easily."
Let’s hear the story of the simple signal when it is fed into different procedures of FFT.
First of all, the signal is decomposed into a complex N time domain signal that is a complex signal. This signal has two parts:
Real part
Imaginary part
Then different procedures occur at these parts. They are multiplied, and we get different chunks of information.
After all the information from the N-1 number of samples is collected, the procedure to merge all the information into a specific pattern starts.
Once we get the information in that particular sequence in the frequency domain, we use the calculations to get the final result.
You might be wondering why this method is named "fast transform." Well, FFT is the form of DFT that skips some procedures, and in this way, we get a short form of the Fourier transform that is fast to perform.
It is a fast algorithm that works on the rule of divide and conquers. It takes the signal and divides it into two smaller signals. In this way, it becomes easy to solve the signal.
Code:
t=0:0.01:1;
x=sin(2*pi*15*t);
subplot(211)
plot(t,x)
xlabel('Time /The Engineering Projects.com')
ylabel('Amplitude')
FFT=fft(x,1024);
xabs=abs(FFT);
subplot (212)
plot(xabs)
ylabel('Amplitude')
Output:
As you can guess, it is the pre-defined function to perform the Fourier Transform, and we just have to provide the parameters, and all the tasks and calculations are here in front of you in seconds. The syntax of the FFT function is given as
fft(x)
fft(x,y)
fft(x,y, dim)
Where
x is the equation that we want to use to perform the FFT.
y represents the number of points for the DFT.
Dim is the dimension of the Fourier transform. If you have any, you can write them here.
In our code, we have used the second form. It is up to you which kind of syntax you want to use. The more details you provide to MATLAB, the better results you will get.
Another function that we have used in MATLAB is the abs function called the absolute function. This function is used to have the absolute values in the MATLAB codes. The result we obtain from the fft function may have real and imaginary parts or it may also have some negative values in it that are complex to deal with. For our convenience and the accuracy of the result, the abs function converts it into the absolute value that has the positive integers and we get the accuracy in our answer.
While looking deeply into the code given above, we can understand the concepts of the fast Fourier transform. Here is the flow of code through which we are performing it:
First of all, t specifies the time period at which the Fourier transform will be shown on the graph. Here, we have provided the starting point as 0 and the ending point as 1. The value between them is the period on the basis of which the shape of the wave will be shown.
To store the equation of the Fourier transform, we have used the variable x. This is the basic question and as we all know, there is a compulsion to write the signs of arithmetic operations and brackets all the time.
The result is then fed into the plot command where we specify the time on the x-axis and the value of the question that we have saved in the x variable is specified on the y-axis.
The whole work is done by the single function of fft. You just have to input the values and you will get the result.
To improve the work of this transform, we are using the abs function.
You can also use the same function without the plot and subplot commands if you do not want any graph. Take it as your homework and find what value you get when you simply put the value of x in the fft function. The results will be shown on the right side of the screen and each value can also be examined separately as we have specified in our code.
In addition to the two types, we also experience another type of mathematical tool named the Discrete Time Fourier Transform. At first, you may think it is DFT, as we have discussed before, but in reality, it is a slightly different form of Fourier Transform, and it is important to know about it so that you may clear some concepts.
Once you get an idea of its application, you can understand the mathematical form of DTFT. If for a given spectrum of signals, we have the sequence named x(n) then the DFT of that particular sequence can be found with the help of this general formula given below:
Note that x(n) is in the form of time domain signals. whereas the resultant X(ω) is in the form of a frequency domain with the complex variable ω that is omega.
There is a different notation on the same formula on the internet with different types of variables. So, do not be confused and get the core concept and apply it in your own way.
DFT |
DTFT |
|
Full Form |
Discrete Fourier Transforms |
Discrete-Time Fourier Transform |
Continuity |
Non-continuous Sequence |
Continuous Sequence |
Periodicity |
Non-periodic |
Periodic |
Variable |
It does not have any variables like omega. |
It comes with a continuous variable called Omega. |
Type of frequencies |
It has only positive frequencies. |
It contains both positive and negative frequencies. |
Accuracy |
Less accurate |
More accurate |
Today we have learned a lot about the Fourier transform and also seen some practical implementation of some types of Fourier transform. We have introduced the Fourier transform, learned about the type of this transform, and also saw the DTFT with the comparison of DFT. The code on the FFT was explained deeply where we had the details of its function and also saw the graph as a result. We have a lot of information about the Fourier transform, and we are going to discuss it in detail in our next session.
Following this, we will configure bitwarden and host it on our Raspberry Pi 4. The last tutorial discussed utilizing a Raspberry Pi to install and run zeroTire on pi 4. By the end of the project, you will have learned how to set up a Raspberry Pi 4 with the necessary software for password management, including bitwarden, docker containers, and portainer, and how to configure their respective user interfaces.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Raspberry Pi 4 | Amazon | Buy Now |
An effective password manager is a must-have. For the past decade-plus, I've relied on a password manager. The catch is that not all security-focused apps are created equal. Initially, I relied on password managers in my browser, but I soon switched to KeePass. It was an intelligent move ten years ago. The export features of my browsers allowed me to import all of my passwords into a single KeePass database, where I could then construct a system to keep track of them. However, technology has advanced, and now there are safer alternatives to these password managers. Once I discovered I could self-host Bitwarden, I felt it was my best option. I had been using LastPass with Mobile, but as they introduced sync limits into their free tiers, I decided to uninstall it. YubiKey compatibility is one of the features that Bitwarden lacks compared to LastPass, but which I was able to implement thanks to self-hosting. KeePass's lack of support for statistics on hacked, weak, and recycled passwords is disappointing. Most people agree that Bitwarden is the most excellent free password manager.
Raspberry pi 4
Power supply
Ethernet or wifi
To host our Bitwarden server on our domain, we must first take care of a few technical details. Setting up Docker is a necessary first step.
If we like, we can also decide to use Portainer for Docker container management. Either we can run it from the command-line interface or incorporate it into Portainer. A Bitwarden container can be managed with Portainer's user-friendly online interface.
We can then upgrade our operating system once Docker has been installed and a decision has been made regarding using Portainer. After applying the latest updates, our Raspberry Pi should be in peak running condition and ready to host Bitwarden.
It's no exaggeration to say that Docker is a powerful piece of software because it enables OS-level virtualization to distribute software applications within containers. When running inside a container, the software is restricted from accessing any resources that weren't explicitly allocated by the Docker runtime. Since everything is contained within the containers the runner installs, Docker makes it easy to distribute your software to devices. What's more, Docker accomplishes all of this with minimal extra effort. The software's low overhead makes it possible to function on a Raspberry Pi, which has little RAM and processor power.
The Docker team has made it easy to set up their container program by creating a handy installation script. Connecting via SSH to your RPi is an option for completing the tasks below.
The following command will fetch and run Docker's official installation script.
curl -sSL https://get.docker.com | sh
The code will be inserted into the command prompt if you use this command. Usually, you shouldn't, but you can trust Docker, so we'll make an exception here. You can view the script at get.docker.com if you are hesitant to run it before inspecting it. Time should be allowed for this code to finish as it will autodetect and install all requirements to run the Docker container on the RPi.
The container management tool Portainer is small, accessible, and open-source. You may use this program to efficiently build, manipulate, and remove Docker containers on your Raspberry Pi. The software is simple to operate and requires no configuration outside of a Docker container, making it a breeze to set up.
Due to its lightweight design, Portainer doesn't significantly slow down your computer's performance. It's the best option for controlling your containers without messing with the command-line interface.
Once Docker has been installed and configured, Portainer can be installed on the Raspberry Pi. The newest version of Portainer can be obtained by using the command below, as it is hosted as a container on the public Docker hub.
sudo docker pull portainer/portainer-ce:latest
The docker file will be downloaded to your device after running this command. We tell it to get the ARM versions of the container by adding ":Linux-arm" to the conclusion of the pull request.
To begin using Portainer, wait for Docker to complete downloading the file to your RPi. We need to supply some more parameters when telling Docker to launch this container. Launch Portainer on your Pi by typing the command below into the console.
sudo docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer-ce:latest
The most important things we accomplish here involve defining which ports Portainer should have access to. For us, it means using port 9000. Assigning the name "portainer" to this docker container facilitates easy recognition in the event of an emergency. If this Docker goes offline for whatever reason, the Docker management is instructed to start it up again.
You must establish a connection to the program's graphical interface before we can proceed with any tasks. You'll need access to an internet browser and the IP address of your RPi to complete this. The local IP address of your Raspberry Pi may be easily retrieved if you have forgotten it. The IP address allotted to our Pi locally can be shown by entering the hostname command.
hostname -I
For the quickest and easiest access to Portainer, simply type the following into your browser. You see that the port ":9000" is explicitly specified at the end of the address. The location at which Portainer can be accessed is this port.
http://[PIIPADDRESS]:9000
Always change "[PIIPADDRESS]" to your RPi's private IP address. This IP address was part of the previous steps' necessary actions.
When you first access the online interface for Portainer, you'll be prompted to make an administrator account. Specifying a username is required to establish this administrator account. Next, create a password for the new version. Passwords for Portainer must be a minimum of 12 letters in length. After entering the desired username and password, you can create the user by clicking the "Create user" button.
Now we can tell Portainer what kind of container ecosystem to maintain. The Docker option is the best fit for our needs. After making this selection, hit the Connect button.
The Portainer installation on your RPi should now be complete. Now you may use it to control the containers on any computer or mobile device.
Now that our RPi is ready, we can proceed with installing the Bitwarden application. The availability of Bitwarden RS as a container in Docker makes its setup a breeze.
The first part of this section will explain how to set up Bitwarden on Pi 4 using the Portainer online interface. We've already established that Portainer is an excellent option for managing Bitwarden on your RPi without using Secure Shell.
First, we'll need to have Portainer set up so we can deploy the Bitwarden container. A few simple steps are required, but the total time is relatively short.
To get started, launch the Portainer web UI. The IP address of your Pi 4, followed by port 9000, will give you access to this.
Make sure that "[PIIPADDRESS]" is changed to the IP address of your Raspberry Pi.
You must switch to the local Container endpoint while loading the interface. To access the container management interface, please go here.
It is necessary to construct a volume for the Bitwarden containers before they can be created. Look for a link labeled "Volumes" in the menu slides out from the side.
There should be a collection of volumes you've made available here. An "Add volume" link must be placed here first. To access the volume settings, press the button.
A title should be selected for this new volume. In this tutorial, we will continue using Bitwarden exclusively. Simply give the book you're creating in RPi Bitwarden a title, and then hit the "Create the volume" option.
Following successfully creating the volume, we must now navigate to the "Containers" section of the interface. To toggle to this view, select "Containers" from the sidebar.
The containers that can be used with your RPi are listed below. The "Add container" button is up here somewhere.
We have completed the preliminary setup and are ready to install the Bitwarden on our RPi.
As a first step, identify the container's label. Our own container's name is Bitwarden. The next step is to tell Docker which image to retrieve. This is the RPi's Bitwarden container in our instance. Don't forget to type "vaultwarden/server:latest" into the "Image" field.
The container's network configuration comes next. Find the heading labeled "Network ports setup."
Select the "publish a new network port" button below this heading twice. The boxes to set the Bitwarden ports to expose should now be visible.
Firstly, ensure the host is set to "127.0.0.1:8080" in the first box. Make sure that port 80 is entered into the container settings as well. From this port, you can access Bitwarden's web-based administration console.
To proceed to Step 2, please change the host to "127.0.0.1:3012". The correct port number for "container" is 3012. (3.). This port is used by Bitwarden for communicating over web sockets. As a side note, both host ports have been tied to the local computer. Because we can use them without any extra hardware, these are made public via a reverse proxy hosted by NGINX.
Keep going down until you reach the advanced containers settings heading. If you want to adjust the volume, click the "Volumes" tab. To add the RPi's volume to the container, we must next select the "map extra volume" option. Ensure that "/data" is entered into the "container" field.
At this point, we'll want to apply the custom volume setting we made before. Bitwarden-local is a good name for this.
Our next step is to keep Bitwarden running on the Raspberry Pi. Changing the startup policy will accomplish this. Simply select the "Restart policy" tab here. There should be an "Always" option for restarting. That way, even if the container goes offline for any reason, Docker will attempt to keep it running.
We may now deploy the Bitwarden containers after we have done setting it. The "Deploy the container" button may be found under this site's "actions" heading.
In the containers list, you'll find Bitwarden once Portainer has downloaded the file to your Pi 4. Below is a snapshot of our containers list after Bitwarden was successfully installed.
You can also use the command line interface if you avoid installing and using Portainer with Bitwarden on the RPi. Following these instructions, you can successfully download and install Bitwarden on your device.
We will use Docker to retrieve the most recent version of Bitwarden RS. The newest server version will be downloaded and made available after these procedures.
docker pull vaultwarden/server:latest
Docker will automatically begin downloading Bitwarden RS to the Pi 4. The next step will be to launch the image. To accomplish this, please type in the command below and hit enter.
sudo docker run -d --name bitwarden \
--restart=always \
-v /bw-data/:/data/ \
-p 127.0.0.1:8080:80 \
-p 127.0.0.1:3012:3012 \
vaultwarden/server:latest
With this command, our Bitwarden RS servers will begin running from the downloaded file. The ports to which we require Docker to connect the Bitwarden image are then specified. Here, we're listening for connections on port "8080" to our web server. As a next step, we open up "port 3012," which is the port Bitwarden's URL sockets use for communication. The RPi's localhost IP address will be the only one able to access these ports (127.0.0.1). In the following part, we'll set up a proxy server to enable HTTPS for Bitwarden, allowing it to be accessed from outside the local network.
We have Bitwarden functioning, but it is not usable unless we configure HTTPS. The Bitwarden WebClient uses secure HTTPS connections for certain JavaScript operations. Setting up an NGINX proxy is required to enable HTTPS functionality. NGINX will handle processing requests to our Bitwarden server hosted on an RPi.
Setting up NGINX is a prerequisite to deploying Bitwarden. To establish a secure HTTPS connection, it is necessary to install the web server program and create an SSL certificate.
NGINX installation is a prerequisite for continuing with this section. So then, let's go ahead and do it.
There are a few reasons why Nginx is a good choice than Apache for Pi 4. NGINX is preferable to other web servers for the Raspberry Pi because it makes more efficient use of the Pi's limited resources, such as its memory and processing power. While NGINX has more space to maneuver than Apache, you still shouldn't count on it to handle heavy loads or major PHP tasks.
Since Apache2 may already be installed on your machine, we will use the command below to remove it. Since we want to use NGINX as our web server, we have decided to disable it from autostarting and accessing port 80. If you know that Apache2 hasn't been set up on your Pi 4, you can ignore this step.
sudo apt remove apache2
Now that we have the most recent versions of all the packages and have gotten rid of Apache 2, we can continue with the procedure. Finally, use your RPi to execute the command below and set up NGINX.
sudo apt install Nginx
Now that NGINX has been installed, we may launch it. To activate your RPi's web server, enter the command that follows into the terminal.
Sudo systemctl start Nginx.
Now that the NGINX server is running, we may obtain a local IP address. This is done so that we can use a different web browser to check the functionality of our web server. Use the hostname statement to learn your RPi's local Internet Protocol address.
hostname -I
Now that we know the local Internet address for our Pi 4, we can visit that location in any internet browser. Once you have the local Internet Protocol Address by using hostname -I, simply navigate there. The address http://192.168.0.143 works for me.
http://YOUR PI's IP ADDRESS
If you type in the URL above, your browser should take you to the desired location. In the rare case that this displays an Apache page, you should not worry; NGINX does not always replace the Apache index.html file.
After NGINX is set up, we'll make an SSL cert for it. You can make a license on your RPi in two distinct ways.
You can use "Let's Encrypt to generate a trusted SSL certificate" if you have a domain name registered with them. A signed certificate cannot be issued with just an Internet address as the DNS name. If you follow this way, remember to write down the path to where your certificate is kept.
Using this Certbot client and your existing web server or a temporary server, you can acquire an SSL cert from Let's Encrypt. To purchase an SSL Cert for your RPi, you must have a DNS name directed to your Internet address. Ensure your DNS settings are configured to avoid going through Cloudflare's proxy if you use them as your DNS provider. As the proxy disguises your actual internet protocol address, the Let's Encrypt program will be unable to validate your RPi's IP address and provide an SSL cert.
Now, using one of the commands below, we may install the LetsEncrypt application onto our Pi 4. "Cabot" is the program's name in question. Set up the certbot package for Apache if you're using that web server, or use the standalone certbot program.
sudo apt install python3-certbot-apache
sudo apt install certbot
Now that Certbot is set up, we can go to Let's Encrypt and request an SSL cert for our Pi 4. The situation can be approached from two different angles. You can ignore this step if you do not use Apache. If you're using Apache, you may quickly and easily install a certificate into Apache's settings by executing the following command. To begin, you must ensure that ports 80 and 443 are routed. Cloudflare, which disguises your Internet address, must be temporarily bypassed if it is your DNS service provider.
sudo certbot --apache
We can take two approaches to obtain a license cert from Let's Encrypt if Apache is not used. With certbot, we have the option of running a separate python server to seize the host machine. You can also use another web server, such as NGINX, and we will still be able to retrieve the certificate from it. Once you get the license, though, you will need to set it up manually.
If you want to use the web server without having to install anything more, all you have to do is ensure port 80 is open and forwarded. You must modify example.com to your domain name.
sudo certbot certonly --standalone -d example.com -d www.example.com
More expertise is needed to use webroot than the installed web server. Check that the directory /var/www/example exists and can be accessed from the internet by changing its pointing to the correct location.
sudo certbot certonly --webroot -w /var/www/example -d example.com -d www.example.com
Following these instructions, you will be asked to supply information, including your e-mail address. The information you provide will help Let's Encrypt maintain track of the licenses it issues and get in touch with you if any problems arise. After you enter the necessary data, it will immediately retrieve the permit from Let's Encrypt. If you are having problems, check that ports 80 & 443 are not banned and that your DNS name is correctly pointed to your IP address. Finally, if Cloudflare is your DNS service provider, double-check that the DNS settings currently exclude the proxy servers. This is where certbot client licenses will be saved after being downloaded.
The secret key file for the license (privkey.pem) and the entire certificate chain (fullchain.pem) can be found in these directories. Keep in mind that these documents are what authenticates your Https connection and keep it safe; therefore, you shouldn't share them with anyone.
Building a solid Diffie-Hellman group is our final preparation step. This is to assist in strengthening SSL connections on your devices.
sudo openssl dhparam -out /etc/ssl/certs/dhparam.pem 2048
To have NGINX act as a proxy for Bitwarden, a virtual host must first be created. Thankfully, setting NGINX as a proxy requires no effort.
First, we need to get rid of NGINX's factory settings file. If you intend to use Bitwarden with a domain name, there is no need to do so.
sudo rm /etc/nginx/sites-enabled/default
A newer NGINX config file must be made. Launch the nano editor and type the instruction below to get started editing this new configuration file.
sudo nano /etc/nginx/sites-enabled/bitwarden.conf
Copy and paste the below lines of text into this document. The first rule we're creating will force all HTTP (port 80) traffic to use HTTPS instead (port 443).
server {
listen 80;
listen [::]:80;
server_name _; #Change this to your domain name
return 301 https://$host$request_uri;
}
The web server block will manage the proxy and Hypertext transfer protocol connection we'll add next. If you created the certificate with Let's Encrypt, you'd also need to change the locations of the "SSL certificate" & "SSL certificate key" environment variables.
server {
listen 443 ssl http2;
server_name _; #Change this to your domain name
ssl_certificate /etc/ssl/certs/nginx-bitwarden.crt; #Swap these out with Lets Encrypt Path if using signed cert
ssl_certificate_key /etc/ssl/private/nginx-bitwarden.key; #Swap these out with Lets Encrypt Path if using signed cert
ssl_dhparam /etc/ssl/certs/dhparam.pem;
# Allow large attachments
client_max_body_size 128M;
location / {
proxy_pass http://0.0.0.0:8080;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
location /notifications/hub {
proxy_pass http://0.0.0.0:3012;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
location /notifications/hub/negotiate {
proxy_pass http://0.0.0.0:8080;
}
}
According to your needs, tweaks to your RPi Bitwarden server are sometimes necessary. If you have a custom domain name, you should substitute it for the server name.
At completion, your document should resemble the one displayed below.
You may now save this document. The NGINX service just has to be restarted at this point. Our modifications will not take effect until we continue the operation. Type in the following instructions if you want to reboot NGINX on your RPi.
sudo systemctl restart Nginx
The Bitwarden web application on our RPi is now accessible and usable, thanks to the installation of a proxy server.
Visit this link in your preferred web browser to access the Bitwarden interface. Always change "YOURPIIPADDRESS" to reflect your RPi's actual Internet address. A domain name, if you have one, must be used instead.
You will get a warning if you try using a certificate you signed yourself.
Creating a Bitwarden account is a prerequisite to using the service. There must be a "Create Account" link on the login screen. If you can locate this link, please click it.
Starting immediately, you can enter data for your brand-new account. To get prompted, type in your Bitwarden account's e-mail address. You'll need to use this e-mail address to sign in. Next, provide Bitwarden with a label to utilize throughout its user interfaces. Next, you'll want to protect this account with a strong password. This needs to be a robust and difficult-to-guess password. After reading and accepting Bitwarden's terms of service and privacy policy, you can finish creating your account. When you're through customizing your account, click the "Submit" button.
Having signed up, you can now access your Bitwarden vault. Enter the e-mail address you used to create the account first. Now, please log in using the password you just created. The "Log In" button is active, allowing you to enter the site.
Once you've installed Raspberry Pi Bitwarden, you may begin using it as a secure repository for your data.
Your account has been created, and the administrator token can be created now. You'll need the admin token to go into the Bitwarden control panel. We'll have to adjust the settings on our Docker containers to accommodate this. You will have access to a list of all users who have registered, as well as the option to delete them from the administrative dashboard. Even if you've turned off the feature, you can still create invites for new users. Bitwarden's settings can also be adjusted through this user interface. You may wish to decide if you want others to be capable of signing up.
The first order of business is to produce a new Bitwarden administrator token. Given this token's importance, we will use OpenSSL to construct a long string of robust randomly generated digits. You may create this secure code using the following program on your Pi 4.
openssl rand -base64 48
Keep this token secure as it provides unrestricted access to the Bitwarden RS server if it falls into the wrong hands.
This current admin token will need inputted into the Bitwarden Docker container running on our RPi. The Portainer online interface or a customized command line can be used to accomplish this.
The Portainer UI must be launched, and then the container list revisited to change the administrator token. Find the Bitwarden container in the list of containers. Click on the link once you've located it to read more about it.
There must be a "Duplicate/Edit" button at the top of the page you're about to visit. The container's properties can be modified by clicking this button.
To access the "Advanced container options," please continue scrolling down. Click the "ENV" button to switch to the Environment tab under this header. For us to add the administrator token, please select the "add environment variable" button. After you click the button, you should see two new text fields appear at the page's footer. Just enter "ADMIN TOKEN" into the "name" field. A valid admin token must be entered in the "value" field. You can now click "Deploy the container" after creating the administrator token.
Please read the following message before attempting to update the Bitwarden container on your Raspberry Pi using Portainer. The container with the same name will be replaced, as shown by this message. For this, select the "Replace" option.
Using a command prompt to update a container is a little more involved than doing it via the GUI, as you will need to delete the old container by hand. The Bitwarden container on our Pi 4 will need to be taken offline for us to delete it. Using this command, you can terminate a container that is already executing.
sudo docker stop bitwarden
Next, the old container must be discarded. If a container with an identical name and port number already exists, Docker will not allow us to create a duplicate. Execute the following command to get rid of the current Bitwarden container.
sudo docker rm bitwarden
The final step is to restart the docker process. Instead of using the default token, we'll use the administrator token we just created.
sudo docker run -d --name bitwarden \
-e ADMIN_TOKEN=EXAMPLEPIMYLIFEUPADMINTOKEN \
--restart=always \
-v /bw-data/:/data/ \
-p 127.0.0.1:8080:80 \
-p 127.0.0.1:3012:3012 \
vaultwarden/server:latest
To use these new commands, you must first produce a token and replace all occurrences of "EXAMPLETHEENGINEERINGPROJECTS" with that key.
Access the Bitwarden administration website once you've successfully implemented your freshly generated administrator token on Pi's Bitwarden setup. You should type this address into your internet browser's address bar. Remember to change "YOURPIIPADDRESS" to the address of your Pi 4.
https://YOURPIIPADDRESS/admin
The Bitwarden control panel can be accessed at this location.
The created administrator token is required to be entered here. You can now log in by selecting the "Enter" button after you have provided the token.
To manage your Bitwarden account, you can now visit the control panel. These sections allow you to control who has access to Bitwarden and how it operates.
After logging in for the first time and gaining access to the control panel, you may remove the option for new users to register. As a result, only anyone you grant permission can add new users to the Bitwarden safe.
Bitwarden's new account creation can be disabled in the admin interface of your Raspberry Pi. Once you have logged into the control panel as an administrator, you can continue.
New user registrations can be disabled using a setting in the system's global preferences. Click the corresponding button to access the locations buried in the "General settings" panel.
You should see an option labeled "Allow new signups" within the "General settings" menu. To turn off this feature, uncheck the box close to it.
A confirmation of the new settings will appear at the end of the page. There should be a blue "Save" button near the bottom of the page. To keep the current changes, please click here.
As of this point, your Raspberry Pi ought to be running Bitwarden. Clients for Bitwarden, a free and open-source password manager, are available for virtually any platform. Using a modified version of the standard client that uses fewer system resources, you may set up your Bitwarden web service on your Raspberry Pi. The following article will teach you how to use Pi 4 to play Xbox games in the cloud.
Hi Guys! Hope you’re well today. I welcome you on board. In this post, I’ll walk you through How to Install PCBWay Plugin for FreeCAD PCB Software.
Before we move further and help you with the installation of the plugin, let’s get a brief introduction to the FreeCAD software.
FreeCAD is a free and open-source parametric 3D modeler used to design real-life objects. With parametric modeling, you can easily modify your design and change its parameters. The tool is mainly used in mechanical engineering for product design and also proves to be handy in electrical engineering for electronic board designs. It supports Windows, Linux and macOS operating systems. Python programming language is primarily used to extend the overall functioning of the software.
Hope you’ve got an idea of what FreeCAD is all about. Let’s get further and discuss How to Install the PCBWay Plugin for FreeCAD PCB Software.
FreeCAD allows you to design PCB boards and send the final layout to PCBWay for instant production.
First, we download and install the FreeCAD software then we’ll cover how to install the plugin. To download the software, go to the FreeCAD website and click the “Download Now” option as follows.
Click the “next” option to continue to install the software, as shown in the figure below.
When you click the “PCBWay” the plugin will be installed on the software. Now you can make PCB designs on the FreeCAD and send it right away to the PCBWay manufacturer for the production of your required electronic board.
PCBWay is the largest PCB manufacturer in China. It’s a one stop shop for your DIY projects, custom test equipment and the advanced electronic projects. Apart from manufacturing regular PCBs including single layer, double layer and multi-layer boards, they also offer other services like flexible PCBs, SMD stencils, advanced PCBs and PCBA (printed circuit board assembly).
Website is easy to navigate and runs well on both laptop and mobile screen. You can instantly get the quote and submit your Gerber files on the website. When you submit the order, you can see all the information about your orders on the dashboard, including the order status, progress of your boards and delivery updates.
First you need to put the parameters on the Instant Quote appearing on the website above the fold. Then you’ll see the following page. If you pick PCB assembly service, you are offered with three flexible options to choose from. If you pick “Turnkey” option, it means PCBWay will supply the parts. And if you pick “Kitted or Consigned” it means the customers will supply the parts. And the third option is a mix of both: some parts will be supplied by the customers and the remaining parts will be sourced by the company.
Customer service is great. All the representatives are responsive, highly professionals and well aware of the technical details of the electronic boards. Plus, if you find any defective piece, you can instantly get in touch with their aftersales team and they will guide you on the best possible solution. And if you find the dedicated service representative is not helpful, you can request the new agent by sending your request to service@pcbway.com or feedback@pcbway.com
If you want electronic boards in large numbers for your projects, then PCB panel is the option. PCBWay also offer PCB panel services where a single PCB design is replicated multiple times on a large board called panel. Individual boards are then depanelized from the main boards and are ready to be used in the project.
Once you click the Instant Quote from the main page, you’ll see the following page with the PCB panel option.
They pride themselves to maintain a 99% delivery rate. Some people complained about the late delivery. But know that delivery time mainly depends on the shipment service you choose and it’s not in their control once the product leaves the fabrication house. However, they make sure the product leaves the facility within the due date.
That’s all for today. Hope you find this article helpful. If you have any questions about installing the PCBWay plugin, you can ask me in the section below. I’d love to help you the best way I can. Thank you for reading the article.
Throughout our lives, we've relied on Radio and tv stations to keep us engaged. While we're on the subject of contradictions, it's also fair to say that these Stations can become tedious at times due to the RJ rambling on about nothing or annoying advertisements, and this may have left you wondering why you can't own a Radio station to broadcast your data over short distances.
Almost any electronics technician uses coils and other hardware to make an FM transmitter, although the tuning process is time-consuming and difficult. Setting up your FM station and going live in your neighborhood shouldn't take more than 30 minutes using an RPi. If you use the right antenna, you must be able to transmit to your school or community within 50 meters. Wow, that's interesting! So, let's get started right now.
Caution: This project is an education project and should not be abused in any way that might harm or inconvenience anyone. Interfering with neighboring FM frequencies is illegal, so please exercise caution when using this feature. In the event of any mishaps, we take no responsibility for them.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Jumper Wires | Amazon | Buy Now | |
2 | Raspberry Pi 4 | Amazon | Buy Now |
Raspberry Pi
Internet connection
Microphone
An enthusiastic RJ
Your RPi should already be running an os and be able to establish a network connection. If you haven't done so already, go through the instructions on how to use a raspberry pi.
A virtual server such as VNC, or a putty terminal window, is assumed to be accessible to you at all times. For the sake of this tutorial, we will run the program on RPi using the putty terminal session.
A method or procedure known as FM involves changing the carrier signal frequencies to match the frequencies of the modulated signal to encode information on a specific signal. Since data must be conveyed after being transformed into an electrical signal, a modulation signal is simply that.
A carrier's signal is transformed by an original signal in the modulation technique, which uses a methodology similar to amplitude modulation. On the other hand, FM maintains or maintains a steady signal loudness.
Fm is primarily used to decrease noise as well as the size of antennae, respectively. We know that a bigger antenna is required to send reduced frequency signals, whereas a smaller one is necessary to broadcast high-frequency signals.
Therefore, the sound signals are transformed into high-frequency radio waves and broadcast using the FM technique. Once more, the demodulation circuit on the receiver's side converts the high-frequency radio transmission frequency into the original understandable audio signal.
There is little interference since different signals are transmitted over a specific channel using separate wavelengths. So many folks can converse simultaneously and unhindered in a large metropolis.
The construction of a long-range FM transmitter has long been on my bucket list of cool things. I've been so intrigued by some of the transmitter's uses, particularly since I was a kid, and spent much of my time fantasizing about how awesome it would be to have a few of the technology and technologies used in espionage movies. So lately, while reviewing one of my residence automation projects by using RPi and the motion package library, I felt it would be cool to add audio to the deliverable and stream live, so in addition to the multimedia feedback provided by the RPi, I could also get sound feedback out from area under monitoring. Even while this FM transmitter would not let me hear distantly (a range exceeding 10 kilometers), it will at least enable me to maintain an "ear" on events while I am about the property; then, after building it, I would have accomplished a few of the objectives that the younger me had set out to attain. It took me a few days ago, but I eventually got the motivation to make one, and I'll show you how to do it in today's post.
To avoid violation of policies of some countries, this experiment is being conducted solely for educational and scientific purposes. Keep the FM transmission at a low range and make sure it is built in compliance with applicable laws of one’s nation and therefore does not induce a disruption to others. This is essential. For any mishaps, I take no responsibility.
Using the concepts of the modulated signal, an FM transmitter can transmit the audio it receives from its input. Most FM transmitters are constructed in the manner depicted in the diagram below.
An amplification is frequently included in the transmitters because the transmission power of audio input is relatively low. This is done by utilizing an oscillator component to produce the carrier signal, which is then combined with an audio stream to generate a modulated signal that can be transmitted. When it comes to communicating, the low-impedance modulation signal is fed via a power amplifier to get to the antenna.
The electrical component should be connected as illustrated in the following FM transmitter diagram.
In this photo, you can see the prototype version of the FM radio transmitter.
The first transistors amplify the mic's output signals to a level suitable for transmission because the mic's output waveform is typically modest. In addition to amplification, the transmitter must also modulate. After that, the boosted audio signal is combined with the desired transmission carrier frequency to create a final signal. Because there is no visible output to identify the precise frequency where the transmitters are working, you may need to modify the FM transceiver radio well within the frequency range stated above to get the transmission frequency. This carrier signal can be differed using a 20pF capacitor attached to the inductor. The traditional spectral range of this specific design would be between 88MegaHeartz and 108MegaHertz. Once the carrier signal has modulated the audio signal, it is sent to the antenna, where it is received.
The resistors and capacitors used aren't set in stone, so you can experiment with them to get the best performance out of the transmitters.
Several other uses for this design aren't mentioned above, such as baby monitors or school address systems. Before constructing any of those practical items, please remember to check your local laws.
How can RPi, a board designed to serve as a development platform for microprocessors, do all of this? What if I don't need extra hardware to use the board as an FM station?
To prevent interference problems, each CPU will have a synchronized digital device. A signal known as a Spread-spectrum system clock, or SSCS is responsible for this Electromagnetic interference suppression. This frequency ranges from 1 MegaHeartz to 250 MegaHeartz, which fortunately fits well within the FM spectrum. We can make the Pi become an FM broadcaster by developing some code that uses the spread-spectrum clock frequency to modulate the frequencies. The Rpi Pi's GPIO pin 4 is where the frequency modulation will be sent. To use this pin as an antenna, we need a piece of standard wire attached to it no longer than 20 cm in length.
Otherwise, read on for instructions on accessing your pi through the Command window if you haven't already done so. Boot Raspberry Pi with an HDMI connection to a display and an input device once you've installed a new operating system.
Link your Raspberry to the network by searching for a network option on the Raspberry desktop. Then go to the raspberry menu, click raspberry settings, and activate the SSH connection afterward. On your Windows or MAC computer, reconnect your computer to the same network as your Raspberry Pi so that both devices may communicate with each other on the local area network. You're ready to begin now that you've had Putty installed and running. Enter the Raspberry Pi's Internet protocol address and press enter. If you don't know your PI's Internet address, go to the admin side of your router and see if it's 192.168.43.XXX or something similar. An open command prompt will appear and ask for your login and passcode if all is done correctly. The default login and passcode are pi and Raspberry, respectively. Press Enter to see the next screen after entering it.
GitHub provides the code needed to turn the Raspberry into a radio station. This page can be cloned directly into Raspberry; the application can be compiled and launched if you understand how to do so. Just follow the instructions below, and you'll be transmitting your audio files in no time.
Set up a new directory for our software files and put them there. Create a new guide by typing 'mkdir RPI FM' inside the command prompt, and then enter the folder using the word 'cd.'
mkdir PI_FM
cd PI_FM
We must now copy the application from GitHub and place it in the folder we just made. Since we've previously moved inside the folder, we can run the following command below to complete the task.
sudo git clone https://github.com/markondej/fm_transmitter
We'll need a C compiler and other tools to run the C program we just acquired. GCC and G++ are the tools for this code, and the software for compiling them is termed make. To obtain compilers, enter the code shown below. Once the file is downloaded, your display will appear like the one below.
sudo apt-get install GCC g++ make
Compiling the code is now a cinch. You can do this by going into the folder using the change directory 'cd' FM transmitter and then compiling the script with root user 'sudo make .'The screen below should appear once your code has been successfully compiled.
cd fm_transmitter
sudo make
Launching the system is the last step. The intensity for which we would like to transmit, and the identity of the audio recording we would like to play must be specified when the program is launched. Star wars.wav is the default sound file that will be retrieved together with the code. We'll play the Movie Theme song at a 100megahertz frequency for testing purposes. The launch line's syntactic structure is:
sudo ./fm_transmitter [-f frequency] [-r] filename
The channel will be 100 MegaHeartz long because we need to play the movie file at that frequency.
sudo ./fm_transmitter -f 100 -r star_wars.wav
After you have started the application and you see the playback message as seen above, we may link an antenna to a Gpio 4 of Raspberry, I use a standard connecting wire, and it works perfectly for me.
Take a Radio, then set it to 100MegaHeartz channel, and you'll be able to listen to the movie music being aired. After making sure it works, you may switch out the movie theme with any other music or audio recording you choose and broadcast it with the same instructions as in step 5.
While playing pre-recorded audio clips is entertaining, using this Pi 4 FM broadcast live audio would be much more enticing. With the help of the same tool, this is also possible. Just plug a mic into the Raspberry Pi's USB connection and modify the startup command-line interface. For additional information on this, please visit the GitHub homepage. Use the comment section of the forums if you run into any issues getting this to function.
When it comes to frequency modulation uses, radio transmission dominates the list. Due to its higher signal-to-noise ratios, it provides a significant advantage in a radio broadcast. That is, there is little radio wave interference as a result. This is the fundamental justification for why so most radio stations choose to transmit music via FM.
Furthermore, many of its applications can be found in telematics, geophysical prospecting, EEG, various radio technologies, music creation, and devices used for broadcasting video. Fm offers a significant benefit over all other modulations in a radio broadcast. It will resist radio wave disruptions far better than an equally powerful modulation amplitude (AM) signal because it has a higher signal-to-noise ratio. The majority of music is aired through FM radio for this important reason.
Radio transmission frequently uses pulse modulation technology. Each radio broadcast station has its frequency range, and all broadcaster station signals are sent over the same transmission system. We can adjust the Radio's tuning to link it to a specific radio channel.
Our pc connections also employ pulse modulation technology.
The pulse modulation method is employed in magnetic storage tape recording systems.
Radio Detecting And Range (RADAR) systems employ the pulse modulation approach.
Multimedia content communications, including voice/video broadcasts, also use pulse modulation technology. Most of the time, the sound is delivered over FM, and occasionally, the film is as well.
The modulated signal generates an electrical impulse for usage in electronic instruments.
The monitoring system also makes use of FM technology.
Audio is synthesized by using the FM technology in pc sound adapters.
Military communication systems like Walkie-Talkies employ pulse modulation technology.
Additionally, Bluetooth and Zigbee communications technology utilize the FM method.
The Broadcasting method is also employed in ambulance systems.
The satellite radio technology uses FM technology.
Due to its low electronic noise, this FM method is employed in two-way radio transmission.
Low noise distortion
A smaller antenna is needed for pulse modulation equipment.
The pulse modulation platform's can be built to consume little power. This is a significant benefit of the modulation technique.
The pulse modulation process is more efficient because the signal's amplitude is always consistent.
The frequencies modulation circuit has many intricate parts.
A carrier wave is required for the frequency modulation process.
Amplification modulation is appropriate for long transmission lines, while FM is not.
In this article, we have learned how to create a radio station using a raspberry pi 4 with a few very simple steps. We have broadcasted a Star Wars movie theme through this system, and now you can try many other forms of data to broadcast, including video and live sound using a mic to get more familiar with the system. The next tutorial will teach us how to build a temperature log.
Thank you for joining us for yet another session of this series on Raspberry Pi programming. In the previous tutorial, we built a motion sensor-based security system with an alarm. Additionally, we discovered how to use Twilio to notify the administrator whenever an alarm is triggered. However, in this tutorial, we'll learn how to build a stop motion film system using raspberry pi 4.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Breadboard | Amazon | Buy Now | |
2 | Jumper Wires | Amazon | Buy Now | |
3 | Raspberry Pi 4 | Amazon | Buy Now |
With a Raspberry Pi, Py, and a pi-camera module to capture images, you can create a stop-motion animated video. In addition, we'll learn about the various kinds of stop motion systems and their advantages and disadvantages.
The possibilities are endless when it comes to using LEGO to create animations!
Using your RPi to build a stop motion machine, you'll discover:
How to install and utilize the picamera module on the RPi
This article explains how to take photos with the Picamera library.
RPi GPIO Pushbutton Connection
Operate the picamera by pressing the GPIO pushbutton
How to use avconv to create a video clip from the command prompt
Raspberry Pi 4
Breadboard
Jumper wires
Button
It is recommended that FFmpeg comes preconfigured on the most recent release of Raspbian. If you don't have it, launch the terminal then type:
sudo apt-get update
sudo apt-get upgrade
sudo apt install FFmpeg
Inanimate things are given life through the use of a sequence of still images in the stop-motion cinematography technique. Items inside the frame are shifted slightly between every picture to create the illusion of movement when stitched together.
You don't need expensive gadgets or Graphics to get started in stop motion. That, in my opinion, is the most intriguing aspect of it.
If you've ever wanted to learn how to make a stop-motion video, you've come to the right place.
Product Animation can also be referred to as the frame-by-frame movement of things. You're free to use any items around you to tell stories in this environment.
Changing clay items in each frame is a key part of the claymation process. We've seen a lot of clever and artistic figures on the big screen thanks to wires and clay.
Making folks move! It is rarely utilized. For an artist to relocate just a little each frame, and the number of images you would need, you'll need a lot of patience and possibly a lot of money, if you're hiring them to do so.
The degree of freedom and precision with which they can move is also an important consideration. However, if done correctly, this kind can seem cool, but it can also make you feel a little dizzy at times.
One can do so much with cuts in cutout motion because of this. two-dimensional scraps of paper may appear lifeless, yet you may color & slice them to show a depth of detail.
It's a lot of fun to play about with a cartoon style, but it also gives you a lot more control over the final product because you can add your graphics and details. However, what about the obvious drawback? I find the task of slicing and dicing hundreds of pieces daunting.
Having puppets can be a fun and creative way to tell stories, but they can also be a pain in the neck if you're dealing with a lot of cords. However, this may be a challenge for professional stop motion filmmakers who are not the greatest choice to work with at first. These puppets are of a more traditional design.
When animators use the term "puppet" to describe their wire-based clay character, they are referring to claymation as a whole. Puppets based on the marionette style are becoming less popular.
Position the items or performers behind a white sheet and light their shadows on the sheet with a backlight. Simple, low-cost methods exist for creating eye-catching animations of silhouettes.
The duration takes to create a stop-motion video is entirely dependent on the scale and nature of your project. Testing out 15- and 30-second movies should only take an hour or two. Because of the complexity of the scenes and the usage of claymation, stop-motion projects can take days to complete.
You must first attach the camera to the Pi before it can begin rebooting.
Next to Ethernet, find the camera port. Take a look at the top.
The blue side of the strip should face the Ethernet port when it is inserted into the connector. Push that tab downward while keeping the ribbon in place.
Use the app menu to bring up a command prompt. The following command should be typed into the terminal:
libcamera-hello
If all goes well, you'll see a sneak peek of what's to come. What matters is that it's not upside-down; you can fix it afterward. To close the preview, hit Ctrl + C.
For storing an image on your computer, run the command below:
libcamera-jpeg -o test.jpg
To examine what files are in your root folder, type ls in the command line and you'll see test.jpg among the results.
Files and folders will be displayed in the taskbar's file manager icon. Preview the image by double-clicking test.jpg.
There is no default way to make Python Picamera work with Raspbian newest version.
To make use of the camera module, one must activate the camera's legacy mode.
The command below must be entered into a command window:
sudo raspi-config
When you get to Interface Options, hit 'Enter' on your keyboard to save your changes.
Ensure that the 'Legacy Camera option is selected then tap the 'Return' key.
Select Yes using the pointer keys and hit the 'Return' key.
Repeat the process of pressing 'Return' to verify.
Click on Finish with your mouse cursor buttons.
To restart, simply press the 'Return' key.
Py IDLE can be accessed from the menu bar.
While in the menu, click Files and then New Window to launch a Python code editor.
Paste the code below paying attention to the capitalization with care into the newly opened window.
from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.start_preview()
sleep(3)
camera.capture('/home/pi/Desktop/image.jpg')
camera.stop_preview()
Using the File menu, choose Save Animated film.
Use the F5 key to start your program.
You should be able to locate image.jpg on your desktop. It's as simple as clicking it twice to bring up a larger version of the image.
It's possible to fix an upside-down photo by either repositioning your picamera with a camera stand or by telling Python to turn the picture. Adding the following lines will accomplish this.
camera.rotation = 180
Once the camera is set to PiCamera(), the following is the result:
from picamera import PiCamera
from time import sleep
camera = PiCamera()
camera.rotation = 180
camera.start_preview()
sleep(3)
camera.capture('/home/pi/Desktop/image.jpg')
camera.stop_preview()
A fresh photo with the proper orientation will be created when the file is re-run. Do not remove these lines of code from your program when making the subsequent modifications.
Hook the Raspberry Pi to the pushbutton as illustrated in the following diagram with a breadboard and jumper wires:
Pushbutton may be imported at the beginning of the program, attached to pin17, and the sleep line can be changed to use the pushbutton as a trigger in the following way:
from picamera import PiCamera
from time import sleep
from gpiozero import Button
button = Button(17)
camera = PiCamera()
camera.start_preview()
button.wait_for_press()
camera.capture('/home/pi/image.jpg')
camera.stop_preview()
It's time to get to work!
Soon as the new preview has begun, press the pushbutton on the Pi to take a picture.
If you go back to the folder, you will find your image.jpg there now. Double-click to see the image once more.
For a self-portrait, you'll need to include a delay so that you can get into position before the camera board takes a picture of you. Modifying your code is one way to accomplish this.
Before taking a picture, put in a line of code that tells the program to take a little snooze.
camera.start_preview()
button.wait_for_press()
sleep(3)
camera.capture('/home/pi/Desktop/image.jpg')
camera.stop_preview()
It's time to get to work.
Try taking a selfie by pressing the button. Keep the camera steady at all times! It's best if it's already mounted somewhere.
Inspect the photo in the folder once more if necessary. You can snap a second selfie by running the application again.
This is made easier with the aid of a well-designed setup. To avoid blurry photos due to camera shaking, you will most likely want to use a tripod or place your camera on a flat surface.
If you don't press the push button every time, your stop-motion movie will appear the best. To get the camera to snap a picture, use a wireless trigger.
Maintain your shutter speed, ISO, aperture, and white balance same for every photo you shoot. There are no "auto" settings here. You have the option of selecting and locking the app's configurations first. As long as your preferences remain consistent throughout all of your photos, you're good to go. The configurations will adapt automatically as you keep moving the items, which may cause flickering from image to image if you leave them on auto.
It's ideal to shoot indoors because it's easier to regulate and shields us from the ever-changing light. Remember to keep an eye out for windows if you're getting more involved. Try using a basic lighting setup, where you can easily see your items and the light isn't moving too much. In some cases, some flickering can be visible when you're outside of the frame. Other times the flickering works well with animation, but only if it does so in a way that doesn't disrupt the flow of the project.
You do not get extremely technical with this in the beginning, but you'll need to understand how many frames you'll have to shoot to achieve the series you desire. One sec of the film is typically made up of 12 images or frames. If your video is longer than a few secs, you risk seeming like a stop motion animation.
When you're filming your muted stop motion movie, you can come up with creative ways to incorporate your sound later.
The next step is to experiment with creating a stop motion video using a collection of still photos that you've captured with the picamera. Note that stills must be saved in their folder. Type "mkdir animation" in the command line.
When the button is pushed, add a loop to your program so that photographs are taken continuously.
camera.start_preview()
frame = 1
while True:
try:
button.wait_for_press()
camera.capture('/home/pi/animation/frame%03d.jpg' % frame)
frame += 1
except KeyboardInterrupt:
camera.stop_preview()
break
Since True can last indefinitely, you must be able to gently end it. If you use Ctrl + C to force it to end, the picamera preview will collapse and the loop will be terminated because it is using try-except.
Files stored as "frame" with a three-digit number preceded by a leading zero (009,005.) are known as "frame" files because of the % 03d format. This makes it simple to arrange them in the proper sequence for the video.
To capture each following frame, simply push the button a second time once you've finished rearranging the animation's main element.
To kill the program, use Ctrl + C when all the images have been saved.
Your image collection can be viewed in the folder by opening the animation directory.
To initiate the process of creating the movie, go to the terminal.
Start the movie rendering process by running the following command:
FFmpeg -r 10 -i animation/frame%03d.jpg -qscale 2 animation.mp4
Because FFmpeg and Py recognize the percent 03d formatting, the photographs are sent to the movie in the correct sequence.
Use vlc to see your movie.
vlc animation.mp4
The renderer command can be edited to change the refresh rates. Try adjusting -r 10 to a different value.
Modify the title of the rendered videos to prevent them from being overwritten. Modify animation.h264 to a different file to accomplish this.
Corporations benefit greatly from high-quality stop motion films, despite the effort and time it takes to produce them. One of these benefits is that consumers enjoy sharing these movies with friends, and their inspiring content can be associated with a company. Adding this to a company's marketing strategy can help make its product extra popular and remembered.
When it comes to spreading awareness and educating the public, stop motion films are widely posted on social media. It's important to come up with an original idea for your stop motion movie before you start looking for experienced animators.
In the early days of filmmaking, stop motion was mostly employed to give animated characters the appearance of mobility. The cameras would be constantly started and stopped, and the multiple images would all be put together to tell a gripping story.
It's not uncommon to see films employ this time-honored method as a tribute to the origins of animations. There's more, though.
In the recent resurgence of stop motion animations, strange and amazing props and procedures have been used to create these videos. Filmmakers have gone from generating stop motion with a large sheet of drawings, to constructing them with plasticine figures that need to be manually manipulated millimeters at a time, and to more esoteric props such as foodstuffs, domestic objects, and creatures.
Using this technique, you can animate any object, even one that isn't capable of moving by itself. A stop-motion movie may be made with anything, thus the options are practically limitless.
A wide range of material genres, from educational films to comedic commercials, is now being explored with stop motion animation.
When it comes to creating marketing and instructional videos, stop motion animations is a popular choice due to their adaptability. An individual video can be created.
Although the film is about five minutes long, viewers are likely to stick with it because of its originality. The sophisticated tactics employed captivate the audience. Once you start viewing this stop motion video, it's impossible to put it down till the finish.
It's easy to remember simple but innovative animations like these. These movies can assist a company's image and later recall be more positive. Stop motion video can provoke thought and awe in viewers, prompting them to spread the creative message to their social networks and professional contacts.
It is becoming increasingly common for organizations of all kinds to include stop-motion animations in their advertisements.
Stop-motion films can have a positive impact on both education and business. Employees, customers, and students all benefit from using them to learn difficult concepts and methods more enjoyably. Stop motion filmmaking can liven up any subject matter, and pupils are more likely to retain what they've learned when it's done this way.
Some subjects can be studied more effectively in this way as well. Using stop motion films, for instance, learners can see the entire course of an experiment involving a slow-occurring reaction in a short amount of time.
Learners are given a stop motion assignment to work on as a group project in the classroom. Fast stop motion animation production requires a lot of teamwork, which improves interpersonal skills. Some learners would work on the models, while others might work on the backdrops and voiceovers, while yet others might concentrate on filming the scenes and directing the actors.
The usage of stop motion movies can be utilized to explain product uses rapidly, even though the application of the device and the output may take a while. You can speed up the timeline as much as you want in stop motion animations!
For safety and health demonstrations or original sales demonstrations, stop motion instructional films may also be utilized to effectively express complex concepts. Because of the videos' originality, viewers are more likely to pay attention and retain the content.
Some incredibly creative music videos have lately been created using stop motion animations, which has recently seen a resurgence in popularity. Even the human body could be a character in this film.
Stop-motion animations have the potential to be extremely motivating. Sometimes, it's possible to achieve it by presenting things in a novel way, such as by stacking vegetables to appear like moving creatures. The sky's the limit when it comes to what you can dream up.
When it comes to creating a stop motion movie, it doesn't have to be complicated. If you don't have any of these things in your possession, you'll need to get them before you can begin filming. However, if you want to create a professional-level stop motion film, you'll need to enlist the help of an animation company.
As a marketing tool, animated videos may be highly effective when they are created by a professional team.
The story of a motion-capture movie is crucial in attracting the attention of audiences, so it should be carefully planned out before production begins. It should be appropriate for the video's intended audience, brand image, and message. If you need assistance with this, consider working with an animation studio.
But there are several drawbacks to the overall process of stop motion filmmaking, which are difficult to overcome. The time it takes to create even a min of footage is the most remarkable. The time it takes to get this film might range from a few days to many weeks, depending on the approach used.
Additionally, the amount of time and work that is required to make a stop-motion movie might be enormous. This may necessitate the involvement of a large team. Although this is dependent on the sort of video, stop motion animating is now a fairly broad area of filmmaking, which can require many different talents and approaches.
Using the Raspberry Pi 4, you were able to create a stop-motion movie system. Various stop motion technologies were also covered, along with their advantages and disadvantages. After completing the system's basic functions and integrating additional components of your choice, you're ready to go on to the next phase of programming. Using raspberry pi 4 in the next article, we will build an LED cube.
Hello friends, all of us know that PLCs are nothing but the smartest migration from relay logic control to programmable logic control. Also, you know clearly that, logic is the heart of any programming language, and the same is applied to ladder logic programming. Bitwise operators represent the logical operations including the basic logical operations like AND, OR, and NOT and the derived logical operations like NAND, NOR, and XOR. in most cases, for each bitwise operator, there are inputs based on which the output can be decided. Some of these bitwise operators have two inputs and some have only one input. In this article, we are going to present how we can use these bitwise logical operators and their instructions with examples and practice using the PLC simulator.
Despite we have talked about these, basics and concepts in one of our articles, we have seen it’s good to remind you briefly that basic is the ground for your foot to stand coding logical operations in ladder logic programming. for defining a logical operation, there is a truth table that shows the combinations of the inputs and the resulting output. For example, the bitwise operator that has only one input like “NOT”, has only two possible value for input which is high or low, True or False. And it has one output which is the negate of the input. So it is either TRUE or FALSE. To sum up, for every bitwise operator instruction, we are going to discuss its truth table showing the states of the possible combinations of its inputs and the resulting output as well. In addition, one example using ladder logic programming shows the operation practically. We come to see it is important to list the bitwise operators in table 1 below shows the inputs, output, and the symbol of the logical gate that is equivalent to that bitwise operator.
Table 1: the bitwise operator list
The bitwise operator |
Inputs |
Output |
AND |
2 |
1 |
OR |
2 |
1 |
NOT |
1 |
1 |
NAND |
2 |
1 |
NOR |
2 |
1 |
XOR |
2 |
1 |
Guys, we can see the truth table of the AND instruction as tabulated in table 2. It shows the operator has two operands input A, and input B, and one output. The inputs can be switches, sensors i.e. limit switch for example while the output is a digital output to switch one actuator i.e. motor.
Input A |
Input B |
Output |
False |
False |
False |
True |
False |
False |
False |
True |
False |
True |
True |
True |
Also, Fig. 1 shows the symbol of the AND gate which is equivalent to AND bitwise operator. It shows two inputs A and B and only one output. Let us see that practically in ladder logic programming showing how to implement this with example.
Figure 2 shows our first simple rung that codes the logic of AND bitwise logic. It shows two contacts A and B are connected in series to decide output AND-RES based on AND logic shown in truth table 2. So let us go .simulating this thing we just coded and see the logic in the application.
We typically have 4 cases according to the truth table. Figure 3 shows the case when inputs A and B are low. The output shows low as shown by the coil AND-RES.
Now let us switch on input A and keep the second operand B false as shown in fig. 4, output AND-RES output still off.
So let us try to switch the other input, B ON, and set input A off, as shown in fig. 5 output is off as represented by coil M0.2, tag AND-RES.
At last, when both inputs A and B are ON as in Fig. 6. Now only the output comes to turn ON.
Guys!, you know for sure have got to know that, with AND logic, for having the output turned high both inputs A and B must be high.
Ladder logic in Siemens and most other brands offer the facility to perform AND between byte, word, and Double word memory space as shown in Fig. 7 shows the AND block.
Figure 8 shows the usage of AND block for byte data type and it is possible to do the same with a word or double word data type. The instruction block applies to byte, word, and double word data types. However, for showing one example, Fig. 8. Shows the process of byte datatype. It shows the inputs A and B represented by memory bytes MB1 and MB2 while the output is represented by MB3. The operation shown in Fig, 8, can show the AND logic between two bytes that hold values “10001110” and “00001111” so the output represented by MB3 shows the value “00001110”.
This logic gate has two inputs and one output like the “AND” gate. Like its name, the output comes true when either input A or input B comes true as shown in Fig. 4.
Table 3 lists the truth table of the “OR” gate. It lists all possible combinations of inputs and the output status as well. It shows that the output comes to true when input A or input B comes to true.
Input A |
Input B |
Output |
False |
False |
False |
True |
False |
True |
False |
True |
True |
True |
True |
True |
Figure 10 depicts the very simple rung of ladder logic that represents OR bitwise operation. It shows two inputs A and B connected in two parallel branches to give the output. So let us simulate that very OR code and apply the cases listed in the truth table in table 3.
Typically as listed in table 3, the output is low when both inputs are OFF as shown in Fig. 11.
Ohh, you can see output comes ON when input A is ON and input B is OFF as shown in Fig. 12.
Also, output comes ON when input B is ON and input A is OFF as shown in Fig. 13.
Also, you can see output comes ON when both inputs A and B are ON as shown in Fig. 14.
That concludes two things guys, in OR bitwise logic, for having output ON, there must be at least one of the inputs High.
Ladder logic in Siemens and most other brands offer the facility to perform OR between byte, word, and Double word memory space as shown in Fig. 15 shows the AND block.
Figure 16 shows the usage of OR block for byte data type and it is possible to do the same with a word or double word data type. The instruction block applies to byte, word, and double word data types. However, for showing one example, Fig. 16. Show the process of byte datatype. It shows the inputs A and B represented by memory bytes MB1 and MB2 while the output is represented by MB3. The operation shown in Fig, 15, can show the OR logic between two bytes that hold values “00001111” and “11110000” so the output represented by MB3 shows the value “11111111”.
This logic gate has only one input and one output. In a very simple language, the output is the inverted logic of the input. So when the input is true, the output would come to false and vice versa as shown in Fig. 17.
Table 4 lists the truth table rows of all possible combinations of input and output.
Input |
Output |
True |
False |
False |
True |
Figure 18 depicts a very simple example of a ladder logic rung that shows the output “NOT-A” is the negate logic of the input A.
Now let's simulate the two cases listed in table 4 when inputs A is high and when it is low as well. Figure 19 and 20 show the output is the negate of the input using the NOT bitwise logic.
Now Guys we have gone through the basic bitwise logic. So how about the other bitwise logic that is formed by combining these basic bitwise operators like XNOR? let us simulate XNOR.
XNOR is the negative logic of OR bitwise or you can name it as NOT-OR. Table 5 lists the combination of its two inputs and its output. It shows clearly that, the output becomes true when inputs are equal i.e. both inputs are true or both are false. Yes! Exactly, that’s why this bitwise operation is used when we need to compare two inputs if they are equal or not.
Input A |
Input B |
Output |
0 |
0 |
1 |
0 |
1 |
0 |
1 |
0 |
0 |
1 |
1 |
1 |
Figure 21 shows the symbol of the “XNOR” logic gate showing inputs and output of the bitwise operation.
On the other hand, Fig. 22 shows a sample ladder logic of an “XNOR” logic gate implementation. It shows that there are only two ways to have the output in a TRUE state which are by set both inputs TRUE or setting both FALSE. So let us apply this to our simulator and test cases listed in table 5.
Figure 23 shows the test of simulating XNOR when both inputs are low. You can notice friends that output comes to high.
The same thing when both inputs are high, outputs show high as shown in Fig. 24.
Ohh, you can see when one input is not matched with the other that leads to low logic of the output. That concludes the XNOR gives a high logic output when only both inputs have the same logic; otherwise, it gives a low if they are different.
Before naming the next tutorial, I would like to let you know that there are many other bitwise operators like XOR, NAND, NOR, etc. this bitwise logic can be programmed in the same scenario we demonstrated above. Now, let me tell you that the next tutorial will be about one of the most important instructions ever in the PLC that will ease the data transfer between memory locations including all data types bytes, word, Dword, etc. it is the MOVE instruction in ladder logic. So be there to learn and practice that good one.
Hi friends, today we are going to learn a good technique to run multi outputs in sequence. In another word, when we have some output that is repeatedly run in sequence. In the normal or conventional technique of programming we deal with them individually or one by one which takes more effort in programming and much space of memory. So instead we can use a new technique to trigger these outputs in sequence using one instruction which will save the effort of programming and space of memory. In this article, we are going to introduce how to implement sequencer output instruction. And practice some examples with the simulator as usual. Before starting the article, we need to mention that, some controllers like Allen Bradley have sequencer output instruction and some has not like Siemens. So we are going to give one example for each case showing how to code the equivalent to the sequencer output instruction in the PLCs that does not support this instruction.
Figure one shows the block diagram of the process. The instruction takes the input data from the file, array, and data block and sequentially relays it to the outputs to trigger them sequentially.
Figure 2 shows the block of the sequencer output instruction showing input and output parameters. The file parameter is the first input parameter showing the address of the reference sequencer file. In addition, the mask input is to receive the address of the mask or the data block of which the instruction will move the data sequentially before relaying it to the output. Furthermore, the dest parameter is an output parameter that shows the address of the output to which the sequence bits will be applied. And the control parameter is the storage words for the status of the instruction, the file length, and the position of the pointer in the data file or array. Also, the length parameter holds the number of steps to move in the data file to the output destination sequentially. And position parameter holds the location of the pointer in the data file.
Figure 3 shows an instance of sequencer output instruction QSO. The QSO instruction steply moves through the input data file or array or data block and transfers sequentially the data bits from the data file to the output (destination word) through the mask word. The status of the instruction can be shown in the DONE (DN) bit. You should notice my friends that after the data transition is done the position is reset to the initial position or the first step.
Now guys, let us move to the ladder logic coding. So how does that sequencer output instruction work in ladder logic? Well! Figure 4 shows a complete example of QSO instruction that is used in Allen Bradley to handle the sequencer output process, it shows one rung that has a start and stops push buttons from left to right at address I:0/0 and I:0/1 respectively to control the starting and stopping of the sequencer output processing. Next, you can see input I:0/2 which is used as a sequencer process flag to switch on or off the sequencer process. So, if the start PB is requested when no emergency stop and the sequencer on input is ON, the QSO is enabled and the data at address #B3:0 will be moved to dest at address O0:0 though the mask word at address 000Fh starting from position 0 with length 4.
Figure 5 shows the data file that the QSO uses to transfer sequence data bits to output. It shows the bits B3:0, B3:1, B3:2 & B3:3 are set to 1 for reference. So, when the sequencer ON input is set to high (I:0/2). The output Q:0/1 will be turned on based on the data in the data file shown in fig. 5. In that case, the length is 4 and the position is 1.
And when the sequencer flag I:0/2 is switched on next time, output O:0/2 will be switched ON. In that case, the length is 4 and the position is 2 as shown in Fig. 6.
In the third time, the sequencer flag is turned ON, the output O:0/3 will be turned ON and the length and position are updated to 4 and 3 respectively as shown in Fig. 7.
When it comes to the fourth time of switching the sequencer flag I:o/2, the output O:0/4 will be turned high and the position will be at 4 and length is 4 as shown in fig.8. At that time, the process is reset and position reset to 1.
The previous example shows how it is simple to control a bunch of outputs that are required to run in sequence with only one rung of the ladder program and using only one instruction which is QSO in Allen Bradley. This merit helps to save the memory space and time and efforts of programming and troubleshooting as well because the program will be shorter and more readable. However, still, some brands have not supported such instructions even the big names like siemens. That can not be counted as limitations but they are banking on there being a way to implement such logic. So, it is very beneficial for you guys to go implement together a piece of code (ladder logic) that is equivalent to such instruction for performing the function of sequencer output instruction in Siemens S7-1200 using our simulator.
As you guys see the sequencer output instruction is nothing but shifting the height value from right to left bit or right to left or even rotated shift for continuous operation. That drives our thinking to use the shift instructions in Siemens to perform this sequencer output instruction.
Figure 9 shows the rungs of a ladder PLC simple program that implements the sequencer output process. See guys how lengthy the logic we have to code to do the same function of single instruction QSO in Allen Bradley. Again, that is a drawback or limitation thing but the program is more lengthy and takes more effort and also memory it is consuming that way. Moving to the logic listed in Fig. 9, the first thing is using a rotated shift instruction that shifts through the data block bit by bit and applies to the output QW0. At the same time increment instruction is used to move through the data. Also, one on delay timer is used to do some delay to show up the sequencing process of activating the output sequentially. And the end, a comparison instruction has been used to check if the pointer or the position reached the last output coil to reset to the first position and so on.
Figure 10 shows the simulation of the sequencer output ladder code before activating the processes by using M0.0, it shows the position is at 1 and the output QW0 is all zeros. So let us activate the sequencer output process by set M0.0 to high and see the output.
Figure 11 shows the process after activating the sequencer program and starting to switch on outputs sequentially. The figure shows the process reached the sixth output coil and the position set to 7 to point at the next output. The process continues to tell reach the last one and then the position set the first step.
I am glad to have you guys following tell that point and I hope you see the importance of the sequencer output technique in reducing the effort of programming and saving memory. Next time will take a tour with the bitwise logic operator and how they are utilized and how they work in the ladder program with given examples and for sure simulation to practice their usage. So let’s meet then and be ready.
Hi readers! Hopefully, you are doing well and exploring something new. Every powerful machine has a secret weapon, a machine that few think about but is responsible for all speed, torque, and, relatively speaking, performance. That secret weapon is an incredibly engineered gearbox. Today, we discuss gearbox design.
Gearbox design and selection are amongst the most critical elements of mechanical engineering, as they involve how power will be best transferred between two rotating shafts. A gearbox changes speed and torque position from a power supply (usually a motor) to the required application. Gearboxes accomplish this through a series of different types of gears, in various configurations. Gearboxes allow machines to perform under various parasitic load conditions.
Gearboxes vary widely, from automotive experiences with gearboxes or transmissions, industrial equipment, wind turbines, and robotics. Each of these applications will have vastly different required gear configurations: spur gears, helical, bevel, worm or planetary gears. The selection of gears will vary due to the constraints of required gear ratio, torque, noise level, or efficient size in the application and lastly, the level of environment needed for the gearbox to be optimally integrated.
Designing a gearbox includes a number of considerations such as: material of the selected gears, efficiency, lubrication, heat dissipation, and the expected life span of the gearbox components. Key considerations of a gearbox design include gears, shafts, bearings, housing and controls. Careful consideration must be made so that losses in power can be minimised and that reliable operations are guaranteed with a long operational lifespan, with stresses that may be encountered in different environments.
Here, you will find the definition of the gearbox, its basic parts, types of gears used in it, types of gearboxes, objectives in gearbox design, steps to design a gearbox, and applications. Let’s unlock detailed guidance.
A gearbox takes power from an engine and sends it to another device, changing both speed and torque. A gearbox supplies the right RPM and torque levels for different types of vehicles and equipment. A gearbox changes speed and torque by % using different ratios. Gearboxes provide an efficient means of changing motion and torque, better overall performance, and improved fuel consumption. Gearboxes are found in many mechanical systems such as vehicles, industrial machines, and wind turbines.
Examining the pieces in a gearbox helps the designer and maintainer work on and troubleshoot problems with it. Every component is necessary for transferring power efficiently, without much wear on the machine itself. The basic parts of a gearbox are as follows:
Gears are the main component of a gearbox that change speed and torque. Gears transmit motion by engaging in pairs to convert the rotary motion of one shaft to another shaft with a designed gear ratio.
Spur Gears: connect parallel shafts, and are also one of the simpler ways to transmit power and motion.
Helical Gears: have angled teeth that allow for smooth, quiet operation.
Bevel Gears: used for shafts at right angles.
Worm Gears: best used for high rates of torque reduction, and are best for a compact design.
Depending on the function required by speed, load, and spatial limitations, each gear type equally serves a purpose. Design considerations will consider material strength, tooth geometry, and precision machining to achieve the best contact point with minimal backlash.
Shafts are the mechanical axis by which gears will turn, allowing for the transfer of torque and motion to other mechanical devices.
Input Shaft: the shaft that connects the source of power (e.g., engine, motor).
Countershaft: intermediate shaft that utilises gears but does not provide any motion; it is used to distribute torque.
Output Shaft: provides adjusted torque and speed to the driven mechanical device.
For the most part, shafts are made from alloy steel, and they must be engineered to support constant and changing forces that could cause them to bend, twist and weaken. It is extremely important to make sure all rotating parts are aligned and balanced, because misaligned or unbalanced parts can eventually damage the machine.
Bearings make possible the smooth and stable rotation of the shafts and minimize friction between moving pieces. Bearings assist in supporting both radial and axial loads, and specific gearbox designs may be used for specific applications.
Ball Bearings: Suitable for any light radial and axial loading.
Roller Bearings: Suitably rated for a heavy radial loading.
Tapered Bearings: Suitable for a combination of radial and axial loads.
Bearings will last indefinitely anything by protected from contamination and kept lubricated.
The housing provides the outside structure to the gearbox; it houses the internal components, provides structural support, and corrosion, allowing gears and shafts to be properly aligned.
The housing does the following:
Protect gears and bearings from dirt, debris, and moisture.
Act as a reservoir for lubricants.
Dissipate heat generated from mechanical operations.
Minimise the noise and vibration of operation.
Commonly used materials are cast iron for heavy-duty applications, and aluminium for lightweight machinery - it is essential that the housing be machined to an accuracy to stay within tolerances, and hold gears and shafts in position without misalignment.
Lubrication is critical for effective operation and longevity of components. Reducing friction, transferring heat, and preventing metal-on-metal contact is the lubricant's job.
The methods of lubrication are:
Splash Lubrication: A simple method, and one most used; gears dip into an oil bath.
Forced Lubrication: Pumps provide oil right to critical parts.
Mist Lubrication: Uses very fine oil mist, used for all high-speed gearboxes or other applications.
Different types of gears are used in gearboxes based on specific design parameters such as the required torque being transmitted, physical constraints such as available space, and noise and speed variation control parameters. Below is a list of the most common gears.
Spur gears have their teeth cut straight and are assembled on parallel shafts. The design is simple, it is easily produced, and it is very efficient. The drawback to spur gears is that they typically create the highest amount of noise and vibration, especially when run at higher speeds.
Helical gears have angled gears which engage gradually in a more controlled manner, which results in less noise and vibration and a smoother operation. Helical gears can be used to transmit higher loads, but introduce axial thrust, which should be accounted for. They are popular for high-speed or heavy-duty applications
These days, bevel gears are commonly built for shafts that connect at a 90° angle. Because bevel gears are built as cones, they permit the direction of power delivery to change. Bevel gears are commonly integrated into differential drives and gearboxes that form right angles.
They are made up of a worm (the screw) with a worm wheel. They can produce strong torque in small packages and are applied at high-speed reduction rates. Sliding contact in worm gears makes them less efficient and likely to produce heat.
The parts of a two-stage gear system are a sun gear, several orbiting planet gears and an outer ring gear. Because planetary gears have a high ratio of power to space, they are usually selected for use in many automotive, robotics and aerospace machines.
Gear Box |
Features |
Applications |
Manual Transmission |
The driver shifts gears manually; a simple design |
Automobiles, motorcycles |
Automatic Transmission |
Shifts gears automatically using hydraulic or electronic control |
Passenger cars, heavy vehicles |
Planetary Gearbox |
High torque and compact; uses central sun gear, planet gears, ring gear |
Robotics, aerospace, EVs |
Worm Gearbox |
Right-angle drive, high torque output |
Lifts, conveyors, tuning instruments |
Helical Gearbox |
Smooth and quiet; handles higher loads |
Industrial machinery |
Bevel Gearbox |
Transfers motion at right angles |
Power tools, marine applications |
The core goal of gearbox design is to create an optimal system performance, reliability, cost, and operational efficiency. A good gearbox will provide an efficient means of transferring power to the driven machines while also tolerating in-use rigours and tribulations. Below are the key objectives in gearbox design:
The primary aim of any gearbox is to transmit power from the driving source, such as a walking beam pump or other motor devices, to the driven machinery as efficiently as possible. The proper torque and speed are needed for any given application. The designer must select the proper gear ratios, confirm or make the best provisions for the gearbox to accommodate the expected loads and provide leeway not to experience slippage or power loss while operating and without mechanical collapse.
In many applications, gearboxes are used for long periods and frequently in harsh environments. Gearboxes will need to be able to withstand wear, fatigue, thermal cycling and many other considerations over their entire service life. Choices in material selection, surface treatments, alignment, load distribution and reduced stress must be made to reduce failure rates.
Many applications, particularly in automotive, aerospace, and robotics, have strict size and weight restrictions. The gearbox must be designed to be as compact and light as possible, avoiding loss in strength or performance. This invokes a lot of thought into gear configuration and the housing that provides maximum power density.
Modern gearbox design incorporates reducing noise and vibration during operation, especially in consumer or comfort-sensitive locations. This has been done with components such as helical gears, precision machining, and the use of noise-reducing materials. A quieter gearbox usually means smoother mechanical operation and will experience less wear over time.
Gearboxes produce heat due to friction between moving parts. Effective design calls for adequate thermal management, from sufficient lubrication to heat dispersal in the gearbox housing, or even cooling systems. For component and performance efficiency in the long run, gearboxes should operate at sufficient and consistent temperature ranges.
The design begins with determining requirements around the application, such as input and output speed, torque quantities, and conditions of the application, such as ambient temperature, load cycles, or even environmental exposure. These requirements must be noted down as they will guide every decision that follows.
Designers consider the style of gear (spur, helical, bevel, etc.), but also the demands form the application. An important consideration will be material, considering strength and wear resistance. The designer has to calculate the specific gear ratio, consistent with speed and torque.
Shafts must be designed considering torsional resistance and bending resistance, while bearings take into consideration radial and axial loading. It is imperative to will also keep shafts aligned to ensure a service life without premature failure.
The house requires sufficient support for all internal components and contains sufficient provision for lubrication, cooling and maintenance. Structural rigidity and precision of internal layout are critical factors.
Selecting the right lubricant and delivery method will ensure a loss of friction and squash continued operation. Designing provisions for heat dissipation can be equally as important as avoiding thermal degradation.
The designer will conduct the final step on their design with fatigue check, checks for overload, and cap it with Finite Element Analysis (FEA). If prototypes are fabricated, they can also be subjected to real-world tests to validate that the design as-built meets their expectations and still meets their design objectives under conditions of use.
In the automotive world, gearboxes are found to be critical in both manual and automatic transmissions, and electric vehicle (EV) drive units, ensuring effective power delivery and optimization of the available fuel or battery energy.
In industrial machinery, gearboxes are present in conveyor systems, packaging/inspection machines, and material handling equipment, which provide the ability to modulate motor output to operational speed and torque requirements.
In aerospace, gearboxes are present in helicopter main and tail rotor drives (or engines) and in the position mechanism of satellites. These have a requirement for high precision and reliability to operate in harsh environments.
Gearboxes in wind turbine applications would be responsible for increasing the slow rotational speed of the rotor to a higher speed that is used by the generator, which improves the throughput of electric power production.
In marine applications, gearboxes can assist in directional propeller drives, anchor winches and thrusters, which all have requirements to withstand extreme loads and corrosion.
When a robot moves, gearboxes will typically be used to match the human-like control of joint movement with high accuracy and repeatability, especially in robotic arms and automated manufacturing systems.
Gearbox design is a vital part of modern mechanical engineering, making power transmission systems work. From automobiles to industrial applications, in aerospace, robotics, and renewable energy, gearboxes provide regulated, efficient torque and speed transmission. Moving from concept to reality, gearbox design starts a complex process that takes into account gear type, shaft geometry and alignment, bearing loads, gearbox housing structure, component lubrication, and thermal management.
A careful balance of durability against performance, size, cost, and noise is paramount. Modern gearbox design combines advanced materials and manufacturing techniques with computer-aided design (CAD), simulation technologies like finite element analysis (FEA), and successful design ideas have led to compact, reliable, and energy-efficient gearboxes. Industry is demanding compact size with more performance, so gearbox design will continue to innovate, integrate, and develop precision power for the foreseeable future. Because gearboxes need to be more compact and have more performance, they will need to be socially responsible while reducing the total cost of ownership. Gearboxes must continue to deliver, better and better, so our world can be powered with the most efficient designs with reliability built in.
Fluid mechanics is considered to be one of the essential branches of Mechanical Engineering. Fluid Mechanics comprises two words, fluid, and mechanics, with different meanings and research criteria. In this article, I will extensively introduce fluid mechanics and its importance in daily life. So without wasting any time, let us start:
We remember in the early classes, we used to study three states of matter, and afterward, they became four named:
The definition of fluid is the state of matter that can be liquid or solid. We might have noticed that whenever the matter is in any stage, the criteria to know its state is to understand how much stress it can bear, and we name that stress as shear stress that changes its shape. But this situation mostly happens in solid or liquid cases. When the stress is applied, the substantial changes shape and reform into a new one. But up to a limit that cannot destroy its ultimate form. The stress applied to a solid is directly proportional to the strain, whereas, in liquids, the stress is directly proportional to the strain rate.
As mentioned that fluid mechanics comprises of two terms, so now I will define what mechanics is and how much it is essential in our today’s life.
Here are two essential terminologies:
The branch of mechanics in which bodies are at rest is called statics. It is a vast study of internal and external forces in a structure
Example:
The best example of statics is when you are standing on a plane on the rigid ground. The force of gravity and the reaction force as the reaction of gravitational force, both these forces act as statics and help in maintaining the state of rest.
The branch of mechanics which studies the bodies in motion is called dynamics. The study is all related to the movement and what is the cause of it.
Example:
The example of moving the body and dealing with all the forces that are acting on and their effect is categorized in dynamics.
Fluid Mechanics is the sub-category defining the fluid’s nature at rest or in motion.
The types of fluid mechanics are as follows:
Example:
It involves the mass flow rate of oil through the pipeline, study of the pattern weather forecast, and blood circulation.
Example:
The best example of fluid statics involves drinking with a straw. The mechanism happening inside is that when we reduce the pressure at the top of the straw, inside the liquid the atmosphere pushes the liquid up to the mouth.
Fluid statics and dynamics are divided into compressible and incompressible fluid as well as real and ideal fluids. So real is divided into the laminar and turbulent flow, and this goes on.
As I discussed earlier, fluid flow is classified, and they vary from type to type.
By reading their names, you get an idea of what a laminar and turbulent flow is. So laminar flow is one in which fluid flows smoothly without any turbulence. Usually, highly viscous fluid with low viscosity is characterized as laminar flow. Whereas turbulent flow is the one in which fluid flow is not smooth. And they have high velocities.
The compressible and incompressible flows depend upon one of the significant factors density. The flow is incompressible when the density is constant or nearly constant throughout the flow. Incompressible flows characterize most liquids. The compressible flows are opposite to the incompressible ones; they don’t have constant throughout. One of the best examples of compressible flow is gases.
In these types of flow, viscosity is one of the essential vital elements. Every fluid has some viscosity value. So the flows with a significant amount of frictional effect are said to be viscous. Inviscid flows are where viscosity is neglected or to some extent.
As the name shows, the flow covered with a solid boundary is considered internal flow. The liquid is flowing in a pipe or a wire. At the same time, the external flow is defined as an unbounded flow. The fluid flowing over the pipe or the fluid over the ball is exemplified as external flow. And the flow inside a pipe covered is said to be internal flow.
The names are enough to define the nature of the flows. So steady or uniform flows are said to be steady flows. And the unsteady one is opposite to the steady one that does not have any uniformity.
Natural flows are the one that flows naturally. But the theoretical example will be the one that flows due to the buoyancy effect. The forced fluids are the ones that are forced to flow with the help of external means. An example of forced flow is a fan or pump.
The nature of the fluid varies from type to type. The following are some vital types of fluids.
Real fluids possess viscosity. Viscosity is defined as resistance or opposition. Eliminating the ideal cases, all the fluids are examples of real fluids.
The ideal fluids are the one that has no viscosity at all. As I have mentioned just now that all the fluids have viscosity. So ideal fluids are just an ideal case study.
Both of them have two different properties. The Newtonian fluids are the ones in which the shear stress is directly proportional to the shear strain, and in non-Newtonian fluids, they are not proportional to each other.
The ideal plastic fluids are the ones in which shear stress is directly proportional to the shear strain. The shear stress value is also more than the yield value. These fluids are velocity gradient ones and have significant importance.
Fluid mechanics is considered one of the vast branches of mechanical engineering that covers all the fundamental laws of physics. It is not wrong to say those fluid mechanics depend on these laws, and they are named as follows:
Second Law of Thermodynamics
Conservation of mass
Conservation of linear momentum
Conservation of energy
Conservation of angular momentum
As I have briefly discussed all the types of fluids, the following is their graphical presentation.
The properties are one of the significant features of everything. The fluids also have some properties. The following are some essential properties of the fluid.
The word viscosity means thickness. According to the definition, viscosity is defined as the fluid’s property related to friction and resistance.
When one layer moves adjacently to the other, some friction exists, which we named viscosity. The layers are moving at some distance and are named dy. The velocities of the fluids are u and u+du, respectively.
The graphical presentation of the layer velocity versus the distance is shown below.
The graph will explain the trends of velocity and distance. As mentioned, two layers are moving adjacently to each other, so the layer that is on top imposes shear stress on the lower layer, and the lower layer, in response, causes shear stress on the upper one.
According to physics, density is defined as the mass to volume ratio. So the fluid mass to fluid volume ratio is the density of the fluid. In liquids, the density is constant, but in gases, it’s variable.
The specific weight is defined as the ratio between the weight of the fluid and volume. Thus the weight density is defined as the weight per unit volume of fluid and is denoted by w.
Mathematically,
w=Weight of FluidVolume of Fluid
w=Mass of Fluid×Acceleration due to cycleVol. of fluid
w=Mass of Fluid×gVol. of Fluid
w=ρg
The specific volume is defined as the volume of a fluid by a unit mass or volume. This property applies to gases.
Mathematically,
Specific Volume = Vol. of fluidMass of fluid
Specific Volume=1Mass of FluidVol.
Specific Volume=1
The thermodynamic property is the salient feature of gas and liquid. We know that when liquids are compressed, they form gas, so thermodynamics is one of the critical features of gases.
The equation below shows a connection between the pressure, specific volume, absolute temperature, and gas constant.
p=RT
The definition of a system is as follows:
The system is the quantity of matter or a specific region specified for research or study.
As you can see from the diagram, an imaginary or real wall or a surface separates the system from the surroundings. So a system can be open, close, or isolated (special case). So following is a brief explanation of all the types of systems.
Open System
In the open system, the volume is controlled and the energy and mass can easily pass through the boundary of the control volume.
Close System
In the closed system, the mass is controlled and cannot cross the boundary. The energy can cross the boundary easily and volume is also not fixed.
Isolated System
In the isolated system, the energy cannot cross the boundary.
The definition of dimensions is as follows:
The Definition of units is as follows:
There are two types of units explained below briefly.
Some basic dimensions are given the names and they are as follows:
Dimensions |
Units |
Mass |
m |
Temperature |
T |
Length |
L |
Time |
t |
Some dimensions are assigned names in terms of primary dimensions and they are as follows:
Dimensions |
Units |
Volume |
V |
Energy |
E |
Velocity |
V |
Two kinds of units are commonly used in today’s world and that is;
The English system does not have an apparent systematic and numerical base. It is considered to be one of the most difficult systems to memorize. In almost every country metric SI units are widely used but the United States is the only country that has not fully opted for the metric system rather they use the English system in many states.
Example
12 in =1 ft
1 mile =5280 ft
4 qt =1 gal
It is one of the most commonly used and feasible units. The metric SI units are widely used in industries and countries like England. There are seven basic fundamental dimensions introduced and their units in SI are as follows:
Dimension |
Unit |
Length |
meter (m) |
Mass |
Kilogram (kg) |
Time |
Second (s) |
Temperature |
Kelvin (K) |
Electric Current |
Ampere (A) |
Amount of light |
Candela (cd) |
Amount of Matter |
Mole (mol) |
There are numerous examples of fluid mechanics in our daily life. The following examples are some crucial parameters that cover fluid mechanics.
Our heart is an integral part of the human body that pumps blood to all body parts through arteries and veins. In this modern era of science and technology, many scientists have designed artificial hearts that work on the working principle of fluid dynamics and transmit blood and pumps like the original heart.
Our homes are one of the best examples of fluid mechanics. The piping, sewage, hot and cold water pipes, natural gas, and LPG work on fluid mechanics principles. Moreover, our refrigerator, air conditioning, heating, cooling, and insulating system are all examples of fluid mechanics.
We find various examples in our cars, planes, buses, and ships. Fluid mechanics covers all the fields associated with fuel transportation, from the fuel tanks to the cylinders, fuel pumps, carburetors, etc. It covers all the cooling heating systems of automobiles, lubrication systems, power steering, and radiator cooling.
Fluid mechanics is used in many medical devices such as glucose monitors, heart assistance devices, etc.
It is beneficial for eliminating pollution from the atmosphere, cleaning water, cleaning sewage systems, and controlling floods.