DOC-20240504-WA0001.
DOC-20240504-WA0001.
AIM:
To study the basics of Arduino Uno board and Arduino IDE 2.0 software.
INTRODUCTION TO ARDUINO:
Arduino is a project, open-source hardware, and software platform used to design and build
electronicdevices. It designs and manufactures microcontroller kits and single-board interfaces for
building electronics projects. The Arduino boards were initially created to help students with the non-
technical background. The designs of Arduino boards use a variety of controllers and
microprocessors. Arduino is an easy-to-use open platform for creating electronic projects. Arduino
boards play a vitalrole in creating different projects. It makes electronics accessible to non-engineers,
hobbyists, etc.
The Arduino IDE 2.0 is an open-source project, currently in its beta-phase. It is a big step from it's
sturdy predecessor, Arduino IDE 2.0, and comes with revamped UI, improved board & library
manger, autocomplete feature and much more.
In this tutorial, we will go through step by step, how to download and install the software.
Download the editor
Downloading the Arduino IDE 2.0 is done through the Arduino Software page. Here you will
also find information on the other editors available to use.
Requirements
Windows - Win 10 and newer, 64 bits
Linux - 64 bits
Mac OS X - Version 10.14: "Mojave" or newer, 64 bits
Installation
Windows
Download URL: https://www.arduino.cc/en/software
To install the Arduino IDE 2.0 on a Windows computer, simply run the file downloaded from the
software page.
Follow the instructions in the installation guide. The installation may take several minutes.
RESULT:
EXP NO:2
INTERFACING ARDUINO TO ZIGBEE MODULE
DATE
AIM:
To write a program to control an LED using a Zigbee module.
5 Zigbee Module 2
THEORY:
IoT devices require reliable and efficient communication methods to transmit data and interact
withother devices or systems.
Zigbee is a low-power wireless communication protocol designed for short-rangecommunication
between devices. It operates on the 2.4 GHz frequency band and supports mesh networking, allowing
devices to communicate with each other through intermediate nodes. Zigbee iscommonly used in home
automation, industrial control, and smart energy applications.
CONNECTIONS:
TRANSMITTER:
RECEIVER:
RECEIVER SIDE:
#include<SoftwareSerial.h>
SoftwareSerial mySerial(2,3); //rx,tx
void setup() {
mySerial.begin(9600);
Serial.begin(9600);
pinMode(4, OUTPUT);
}
void loop()
{
if(mySerial.available()>0)
{
char data=mySerial.read();
Serial.println(data);
if(data=='A')
digitalWrite(4,HIGH);
else if(data=='B')
digitalWrite(4,LOW);
}
}
RESULT:
EXP NO:3
INTERFACING ARDUINO TO GSM
DATE MODULE
AIM:
To write a program to control an LED using a GSM module.
5 GSM Module 2
PROGRAM:
void loop() {
{
digitalWrite(LED, LOW);
Serial.write("LED turned OFF\n");
}
else
{
Serial.write("Select either 1 or 2");
}
}
}
import gsm def
main():
print("GSM communication")
gsm_device = gsm.GSMDevice()
gsm_device.connect()
data = gsm_device.read()
print(data)
RESULT:
EXP NO:4
INTERFACING ARDUINO TO
DATE BLUETOOTH MODULE
AIM:
To write a program to control an LED using a Bluetooth module.
THEORY:
IoT devices require reliable and efficient communication methods to transmit data and interact with
other devices or systems.
Bluetooth is a short-range wireless communication technology that operates on the 2.4 GHz frequency
band. It is commonly used for connecting IoT devices to smartphones, tablets, and other nearby devices.
Bluetooth Low Energy (BLE) is a power-efficient version of Bluetooth that is ideal for battery-powered
IoT devices. Bluetooth is widely used in applications such as wearable devices, healthcare monitoring,
and home automation
CONNECTIONS:
#include<SoftwareSerial.h>
SoftwareSerial mySerial(2,3); //rx,tx
void setup() {
mySerial.begin(9600);
Serial.begin(9600);
pinMode(4, OUTPUT);
}
void loop() {
if(mySerial.available()>0)
{
char data=mySerial.read();
Serial.println(data);
if(data=='1'){
digitalWrite(4,HIGH);
Serial.println("LED ON");
}
else if(data=='2'){
digitalWrite(4,LOW);
Serial.println("LED OFF");
}
}
}
RESULT:
EXP NO: 5 INTRODUCTION TO THE RASPBERRY PI
DATE PLATFORM AND PYTHON PROGRAMMING
AIM:
To study the basics of Arduino Uno board and Arduino IDE 2.0 software.
1 Thonny IDE 1
2 Raspberry Pi Pico Development Board 1
3 Jumper Wires few
5 IR Sensor 1
6 Ultrasonic sensor 1
The Raspberry Pi Pico W is a compact and affordable microcontroller board developed by the
Raspberry Pi Foundation. Building upon the success of the Raspberry Pi Pico, the Pico W variant
brings wireless connectivity to the table, making it an even more versatile platform for embedded
projects. In this article, we will provide a comprehensive overview of the Raspberry Pi Pico W,
highlighting its key features and capabilities.
Features:
RP2040 microcontroller with 2MB of flash memory
On-board single-band 2.4GHz wireless interfaces (802.11n)
Micro USB B port for power and data (and for reprogramming the flash)
40 pins 21mmx51mm ‘DIP’ style 1mm thick PCB with 0.1″ through-hole pins also with edge
castellations
Exposes 26 multi-function 3.3V general purpose I/O (GPIO)
23 GPIO are digital-only, with three also being ADC-capable
Can be surface mounted as a module
3-pin ARM serial wire debug (SWD) port
Simple yet highly flexible power supply architecture
Various options for easily powering the unit from micro-USB, external supplies, or batteries
High quality, low cost, high availability
Comprehensive SDK, software examples, and documentation
Dual-core Cortex M0+ at up to 133MHz
On-chip PLL allows variable core frequency
264kByte multi-bank high-performance SRAM
What is MicroPython?
MicroPython is a Python 3 programming language re-implementation targeted for microcontrollers
and embedded systems. MicroPython is very similar to regular Python. Apart from a few exceptions,
the language features of Python are also available in MicroPython. The most significant difference
between Python and MicroPython is that MicroPython was designed to work under constrained
conditions.
Because of that, MicroPython does not come with the entire pack of standard libraries. It only
includes a small subset of the Python standard libraries, but it includes modules to easily control and
interact with the GPIOs, use Wi-Fi, and other communication protocols.
Thonny IDE:
Thonny is an open-source IDE which is used to write and upload MicroPython programs to different
development boards such as Raspberry Pi Pico, ESP32, and ESP8266. It is extremely interactive and
easy to learn IDE as much as it is known as the beginner-friendly IDE for new programmers. With
the help of Thonny, it becomes very easy to code in Micropython as it has a built-in debugger that
helps to find any error in the program by debugging the script line by line.
You can realize the popularity of Thonny IDE from this that it comes pre-installed in Raspian OS
which is an operating system for a Raspberry Pi. It is available to install on r Windows, Linux, and
Mac OS.
RESULT:
EXP NO:6
INTRODUCTION TO PYTHON PROGRAMMING
DATE
4. Follow the installation wizard to complete the installation process. You just need to click “Next”.
5. After completing the installation, open Thonny IDE. A window as shown in the following figure
should open.
CONNECTIONS:
LED:
from machine import Pin
import time
LED = Pin(16, Pin.OUT)
while True:
LED.value(1)
time.sleep(1)
LED.value(0)
time.sleep(1)
CONNECTIONS:
RGB:
from machine import Pin
from time import sleep_ms,sleep
r=Pin(16,Pin.OUT)
y=Pin(17,Pin.OUT)
g=Pin(18,Pin.OUT)
while True:
r.value(1)
sleep_ms(1000)
r.value(0)
sleep_ms(1000)
y.value(1)
sleep(1)
y.value(0)
sleep(1)
g.value(1)
sleep(1)
g.value(0)
sleep(1)
CONNECTIONS:
RESULT:
EXP NO:7
INTERFACING SENSORS WITH RASPBERRY PI
DATE
AIM:
To interface the IR sensor and Ultrasonic sensor with Raspberry Pico.
1 Thonny IDE 1
2 Raspberry Pi Pico Development Board 1
3 Jumper Wires few
5 IR Sensor 1
6 Ultrasonic sensor 1
PROCEDURE
CONNECTIONS:
IR Sensor:
from machine import Pin
from time import sleep
buzzer=Pin(16,Pin.OUT)
ir=Pin(15,Pin.IN)
while True:
ir_value=ir.value()
if ir_value== True:
print("Buzzer OFF")
buzzer.value(0)
else:
print("Buzzer ON")
buzzer.value (1)
sleep(0.5)
CONNECTIONS:
def measure_distance():
trigger.low()
utime.sleep_us(2)
trigger.high()
utime.sleep_us(5)
trigger.low()
while echo.value() == 0:
signaloff = utime.ticks_us()
while echo.value() == 1:
signalon = utime.ticks_us()
while True:
dist = measure_distance()
print(f"Distance : {dist} cm")
if dist <= 10:
buzzer.value(1)
utime.sleep(0.01)
else:
buzzer.value(0)
utime.sleep(0.01)
utime.sleep(0.5)
RESULT:
EXP NO:8 COMMUNICATE BETWEEN ARDUINO AND
DATE RASPBERRY PI
AIM:
To write and execute the program to Communicate between Arduino and Raspberry PI
using any wireless medium (Bluetooth)
1 Thonny IDE 1
2 Raspberry Pi Pico Development Board 1
3 Arduino Uno Development Board 1
4 Jumper Wires few
5 Micro USB Cable 1
6 Bluetooth Module 2
PROCEDURE
CONNECTIONS:
MASTER
ARDUINO:
#include<SoftwareSerial.h>
SoftwareSerial mySerial(2,3); //rx,tx
void setup() {
mySerial.begin(9600);
}
void loop() {
mySerial.write('A');
delay(1000);
mySerial.write('B');
delay(1000);
}
CONNECTIONS:
while True:
if uart.any() > 0:
data = uart.read()
print(data)
if "A" in data:
led.value(1)
print('LED on \n')
uart.write('LED on \n')
elif "B" in data:
led.value(0)
print('LED off \n')
uart.write('LED off \n')
RESULT: