Loading the figure…
Stopped · Your code isn't running yet. Until you press Run, the board runs the program already on it.
Nothing printed yet. Press Run.
Not checked yet
Run your code to check it. The checks replay a fixed script on a virtual clock, so the same code always gets the same result.
Each fault really happens in the simulation. Trigger one, watch the figure, then read why.
Play the world: press, slide and turn the parts while the code runs.
Change a value here or click a chip in the code.
Full speed above the limit, off below it.
A TMP36 turns temperature into a voltage. The sketch converts it to degrees and switches on a fan through a transistor when it gets too warm.
| Pin | Connects to | What it does |
|---|---|---|
5V | The TMP36's +VS leg | Powers the sensor, and the fan. |
A0 | The TMP36's middle leg (VOUT) | Reads the temperature as a voltage. |
GND1 | The TMP36's GND leg | Ground. |
D6 | 1 kΩ resistor, then the transistor's base | Switches the fan. |
Sensors and actuators this board drives, with the real connections.
Ends to GND and 5V, the middle leg (wiper) to A0. analogRead(A0) then goes from 0 to 1023 as you turn it.
| Part pin | Board pin |
|---|---|
| 1 | GNDWire colour black |
| 2 | A0Wire colour green |
| 3 | 5VWire colour red |
From 5V to A0, with a 10 kΩ resistor from A0 to GND. More light, lower resistance, higher reading.
| Part pin | Board pin |
|---|---|
| 1 | 5VWire colour red |
| 2 | A0Wire colour green |
Flat face toward you: left leg 5V, middle leg to A0, right leg GND. Degrees C = (volts − 0.5) × 100.
| Part pin | Board pin |
|---|---|
| VS | 5VWire colour red |
| VOUT | A0Wire colour green |
| GND | GNDWire colour black |
Base through a 1 kΩ resistor to a PWM pin, emitter to GND, the load from 5 V (or its own supply) to the collector.
| Part pin | Board pin |
|---|---|
| B | D6Wire colour orange |
| E | GNDWire colour black |
A motor or fan needs a 1N4007 diode across it, band toward the + supply, or switching it off sends a voltage spike into the transistor.
AOUT to A0, VCC to 5V, GND to GND. The reading falls as the soil gets wetter.
| Part pin | Board pin |
|---|---|
| AOUT | A0Wire colour yellow |
| VCC | 5VWire colour red |
| GND | GNDWire colour black |
One leg to 5V, the other to A0, with a 10 kΩ pull-down from A0 to GND. Press harder, read higher.
| Part pin | Board pin |
|---|---|
| 1 | 5VWire colour red |
| 2 | A0Wire colour green |