IoT Virtual LabNIELIT Gorakhpur
Student sign-in Teacher sign-in

NIELIT Gorakhpur · IoT Virtual Lab

Lab manual

23 experiments, from lighting your first LED to sending sensor data over WiFi and testing access-control security. Each one has the aim, parts, connections, theory, step-by-step procedure, what you should see, an observation table and viva questions. Press Open in the lab to load the ready-made circuit.

How to use the lab

  1. Open an experiment. Press Open in the lab. The circuit and code load in the editor.
  2. See the code. Press Code. Switch between Blocks and Text (C++) at the top of the code panel.
  3. Run it. Press Start simulation. While it runs, click sensors, knobs and buttons to change them.
  4. Watch the outputs. Use the Serial monitor, the Plotter and, for WiFi parts, the Network tab under the code.
  5. Change and save. Stop, edit the code or circuit, run again. Sign in and press Save to keep your work in My projects.

You can try every experiment without signing in. To save work, hand in assignments or use the IoT dashboard, sign in with your class code from your teacher.

Your lab record

Write each experiment in your practical file under these headings:

  1. Aim
  2. Components used
  3. Theory (in your own words)
  4. Circuit / connections
  5. Procedure
  6. Observation table
  7. Result
  8. Precautions for the real circuit

Precautions to remember for real hardware: always use a series resistor with an LED; never connect 5 V to a 3.3 V ESP pin; switch motors and lamps through a transistor or relay, never straight from a pin; disconnect power before changing wiring.

Unit 1 · Getting started

Circuits, digital outputs and inputs, and the serial monitor.

Experiment 1

LED and battery (no code)

BeginnerAbout 15 min

Open in the lab

Aim

To light an LED from a battery through a current-limiting resistor on a breadboard, and to see why the resistor is needed.

Components

  • 9 V battery
  • Resistor
  • LED
  • Breadboard

Theory

An LED needs only about 2 V and 10–20 mA. The resistor drops the rest of the battery voltage and limits the current: R = (Vbattery − VLED) / I. Without it the current would be far too high and a real LED would burn out.

Procedure

  1. Open the experiment with Open in the lab.
  2. Press Start simulation. No code is needed: this is a plain circuit.
  3. Click the resistor and change its value. Watch the LED brightness.
  4. Click the LED and note the current shown in its panel, if shown.
  5. Stop the simulation.

What you should see

The LED lights. A smaller resistor makes it brighter; a larger one makes it dimmer.

Observation table

S. No.Resistor (Ω)Observation
1220
2470
31 k
410 k

Try this

  • Work out the resistor for 15 mA from 9 V with a 2 V LED (≈ 470 Ω).
  • Turn the LED round. Does it light? Why?

Viva questions

Why does an LED need a series resistor?

To limit the current; otherwise the LED and the source can be damaged.

What happens if the LED is reversed?

It does not conduct, so it stays off: an LED is a diode and conducts in one direction only.

Experiment 2

Blink an LED (blocks)

BeginnerAbout 15 min

Open in the lab

Aim

To switch an LED on pin 13 on and off every second using code blocks.

Components

  • Arduino Uno
  • Breadboard
  • LED
  • Resistor

Connections

PartArduino / board pin
LED (through resistor)D13

Theory

A digital pin is either HIGH (5 V) or LOW (0 V). digitalWrite(13, HIGH) turns the LED on; a wait keeps it on before it is switched off again. setup() runs once, loop() runs forever.

Procedure

  1. Open the experiment and press Code to see the blocks.
  2. Press Start simulation. The LED blinks once per second.
  3. Stop. Change the wait from 1 s to 0.2 s and run again.
  4. In the code panel switch from Blocks to Text to see the same program in C++.
  5. Press Save if you are signed in.

What you should see

The LED on pin 13 (and the small "L" LED on the board) blinks at the rate you set.

