McMaster University logo

SMRTTECH 3CC3 · Cloud Computing and Internet of Things

Lab 1: Introduction to LabVIEW, Tinkercad, Arduino, and Sensors

A guided interactive companion for the Lab 1 sequence: build a LabVIEW voltage-divider VI, simulate a photoresistor circuit, program an automatic lighting system, and verify the real sensor circuit.

Software: LabVIEW + Tinkercad Hardware: Arduino + photoresistor Core concept: voltage divider Deliverables: VI, quiz, tables, demos
1

Before the lab sequence

Readiness and Combined Objectives

Laboratory 1 introduces the LabVIEW graphical programming environment. Later sections apply the same voltage-divider idea to a photoresistor, Arduino analog input, LED digital output, and real-bench measurement.

Need refreshers?
LabVIEW interface · Voltage dividers · Photoresistors · Digital multimeters

Final Evidence

Submit the LabVIEW VI and quiz; show Tables 1-4 and demonstrate Exercises 4 and 5.

How to Use This Interactive Page

Auto checks

10 points

Ten concept checks with hints and retry support.

Lab record

Tables 1-4

Measurement fields save locally in this browser.

The page preserves the staged format of the original template: complete each checklist, table, and auto-graded question before advancing.

Learning Outcomes

  1. Recognize LabVIEW fundamentals: controls, indicators, VIs, SubVIs, data types, arrays, clusters, loops, and shift registers.
  2. Create a LabVIEW VI that calculates voltage-divider output.
  3. Measure how photoresistor resistance changes as light level changes.
  4. Use a voltage divider to convert resistance variation into voltage variation.
  5. Wire a sensor to Arduino A0 and an LED to digital pin 7.
  6. Program an automatic lighting system using a threshold decision.

Materials Checklist

Confirm the required materials

Gather the following software, hardware, and course resources before beginning the lab.

Concept Flow

LABVIEW VI
Calculate Vout
PHOTORESISTOR
Resistance changes
VOLTAGE DIVIDER
Voltage changes
ARDUINO ANALOG INPUT
Read analog level
LED
React to low light level

Auto-Graded Readiness Check

Answer both questions correctly before moving into the activities.

Which pair of requirements is needed for Laboratory 1? 1 point
What nickname should be used when joining the Tinkercad class? 1 point

Need refreshers?
Voltage dividers · Photoresistors

2

Laboratory 1

Introduction to LabVIEW

LabVIEW foundations

Approved Learning Resources

Begin with the linked Skill Tree topics. They explain the LabVIEW workspace and the reusable skills needed for this activity.

Voltage Divider Equation

Vout = Vin * R2 / (R1 + R2)

Calculated Vout: Enter values
Voltage divider circuit from Laboratory 1

Build the Voltage-Divider VI

Build a LabVIEW VI that represents and evaluates a voltage-divider circuit. Create an appropriate front-panel interface, add the required controls and indicators, and construct the corresponding block-diagram logic.

Completed LabVIEW voltage-divider front panel with Vin, R1, R2, Vout, Stop, student name, and student ID
Example completed front panel. Keep controls, indicators, labels, and wiring guides arranged clearly.

Beginner Build Sequence

  1. Start a blank VI. A VI is the LabVIEW program file; it has a front panel for the user interface and a block diagram for program logic.
  2. On the front panel, place three numeric controls named Vin, R1, and R2. A control supplies a value to the program.
  3. To create the boxes & arrows shown in the image, use the Controls>>Decorations tab
  4. Place one numeric indicator named Vout. An indicator displays a value calculated by the program.
  5. Open the block diagram and use arithmetic functions and wires to implement Vout = Vin × R2 ÷ (R1 + R2). Wires carry data from controls through functions to the indicator.
  6. Place the calculation inside a While Loop, add a Boolean Stop control, and wire it to the loop Stop terminal.
  7. Run the VI, change the three inputs, and confirm that Vout updates. End the program with the Stop control, not the Abort button.
  8. Add your name and student number to the front panel, then save the file with the .vi extension.

Why the While Loop is used

The While Loop repeatedly updates the voltage-divider calculation and keeps the front panel responsive while the VI runs. It continues until the programmed Stop condition is met, so the student can change inputs without pressing Run again. Stop the VI with its Stop control rather than the Abort button.

LabVIEW block diagram showing an empty While Loop and the Functions palette path to the While Loop structure
Place the While Loop from the Programming > Structures palette, then build the repeated calculation inside its border and connect a Stop control to the loop condition.

Submit the LabVIEW VI

  1. Select your completed .vi file in the HTML-page evidence dropbox below.
  2. The portal records the filename locally in this browser and in the completion JSON; it does not upload or embed the VI contents.
  3. Submit the actual .vi file through the Lab 1 Avenue to Learn submission location identified by your instructor.
  4. Complete the Lab 1 quiz on Avenue to Learn.
Your submitted VI front panel must contain your student name and ID.
Which formula should the VI implement?1 point
What information must appear on the VI front panel?1 point

Need a refresher?
Digital multimeters

3

Lab 1 - Part 2

Measure Photoresistor Resistance

Tinkercad simulation

Build Steps

  1. Go to Tinkercad and sign up for a new account.
  2. In Tinkercad, select New, then Circuit.
  3. Find a photoresistor in the component list.
  4. Place it so its two legs are in separate breadboard rows.
  5. Add a multimeter and connect the meter leads across the two photoresistor legs.
  6. Set the multimeter mode to Resistance.
  7. Record measurements at 0%, 25%, 50%, 75%, and 100% light.
Tinkercad photoresistor with multimeter resistance setup

Table 1 - Photoresistor Resistance

Light0%25%50%75%100%
PR resistance (Ω)

Record photoresistor resistance in Ω so the checkpoint validation can check for likely measurement-entry errors.

Which multimeter mode is used in Exercise 1?1 point
Which light levels are recorded in Table 1?1 point

Need a refresher?
Systematic troubleshooting

4

Lab 1 - Part 3

Simulate the Voltage Divider

4.7 kΩ resistor

Why the Divider Matters

The photoresistor changes resistance with light. The Arduino analog input reads voltage, so the divider converts resistance variation into a measurable sensor voltage.

Divider Rule

Vout = Vin * R2 / (R1 + R2)

In this sensor sequence, the fixed resistor is 4.7 kΩ and the photoresistor changes with light.

Circuit Steps

  1. Add the fixed resistor so it shares one row with the photoresistor junction.
  2. Set the resistor value to 4.7 kΩ.
  3. Connect one end of the divider to 5 V and the other end to GND.
  4. Connect Arduino 5 V and GND to the same power rails used by the divider.
  5. Measure the divider junction voltage relative to ground.
  6. Set the multimeter mode to Voltage.
Tinkercad Arduino voltage divider circuit

Table 2 - Divider Voltage

Light0%25%50%75%100%
Voltage (V)

Record measured voltage at the same light levels used in Table 1.

Submission questions

5

Checkpoint 4 · Source Manual Exercise 4

Connect and Program the Automatic Lighting System

A0 sensor + D7 LED
Photoresistor and LED connected to Arduino

Connection Steps

  1. Delete the multimeter.
  2. Connect the divider junction to Arduino Analog Input A0.
  3. Add the LED and a 220 Ω current-limiting resistor in series.
  4. Connect the LED circuit between Arduino digital output pin 7 and ground, using the correct LED polarity.
  5. Before running code, confirm common ground is shared by the divider and LED circuit.
// Add variables for the photoresistor input, LED output, sensor reading, and threshold.

void setup()
{
  // Set the LED pin mode.
}

void loop()
{
  // Read the analog value from A0.
  // Compare the value against the low-light threshold.
  // Write HIGH or LOW to the LED pin based on that comparison.
}
Tinkercad code mode interface

Program and Verify

  1. Click Code at the top right of Tinkercad.
  2. Change edit mode from Blocks to Text.
  3. Enter the automatic lighting sketch.
  4. Start the simulation and change light level.
  5. Confirm the LED turns on when the sensor reading is below 400.

Submission questions

Checkpoint 5 · Source Manual Exercise 5

Real Photoresistor Divider

Submission No report

Build the real circuit, compare calculated and measured voltage, then show the required demonstrations.

Trainer 5 V Photoresistor 4.7 kΩ Multimeter Dark / normal / flashlight

Equipment Required

  • Trainer board with internal power supply - quantity 1
  • Photoresistor - quantity 1
  • 4.7 kΩ resistor, 0.25 Watt - quantity 1
  • Multimeter - quantity 1

Measurement Conditions

  1. Dark: cover the top surface of the sensor with your finger.
  2. Normal light: use the ambient room condition.
  3. Flashlight: shine your phone flashlight on the sensor surface.

Tables 3 and 4

LightDarkNormalFlashlight
Total resistance (kΩ)
LightDarkNormalFlashlight
Voltage (V) calculated
Voltage (V) measured

Use the voltage-divider rule for calculated values, then use a voltmeter to measure sensor voltage under the same conditions and compare the evidence.

Final External Confirmations

Use these only for requirements the portal cannot verify automatically.

Submission rules

  1. Laboratory 1: select the .vi evidence on the Submission subpage, submit the actual VI through Avenue to Learn, and complete the Lab 1 quiz.
  2. No separate report is required for the photoresistor demonstration sequence unless your instructor requests one.
  3. Show Tables 1-4 to the lab instructor.
  4. Demonstrate Checkpoint 4: Automatic Lighting System and Checkpoint 5: Real Photoresistor Divider to the lab instructor.

Learning Outcomes Achieved

  • Built and tested a LabVIEW VI with front-panel controls, an indicator, block-diagram arithmetic, and a responsive While Loop.
  • Measured photoresistor resistance and used a voltage divider to convert changing resistance into a measurable voltage.
  • Connected Arduino analog input A0 and digital output D7, then tested threshold-based automatic lighting.
  • Compared calculated and measured real-circuit values and presented traceable evidence for instructor review.