Microcontrollers – sensors driving an LED and a motor
Design & TechnologyElectronics & MicrocontrollersAges 17–18Virtual lab
How do you mainly use this simulation?
Use it with your class: students open it from a link or a QR code, with no account needed.
A circuit with a microcontroller, a light sensor, a push button, a temperature sensor, one LED and one small motor. Pick a sample program (auto light by brightness, timed blink, button toggle, or temperature-controlled fan), then drag the light or temperature slider or press the button to watch the microcontroller read the input, compare it with a threshold, and drive an output pin. The block-program panel highlights the instruction being executed, and the chart below logs the output state over time. A Connected (IoT) view turns the board into a smart greenhouse: a soil moisture sensor sends readings over a network to a server and an app dashboard, and a rule on the server opens a watering valve. Set the sampling interval, the network delay and the privacy setting, then record the delay, the data sent and what the dashboard shows.
Lesson: Microcontrollers and applications: structure, digital input/output signals, sensors, actuators, and control programs
What it shows
A microcontroller is a small computer on a single chip that runs one program in an endless loop: read the inputs, make a decision, set the outputs. In the circuit view a light sensor, a temperature sensor and a push button feed its input pins, and output pins switch an LED or a motor on (1) or off (0). The Connected (IoT) view adds a network: a greenhouse sensor sends soil moisture readings to a server, a rule there opens a watering valve, and an app shows the data. The sampling interval and the network delay decide how quickly the system reacts, and the privacy setting decides what is collected, where it is stored and who can see it.
How to use
Pick a program with the Auto light, Blink, Push button or Auto fan buttons and drag the sliders across the Threshold. Then press Connected (IoT): set Sampling interval, Network delay and Privacy setting, press Run and watch readings travel to the server and commands return to the valve. Press Record run after each run and answer the tasks.
Parameters you can change
- Sample program Auto light: LED on when light < threshold, Blink LED on a timer, Push button toggles LED, Auto fan: motor runs when temperature > threshold
- Sensor threshold (% light or °C) 10–60
- Blink period 200–3000 ms
- Show program block diagram
- View Circuit and sample programs, Connected greenhouse (IoT)
- Sampling interval (IoT view) 1–60 s
- Network delay, one way (IoT view) 10–5000 ms
- Privacy setting (IoT view) Local only, Cloud, owner only, Cloud and public map
Questions to explore
- In the Auto light program, which component is the input, which is the output, and what decision does the program make?
- If you raise the threshold from 30 to 50, does the LED switch on earlier or later as the light fades?
- With a blink period of 1000 ms, how long is the LED on in each cycle, and what is the blink frequency?
- Why does a longer sampling interval save data but let the soil dry further before the valve opens?