0% found this document useful (0 votes)
11 views13 pages

Anatomy of Arduino Uno Components

The document outlines the components and workflow for a project involving an Arduino board, a water level sensor, and a GSM board. It details the functionality of each component, how to wire them together, and provides a basic example of Arduino code for reading water levels and sending SMS notifications. Additionally, it includes instructions for setting up a GSM module for communication and executing basic AT commands.

Uploaded by

sorandaemon
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views13 pages

Anatomy of Arduino Uno Components

The document outlines the components and workflow for a project involving an Arduino board, a water level sensor, and a GSM board. It details the functionality of each component, how to wire them together, and provides a basic example of Arduino code for reading water levels and sending SMS notifications. Additionally, it includes instructions for setting up a GSM module for communication and executing basic AT commands.

Uploaded by

sorandaemon
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Projects components

Materials:

-Waterproof Box

: The other components will be put inside this box

:Must be waterproof but needs small holes to allow water to detect the sensor

-Arduino board

: Arduino boards are versatile, open-source electronics platforms used for creating interactive
projects by allowing users to read inputs from sensors and control outputs like LEDs or motors,
all through a simple, C/C++ based programming language and software environment.

-Water level sensor

: Water sensors detect the presence of water and, when placed in locations where water should
not be present, a leak

: How does it work?

The operation of the water level sensor is fairly simple.

The power and sense traces form a variable resistor (much like a potentiometer) whose
resistance varies based on how much they are exposed to water.

: Hardware Overview

The sensor has ten exposed copper traces, five of which are power traces and the remaining
five are sense traces. These traces are interlaced so that there is one sense trace between
every two power traces.

Normally, power and sense traces are not connected, but when immersed in water, they are
bridged.

-GSM Board

: With an Arduino GSM shield and the GSM library, you can enable your Arduino to
make/receive calls, send/receive SMS, and connect to the internet via GPRS networks.

A Typical Workflow

To upload code to an Arduino board using the IDE, one typically does the following:
1. Install your board - this means installing the right "package" for your board. Without the
package, you can simply not use your board. Installing is done directly in the IDE, and is a quick
and easy operation.

2. Create a new sketch - a sketch is your main program file. Here we write a set of instructions
we want to execute on the microcontroller.

3. Compile your sketch - the code we write is not exactly how it looks like when uploaded to our
Arduino: compiling code means that we check it for errors, and convert it into a binary file (1s
and 0s). If something fails, you will get this in the error console.

4. Upload your sketch - once the compilation is successful, the code can be uploaded to your
board. In this step, we connect the board to the computer physically, and select the right serial
port.

5. Serial Monitor (optional) - for most Arduino projects, it is important to know what's going on
on your board. The Serial Monitor tool available in all IDEs allow for data to be sent from your
board to your computer.

Anatomy of an Arduino Board


While all Arduino boards differ from each other, there are several key

components that can be found on practically any Arduino. Let's take a look at

the image below:

Key components of an Arduino board.


1. Microcontroller - this is the brain of an Arduino, and is the component that we
load programs into. Think of it as a tiny computer, designed to execute only a
specific number of things.
2. USB port - used to connect your Arduino board to a computer.
3. USB to Serial chip - the USB to Serial is an important component, as it helps
translating data that comes from e.g. a computer to the on-board microcontroller.
This is what makes it possible to program the Arduino board from your computer.
4. Digital pins - pins that use digital logic (0,1 or LOW/HIGH). Commonly used for
switches and to turn on/off an LED.
5. Analog pins - pins that can read analog values in a 10 bit resolution (0-1023).
6. 5V / 3.3V pins- these pins are used to power external components.
7. GND - also known as ground, negative or simply -, is used to complete a circuit,
where the electrical level is at 0 volt.
8. VIN - stands for Voltage In, where you can connect external power supplies.

Depending on the Arduino board, you will find many more components.
The items listed above are generally found on any Arduino board.

How Does a Water Level Sensor Work?


The operation of the water level sensor is fairly simple.
The power and sense traces form a variable resistor (much like a potentiometer) whose
resistance varies based on how much they are exposed to water.

This resistance varies inversely with the depth of immersion of the sensor in water:

● The more water the sensor is immersed in, the better the conductivity and
the lower the resistance.
● The less water the sensor is immersed in, the poorer the conductivity and
the higher the resistance.

