Embedded System1 - Lab
Embedded System1 - Lab
Lab Record
Batch Name : B2 Batch Members:
1.Sahana.V
2.Sneha.M
Using Arduino
1.LED blink
2.Buzzer sensor
Experiment No:1
Hardware components used and the design (take the snap of the circuit design drawn in the book):
1.Bread board
2.Led
3.Aurdino board
4.Jumpers
List of Functionality and the final code:
void setup()
pinMode(ledPin, OUTPUT);
void loop()
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
Video demonstration of the same(insert the video snippet):
Experiment No:2
Hardware components used and the design (take the snap of the circuit design drawn in the book):
1.Active Buzzer
2.Bread board
3.Jumpers
List of Functionality and the final code:
const int buzzer = 9; //buzzer to arduino pin 9
void setup(){
void loop(){
}
Video demonstration of the same(insert the video snippet:
Experiment No:3.
Hardware components used and the design (take the snap of the circuit design drawn in the book):
1.Active Buzzer
2.Bread board
3.Jumpers
4.Led
List of Functionality and the final code:
void setup()
{
pinMode(led, OUTPUT); // sets the LED as output
pinMode(sound, OUTPUT); // sets the buzzer alarm as output
}
}
Purpose/Application(if any): These are used in electric motors for measuring the motor
winding temperature, internal housing temperature, bearing temperature, brushes
temperate and external body temperature.
Hardware components used and the design (take the snap of the circuit design drawn in the book):
1.Temperature sensor
2.Bread board
3.Jumpers
List of Functionality and the final code:
//Libraries
#include <DHT.h>;
//Constants
#define DHTPIN 7 // what pin we're connected to
#define DHTTYPE DHT22 // DHT 22 (AM2302)
DHT dht(DHTPIN, DHTTYPE); //// Initialize DHT sensor for normal 16mhz
Arduino
//Variables
int chk;
float hum; //Stores humidity value
float temp; //Stores temperature value
void setup()
{
Serial.begin(9600);
dht.begin();
}
void loop()
{
delay(2000);
//Read data and store it to variables hum and temp
hum = dht.readHumidity();
temp= dht.readTemperature();
//Print temp and humidity values to serial monitor
Serial.print("Humidity: ");
Serial.print(hum);
Serial.print(" %, Temp: ");
Serial.print(temp);
Serial.println(" Celsius");
delay(10000); //Delay 2 sec.
}
Video demonstration of the same(insert the video snippet):
Using Msp4:
Experiment No 1: BUZZER
Purpose/Application:
Can be used for the purpose of signalling.
Hardware components:
MSP430 Launchpad
Buzzer
Jumper wires
Design:
List of functionality with final code:
Code:
void setup( )
pinMode(buzzerPin,OUTPUT);
void loop( )
tone(buzzerpin,699,500);
delay(500);
Video demonstration:
Experiment No 2: LED BLINK
Purpose/Application:
They are mainly used for visual indication in any electronic devices, measuring and interacting with the
process and can also be used for signalling.
Hardware components:
MSP430 Launch pad
LED
Jumper Wires
Design:
List of functionality with final code:
1. The MSP430 LaunchPad kit includes everything you need out of the box. To
start programming your MSP430 LaunchPad, you'll first have to install Code
Composer Studio onto your computer. This will install all of the required
drivers for your new MSP430 LaunchPad kit.
2. Next, simply plug in your LaunchPad with the included USB cable to your
Windows PC. The green power (PWR) LED should glow.
3. If prompted, let Windows automatically install the software.
CODE:
#include <msp430g2553.h>
int main(void) {
volatile int i;
// stop watchdog timer
WDTCTL = WDTPW | WDTHOLD;
// set up bit 0 of P1 as output
P1DIR = 0x01;
// intialize bit 0 of P1 to 0
P1OUT = 0x00;
// loop forever
for (;;) {
// toggle bit 0 of P1
P1OUT ^= 0x01;
// delay for a while
for (i = 0; i < 0x6000; i++);
}
}
Video demonstration:
Experiment No 3: RGB
Purpose/Application:
The main purpose of the RGB color model is for the sensing, representation, and display of images in
electronic systems, such as televisions and computers, though it has also been used in conventional
photography.
Hardware components:
MSP430G2 LaunchPad
RGB LED
Breadboard
Jumper wires
Design:
List of functionality with final code:
CODE:
void setup() {
pinMode(redPin, OUTPUT);
pinMode(greenPin, OUTPUT);
pinMode(bluePin, OUTPUT);
}
void loop() {
delay(1000);
delay(1000);
delay(1000);
digitalWrite(redPin, redValue);
digitalWrite(greenPin, greenValue);
digitalWrite(bluePin, blueValue);
}
Video demonstration:
Experiment No 1: LED
Aim/Title of the Experiment:
Use of LED to obtain the output of Raspberry pi which can be expressed by the blink of led based
on the delay.
Purpose/Application:
In this project, we have seen how to blink an LED using Raspberry Pi and Python Program.
This project will help you in understanding some basics of the GPIO Pins of Raspberry Pi.
With this project as reference, we can develop many other projects like driving motors,
connecting LCDs, etc.
Hardware components:
Raspberry pi
Bread board
LED
Jumper Wires
Design:
In order to control the GPIO Pin i.e. making it HIGH and LOW, I’ll be using Python programming
and few Python Packages.
The first important function of the RPi.GPIO Module is the setmode(). Using
GPIO.setmode(), we can select either GPIO Numbering of the Pins or Physical
Numbering. By using GPIO.setmode(GPIO.BOARD), we are selecting the Physical
Numbering Scheme.
CODE:
Video demonstration:
RASPBERRY PI
Experiment No:2
Aim/Title of the Experiment:Demonstration of active buzzer on raspberry pi
Purpose/Application(if any):
Hardware components used and the design (take the snap of the circuit design drawn in the book):
1.Jumpers
2.Breadboard
3.Buzzer/piezo speaker
List of Functionality and the final code:
1. #Libraries
5. GPIO.setwarnings(False)
7. GPIO.setmode(GPIO.BCM)
9. buzzer=23
10. GPIO.setup(buzzer,GPIO.OUT)
13. ......GPIO.output(buzzer,GPIO.HIGH)
16. ......GPIO.output(buzzer,GPIO.LOW)
18. ......sleep(0.5)