Hello friends! I hope you are doing great. Today, we are discussing the latest version of the Arduino Mega 1280 library for Proteus. This can be used in both versions (Proteus 7 and Proteus. We have shared the previous versions, which are the Arduino Mega 1280 library for Proteus and the Arduino Mega 1280 library for Proteus V2.0 with you. With the advancement in the version, these microcontrollers have a better structure and the design is closer to the real microcontrollers.
In this article, I will discuss the introduction of the Arduino Mega 1280 in detail. Here, you will learn the features and functions of this microcontroller. Then, we’ll see how to download and install this library in Proteus. In the end, we’ll see a mini project using the Arduino Mega 1280 V3.0. Let’s move towards our first topic:
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Battery 12V | Amazon | Buy Now | |
2 | Resistor | Amazon | Buy Now | |
3 | LCD 20x4 | Amazon | Buy Now |
Now, let’s see the Arduino Mega 1280 library V3.0 in Porteus.
The download and installation process for Arduino Mega 1280 is easy. The Proteus software does not have this library by default. To use it, the first step is to download it from the link given below:
Arduino Mega 1280 V3.0 for Proteus
The downloading does not take much time. Once it is complete, it can be seen in the download folder on your system.
You will see a zip file when it is extracted to a particular path of your choice.
There are two files in the folder named:
ArduinoMega3TEP.IDX
ArduinoMega3TEP.LIB
Copy these files and paste them into the folder with the following path:
C>Program files>Lab centre electronics>Proteus 7 Professional>Library
If you want more details on this process, you must see How to Add a New Library File in Proteus .
Note: The same process is applicable to Proteus 8 professional if you are using that.
You can see it has many pins and the structure and design are closer to the real Arduino Mega. There is no link to the website on this microcontroller and it has more details about the pins on it. These points are different from the previous versions.
The Arduino Mega 1280 has many features and it is used in a great number of projects. But, as a beginner, we’ll check the work with the help of a simple project. In this project, we’ll use the LED with Arduino Mega 1280 V3.0 and print the message of our own choice. Follow the steps to perform this example:
Go to the terminal mode from the left side of the screen, and then choose the default pins for the clean circuit.
Set and label the pins according to the image given here:
The circuit is fine but it can’t be run without coding.
Fire up your Arduino IDE.
Create a new sketch for this project.
The upper side has a drop-down menu, choose Arduino from there.
Delete the default code.
Paste the following code into it:
#include
//Setting the LCD pins
LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
const int buttonPin = 0;
boolean lastButtonState = LOW;
boolean displayMessage = false;
void setup() {
pinMode(buttonPin, INPUT);
//Printing the first message
lcd.begin(20, 4);
lcd.setCursor(1, 0);
lcd.print("Press the button to see the message");
}
void loop() {
int buttonState = digitalRead(buttonPin);
// Using if loop to create the condition
if (buttonState != lastButtonState) {
lastButtonState = buttonState;
if (buttonState == LOW) {
displayMessage = true;
lcd.clear();
lcd.setCursor(1, 0);
//Printing the message on screen when buttin is pressed
lcd.print("www.TheEngineering");
lcd.setCursor(4, 1);
lcd.print("Projects.com");
} else {
displayMessage = false;
lcd.clear();
lcd.setCursor(1, 0);
lcd.print("Press the button to see the message");
}
}
}
The same code is also present in the zip file of the Arduino Mega 1280 V3.0 library folder you have downloaded.
Click on the tick mark to run the code. It will take some moments to be loaded.
Once the loading is complete, click on the upload button to get the hex file address.
In the loading process, you have to search for the path to the hex file. In my case, it looks like the following image:
Go to the proteus where we have created our project.
Double-click on the Arduino Mega 1280 V3.0 module. It will open its properties panel in front of you.
Paste the address of the hex file into the section named “Program File.".
Hit the “OK” button and close the window.
There are some buttons at the bottom left corner of the screen. Out of these, you have to click the play button to run the project.
If all the above procedures are completed successfully, you will see the output on the screen.
When the button is opened, the LCD shows the message that you have to push the button to see the message.
Click on the button, and now you can see the message on the LCD.
If all the above steps are completed successfully, you will see that you have used the Arduino Mega 1280 V3.0 to show the required message on the LCD. This microcontroller can be used in different complex projects and can provide the basic working according to the code. Now, you can try different projects on your Proteus. I hope you have installed the microcontroller successfully. Yet, if you are stuck at any point, you can ask in the comment section.
Welcome back to another Python tutorial for the Raspberry Pi 4! The previous tutorial showed us how to construct a Raspberry Pi-powered cell phone with a microphone and speaker for making and receiving calls and reading text messages (SMS). To make our Raspberry Pi 4 into a fully functional smartphone, we built software in Python. As we monitored text and phone calls being sent and received between the raspberry pi and our mobile phone, we experienced no technical difficulties. But in this tutorial, you'll learn how to hook up the PCF8591 ADC/DAC module to a Raspberry Pi 4.
Since most sensors only output their data in analog values, converting them to binary values that a microcontroller can understand is a crucial part of any integrated electronics project. A microcontroller's ability to process analog data necessitates using an analog-to-digital converter.
Some microcontrollers, including the Arduino, MSP430, and PIC16F877A, contain an onboard analog-to-digital converter (ADC), whereas others, like the 8051 and Raspberry Pi, do not.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Jumper Wires | Amazon | Buy Now | |
2 | PCF8591 | Amazon | Buy Now | |
3 | Raspberry Pi 4 | Amazon | Buy Now |
Raspberry-pi 4
PCF8591 ADC Module
100K Pot
Jumper wires
You are expected to have a Raspberry Pi 4 with the most recent version of Raspbian OS installed on it, and that you are familiar with using a terminal program like putty to connect to the Pi via the Internet and access its file system remotely. Those unfamiliar with Raspberry Pi can learn the basics by reading the articles below.
Each of the ten pins on the PCF8591 module may read analog values as high as 256 on the PCF8591's digital side or vice versa. The board has a thermistor and LDR circuit. Input and output from this module are both analogs. To facilitate the I2C protocol, it has a dedicated serial clock and serial data address pins. The supply voltage ranges from 2.5 to 6V, and the stand-by current is minimal. We can further turn the module's potentiometer knob to control the input voltage. A total of three jumpers can be found on the board. Switching between the thermistor, LDR/photoresistor, and adjustable voltage access circuits is possible by connecting J4, J5, and J6. D1 and D2 are two LEDs on the board, with D1 displaying the strength of the output voltage and D2 indicating the power of the supply voltage. When the supply or output voltage is increased, the brightness of LEDs D1 and D2 are correspondingly enhanced. Potentiometers connected to the LEDs' VCC or AOUT pins also allow testing.
Microprocessors, Arduinos, Raspberry Pis, and other digital logic circuits can interact with the physical environment thanks to Analogue-to-Digital Converters (ADCs). Many digital systems gather information about their settings by analyzing the analog signals produced by transducers such as microphones, light detectors, thermometers, and accelerometers. These signals constantly vary in value since they are derived from the physical world.
Digital circuits use binary signals, which can only be in one of two states, "1" (HIGH) or "0" (LOW), as opposed to the infinitely variable voltage values provided by analog signals (LOW). Therefore, Analogue-to-Digital Converters (A/D) is an essential electronic circuit for translating between constantly varying analog impulses and discrete digital signals.
To put it simply, an analog-to-digital converter (ADC) is a device that, given a single instantaneous reading of an analog voltage, generates a unique digital output code that stands in for that reading. The precision of an A/D converter determines how many binary digits, or bits, are utilized to represent the original analog voltage value.
By rotating the potentiometer's wiper terminal between 0 and VMAX, we may see a continuous output signal with an endless set of output values related to the wiper position. In a potentiometer, the output voltage constantly varies while the wiper is moved between fixed positions. Variations in temperature, pressure, liquid levels, and brightness are all examples of analog signals.
A digital circuit uses a single rotary switch to control the potential divider network, taking the place of the potentiometer's wiper at each node. The output voltage, VOUT, rapidly transitions from one node to the next as the switch is turned, with each node's value representing a multiple of 1.0 volts.
The output is guaranteed at 2-volt, 3-volt, 5 volts, etc., but NOT a 2.5-volt, 3.1-volt, or 4.6-volt output. Using a multi-position switch and more resistive components in the voltage-divider network, resulting in more discrete switching steps, would allow for generating finer output voltage levels.
By this definition, we can see that a digital signal has discrete (step-by-step) values, while an analog signal's values change continuously over time. We are going from "LOW" to "HIGH" or "HIGH" to "LOW."
So the question becomes how to transform an infinitely variable signal into one with discrete values or steps that a digital circuit can work with.
Although several commercially available analog-to-digital converter (ADC) chips exist, such as the ADC08xx family, for converting analog voltage signals to their digital equivalents, a primary ADC can be constructed out of discrete components.
Using comparators to detect various voltage levels and output their switching signal state to an encoder is a straightforward method known as parallel encoding, flash encoding, simultaneous encoding, or multiple comparator converters.
The equivalence output script for a given n-bit resolution is formed by a chain network of accuracy resistors and a series of comparators that are connected but equally spaced.
As soon as an analog signal is provided to the comparator input, it is evaluated with a reference voltage, making parallel converters advantageous because of their ease of construction and lack of need for timing clocks. The following comparator circuit may be of interest.
The LM339N is an analog comparator that compares the relative magnitudes of two voltage levels via its two analog inputs (one positive and one negative).
The comparator receives two signals, one representing the input voltage (VIN) and the other representing the reference value (VREF). The comparator's digital circuits state, "1" or "0," is determined by comparing two output voltages at the input of the comparator.
One input (VREF) receives a reference voltage, and the other input (VIN) receives the input voltage to be compared to it. Output is "OFF" by an LM339 comparator when the input power is lower than (VIN VREF) and "ON" when the input power is higher than the standard voltage (VIN > VREF). A comparator is a device to determine which of two voltages is greater.
Using the potential divider network established by R1 and R2, we can calculate VREF. If the two resistors are identical in value (R1 = R2), then the reference voltage will be half the input power (V/2). Therefore, like with a 1-bit ADC, the output of an open-collector comparator is HIGH if VIN is lower than V/2 and LOW otherwise.
However, by increasing the number of resistors in the voltage divider circuit, we can "divide" the voltage source by an amount equal to the ratio of the resistors' resistances. However, the number of comparators needed increases with the number of resistors in the voltage-divider network.
For an "n"-bit binary output, where "n" is commonly between 8 and 16 bits, a 2n- 1 comparator would be needed in general. As we saw previously, the comparator utilized by the one-bit ADC to determine whether or not VIN was more significant than the V/2 voltage output was 21 minus 1, which equals 1.
If we want to build a 2-bit ADC, we'll need 22-1 or "3" comparators since the 4-to-2-bit encoder circuitry depicted above requires four distinct voltage levels to represent the four digital values.
Where X is a "don't care" statement, representing a logical 0 or 1.
Explain how this analog-to-digital device operates. An analog-to-digital converter (A/D) must generate a faithful digital copy of the Analog input signal to be of any value. To keep things straightforward, we've assumed that VIN is somewhere between 0 and 4 volts and have adjusted VREF and the voltage divider network so that there is a 1 V drop between each resistor in this simple 2-bit Analog - to - digital example.
A binary zero (00) is output by the encoder on pins Q0 and Q1 when the input voltage, VIN, is less than the reference voltage level, which occurs when VIN is between 0 and 1 volts (1V). Since comparator U1's reference voltage input is set to 1 volt, when VIN rises above 1 volt but is below 2 volts, U1's HIGH output is triggered. When the input changes at D1, the priority encoder, used for the 4-to-2-bit encoding, generates a binary result of "1." (01).
Remember that the inputs of a Priority Encoder, like the TTL 74LS148, are all assigned different priority levels. The highest priority input is always used as the output of the priority encoder. So, when a higher priority input is available, lesser priority inputs are disregarded. Therefore, if there are many inputs simultaneously at logic state "1", only the input with high priority will have its output code reflected on D0 and D1.
Thus, now that VIN is greater than 2 volts—the next reference voltage level—comparator U2 will sense the difference and output HIGH. However, when VIN is more than 3 volts, the priority encoder will output a binary "3" (11), as input D2 has a high priority than inputs D0 and D1. Each comparator outputs a HIGH or LOW state to the encoder, generating 2-bit binary data between 00 and 11 as VIN decreases or changes between every reference voltage level.
This is great and all, but commercially available priority encoders, like the TTL, are 8-bit circuits, and if we use one of these, six of the binary numbers will go unused. A digital Ex-OR gate and a grid of signaling diodes can create a straightforward encoder circuit.
Before feeding the diodes, the results of the comparators go through an Exclusive-OR gate to be encoded. Whenever the diode is reverse biased, an external pull-down resistor is connected between the diodes' outputs and ground (0V) to maintain a LOW state and prevent the outputs from floating.
Also, as with the main board, the value of VIN controls which comparator sends a HIGH (or LOW) signal to the exclusive-OR gates, which provide a HIGH output if either of the inputs is HIGH but not both (the corresponding Boolean is Q = A.B + A.B). The AND-OR-NAND gates of combinational logic could also be used to build these Ex-OR gates.
The difficulty with both of these 4-to-2 converter designs is that the input analog voltage at VIN needs to vary by one full volt for the encoder to vary its output code, limiting the precision of the simple two-bit A/D converter to 1 volt. The output resolution can be improved by employing more comparators to convert to a three-bit A/D converter.
The aforementioned parallel ADC takes a voltage reading between 0 and over 3 volts as an analog input and turns it into a binary code with only 2 bits. Since there are 23 = 8 possible digital outputs from a 3-bit digital circuits system, the input analog voltage can be compared to a scale of eight voltages, each of which is one-eighth (1/8) of the voltage supply. This means that we can now measure to an accuracy of 0.5 (4/8) volts and that 23-1 comparators are needed to generate a binary code with a 3-bit resolution (from 000 (0) to 111 (7)).
This will provide us with a three-bit code for each of the eight potential values of the analog input of:
An "X" may be a logic 0 or a logic 1 to indicate a "don't care" state.
Then we can see that more comparators and power levels are required and more output binary bits when the ADC's resolution is increased.
Therefore, an analog-to-digital converter with a 4-bit resolution needs only 15 (24-1) comparators. An eight-bit resolution requires 255 (28-1) comparators. A 10-bit resolution needs 1023 comparators, etc. Therefore, the complexity of this type of Analog-to-Digital Converter circuit increases as the number of output bits increases.
Only if a few binary bits are needed to make a read on a display unit to represent the reference voltage of an input analog signal can a parallel or flashed A/D converter quickly be developed as part of a project due to its fast real-time conversion rate.
As an input interface circuit component, an analog signal from sensors or transducers is converted into a digital binary code by an analog-to-digital converter. Similarly, a digital binary code can be converted into a comparable analog quantity using a Digital-to-Analog Conversion for output interfacing to operate a motor or actuator or, more often, in audio applications.
Knowing the Raspberry Pi's I2C port pins and setting up the I2C connection in the pi 4 are the initial steps in using a PCF8591 with the Pi.
GPIO2 and GPIO3 on the Rpi Model are utilized for I2C communication in this guide.
Raspberry Pi I2C Configuration
Raspberry Pi lacks I2C support by default. Therefore, it must be activated before anything else. Turn on Raspberry Pi's I2C port.
First, open a terminal and enter sudo raspi-config.
The RPi 4 Software Configuration Tool has opened.
Third, activate the I2C by selecting Interfacing options.
Restart the Pi after enabling I2C.
The Raspberry Pi has to know the I2C address of the PCF8591 IC before communication can begin. You may get the address by linking the PCF8591's SDA and SCL pins to the Raspberry Pi's own SDA and SCL jacks. The 5-volts and GND pins should be connected as well.
You may find the address of an attached I2C device by opening a terminal and entering the following command.
sudo i2cdetect –y 1 or sudo i2cdetect –y 0
After locating the I2C address, the next step is constructing the circuit and setting up the required libraries to use PCF8591 and a Raspberry Pi 4.
The circuit diagram to interface the PCF8591 with the Raspberry Pi is straightforward. In this example of interfacing, we'll read the analog signal from any analog inputs and display them in the Raspberry Pi terminal. We have a 100K pot to adjust the settings.
Pi's GPIO2 and GPIO must be connected to the power supply and ground. Then, hook up GPIO3 and GPIO5 to SDA and SCL, respectively. Last but not least, link AIN0 to a 100K pot. Instead of using the Terminal to view the ADC values, a 16x2 LCD can be added.
The complete code and demo video are included after this guide.
To communicate with the I2C bus, you must first import the SMBus library and then use the time library to specify how long to wait before outputting the value.
import smbus
import time
Create some variables now. The I2C bus address is stored in the first variable, and the first analog input pin's address is stored in the second variable.
address = 0x48
A0 = 0x40
Next, we've invoked the library smbus's SMBus(1) function to create an object.
bus = smbus.SMBus(1)
The first line in the while instructs IC to take a reading from the first analog signal pin. Address information read from an Analog pin is saved as a numeric variable in the second line. Exit with the value printed.
While True:
bus.write_byte(address,A0)
value = bus.read_byte(address)
print(value)
time.sleep(0.1)
Finally, put the Python script in a file ending in.py and run it in the Raspberry Pi terminal with the command below.
python filename.py
Ensure that the I2C communication is turned on and that the pins are linked according to the diagram before running the code, or else you will get errors. It's time for the analog readings to appear in the terminal format below. The values gradually shift as you turn the pot's knob. Find out more about getting the software to work in
Here is the full Python script.
import smbus
import time
address = 0x48
bus = smbus.SMBus(1)
while True:
bus.write_byte(address,A0)
value = bus.read_byte(address)
print(value)
time.sleep(0.1)
We rely heavily on electronic gadgets in today's high-tech society. The digital signal is the driving force behind these digital devices. While most numbers are represented digitally, few still use analog notation. Thus, an ADC is employed to transform analog impulses into digital ones. ADC can be used in an infinite variety of contexts. Here are only a few examples of their use:
The digitized voice signal is used by cell phones. The voice is first transformed to digital form using an ADC before being sent to the cell phone's transmitter.
Digital photos and movies shot with a camera can be viewed on any computer or mobile device thanks to an analog-to-digital converter.
X-rays and MRIs are just two examples of medical imaging techniques that use ADC to go from Analog to digital before further processing. Then, they're adjusted so that everyone can follow along.
ADC converters can also transfer music from a cassette tape to a digital format, such as a CD or a USB flash drive.
The Analog-to-Digital Converter (ADC) in a digital oscilloscope converts analog signals to digital ones that can then be displayed and used for other reasons.
The air conditioner's built-in temperature sensors allow for consistent comfort levels. The onboard controller reads the temperature and makes adjustments based on the data it receives from the ADC.
Nowadays, practically everything has a digital counterpart, so every gadget must also include an ADC. For the simple reason that its operations require a digital domain accessible only via an analog-to-digital converter (ADC).
This piece taught us how to connect a Raspberry Pi 4 to a PCF8591 Analogue - to - digital decoder module. We have observed the output being shown as integers on our Terminal. We have also researched how the ADC generates its output signals. Here we will use OpenCV and a Raspberry Pi 4 to create a social distance detector.
Greetings, and welcome to another tutorial in our series on the raspberry pi 4 Python programming. The previous guide covered the basics of transmitting data over the radio using the nrf24l01 chip in Pi 4. We also learned about interfacing Arduino and raspberry pi 4 and sending radio signals between the two devices. However, this tutorial will walk you through building a Raspberry Pi-based mobile phone with a microphone and speaker for making and receiving calls and reading text messages (SMS). This Project also serves as a proper GSM Module for the Raspberry Pi interface, with all the necessary Code to run the most fundamental features of any modern smartphone. First, we will understand what gsm is, its architecture and how it works, then we will learn how to program it in our pi 4; therefore, let us begin.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | Jumper Wires | Amazon | Buy Now | |
2 | LCD 16x2 | Amazon | Buy Now | |
3 | Raspberry Pi 4 | Amazon | Buy Now |
Raspberry Pi 4
GSM Module
16x2 LCD
4 *4 Keypad
10k pot
Breadboard
Connecting jumper wire
Power supply
Speaker
Microphone
SIM Card
Loudspeaker
The acronym "GSM" refers to the "global system for mobile communication" and is the name of a type of mobile communication modem (GSM). Bell Labs was responsible for conceptualizing GSM in the 1970s. It's one of the most common forms of mobile communication around the globe. The 850MegaHertz, 900MegaHertz, 1800 Megahertz, and 1900 Megahertz frequency bands are utilized by GSM networks, which are part of an open and digital mobile network used to carry voice and data services.
Using the telecommunications method of multiple time division access (TDMA), GSM technology was created as a digital system. For transmission, a GSM converts analog signals to digital ones, compresses them further and delivers them through a channel sharing bandwidth with two data streams from separate clients. The data rates transported by the digital system range from 64 kilobytes per second to 120 Megabytes per second.
In a GSM network, macro, micro, and umbrella cells coexist. The implementation context determines the specifics of each cell. The macro, micro, and umbrella cell sizes are in use in a GSM network. Each cell may have a different range of coverage depending on the setting.
Time-division multiple access (TDMA) works by giving each user a specific amount of time to transmit on the same frequency. It's flexible, supporting data rates from 64kbps to 120Mbps and allowing for clear voice communications.
The following are the primary components of the GSM architecture.
Connectivity and Switching Infrastructure (NSS)
All three of these components—the Base Station (BS), the Mobile Station (MS), and the Operations and Maintenance Subsystem (OSS)—are necessary for proper communication (OSS)
Each component of the GSM system design contributes to what is collectively called the core system/network. In this case, the mobile network system is primarily controlled and interfaced with via a data network consisting of several different components. Listed below are some of the most crucial elements of the underlying network.
One of the essential parts of a GSM network is its core network, where the Mobile Switching Center (MSC) resides. This MSC performs the same functions as a common switching node in an ISDN or PSTN. Still, it provides additional features to accommodate mobile users' requirements, such as authentication, registration, inter-MSC handovers, call localization, and routing.
In addition, it gives users an advantage in connecting their mobile phone networks to the PSTN (public switched telephone network) for making and receiving landline calls. To facilitate mobile-to-mobile calls across different networks, interfaces to all other switched telephone networks ( PSTN center servers are given.
Every subscriber's administrative details, including their last known location, are stored in this HLR database. This manner, calls can be routed over the GSM network to the appropriate mobile switch base station. If a call comes in when an operator has their phone turned on, the network can determine which base transmitter station the call is coming from and link it to the correct phone.
When the phone is turned on but not being used, it nevertheless registers to ensure the HLR system is aware of its current location. Each network has a single HLR, which may be physically split across several data centers for practical reasons.
To facilitate the VLR's desired services for the individual subscriber, it incorporates data from the HLR network. It is possible to run the visitor coordinates register independently, but it is most commonly implemented as a core component of the MSC. Because of this, getting access is more manageable, and it takes less time overall.
The Equipment Identity Register (EIR) is the part of the network infrastructure in charge of deciding whether or not certain pieces of mobile equipment are allowed access. The International Mobile Equipment Identification (IMEI) numbers uniquely identify each mobile technology work.
This IMEI number is permanently embedded within the mobile device and checked by the network after registration. Depending on the data in the EIR, the mobile phone may be given one of three possible network access states: allowed, banned, or monitored.
When users insert their SIM card into their phone, the secret key is stored in a secure file known as the AUC (authentication center). The AUC sees the extensive application as a radio channel coding and verification standard.
In the absence of location information for the mobile station (MS), a call placed by a ME terminates with the GMSC (Gateway Mobile Switching Centre). Using the Mobile Subscriber Identifier Service Data Number (MSISDN) and the HLR, the GMSC can locate the specific MSC that has been visited and connect the call to the appropriate location. It's unclear what the "MSC" part of GMSC stands for, as the gateway procedure does not require relating to an MSC.
Both SMS-Gateways are referred to collectively as the SMS gateway in the GSM specifications. The messages passing via these gateways are directed in various ways.
Sending a short message to mobile equipment (ME) requires the usage of the Short Messaging Service Gateway Switching Center. Short messages sent over a mobile network are routed through the SMS Inter-Working Switching Center. While the SMS-primary GMSC's function concerns the GMSC, the SMS-IWMSC serves as a constant endpoint for access to the Short Message Service Centre.
These were the primary nodes in the GSM system's infrastructure. While they frequently shared physical space, the entire middle network would sometimes be broadcast throughout the country. In the event of a failure, it will provide a degree of leeway.
The connection point between the mobile node and the broader network infrastructure. The radio transceivers and protocol management for mobile devices are housed in the Base Transceiver Station. In addition, a Base Station Controller manages the Base Transceiver and serves as a bridge between mobile devices and the mobile switching hub.
The network subsystem handles connectivity between the network and the mobile stations. The Phone Service Switch Centre is the backbone of the Network Subsystem, allowing users to connect to other networks (ISDN, PSTN, etc.). The GSM system's ability to route calls and allow for roaming depends on two additional components, the Home Location Record and the guest Location Record.
In addition, it stores the Equipment Identity Register, which keeps track of all the mobile devices and their associated IMEI numbers. The acronym IMEI refers to the unique identifier for mobile devices worldwide.
In the second generation of GSM network design, the mobile devices communicate with the BSS, or Base Station Subsystem. These components comprise this subsystem, and each will be examined.
As part of a GSM network, the radio Tx, Rx, and their associated antennas make up the base Transceiver Station, which is used for transmitting, receiving, and communicating directly through mobiles. The base station is the central component of each cell, and it communicates with mobile devices using an interface known as the Um interface and related protocols.
The base station controller (BSC) is employed for the following step back into GSM technology. This controller is typically co-located within one of the base transceiver stations it controls. This controller handles radio resource management, including channel allocation and handover between base station groups. Over the Abis interface, it communicates with the BTSs.
The acceptable radio technology is used by the GSM network's subsystems component in the ground station to ensure that multiple operators can utilize the system at the same time. Each base station can support many operators because each channel can support up to eight users.
The network provider strategically places these to ensure comprehensive coverage. A base station, sometimes known as a "cell," can surround this space. Signals can't be prevented from bleeding into neighbouring cells, and the channels used in one don't transfer to the next.
Mobile phones include a transceiver, a display, and a CPU, all of which are network-connected and operated using a SIM card. In a GSM mobile transmission medium, the operator monitors and controls the mobile station or mobile equipment, which are most commonly represented by cell phones. Their size has shrunk significantly while their functionality has skyrocketed. The benefit of a much longer interval between charges is still another advantage. Phone hardware and the subscriber identity module (SIM) are two of many components.
A mobile device's hardware consists of its primary components, such as the housing, screen, battery, and electronics used to generate the signal and process the signal receiver before transmission. The IMEI is a unique number assigned to each mobile device. This feature can be permanently programmed into a phone throughout its manufacturing process. During the registration process, the network accesses this database to see if the device has been flagged as stolen.
A user's identity on the network is stored in the information contained in their SIMcard. It also includes other data, such as the IMSI number. With this IMSI stored in the Sim, the phone user could easily switch phones by swapping SIM cards. As a result, if switching to a new mobile phone were simple and didn't require a unique phone number, more people would do it, generating more revenue for network operators and contributing to GSM's overall economic triumph.
The OSS is an integral aspect of any functional GSM network. The NSS and BSC parts are linked here. The GSM network and BSS traffic load are the primary areas of focus for this OSS. It is worth noting that some preservation responsibilities are relocated to the base station controller to lower the maintenance expense of the system when the amount of BS increases through the consumer population growth.
The 2G GSM network architecture is predicated on a rational functioning method. This approach is remarkably straightforward compared to today's mobile network architectures, which rely on software-defined units to facilitate highly adaptable operations. However, the 2G GSM architecture will show how the necessary voice and essential operational functions are organized.
The following are some of the functions provided by the GSM module.
Enhanced spectrum efficiency
Features including "international roaming," "integrated services digital network" (ISDN) compatibility, and "support for future services" are also included.
High-quality voice communications; encrypted phone conversations;
Features like a programmable alarm clock, high-quality voice communication, a fixed calling number, a real-time clock, and the ability to send and receive SMS messages are all standard on modern smartphones (SMS)
As a result of its rigorous security measures, the GSM system is currently the safest available for use in the telecommunications industry. Call privacy and subscriber anonymity for GSM users are only protected during transmission, but this is still a massive step toward attaining end-to-end security.
In either its mobile phone or modem form, a Global System for Mobile Communications (GSM) modem enables two computers or processors to connect across a network. A SIM card is needed to run a GSM modem, and it can only be used within the coverage area the network provider has paid for. It has serial, USB, and Bluetooth connectivity options for linking to a personal computer.
Any regular GSM cell phone can double as a GSM modem if you have a suitable cable and driver installed on your PC. It would be best if you used a GSM modem instead of a GSM cell phone. The GSM modem is helpful in many devices, including POS terminals, inventory management systems, surveillance cameras, weather stations, and GPRS-mode remote data loggers.
Below is a circuit showing how to connect a GSM modem to the MC using the level-shifting IC Max232. When a numeric command is received by short message service (SMS) from any mobile device, the SIM card-mounted GSM modem transfers that information to the MC via serial connection. The GSM modem is programmed to respond to the order "STOP" by producing an MC output, the point which is utilized to deactivate the ignition switch.
If the input is driven low, the GSM modem will send a predetermined message (in this case, "ALERT") to the user. A 162 LCD screen displays the entirety of the procedure.
We have utilized a GSM module and a Raspberry Pi 4 to manage the entire system and interface its many parts in this Project. You can input data of any kind, including phone numbers, text messages, and phone calls, read and respond to text messages, and more, using a 4x4 alphanumeric keypad. The SIM900A GSM module connects mobile phones to wireless networks for making and receiving calls and sending and receiving text messages. We've integrated a microphone, a loudspeaker for making and receiving voice calls, and a 16 * 2 liquid crystal displays information like menu options and alarms.
With alphanumeric input, you can use the same keyboard to type in both numbers and letters. For the Code we used to allow alphabets in addition to numbers in this method, scroll down to the "Code in Code" section.
It's simple to put this plan into action. The alphanumeric keypad is used for all functions. Below you'll find a link to the complete Code and a demonstration video. This section will elaborate on the four aspects of the listed projects.
The Pi 4 phone we built requires us to press the letter "C" and provide the cellphone number we wish to call. We'll use an alphanumeric keyboard to enter the number. Once the correct number has been entered, we must hit "C" again. The AT command is now processed by pi 4 to connect the call to a specified number.
ATDxxxxxxxxxx; <Enter> where xxxxxxxxx is entered Mobile Number.
Answering a phone call is simple. When a call comes into the SIM number stored in the GSM Module of your system, the LCD will display the message "Incoming..." along with the caller's number. All that's left to do is hit the 'A' key to answer the call. Pi 4 will send the following command to the GSM Module when the "A" button is pressed:
ATA <enter>
Pressing "D" on our Raspberry Pi phone allows us to send a text message. To whom (or what) should we address the SMS message that the system has just requested? Once the number has been entered, pressing "D" again will prompt the LCD to request a message. To send an SMS, enter the message using the keypad as you would with any other mobile device, and then hit the 'D' key again. Raspberry Pi can send SMS with the following command:
AT+CMGF=1 <enter>
AT+CMGS=”xxxxxxxxxx” <enter> where: xxxxxxxxxx is entered mobile number
Even this component is easy to use. Here, the SIM card is used to receive SMS messages from the GSM. The Raspberry Pi also keeps a close eye on the UART SMS signal. New notes are shown by the LCD displaying the text "New message," and reading them is as simple as pressing the "B" key. This is an SMS Received signal:
+CMTI: "SM," 6 Where 6 is the message location where it is stored in the SIM card.
When the RPi detects the 'SMS received' signal, it will get the SMS storage location and instruct the Global system for mobile to read the message. Moreover, the LCD will flash the words "New Message" in a prominent location.
AT+CMGR=<SMS stored location><enter>
The GSM now delivers the saved message to the Raspberry Pi, and the Pi, having extracted the primary SMS, shows it on the LCD. When it comes to MIC and Speaker, there is no secret code.
The GPIO pins of the Raspberry Pi are wired to the RS, EN, D4, D5, D6, and D7 pins of the 16 * 2 liquid crystal display. A direct connection is made between the GSM module's Rx and Tx pins and the Raspberry Pi's Tx and Rx pins. Connectors R1, R2, R3, and R4 of a 4 * 4 keypad are connected to GPIOs 12, 16, 20, and 21, whereas pins C1, C2, C3, and C4 are connected to GPIOs 26, 19, 13, and 6. If you want to boost the audio volume from the GSM Module, you can join the microphone directly to the mic+ and mic- pins and the loudspeaker to the sp+ and sp- pins. The loudspeaker can be connected directly to the GSM module without using the Audio Amplifier circuit.
This Pi 4 mobile phone's programming interface may be challenging to novices—the programming language of choice for this Project is Python.
Here, we define the keypad() function to be used with a basic numeric keypad. We've also added a def alpha keypad(): for typing alphabets so that you may use the same keypad for both purposes. To make it compatible with the Arduino keypad library, we've given this keypad a wide range of new capabilities. This keypad only takes 10 presses to enter a whole string of text or a numeric value.
For example, if we push key 2 (abc2) once, the LCD will display the letter 'a.' If we press it again, the letter 'b' will take its place, and if we hit it three more times, the letter 'c' will appear in the same spot. After holding down a key for a short time, the LCD pointer will advance to the following available location. We can now proceed to the next character or number. Any other keys can be processed in the same way.
def keypad():
for j in range(4):
gpio.setup(COL[j], gpio.OUT)
gpio.output(COL[j], 0)
ch=0
for i in range(4):
if gpio.input(ROW[i])==0:
ch=MATRIX[i][j]
return ch
while (gpio.input(ROW[i]) == 0):
pass
gpio.output(COL[j],1)
def alphaKeypad():
lcdclear()
setCursor(x,y)
lcdcmd(0x0f)
msg=""
while 1:
key=0
count=0
key=keypad()
if key == '1':
ind=0
maxInd=6
Key='1'
getChar(Key, ind, maxInd)
.... .....
..... .....
To begin, we have declared the pins for the liquid crystal display, the keypad, and other components, as well as included the necessary libraries in this python script:
import RPi.GPIO as gpio
import serial
import time
msg=""
alpha="1!@.,:?ABC2DEF3GHI4JKL5MNO6PQRS7TUV8WXYZ90 *#"
x=0
y=0
MATRIX = [
['1','2','3','A'],
['4','5','6','B'],
['7','8','9','C'],
['*','0','#','D']
]
ROW = [21,20,16,12]
COL = [26,19,13,6]
... .....
..... .....
The pins need to be pointed in the proper direction.
gpio.setwarnings(False)
gpio.setmode(gpio.BCM)
gpio.setup(RS, gpio.OUT)
gpio.setup(EN, gpio.OUT)
gpio.setup(D4, gpio.OUT)
gpio.setup(D5, gpio.OUT)
gpio.setup(D6, gpio.OUT)
gpio.setup(D7, gpio.OUT)
gpio.setup(led, gpio.OUT)
gpio.setup(buz, gpio.OUT)
gpio.setup(m11, gpio.OUT)
gpio.setup(m12, gpio.OUT)
gpio.setup(button, gpio.IN)
gpio.output(led , 0)
gpio.output(buz , 0)
gpio.output(m11 , 0)
gpio.output(m12 , 0)
To begin Serial communication, follow the steps below.
Serial = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=2)
We must now create a liquid crystal display driving function. The def lcdcmd(ch): and def lcdwrite(ch): functions are used to deliver commands and data to the LCD, respectively. The liquid crystal display may also be cleared with def lcdclear(), the cursor position can be set with def setCursor(x,y), and a string can be sent to the liquid crystal display with def lcdprint(Str).
def lcdcmd(ch):
gpio.output(RS, 0)
gpio.output(D4, 0)
gpio.output(D5, 0)
gpio.output(D6, 0)
gpio.output(D7, 0)
if ch&0x10==0x10:
gpio.output(D4, 1)
.... .....
..... ....
def lcdwrite(ch):
gpio.output(RS, 1)
gpio.output(D4, 0)
gpio.output(D5, 0)
gpio.output(D6, 0)
gpio.output(D7, 0)
if ch&0x10==0x10:
gpio.output(D4, 1)
if ch&0x20==0x20:
gpio.output(D5, 1)
.... .....
..... ....
def lcdclear():
lcdcmd(0x01)
def lcdprint(Str):
l=0;
l=len(Str)
for i in range(l):
lcdwrite(ord(Str[i]))
def setCursor(x,y):
if y == 0:
n=128+x
elif y == 1:
n=192+x
lcdcmd(n)
Next, we'll need to code some features for interacting with text messages, phone calls, and incoming calls.
The call is placed using the function def call():. Also, the LCD can display the receiving message and number via the function def receiveCall(data):. Finally, the call is answered with def attendCall():.
The message is composed and sent using the alphaKeypad() method, accessed via the def sendSMS(): function. The SMS is received, and its location is retrieved using the def receive SMS(data) function. And finally, the LCD gets updated with the message thanks to def readSMS(index:).
All of the operations mentioned above are included in the Code that follows.
import RPi.GPIO as gpio
import serial
import time
msg=""
# 0 7 11 15 19 23 27 32 36 414244 ROLL45
alpha="1!@.,:?ABC2DEF3GHI4JKL5MNO6PQRS7TUV8WXYZ90 *#"
x=0
y=0
MATRIX = [
['1','2','3','A'],
['4','5','6','B'],
['7','8','9','C'],
['*','0','#','D']
]
ROW = [21,20,16,12]
COL = [26,19,13,6]
moNum=['0','0','0','0','0','0','0','0','0','0']
m11=17
m12=27
led=5
buz=26
button=19
RS =18
EN =23
D4 =24
D5 =25
D6 =8
D7 =7
HIGH=1
LOW=0
gpio.setwarnings(False)
gpio.setmode(gpio.BCM)
gpio.setup(RS, gpio.OUT)
gpio.setup(EN, gpio.OUT)
gpio.setup(D4, gpio.OUT)
gpio.setup(D5, gpio.OUT)
gpio.setup(D6, gpio.OUT)
gpio.setup(D7, gpio.OUT)
gpio.setup(led, gpio.OUT)
gpio.setup(buz, gpio.OUT)
gpio.setup(m11, gpio.OUT)
gpio.setup(m12, gpio.OUT)
gpio.setup(button, gpio.IN)
gpio.output(led , 0)
gpio.output(buz , 0)
gpio.output(m11 , 0)
gpio.output(m12 , 0)
for j in range(4):
gpio.setup(COL[j], gpio.OUT)
gpio.setup(COL[j],1)
for i in range (4):
gpio.setup(ROW[i],gpio.IN,pull_up_down=gpio.PUD_UP)
Serial = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=2)
data=""
def begin():
lcdcmd(0x33)
lcdcmd(0x32)
lcdcmd(0x06)
lcdcmd(0x0C)
lcdcmd(0x28)
lcdcmd(0x01)
time.sleep(0.0005)
def lcdcmd(ch):
gpio.output(RS, 0)
gpio.output(D4, 0)
gpio.output(D5, 0)
gpio.output(D6, 0)
gpio.output(D7, 0)
if ch&0x10==0x10:
gpio.output(D4, 1)
if ch&0x20==0x20:
gpio.output(D5, 1)
if ch&0x40==0x40:
gpio.output(D6, 1)
if ch&0x80==0x80:
gpio.output(D7, 1)
gpio.output(EN, 1)
time.sleep(0.005)
gpio.output(EN, 0)
# Low bits
gpio.output(D4, 0)
gpio.output(D5, 0)
gpio.output(D6, 0)
gpio.output(D7, 0)
if ch&0x01==0x01:
gpio.output(D4, 1)
if ch&0x02==0x02:
gpio.output(D5, 1)
if ch&0x04==0x04:
gpio.output(D6, 1)
if ch&0x08==0x08:
gpio.output(D7, 1)
gpio.output(EN, 1)
time.sleep(0.005)
gpio.output(EN, 0)
def lcdwrite(ch):
gpio.output(RS, 1)
gpio.output(D4, 0)
gpio.output(D5, 0)
gpio.output(D6, 0)
gpio.output(D7, 0)
if ch&0x10==0x10:
gpio.output(D4, 1)
if ch&0x20==0x20:
gpio.output(D5, 1)
if ch&0x40==0x40:
gpio.output(D6, 1)
if ch&0x80==0x80:
gpio.output(D7, 1)
gpio.output(EN, 1)
time.sleep(0.005)
gpio.output(EN, 0)
# Low bits
gpio.output(D4, 0)
gpio.output(D5, 0)
gpio.output(D6, 0)
gpio.output(D7, 0)
if ch&0x01==0x01:
gpio.output(D4, 1)
if ch&0x02==0x02:
gpio.output(D5, 1)
if ch&0x04==0x04:
gpio.output(D6, 1)
if ch&0x08==0x08:
gpio.output(D7, 1)
gpio.output(EN, 1)
time.sleep(0.005)
gpio.output(EN, 0)
def lcdclear():
lcdcmd(0x01)
def lcdprint(Str):
l=0;
l=len(Str)
for i in range(l):
lcdwrite(ord(Str[i]))
def setCursor(x,y):
if y == 0:
n=128+x
elif y == 1:
n=192+x
lcdcmd(n)
def keypad():
for j in range(4):
gpio.setup(COL[j], gpio.OUT)
gpio.output(COL[j], 0)
ch=0
for i in range(4):
if gpio.input(ROW[i])==0:
ch=MATRIX[i][j]
#lcdwrite(ord(ch))
# print "Key Pressed:",ch
# time.sleep(2)
return ch
while (gpio.input(ROW[i]) == 0):
pass
gpio.output(COL[j],1)
# callNum[n]=ch
def serialEvent():
data = Serial.read(20)
#if data != '\0':
print data
data=""
def gsmInit():
lcdclear()
lcdprint("Finding Module");
time.sleep(1)
while 1:
data=""
Serial.write("AT\r");
data=Serial.read(10)
print data
r=data.find("OK")
if r>=0:
break
time.sleep(0.5)
while 1:
data=""
Serial.write("AT+CLIP=1\r");
data=Serial.read(10)
print data
r=data.find("OK")
if r>=0:
break
time.sleep(0.5)
lcdclear()
lcdprint("Finding Network")
time.sleep(1)
while 1:
data=""
Serial.flush()
Serial.write("AT+CPIN?\r");
data=Serial.read(30)
print data
r=data.find("READY")
if r>=0:
break
time.sleep(0.5)
lcdclear()
lcdprint("Finding Operator")
time.sleep(1)
while 1:
data=""
Serial.flush()
Serial.read(20)
Serial.write("AT+COPS?\r");
data=Serial.read(40)
#print data
r=data.find("+COPS:")
if r>=0:
l1=data.find(",\"")+2
l2=data.find("\"\r")
operator=data[l1:l2]
lcdclear()
lcdprint(operator)
time.sleep(3)
print operator
break;
time.sleep(0.5)
Serial.write("AT+CMGF=1\r");
time.sleep(0.5)
# Serial.write("AT+CNMI=2,2,0,0,0\r");
# time.sleep(0.5)
Serial.write("AT+CSMP=17,167,0,0\r");
time.sleep(0.5)
def receiveCall(data):
inNumber=""
r=data.find("+CLIP:")
if r>0:
inNumber=""
inNumber=data[r+8:r+21]
lcdclear()
lcdprint("incoming")
setCursor(0,1)
lcdprint(inNumber)
time.sleep(1)
return 1
def receive SMS(data):
print data
r=data.find("\",")
print r
if r>0:
if data[r+4] == "\r":
smsNum=data[r+2:r+4]
elif data[r+3] == "\r":
smsNum=data[r+2]
elif data[r+5] == "\r":
smsNum=data[r+2:r+5]
else:
print "else"
print smsNum
if r>0:
lcdclear()
lcdprint("SMS Received")
setCursor(0,1)
lcdprint("Press Button B")
print "AT+CMGR="+smsNum+"\r"
time.sleep(2)
return str(smsNum)
else:
return 0
def attendCall():
print "Attend call"
Serial.write("ATA\r")
data=""
data=Serial.read(10)
l=data.find("OK")
if l>=0:
lcdclear()
lcdprint("Call attended")
time.sleep(2)
flag=-1;
while flag<0:
data=Serial.read(12);
print data
flag=data.find("NO CARRIER")
#flag=data.find("BUSY")
print flag
lcdclear()
lcdprint("Call Ended")
time.sleep(1)
lcdclear()
def readSMS(index):
print index
Serial.write("AT+CMGR="+index+"\r")
data=""
data=Serial.read(200)
print data
r=data.find("OK")
if r>=0:
r1=data.find("\"\r\n")
msg=""
msg=data[r1+3:r-4]
lcdclear()
lcdprint(msg)
print msg
time.sleep(5)
lcdclear();
smsFlag=0
print "Receive SMS"
def getChar(Key, ind, maxInd):
ch=0
ch=ind
lcdcmd(0x0e)
Char=''
count=0
global msg
global x
global y
while count<20:
key=keypad()
print key
if key== Key:
setCursor(x,y)
Char=alpha[ch]
lcdwrite(ord(Char))
ch=ch+1
if ch>maxInd:
ch=ind
count=0
count=count+1
time.sleep(0.1)
msg+=Char
x=x+1
if x>15:
x=0
y=1
lcdcmd(0x0f)
def alphaKeypad():
lcdclear()
setCursor(x,y)
lcdcmd(0x0f)
msg=""
while 1:
key=0
count=0
key=keypad()
if key == '1':
ind=0
maxInd=6
Key='1'
getChar(Key, ind, maxInd)
elif key == '2':
ind=7
maxInd=10
Key='2'
getChar(Key, ind, maxInd)
elif key == '3':
ind=11
maxInd=14
Key='3'
getChar(Key, ind, maxInd)
elif key == '4':
ind=15
maxInd=18
Key='4'
getChar(Key, ind, maxInd)
elif key == '5':
ind=19
maxInd=22
Key='5'
getChar(Key, ind, maxInd)
elif key == '6':
ind=23
maxInd=26
Key='6'
getChar(Key, ind, maxInd)
elif key == '7':
ind=27
maxInd=31
Key='7'
getChar(Key, ind, maxInd)
elif key == '8':
ind=32
maxInd=35
Key='8'
getChar(Key, ind, maxInd)
elif key == '9':
ind=36
maxInd=40
Key='9'
getChar(Key, ind, maxInd)
elif key == '0':
ind=41
maxInd=42
Key='0'
getChar(Key, ind, maxInd)
elif key == '*':
ind=43
maxInd=43
Key='*'
getChar(Key, ind, maxInd)
elif key == '#':
ind=44
maxInd=44
Key='#'
getChar(Key, ind, maxInd)
elif key== 'D':
return
def sendSMS():
print"Sending sms"
lcdclear()
lcdprint("Enter Number:")
setCursor(0,1)
time.sleep(2)
moNum=""
while 1:
key=0;
key=keypad()
#print key
if key>0:
if key == 'A' or key== 'B' or key== 'C':
print key
return
elif key == 'D':
print key
print moNum
Serial.write("AT+CMGF=1\r")
time.sleep(1)
Serial.write("AT+CMGS=\"+91"+moNum+"\"\r")
time.sleep(2)
data=""
data=Serial.read(60)
print data
alphaKeypad()
print msg
lcdclear()
lcdprint("Sending.....")
Serial.write(msg)
time.sleep(1)
Serial.write("\x1A")
while 1:
data=""
data=Serial.read(40)
print data
l=data.find("+CMGS:")
if l>=0:
lcdclear()
lcdprint("SMS Sent.")
time.sleep(2)
return;
l=data.find("Error")
if l>=0:
lcdclear()
lcdprint("Error")
time.sleep(1)
return
else:
print key
moNum+=key
lcdwrite(ord(key))
time.sleep(0.5)
def call():
print "Call"
n=0
moNum=""
lcdclear()
lcdprint("Enter Number:")
setCursor(0,1)
time.sleep(2)
while 1:
key=0;
key=keypad()
#print key
if key>0:
if key == 'A' or key== 'B' or key== 'D':
print key
return
elif key == 'C':
print key
print moNum
Serial.write("ATD+91"+moNum+";\r")
data=""
time.sleep(2)
data=Serial.read(30)
l=data.find("OK")
if l>=0:
lcdclear()
lcdprint("Calling.....")
setCursor(0,1)
lcdprint("+91"+moNum)
time.sleep(30)
lcdclear()
return
#l=data.find("Error")
#if l>=0:
else:
lcdclear()
lcdprint("Error")
time.sleep(1)
return
else:
print key
moNum+=key
lcdwrite(ord(key))
n=n+1
time.sleep(0.5)
begin()
lcdcmd(0x01)
lcdprint(" Mobile Phone ")
lcdcmd(0xc0)
lcdprint(" Using RPI ")
time.sleep(3)
lcdcmd(0x01)
lcdprint("Circuit Digest")
lcdcmd(0xc0)
lcdprint("Welcomes you")
time.sleep(3)
gsmInit()
smsFlag=0
index=""
while 1:
key=0
key=keypad()
print key
if key == 'A':
attendCall()
elif key == 'B':
readSMS(index)
smsFlag=0
elif key == 'C':
call()
elif key == 'D':
sendSMS()
data=""
Serial.flush()
data=Serial.read(150)
print data
l=data.find("RING")
if l>=0:
callstr=data
receiveCall(data)
l=data.find("\"SM\"")
if l>=0:
smsstr=data
smsIndex=""
(smsIndex)=receiveSMS(smsstr)
print smsIndex
if smsIndex>0:
smsFlag=1
index=smsIndex
if smsFlag == 1:
lcdclear()
lcdprint("New Message")
time.sleep(1)
setCursor(0,0)
lcdprint("C--> Call <--A");
setCursor(0,1);
lcdprint("D--> SMS <--B")
Here are some examples of how GSM technology can be put to use.
Automation and Safety via Smart GSM Technology
Nowadays, we can't live without our GSM mobile terminal. The Mobile phone terminal is essentially an extension of ourselves, allowing us to connect with the world in the same way our wallet/purse, keys, or watch does. Many people like not having to worry about being unavailable or who they can call at any given moment.
It's clear from the name that this Project relies on the SMS transmission capabilities of GSM networks. The ability to send and receive text messages is widely utilized to provide access to equipment and facilitate home security breach management. There are two proposed subsystems in the system. Controlling appliances in one's house from afar is made possible by the appliance control subsystem, while the security alert subsystem provides automatic security monitoring.
The system can send consumers instructions via SMS from a designated phone number to adjust the home appliance's state as needed. An automatic SMS can be generated by the system upon detection of an intrusion, warning the user of a potential threat to their data.
The advent of GSM technology will make global, instantaneous, and universal communication possible. GSM's functional architecture employs intelligent networking principles as the first step toward a genuinely personal communication system with sufficient standards to ensure interoperability.
Medical Uses for GSM-Based Systems
Here are two examples of similar situations to think about.
The patient has sustained a life-threatening injury or illness and requires emergency medical attention. A mobile phone is the only thing he (or his companion) has.
After being released from the hospital, the patient plans to rest at home but is reminded that he must return for routine exams. A mobile phone and perhaps some health monitoring or other medical sensor gadgets may be in his possession.
The only way to solve either problem is via a mobile communication system. In other words, the above scenarios are easily manageable with today's communication technology because all that needs to be done is send the patient's information across a network and have it processed at the receiving end, which may be a hospital or the doctor's office.
In the first scenario, the doctor keeps tabs on the patient's information and returns the instructions to him so he can take whatever precautions before getting to the hospital. In the second scenario, the doctor keeps tabs on the patient's test results and, if necessary, proceeds with treatment.
Telemedicine services are the driving force behind this entire operation. The telemedicine system has three different applications.
Video conferencing lets patients in one location have face-to-face contact with their doctors and nurses, speeding up the healing process.
With the help of sensors that constantly report on a patient's condition and direct medical staff on how to proceed with treatment.
By sending the gathered health information for further review and analysis.
A wireless method of communication is used for the three options mentioned above. When providing healthcare, it is necessary to have many data retrieval mechanisms in place. These can be online medical databases or hosts with equipment that aid recovery and health monitoring. Broadband networks, medium-throughput media, and narrowband GSM access are all viable possibilities.
There are several benefits to using GSM technology in a telemedicine setup.
Cost savings and widespread availability of GSM receivers (including cell phones and modems)
It can transfer data quickly.
Typical Telemedical Infrastructure
The four components that make up a standard telemedicine system are as follows:
The Patient Unit: It takes data from the patient, either in its original analog form or after being converted to digital format, and then manages the data stream before sending it. It is made up of several different types of medical sensors, such as those used to track heart rate, blood pressure, body temperature, spirometry, etc., each of which generates an electrical signal that is sent to a processor or controller for analysis before being transmitted over a wireless network.
Communication Network: As such, it is employed for both data transmission and security. Networks, mobile stations, and base stations are all components of the Global System for Mobile Communication (GSM) system. The mobile station, also known as the mobile phone or primary mobile access point, is the device responsible for connecting mobile devices to the global system for mobile communications (GSM) network.
Receiving/Server Side: This is a healthcare system with a GSM modem installed to receive, decode, and forward signals to the presenting device.
Presentation Unit: This is the brains of the operation. This processor saves the data in a standard format for later retrieval and analysis by doctors and from which they can send text messages to the client side if necessary.
To demonstrate the fundamentals of telemedicine, a rudimentary model will suffice. It has a sender and a receiver, both of which are separate components. The sensor input is transmitted by the transmitter and received by the receiver unit for processing.
See below for a simplified telemedicine system to track a patient's heart rate and apply the results as needed.
The data collected by the heartbeat detector (a light-emitting device whose light is modified as it flows through human blood) is transformed into electrical pulses at the transmitter unit. When the Microcontroller picks up on these pulses, it calculates the heart rate and communicates that information and other data collected to the medical team via a Gsm network. An IC called a Max 232 connects the Microcontroller to the GSM modem.
The GSM modem at the receiving end grabs the information and passes it to the Microcontroller. The Microcontroller then performs an analysis using the input from the Personal computer and displays the outcome on the LCD. Medical professionals can keep tabs on the patient and begin the necessary treatment after reviewing the results on the screen.
The following are some real-world applications for GSM technology.
AT&T Health GlowCaps
These plain pill bottles serve as a gentle prompt to the patient to take their prescribed medications. It uses GSM technology to contact the patient on their mobile phone at the specified pill-taking time, at which point the cap will light up, the buzzer will sound, and the patient will be reminded to take their medication. Each time a bottle is uncorked, it is documented.
Ultrasound technology
With the help of a portable ultrasound transducer that connects to a smartphone, it is possible to send ultrasound images captured with a handheld device to a distant location using a global system for mobile communications (GSM).
A Continuous Glucose Monitor (CGM)
The patient's blood sugar levels can be tracked and reported to the doctor. A sensor is implanted under the skin and monitors blood glucose levels, sending the data to a receiver (a mobile phone) at regular intervals.
As part of this guide, we analyzed GSM's architecture and learned how it operates in practice. We wrote a Python program to turn our Raspberry Pi 4 into a fully functional mobile phone. No technical difficulties were encountered as we watched text and phone calls travel between the raspberry pi and our mobile phone. You should feel confident in your ability to apply the ideas and understand the circuits of GSM now. One way to up the difficulty level of this Project is to try to make a live video call using the raspberry pi 4 mobile. Next, we'll look at connecting the pcf8591 ADC/DAC analog-digital converter module to a Raspberry Pi.
In this project, we are going to make a water level indicator. We all know it is one of the most essential products because there are many water tanks in every house or office, and most of them are not easily accessible to check the level of water in it and I think most of us faced the problem such as shortage of water as we do not have anything to monitor the exact amount of water available in the tank and this causes many problems on our daily lives.
Where To Buy? | ||||
---|---|---|---|---|
No. | Components | Distributor | Link To Buy | |
1 | LEDs | Amazon | Buy Now | |
2 | Arduino Uno | Amazon | Buy Now |
As we are going to make this project in the simulation first, for that, we will use the Proteus simulation tool. It is a tool used for electronic projects in which, we can run the real-time simulation of any electronic project and we can debug it in real-time without making any damage to real components.
Proteus has a very big database for electronic components which comes in the installation package of Proteus, but still, sometimes we have to install packages or libraries for some modules which are not pre-installed in it.
As in this project, we are going to use Arduino which is not pre-installed in the Proteus software. So we can download the Arduino module package from the link given below:
Note- While uploading the code on the Arduino UNO, disconnect any wire which is connected to Rx(D0) and Tx(D1) pins, otherwise it will give an error while uploading the code.
The water level indicator works on the principle of change in the resistance of the water level sensor due to a change in the amount of water in the container.
Basically, there are two parallel strips in the water level sensor, one for the power supply and another is for the sensor strip. As we know, water is a conductor of electricity so when we increase the amount of water in the container then more length of the sensor emerges in the water and that will increase the conductivity between the strips therefore, it increases the voltage on the sensor pin as well. We will read that voltage on the Arduino UNO.
To get the exact amount of water level in the container, we have to calibrate the sensor with the water because we can not be assured that the output voltage will be the same for every water because we know that there are lots of materials dissolved in the water so it will vary for a different source of water, therefore, we have to calibrate it first.
For calibration of the sensor, we will take a container with the water and we will read the values from the sensor by changing the level of water in the container. We will perform this action till the container gets filled with water and we will note down all the reference values and mark them as thresholds for each level.
As in this project, we are making it in the simulation so it would not be possible for changing the values as per the water level therefore we have used the potentiometer and we have chosen the threshold values randomly.
No need to worry while making this project with the real components as the sensor values from the water level sensor will be in the same format as the output of the potentiometer.
Now that we know the working principle of the water level indicator let’s go for the circuit diagram of the project.
As we know the required components which we are going to use in this project.
For coding, we will use the Arduino IDE. It is a built-in IDE for Arduino developments.
Arduino code is divided into mainly three parts: declaration of function and variables, second is void setup section, and third is void loop.
First of all, declare the variables and pin number which we are going to use in this project.
Now we have completed our code and circuit, it's time to run the project.
I hope we have covered all the points related to this project, and I think it will be very useful in daily life and it will give us ease of monitoring water in our water tanks. After this project, we don’t have to take the headache of how much water is available in our tank. And please let us know in the comment section if you have faced any issues while making it and also how you are going to use it in real life.
Thanks for reading this article. All the best for your projects.
#include<LiquidCrystal.h> //Library for LCD LiquidCrystal lcd(12, 11, 5, 4, 3, 2);// LCD pins at which it is attached to the Arduino void setup() //method used to run the source for the one time onlys { lcd.begin(16, 2);//LCD order i.e. 16 columns & 2 rows lcd.print("The Engineering Projects ");//prints on LCD lcd.setCursor(0,1);//setting cursor on LCD lcd.print("www.TheEngineeringProjects.com");//prints on LCD delay(1000);//delay of 1 sec } void loop() //method to run the source code repeatedly { lcd.noDisplay();//turn off the display of LCD delay(250);//delay to 0.25 seconds lcd.display();//turning on the LCD display delay(250); //delay of 0.25 seconds again }
#include <LiquidCrystal.h>//Library for LCD LiquidCrystal lcd(12, 11, 5, 4, 3, 2);//LCD pins at which it is attached to the Arudino void setup()//method used to run the code for once { lcd.begin(16, 2);//LCD order lcd.print("The Engineering Projects ");//prints on LCD lcd.setCursor(0,1);//Setting the cursor on LCD lcd.print("www.TheEngineeringProjects.com");//prints on LCD delay(1000);//delay of 1 second } void loop() //used to run the code repeatedly { for(int PositionCount=0;PositionCount<13; PositionCount++)//loop for scrolling the LCD text { lcd.scrollDisplayLeft();//builtin command to scroll left the text delay(150);// delay of 150 msec } for(int PositionCount=0; PositionCount<29; PositionCount++) { lcd.scrollDisplayRight(); //builtin command to scroll right the text delay(150);//delay of 150 msec } for(int PositionCount=0; PositionCount<16; PositionCount++)//loop for scrolling the text { lcd.scrollDisplayLeft();//builtin command to scroll the text left again delay(150);//delay of 150 msec } }
While today we will have a look at how to send the data through a serial port in Arduino and for that, I am going to use the Arduino Serial Write command. It's also going to be a very simple and basic Arduino tutorial but if you are new to Arduino then you must read it completely as it will gonna help you out. I have also designed a Proteus Simulation and explained it at the end of this tutorial. I hope you guys are gonna learn from it:
Serial.write ( 'DataSent' ) ;
where:
Serial.write ( '1' ) ;
#include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(13, 12, 11, 10, 9, 8); void setup() { // set up the LCD's number of columns and rows: lcd.begin(20, 4); // Print a message to the LCD. lcd.setCursor(1,0); lcd.print("www.TheEngineering"); lcd.setCursor(4,1); lcd.print("Projects.com"); lcd.setCursor(1,0); Serial.begin(9600); lcd.clear(); Serial.write('1'); } void loop() { }
Serial.write ( "DataSent" ) ;
where:
Serial.write ( "www.TheEngineeringProjects.com" ) ;
#include <LiquidCrystal.h> // initialize the library with the numbers of the interface pins LiquidCrystal lcd(13, 12, 11, 10, 9, 8); void setup() { // set up the LCD's number of columns and rows: lcd.begin(20, 4); // Print a message to the LCD. lcd.setCursor(1,0); lcd.print("www.TheEngineering"); lcd.setCursor(4,1); lcd.print("Projects.com"); lcd.setCursor(1,0); Serial.begin(9600); // lcd.clear(); Serial.write("www.TheEngineeringProjects.com"); } void loop() { }
I am sharing interfacing of this Flame Sensor with Arduino today, but soon I will also post a tutorial on Interfacing of Flame Sensor with PIC Microcontroller. If you guys have any questions then ask in comments. I have also given the Simulation file and the Programming code below to download. But I would recommend you to design this proejct on your own so that you make mistakes and then learn from them. So, let's get started with Interfacing of Flame Sensor with Arduino:
#include <LiquidCrystal.h> LiquidCrystal lcd(13, 12, 11, 10, 9, 8); int Flame = 7; void setup() { Serial.begin(9600); pinMode(Flame, INPUT_PULLUP); lcd.begin(20, 4); lcd.setCursor(0,0); lcd.print("Flame : "); lcd.setCursor(1,2); lcd.print("www.TheEngineering"); lcd.setCursor(4,3); lcd.print("Projects.com"); } void loop() { if(digitalRead(Flame) == HIGH){lcd.setCursor(8,0);lcd.print("Detected ");} if(digitalRead(Flame) == LOW ){lcd.setCursor(8,0);lcd.print("Not Detected");} }
I have designed this project using Arduino UNO and have simulated in the Proteus software, which you all know is my favorite simulating software. :) The code is also quite simple which I have given below for download. The simulation is also included in download package but again I suggest you to design it on your own. If you got into any trouble then ask in comments and I will try to resolve them. Anyways let's get started with How to measure frequency using Arduino.
#include <LiquidCrystal.h> LiquidCrystal lcd(13,12,11,10,9,8); long freq, tempo; int pulsos; boolean pulso; void setup() { pulso=HIGH; pinMode(2,INPUT); lcd.begin(20, 4); lcd.setCursor(0,0); lcd.print("Frequency ="); lcd.setCursor(1,2); lcd.print("www.TheEngineering"); lcd.setCursor(4,3); lcd.print("Projects.com"); } void loop() { tempo = millis(); if(digitalRead(2)==HIGH) { if(pulso==HIGH) { pulsos = pulsos + 1; } pulso=LOW; } else{ pulso=HIGH; } if(tempo%2000==0){ freq = pulsos/2; lcd.setCursor(12,0); lcd.print(freq); lcd.print("Hz"); pulsos=0; } }
So, now I hope that you have installed both these libraries successfully and are ready to design this DS1307 Arduino based Digital Clock. I have given the Simulation and Code for download below but as I always advise, don't just download the files. Instead design your own simulation and try to write your own code. In this way, you will learn more out of it. So, let's get started with DS1307 Arduino based Digital Clock in Proteus ISIS:
#include <LiquidCrystal.h> #include <DS1307.h> #include <Wire.h> LiquidCrystal lcd(13,12,11,10,9,8); int clock[7]; void setup(){ for(int i=3;i<8;i++){ pinMode(i,INPUT); } lcd.begin(20,2); DS1307.begin(); DS1307.setDate(16,4,7,0,17,50,04);//ano,mes,dia,semana,horas,minutos,segundos } void loop(){ DS1307.getDate(clock); lcd.setCursor(0,1); lcd.print("Time: "); Print(clock[4]); lcd.print(":"); Print(clock[5]); lcd.print(":"); Print(clock[6]); lcd.setCursor(0,0); lcd.print("Date: "); Print(clock[1]); lcd.print("/"); Print(clock[2]); lcd.print("/"); lcd.print("20"); Print(clock[0]); if(digitalRead(7)){ clock[5]++; if(clock[5]>59) clock[5]=0; DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]); while(digitalRead(7)); } if(digitalRead(6)){ clock[4]++; if(clock[4]>23) clock[4]=0; DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]); while(digitalRead(6)); } if(digitalRead(5)){ clock[2]++; if(clock[2]>31) clock[2]=1; DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]); while(digitalRead(5)); } if(digitalRead(4)){ clock[1]++; if(clock[1]>12) clock[1]=1; DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]); while(digitalRead(4)); } if(digitalRead(3)){ clock[0]++; if(clock[0]>99) clock[0]=0; DS1307.setDate(clock[0],clock[1],clock[2],0,clock[4],clock[5],clock[6]); while(digitalRead(3)); } delay(100); } void Print(int number){ lcd.print(number/10); lcd.print(number%10); }
Arduino has 10 bit ADC pins so whenever you apply voltage on these pins it will give you a value ranging from 0 to 1023 depending on the voltage provided. One can easily get this value using a simple function in Arduino analogRead(); but the real problem is to convert this analog value into the actual voltage present on the pin. Suppose you are using A0 pin of arduino and you are providing 3.3V over to this pin, now when you use this analoagRead() function then it will give you some value say 543, but you wanna know what's the actual voltage at this pin which is 3.3V so now converting this 543 to 3.3 is a bit tricky part. It's not difficult but involves a little calculations, which I am gonna cover today in detail. Before going any further, make sure you have already installed the Arduino Library For Proteus, if not then first do it because without this library you won't be able to use Arduino board in Proteus. So, let's get started with How to Display ADC value on LCD using Arduino.
I have divided this tutorial on How to Display ADC value on LCD using Arduino in few steps, follow these steps carefully and if you get into some trouble then ask in comments and I will try my best to resolve them, all the materials are provided at the end of step 1 for download but I suggest that you design your own so that you do mistakes and learn from them. Moreover, you should also have a look at these Arduino Projects for Beginners. Anyways, let get started:
Download Proteus Simulation and Arduino Hex File
#include <LiquidCrystal.h> #define NUM_SAMPLES 10 int sum = 0; unsigned char sample_count = 0; float voltage = 0.0; LiquidCrystal lcd(12, 11, 5, 4, 3, 2); const int PT = A0; const int CT = A1; float Cur; float Vol; float Power; void setup() { // set up the LCD's number of columns and rows: lcd.begin(20, 4); // Print a message to the LCD. lcd.setCursor(6,1); lcd.print("Welcome To"); lcd.setCursor(5,2); lcd.print("Energy Meter"); //delay(5000); lcd.clear(); Constants(); } void loop() { lcd.setCursor(0, 2); ShowVoltage(9, 0, PT); Vol = voltage; ShowVoltage(9, 1, CT); Cur = voltage; Power = Vol * Cur; lcd.setCursor(7,2); lcd.print(Power); } void Constants() { lcd.setCursor(0,0); lcd.print("Voltage: "); lcd.setCursor(0,1); lcd.print("Current: "); lcd.setCursor(0,2); lcd.print("Power: "); lcd.setCursor(14,0); lcd.print("V"); lcd.setCursor(14,1); lcd.print("A"); lcd.setCursor(12,2); lcd.print("W"); } void ShowVoltage (int x,int y, unsigned int value) { while (sample_count < NUM_SAMPLES) { sum += analogRead(value); sample_count++; delay(10); } voltage = ((float)sum / (float)NUM_SAMPLES * 5.015) / 1024.0; lcd.setCursor(x, y); lcd.print(voltage); sample_count = 0; sum = 0; }