Try this

  • Make it blink SOS in Morse code (··· ––– ···).
  • Use two LEDs that blink alternately.

Viva questions

What does pinMode(13, OUTPUT) do?

It makes pin 13 an output so the program can drive it HIGH or LOW.

Why does loop() repeat?

The Arduino keeps calling it forever after setup(), so the blink continues.

Experiment 3

Traffic light

BeginnerAbout 20 min

Open in the lab

Aim

To control three LEDs in a timed sequence like a traffic signal.

Components

  • Arduino Uno
  • Breadboard
  • Red, yellow and green LEDs
  • 3 resistors

Connections

PartArduino / board pin
Red LEDD12
Yellow LEDD11
Green LEDD10

Theory

Each LED has its own output pin. The program switches one LED on, waits with delay(), switches it off and moves to the next, which gives a fixed sequence.

Procedure

  1. Open the experiment and press Code.
  2. Start the simulation and time each colour.
  3. Find the delay() lines and match each one to a colour.
  4. Change the timings to red 5 s, green 4 s, yellow 1 s, and run again.

What you should see

The LEDs light one at a time in the order red → green → yellow, with the times set in the code.

Observation table

S. No.LightObservation
1Red
2Green
3Yellow

Try this

  • Add a pedestrian button that starts the red phase early.
  • Print STOP, GO and WAIT on the serial monitor.

Viva questions

What does delay(1000) do?

It pauses the program for 1000 ms = 1 s.

Why is delay() a problem in larger programs?

Nothing else can happen while it waits; millis() timing avoids this.

Experiment 4

Push button and LED

BeginnerAbout 20 min

Open in the lab

Aim

To read a push button as a digital input and switch an LED with it.

Components

  • Arduino Uno
  • Push button
  • LED
  • Resistor

Connections

PartArduino / board pin
Push buttonD2 and GND
Blue LEDD9

Theory

With INPUT_PULLUP the pin is held HIGH by an internal resistor. Pressing the button connects it to GND, so it reads LOW. "Pressed" therefore means LOW.

Procedure

  1. Open the experiment and start the simulation.
  2. Click and hold the button: the LED lights. Release it: the LED goes off.
  3. Read the code and find digitalRead(2) and the comparison with LOW.

What you should see

The LED is on only while the button is held.

Try this

  • Make the button toggle the LED (press once on, press again off).
  • Count presses and print the count on the serial monitor.

Viva questions

Why is INPUT_PULLUP used?

So the pin has a defined HIGH level when the button is open, without an external resistor.

What is switch bounce?

A real contact opens and closes several times in a few ms when pressed; code adds a short delay to ignore it.

Experiment 5

Serial monitor: echo

BeginnerAbout 10 min

Open in the lab

Aim

To send text from the computer to the Arduino and back using the serial monitor.

Components

  • Arduino Uno

Theory

Serial communication sends data one bit at a time over TX/RX at a set speed (9600 baud here). Serial.available() tells the program that data has arrived.

Procedure

  1. Open the experiment and start the simulation.
  2. In the Serial monitor box type hello and press Send.
  3. Watch the reply and the board LED.

What you should see

The Arduino answers "You typed: hello" and the built-in LED changes state each time.

Try this

  • Reply with the length of the text.
  • Switch an LED on when you type on and off with off.

Viva questions

What is a baud rate?

The number of symbols per second on the serial line; both ends must use the same value.

Which pins carry serial data on the Uno?

D0 (RX) and D1 (TX).

Unit 2 · Analog and PWM

Read voltages, make "analog" outputs with PWM, sound and motion.

Experiment 6

Fade an LED with PWM

BeginnerAbout 15 min

Open in the lab

Aim

To change LED brightness smoothly using pulse-width modulation.

Components

  • Arduino Uno
  • LED
  • Resistor

Connections

PartArduino / board pin
Blue LEDD9 (PWM ~)

Theory

A Uno cannot output a true analog voltage. PWM switches the pin on and off very fast; the fraction of time it is on (the duty cycle) sets the average voltage. analogWrite(pin, 0…255) sets the duty cycle. Only pins marked ~ (3, 5, 6, 9, 10, 11) support PWM.

Procedure

  1. Open the experiment and start the simulation.
  2. Watch the LED fade up and down.
  3. In the code, change the step size and see the speed change.

What you should see

The LED brightness rises and falls repeatedly.

Observation table

S. No.analogWrite valueObservation
10
264
3128
4255

Try this

  • Fade two LEDs in opposite directions.
  • Use pin 8 instead of 9. What happens, and why?

Viva questions

What does analogWrite(9, 128) give?

About 50 % duty cycle, an average of about 2.5 V.

Why can pin 8 not fade?

It has no PWM hardware; it can only be fully on or off.

Experiment 7

Potentiometer and analogRead

BeginnerAbout 20 min

Open in the lab

Aim

To read a potentiometer with the ADC and use it to set LED brightness.

Components

  • Arduino Uno
  • Potentiometer
  • LED
  • Resistor

Connections

PartArduino / board pin
Potentiometer wiperA0
LEDD10 (PWM ~)

Theory

The 10-bit ADC turns 0–5 V into a number from 0 to 1023. Voltage = value × 5 / 1023. Dividing the value by 4 gives 0–255 for analogWrite().

Procedure

  1. Open the experiment and start the simulation.
  2. Click the knob and move its slider.
  3. Read the value and voltage in the serial monitor.
  4. Fill in the table for four knob positions.

What you should see

The serial monitor shows the value (0–1023) and the voltage; the LED gets brighter as the value rises.

Observation table

S. No.ADC valueObservation
10
2256
3512
41023

Try this

  • Use the Plotter tab to graph the value.
  • Light a second LED when the value is above 800.

Viva questions

What is the resolution of the Uno ADC?

10 bits: 1024 steps, about 4.9 mV per step at 5 V.

Why divide by 4 before analogWrite()?

analogRead gives 0–1023 but analogWrite takes 0–255.

Experiment 8

Measure PWM with an oscilloscope

IntermediateAbout 25 min

Open in the lab

Aim

To observe a PWM waveform on the virtual oscilloscope and measure its average voltage with the multimeter.

Components

  • Arduino Uno
  • Potentiometer
  • LED
  • Oscilloscope
  • Multimeter

Connections

PartArduino / board pin
PotentiometerA0
LED / scope / meterD9 (PWM ~)

Theory

The oscilloscope shows the voltage against time, so you can see the pulses. The multimeter shows their average. The average equals 5 V × duty cycle.

Procedure

  1. Open the experiment and start the simulation.
  2. Turn the knob and watch the pulse width change on the oscilloscope.
  3. Compare the multimeter reading with 5 × (duty cycle).
  4. Open the Plotter tab to see the values over time.

What you should see

Wider pulses give a higher multimeter reading and a brighter LED.

Observation table

S. No.Duty cycle (%)Observation
125
250
375
4100

Try this

  • Change the oscilloscope time per division and measure the PWM period (about 2 ms on pin 9).

Viva questions

What is duty cycle?

The percentage of each period for which the signal is HIGH.

Why does the multimeter show a steady value?

It averages the fast pulses.

Experiment 9

Play a tune on a buzzer

BeginnerAbout 15 min

Open in the lab

Aim

To generate musical notes with tone() on a piezo buzzer.

Components

  • Arduino Uno
  • Piezo buzzer

Connections

PartArduino / board pin
BuzzerD8

Theory

tone(pin, frequency, duration) makes a square wave at the given frequency. Higher frequency means a higher note (A4 = 440 Hz).

Procedure

  1. Turn on your computer sound.
  2. Open the experiment and start the simulation.
  3. Find the note frequencies in the code and change one.

What you should see

The buzzer plays a short tune.

