Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 8

LAB REPORT on

EMBEDDED SYSTEM FOR SMART SENSING

By- Nrusingha Prasad Panda (201915006)

LAB-1 Hands On with Arduino Nano

Connecting Servo motor –

A servo motor is a rotary actuator or linear actuator that allows for


precise control of angular or linear position, velocity and acceleration. It
consists of a suitable motor coupled to a sensor for position feedback. It
also requires a relatively sophisticated controller, often a dedicated
module designed specifically for use of servomotors.

Servo Motor is a closed-loop servomechanism that uses position


feedback to control it's motion and final position. The input to its control
is a signal(either analogue or digital) representing the position
commanded for the output shaft.

Connect the following:

Servo motor(GND) to Arduino nano (GND)

Servo motor(VCC) to Arduino nano (VCC/+5v)


Servo motor(Data In) to Arduino nano (Digital Pin 2)

Arduino Nano to your laptop/pc

Software connection for Arduino to Servo Motors

Open your Arduino IDE. Go to tools and change your Board to Arduino
Nano. Go to Port and select a port where your Arduino Nano is
connected.

Paste the code given below on your Arduino IDE.

Once done programming your Arduino, click the Upload button to upload
the codes to your Arduino Nano.

Check the servo and it must move from 0' to 180'


LAB-2 Simulating LED Blink with Arduino Nano

Light-emitting diode (LED) is a two-lead semiconductor light source device used for indicating
the output status by making it ON or OFF.
An LED is nothing but a p–n junction diode, which emits light when provided with power supply.
When voltage is applied to the leads of an LED, it forces the electrons to recombine with
electron holes within the device, emitting energy in the form of photons. This effect of emitting
energy in form of photons is called electroluminescent. The color of the light is determined by
the energy band gap of the semiconductor corresponding to the energy of the photon.
Using Arduino, Light emitting diodes (LED's) are handy. For that, connect a wire to digital pin 13
on the Arduino board, GND wire and VIN pin a voltage of 5v-9v. We get a constant or blinking
LED flushing as we need.

The Arduino Nano is a microcontroller(Atmel ATmega328) is an easy to use yet powerful single
board computer that has gained considerable traction in the hobby and professional market.
The Arduino is open-source, which means hardware is reasonably priced and development
software is free. This guide is for students anywhere who are confronting the Arduino for the
first time.

The Arduino project was started in Italy to develop low cost hardware for interaction design. An
overview is on the Wikipedia entry for Arduino. The Arduino hardware comes in several flavors.
This mini project covers the Arduino Nano board, a good choice for students and educators.
With the Arduino board, we can write programs and create interface circuits to read switches
and other sensors, and to control motors and lights with very little efforts.
Genarally, Arduino Board Inludes:
Programmer,  Voltage Regulators  Seral to USB Converter
The Arduino-Nano board features an Atmel ATmega328 microcontroller operating at 5 V with 2
Kb of RAM, 32 Kb of flash memory for storing programs and 1 Kb of EEPROM for storing
parameters. The clock speed is 16 MHz, which translates to about executing about 300,000
lines of C source code per second. The board has 14 digital I/O pins and 6 analog input pins.
There is a USB connector for talking to the host computer and a DC power jack for connecting
an external 6-12V power source, for example a 9 V battery, when running a program while not
connected to the host computer.
The Arduino programming language is a simplified version of C/C++. If you know C,
programming the Arduino will be familiar. If you do not know C, no need to worry as only a few
commands are needed to perform useful functions.
Code for Blink One

Code for Blink Continuously


The pinMode command sets the LED pin to be an output. The first digitalWrite command says
to
set pin 13 of the Arduino to HIGH, or +5 volts. This sends current from the pin, through the
resistor, through the LED (which lights it) and to ground. The delay(500) command waits for 500
msec. The second digitalWrite command sets pin 13 to LOW or 0 V stopping the current
thereby turning the LED off. Code within the brackets defining the loop() function is repeated
forever, which is why the LED blinks.

LAB-3 Connecting ESP8266 wifi module with arduino nano

The following components are needed :

 Arduino Nano
 ESP 8266
 Mini USB to USB cable
 Generic bread board
 Jumper cables (Male and Female)
 Arduino or generic 3.3v power supply

Install the Arduino IDE 


In the Arduino IDE:
Go to menu: Tools > Board > Boards Manager
Search for Arduino AVR Boards when found, click Install

 Select the Arduino Nano board type by going to Tools > Board
 Select the port that displays e.g com9
 Add the WIFI_SSID and PASSWORD
 Add the device_secret_key with your device secret key from the Wia Dashboard (the one
that begins with d_sk)
 Sketch > Upload to send it to your Uno

Unfortunately if you try to power the esp from the nano the com port will stop working, to get
the Wifi module running you will need to power it externally. The easiest way to do this is to
use a second arduino, any will work you just need the 3.3v pin and the Gnd pin.
Arduino pins
3.3v --> Vin on esp8266
Gnd --> Gnd on esp8266
pin 10 --> esp8266 TX pin
pin 11 --> esp8266 RX pin
As the Arduino nano takes male jumper cables while the ESP 8266 requires female jumper
cables, a bread board can be used to make the connections. Its also useful as both the CH_PD
and VCC pins on the ESP 8266 require power
LAB-4 Using Raspberry Pie-2 as a CPU to the Computer

Step-1

Two softwares required Win32 Disk Imager and SD card formatter

Step-2

Raspbian OS: This is the Main operating system of the Pi.


Extract all files to the desktop.

Step-3

Get a minimum 8GB class 10 SD card with a card reader. Insert that card
into the card reader and plug that to the USB port.
Step-4

Go to my computer or My PC and find the drive name where the SD card


is mounted.
Format the SD Card
Open SD Card Formatter and select the drive you noticed in the previous
step.
Click on format and don't alter any other options.
When formatting is completed, click on OK.

Step-5

Write the OS on the SD Card


Open win32diskimager.
Browse the .img file of Raspbian OS that was extracted from the
downloaded file.
Click on open and then click on Write. If any warning pops up then
ignore those by clicking OK.

Wait for the write to be completed and it may take some minutes. So be
patient.

Step-6

Eject the SD Card


Now your OS in installed on your Raspberry Pi.

You might also like