The sensor generates an output voltage proportional to the resistance; by measuring this
voltage, the water level can be determined.

Water Level Sensor Pinout


The water level sensor is extremely simple to use and only requires three pins to connect.

S (Signal) is an analog output pin that will be connected to one of your Arduino’s analog inputs.
+ (VCC) pin provides power to the sensor. It is recommended that the sensor be powered from
3.3V to 5V. Please keep in mind that the analog output will vary depending on the voltage
supplied to the sensor.

– (GND) is the ground pin.

Wiring a Water Level Sensor to an Arduino


Let’s hook up the water level sensor to the Arduino.
To begin, connect the + (VCC) pin on the module to 5V on the Arduino and the – (GND) pin to
ground.

One well-known issue with these sensors is that they have a shorter lifespan
because they are constantly exposed to moisture. Moreover, constantly applying
power to the sensor while immersed in water significantly accelerates the rate of
corrosion.
To avoid this, it is recommended that the sensor be turned on only when taking
readings.
One easy way to do this is to connect the sensor’s power pin to a digital pin on
an Arduino and set it to HIGH or LOW as needed. So, we’ll connect the + (VCC)
pin to the Arduino’s digital pin #7.
Finally, connect the S (Signal) pin to the Arduino’s A0 ADC pin.
The wiring is shown in the image below.
Basic Arduino Example
After constructing the circuit, upload the following sketch to your Arduino.
// Sensor pins
#define sensorPower 7
#define sensorPin A0

// Value for storing water level


int val = 0;

void setup() {
// Set D7 as an OUTPUT
pinMode(sensorPower, OUTPUT);

// Set to LOW so no power flows through the sensor


digitalWrite(sensorPower, LOW);

[Link](9600);
}

void loop() {
//get the reading from the function below and print it
int level = readSensor();

[Link]("Water level: ");


[Link](level);

delay(1000);
}

//This is a function used to get the reading


int readSensor() {
digitalWrite(sensorPower, HIGH); // Turn the sensor ON
delay(10); // wait 10 milliseconds
val = analogRead(sensorPin); // Read the analog value form sensor
digitalWrite(sensorPower, LOW); // Turn the sensor OFF
return val; // send current reading
}

After uploading the sketch, open the Serial Monitor window to view the output.
When the sensor is dry, it will output a value of 0; however, as the sensor is
immersed in water, the output will gradually increase.
SIM900A Modem is built with Dual Band GSM/GPRS based SIM900A modem
from SIMCOM. It works on frequencies 900/ 1800 MHz. SIM900A can search
these two bands automatically. The frequency bands can also be set by AT
Commands. The baud rate is configurable from 1200-115200 through AT
command. The GSM/GPRS Modem is having internal TCP/IP stack to enable
you to connect with internet via GPRS. SIM900A is an ultra compact and
reliable wireless module. This is a complete GSM/GPRS module in a SMT
type and designed with a very powerful single-chip processor integrating
AMR926EJ-S core, allowing you to benefit from small dimensions and cost-
effective solutions.

Specification

Dual-Band 900/ 1800 MHz


GPRS multi-slot class 10/8GPRS mobile station class B
Compliant to GSM phase 2/2+
Dimensions: 24*24*3 mm
Weight: 3.4g
Control via AT commands (GSM 07.07 ,07.05 and SIMCOM enhanced
AT Commands)
Supply voltage range : 5V
Low power consumption: 1.5mA (sleep mode)
Operation temperature: -40°C to +85 °

Step 1: Material Preparation


In this tutorial, you will need :
1. GSM SIM900A (MINI V3.9.2)
2. Arduino Uno Board and USB
3. Jumper Wire
4. Power adapter 5V
5. SIM card
6. Breadboard

Step 2: Booting Up SIM900A

1. Insert your SIM card to GSM module and lock it. (picture 1 and 2)
2. power up your gsm by connecting it to Arduino's 5V and GND (picture 3)
3. Connect the Antenna (picture 4)
4. Now wait for some time (say 1 minute) and see the blinking rate of ‘status
LED’ or ‘network LED’ (D6, refer picture 5) //GSM module will take some time
to establish connection with mobile network//
5. Once the connection is established successfully, the status/network LED
will blink continuously every 3 seconds. You may try making a call to the
mobile number of the sim card inside GSM module. If you hear a ring back,
the gsm module has successfully established network connection.

You can see a TTL pin with 3VR, 3VT, 5Vr, 5VT, VCC and GND on your
sim900a near your power supply pin. You have to connect GSM's 5VT to
Arduino D9 and GSM's 5VR to Arduino's D10 for serial communication
between arduino and sim900a module.

Step 4: Basic AT Command

1. To change sms sending mode : AT+CMGF=1

[Link]("AT+CMGF=1");

2. To read SMS in text mode : AT+CNMI=2,2,0,0,0

[Link]("AT+CNMI=2,2,0,0,0");

3. To make a call : ATD+60XXXXXXXXX; //replace X with number you want


to call, change +60 to your country code

[Link]("ATD+60XXXXXXXXX;");
4. To disconnect / hangup call : ATH

[Link]("ATH");

5. To redial : ATDL

[Link]("ATDL");

6. To receive a phone call : ATA

[Link]("ATA");

Step 5: Library

Common questions

Powered by AI

Uploading code to an Arduino board involves several steps: installing the correct board package in the IDE, creating a new sketch (the main program), compiling this sketch to check and convert it into a binary file, and finally uploading the sketch to the board by connecting it to the computer and selecting the appropriate serial port. Compiling is a crucial step that ensures the code is error-free and transforms it into machine-readable instructions (binary format).

Integrating a microcontroller with a GSM modem provides embedded systems with Internet connectivity by utilizing the modem's TCP/IP stack via GPRS networks. This enables remote monitoring, control, and data exchange, which are critical for IoT applications, allowing devices to communicate over vast distances and interact with other systems or users in real-time .

To prolong the lifespan of a water level sensor, it is recommended to power the sensor only when taking readings to reduce exposure to water, which causes corrosion. This can be achieved by connecting the sensor’s power pin to a digital pin on the Arduino and controlling it programmatically to minimize constant exposure to moisture, thus extending its operational life .

Constant power application to water level sensors can lead to accelerated corrosion due to ongoing exposure to moisture, reducing sensor lifespan. To mitigate this, the sensor should be powered only when taking readings. This is achieved by controlling the power supply via an Arduino digital pin programmed to turn the sensor on momentarily for each measurement and then off, limiting corrosion and prolonging sensor life .

The USB to Serial chip on an Arduino board facilitates programming by translating data between the computer and the onboard microcontroller, enabling the transfer of code. Other key components on an Arduino include the microcontroller (the brain of the board), USB port, digital and analog pins (used for I/O operations), voltage pins (5V/3.3V for power), GND for grounding, and VIN for external power supply connections .

The SIM900A GSM module enhances Arduino project functionality by enabling cellular communication, such as making and receiving calls, sending and receiving SMS, and accessing data services via GPRS. Key commands for interaction include AT+CMGF=1 to set SMS sending mode, AT+CNMI=2,2,0,0,0 to read SMS in text mode, ATD to initiate calls, ATH to hang up, ATDL to redial, and ATA to answer calls. These commands allow for diverse communication and control capabilities in IoT applications .

Arduino offers significant benefits for interactive projects due to its open-source nature, providing flexibility in design and a wide range of compatible components and shields. It allows developers and hobbyists accessibility to an extensive community and resources, facilitating learning and collaboration. The platform enables users to create custom applications affordably and efficiently, making it ideal for education and rapid prototyping .

The microcontroller on an Arduino board functions as its "brain," responsible for executing programs uploaded to it. Unlike conventional computers, which are designed for general-purpose tasks, Arduino microcontrollers are simpler, focusing on specific tasks such as reading sensor inputs and controlling peripheral devices in embedded applications .

To set up a GSM module with an Arduino, insert a SIM card into the module and lock it. Connect the GSM module's power and ground pins to the Arduino's 5V and GND, attach an antenna, and wait for about a minute for the status LED to indicate a network connection by blinking every 3 seconds. The GSM's TTL pins for communication should be connected to Arduino pins D9 and D10 for transmitting and receiving data .

The design of a water level sensor utilizes the relationship between conductivity and resistance by interlacing power and sense traces, which form a variable resistor. The resistance of this sensor changes inversely with immersion depth; more immersion improves conductivity and lowers resistance, indicating higher water levels, while less immersion lowers conductivity and increases resistance. This change in resistance is reflected as a proportional change in output voltage, which is measured to determine water levels .

You might also like