Try this

  • Play the first line of "Happy Birthday".
  • Use a potentiometer to set the pitch.

Viva questions

What does noTone() do?

It stops the sound on that pin.

Why does a piezo buzzer need a changing signal?

The crystal moves only when the voltage changes, so it needs a square wave to make sound.

Experiment 10

Servo sweep

BeginnerAbout 15 min

Open in the lab

Aim

To position a servo motor at angles from 0° to 180° using the Servo library.

Components

  • Arduino Uno
  • Micro servo

Connections

PartArduino / board pin
Servo signalD9

Theory

A servo reads a pulse every 20 ms. The pulse width (about 0.5–2.5 ms) sets the angle. myServo.write(angle) produces the right pulse.

Procedure

  1. Open the experiment and start the simulation.
  2. Watch the arm sweep and the angle printed on the serial monitor.
  3. Change the step from 10° to 30°.

What you should see

The servo sweeps from 0° to 180° and back.

Try this

  • Set the angle with a potentiometer (use map()).

Viva questions

What is the difference between a servo and a DC motor?

A servo turns to a set angle with feedback; a DC motor just spins.

What does map(v,0,1023,0,180) do?

It scales a reading from 0–1023 to 0–180.

Unit 3 · Sensors and displays

Measure light, temperature, humidity and distance; show the results.

Experiment 11

Night light with an LDR (blocks)

BeginnerAbout 20 min

Open in the lab

Aim

To switch an LED on automatically when it gets dark, using a light sensor.

Components

  • Arduino Uno
  • Light sensor module (LDR)
  • LED
  • Resistor

Connections

PartArduino / board pin
LDR output (AO)A0
White LEDD9

Theory

An LDR's resistance changes with light. The module turns this into a voltage on A0. The program compares the reading with a threshold and switches the LED.

Procedure

  1. Open the experiment and look at the blocks.
  2. Start the simulation and click the light sensor.
  3. Move its light slider down (dark) and up (bright).
  4. Find the threshold in the blocks and change it.

What you should see

The LED switches on when the light level falls past the threshold.

Observation table

S. No.Light levelObservation
1Bright
2Dim
3Dark

Try this

  • Make the LED brightness follow the darkness with PWM.

Viva questions

What is a threshold?

The value at which the program changes its decision (on/off).

Why add a small gap (hysteresis) around the threshold?

So the light does not flicker on and off near the limit.

Experiment 12

LM35 temperature sensor

BeginnerAbout 20 min

Open in the lab

Aim

To measure temperature with an LM35 and warn when it reaches 40 °C.

Components

  • Arduino Uno
  • LM35
  • Green and red LEDs
  • Resistors

Connections

PartArduino / board pin
LM35 outputA0
Green LEDD12
Red LEDD13

Theory

The LM35 gives 10 mV per °C. Celsius = (reading × 5.0 / 1023) × 100.

Procedure

  1. Open the experiment and start the simulation.
  2. Click the LM35 and move its temperature slider.
  3. Compare the serial monitor value with the slider.
  4. Find LIMIT_C and change it to 35.

What you should see

The serial monitor shows the temperature; green is on below the limit, red at or above it.

Observation table

S. No.Set temperature (°C)Observation
120
230
340
450

Try this

  • Show °F as well (F = C × 9/5 + 32).
  • Add a buzzer alarm above the limit.

Viva questions

What is the LM35 scale factor?

10 mV per °C.

What is the smallest temperature step the Uno can resolve with the LM35 at 5 V?

About 0.49 °C (4.9 mV per ADC step).

Experiment 13

Weather station with LCD

IntermediateAbout 25 min

Open in the lab

Aim

To read temperature and humidity from a DHT22 and show them on a 16×2 I2C LCD.

Components

  • Arduino Uno
  • DHT22
  • 16×2 LCD with I2C

Connections

PartArduino / board pin
DHT22 dataD2
LCD SDAA4
LCD SCLA5

Theory

