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.
More faults on this board
Play the world: press, slide and turn the parts while the code runs.
Change a value here or click a chip in the code.
PWM fakes an analog output: D9 switches on and off 490 times a second, and the share of time it is on sets the LED's brightness. The knob on A0 chooses that share.
| Pin | Connects to | What it does |
|---|---|---|
D9 | Resistor → LED anode (+) | Carries the PWM signal. |
A0 | Knob wiper | Sets the brightness. |
5V | One end of the knob | The top of the divider. |
GND | LED cathode and the knob | The common return. |
Sensors and actuators this board drives, with the real connections.
A 5 mm LED from a PWM pin through a 220 Ω resistor: about 12 mA on USB, bright and safe.
| Part pin | Board pin |
|---|---|
| A | D9Wire colour orange |
| K | GNDWire colour black |
Never without the resistor: an LED straight on a pin pulls far more than the 40 mA maximum and kills the pin or the LED.
A 10 kΩ knob as a voltage divider: ends to GND and 5V, wiper to A0. analogRead gives 0-1023.
| Part pin | Board pin |
|---|---|
| 1 | GNDWire colour black |
| 2 | A0Wire colour yellow |
| 3 | 5VWire colour red |
A light-dependent resistor from 5V to A0 plus a 10 kΩ resistor from A0 to GND: more light, higher reading.
| Part pin | Board pin |
|---|---|
| 1 | 5VWire colour red |
| 2 | A0Wire colour yellow |
Signal on D9 with the Servo library (it takes Timer1, so PWM on D10 stops too).
| Part pin | Board pin |
|---|---|
| SIG | D9Wire colour orange |
| GND | GNDWire colour brown |
Feed the red wire from a separate 5 V supply whose GND joins the Nano's GND. A stalling servo pulls about 1 A, which browns out the Nano on USB and trips the polyfuse.