The DHT22 sends its readings as a digital signal on one wire. The LCD uses I2C: two wires (SDA, SCL) and an address (0x27).

Procedure

  1. Open the experiment and start the simulation.
  2. Click the DHT22 and change temperature and humidity.
  3. Watch the LCD and serial monitor update.

What you should see

The LCD shows "Temp" and "Humidity" with the values you set.

Observation table

S. No.Temp / Humidity setObservation
125 °C / 40 %
230 °C / 60 %
335 °C / 80 %

Try this

  • Show a "Hot!" message above 30 °C.
  • Work out and show the heat index.

Viva questions

How many wires does I2C use?

Two: SDA (data) and SCL (clock), plus power and ground.

Why is the DHT22 read only every 2 s?

It needs about 2 s between readings.

Experiment 14

Parking sensor (blocks)

IntermediateAbout 25 min

Open in the lab

Aim

To measure distance with an ultrasonic sensor and beep faster as an object gets closer.

Components

  • Arduino Uno
  • HC-SR04 ultrasonic sensor
  • Buzzer
  • LED

Connections

PartArduino / board pin
Ultrasonic TRIG / ECHOD9 / D10
BuzzerD8
Red LEDD12

Theory

The sensor sends a 40 kHz pulse and times the echo. Distance (cm) = time (µs) × 0.0343 / 2.

Procedure

  1. Open the experiment and look at the blocks.
  2. Start the simulation, click the sensor and move the distance slider.
  3. Note the distance at which beeping starts.

What you should see

The buzzer and LED warn when the object is close.

Observation table

S. No.Distance (cm)Observation
1100
250
320
45

Try this

  • Make the beep rate depend on the distance.

Viva questions

Why divide by 2?

The sound travels to the object and back.

What is the speed of sound used?

About 343 m/s, i.e. 0.0343 cm/µs.

Experiment 15

OLED meter

IntermediateAbout 20 min

Open in the lab

Aim

To show a potentiometer reading as a number and a bar graph on a 128×64 OLED.

Components

  • Arduino Uno
  • Potentiometer
  • SSD1306 OLED (I2C)

Connections

PartArduino / board pin
PotentiometerA0
OLED SDA / SCLA4 / A5

Theory

The Adafruit SSD1306 library draws into memory; display.display() sends the picture to the screen over I2C (address 0x3C).

Procedure

  1. Open the experiment and start the simulation.
  2. Turn the knob and watch the number and the bar.
  3. Find map(value, 0, 1023, 0, 124) and explain it.

What you should see

The OLED shows the value in large digits and a bar that grows with it.

Try this

  • Show the voltage instead of the raw value.

Viva questions

What does clearDisplay() do?

It clears the drawing memory before the next frame.

What is the I2C address of the OLED?

0x3C.

Experiment 16

Temperature-controlled fan

IntermediateAbout 25 min

Open in the lab

Aim

To control a fan's speed from the temperature, using a transistor and PWM.

Components

  • Arduino Uno
  • LM35
  • NPN transistor
  • 5 V fan
  • Resistor (1 kΩ)

Connections

PartArduino / board pin
LM35A0
Transistor base (1 kΩ)D9 (PWM ~)

Theory

An Arduino pin cannot supply a motor's current. The transistor acts as a switch driven by PWM. Below 30 °C the fan is off, from 30 to 40 °C it speeds up, above 40 °C it runs at full speed.

Procedure

  1. Open the experiment and start the simulation.
  2. Click the LM35 and move the temperature from 25 to 45 °C.
  3. Note the fan speed at each step.

What you should see

The fan starts at 30 °C and reaches full speed at 40 °C.

Observation table

S. No.Temperature (°C)Observation
125
232
336
442

Try this

  • Change the start temperature to 28 °C.

Viva questions

Why use a transistor?

The pin gives at most about 20–40 mA; the transistor switches the larger motor current.

Why is a diode used across a real motor?

To absorb the voltage spike when the motor is switched off.

Unit 4 · IoT and WiFi

Send readings to the IoT dashboard and control things from it.

Experiment 17

IoT weather station (WiFi)

IntermediateAbout 30 min

Open in the lab

Aim

To send DHT22 readings over WiFi (ESP-01) to a channel on the IoT dashboard.

Components

  • Arduino Uno
  • ESP-01 WiFi module
  • DHT22

Connections

PartArduino / board pin
ESP-01 TX / RXD2 / D3
ESP-01 VCC3.3 V
DHT22 dataD4

Theory

The Uno talks to the ESP-01 with AT commands over a serial link. The ESP-01 sends an HTTP request with a write key and the values as field1, field2.

Procedure

  1. Sign in. Open IoT dashboard and create a channel with field 1 Temperature and field 2 Humidity. Copy the write key.
  2. Open the experiment, press Code and paste the key into the WiFi/send blocks.
  3. Start the simulation and wait for the first send.
  4. Watch the readings and charts appear on the IoT dashboard.

What you should see

New entries appear on the dashboard; change the DHT22 values and see the chart follow.

Try this

  • Open the Network tab and find your key in the plain-HTTP request. Then switch the block to HTTPS and compare.

Viva questions

What is a write key for?

It proves the device may add data to that channel.

Why is plain HTTP risky?

Anyone on the same network can read the request, including the key.

Experiment 18

IoT remote switch

IntermediateAbout 25 min

Open in the lab

Aim

To switch a lamp through a relay from a switch on the IoT dashboard.

Components

  • Arduino Uno
  • ESP-01
  • Relay
  • Lamp

Connections

PartArduino / board pin
RelayD7

Theory

The Arduino regularly reads the last value of field 5 with the channel's read key; 1 means on, 0 means off.

Procedure

  1. On the IoT dashboard create a channel with field 5 set to Switch.
  2. Open the experiment and enter the channel number and read key in the code.
  3. Start the simulation, then flip the switch on the dashboard.

What you should see

A few seconds after you flip the switch, the relay clicks and the lamp follows.

Try this

  • Show the switch state on an LED too.

Viva questions

Why is there a delay before the lamp changes?

The Arduino checks the dashboard at intervals (polling).

Why use a read key and not the write key?

A device that only reads should not be able to change data (least privilege).

Experiment 19

ESP32 on its own

IntermediateAbout 25 min

Open in the lab

Aim

To program an ESP32 directly (no Uno) to blink an LED, read a knob and send it over WiFi.

Components

  • ESP32 DevKit
  • LED
  • Potentiometer

Connections

PartArduino / board pin
LEDGPIO2
PotentiometerGPIO34

Theory

In ESP32 mode the board runs the sketch itself. analogRead() gives 0–4095 (12 bits). The sketch joins the lab WiFi and sends the value to field 1.

Procedure

  1. Create an IoT channel and copy its write key.
  2. Open the experiment and paste the key into WRITE_KEY.
  3. Start the simulation; click the knob and change it.
  4. Check the dashboard for new values.

What you should see

The LED blinks, the serial monitor shows the readings and the dashboard receives them.

Try this

  • Compare the same task on a Uno: pins, analogRead range and libraries.

Viva questions

What range does the ESP32 ADC give?

0–4095 (12 bits).

Why do these boards use 3.3 V logic?

The ESP chips run at 3.3 V; 5 V signals can damage real pins.

Experiment 20

NodeMCU weather station

IntermediateAbout 25 min

Open in the lab

Aim

To build a WiFi weather station on a NodeMCU (ESP8266) with an LCD.

Components

  • NodeMCU
  • DHT22
  • 16×2 I2C LCD

Connections

PartArduino / board pin
DHT22 dataD5
LCD SDA / SCLD2 / D1

Theory

The NodeMCU runs the sketch itself with ESP8266 libraries. It reads the DHT22 every 2 s, shows the values on the LCD and sends them every 20 s.

Procedure

  1. Create an IoT channel and copy its write key.
  2. Open the experiment and paste the key.
  3. Start the simulation; change the DHT22 values.

What you should see

The LCD shows the readings and the dashboard updates every 20 s.

Try this

  • Light the board LED (D0) while sending — check the code.

Viva questions

Why does the board LED light when the pin is LOW?

It is wired to 3.3 V, so a LOW pin completes the circuit (active-low).

Unit 5 · Security and wireless control

Access control and Bluetooth, and the weaknesses to watch for.

Experiment 21

Keypad door lock

IntermediateAbout 25 min

Open in the lab

Aim

To open a lock with a PIN on a 4×4 keypad and block guessing after 3 wrong tries.

Components

  • Arduino Uno
  • 4×4 keypad
  • Relay and solenoid lock
  • Buzzer
  • Green and red LEDs

Connections

PartArduino / board pin
RelayD10
BuzzerD11
Green / red LEDD12 / D13

Theory

A keypad is a matrix: the program scans rows and columns to find the pressed key. After 3 wrong PINs the keypad locks for 30 s, which makes trying all 10,000 four-digit PINs too slow (protection against brute force).

Procedure

  1. Open the experiment and start the simulation.
  2. Type 2580 and press #: the lock opens.
  3. Type a wrong PIN three times and see the lockout.
  4. Change SECRET_PIN in the code.

What you should see

Right PIN: green LED and the lock opens. Wrong PIN: red LED and a beep; 3 wrong: 30 s lockout.

Try this

  • Work out how long trying all 10,000 PINs would take with the lockout.

Viva questions

What is a brute-force attack?

Trying every possible password until one works.

Why should the PIN not be 1234 or 0000?

They are the first ones an attacker tries.

Experiment 22

RFID access control

IntermediateAbout 25 min

Open in the lab

Aim

To allow only listed RFID cards to open a door, and to see why checking only the UID is weak.

Components

  • Arduino Uno
  • RC522 RFID reader
  • Relay
  • Buzzer
  • LEDs

Connections

PartArduino / board pin
RC522 SS / RSTD10 / D9
Green / red LEDD7 / D6
BuzzerD5
RelayD4

Theory

Each card has a UID. The sketch compares it with an allowed list. The UID is not secret, so a copied card with the same UID also gets in; secure systems use cards with cryptographic authentication.

Procedure

  1. Open the experiment and start the simulation.
  2. In the reader's settings, present an allowed card, then an unknown card.
  3. Present the Copied card and note the result.

What you should see

Allowed and copied cards open the door; unknown cards are refused.

Try this

  • Add a second factor: a PIN on a keypad after the card.

Viva questions

Why is a UID-only check insecure?

UIDs can be read and copied, so they prove nothing about the card.

Experiment 23

Bluetooth LED control

BeginnerAbout 20 min

Open in the lab

Aim

To switch an LED from a phone through an HC-05 Bluetooth module.

Components

  • Arduino Uno
  • HC-05
  • Green and red LEDs

Connections

PartArduino / board pin
HC-05 STATED4
Green LEDD12
Red LED (paired)D13

Theory

The HC-05 is a serial-to-Bluetooth bridge: bytes sent from the phone arrive at the Arduino as serial data.

Procedure

  1. Open the experiment and start the simulation.
  2. Click the HC-05 and tick Phone paired.
  3. In the Bluetooth terminal send 1 and then 0.

What you should see

Sending 1 turns the green LED on, 0 turns it off; the red LED is on while paired.

Try this

  • Add a status command that replies with the LED state.

Viva questions

Why is a voltage divider used on the HC-05 RXD in real circuits?

Its RXD takes 3.3 V; the divider brings the Uno's 5 V down.

Copyright NIELIT Gorakhpur · Open the lab · Policies · Open-source notices · Back to top