An Arduino sensors course: read the real world
Buttons and pull-ups, analog voltages and a light sensor, then I2C sensors sharing a bus and a weather station on three buses.
How you will learn it
A sensor turns something in the world into a voltage or a number, and every one of them has a way to read it wrong. This route goes from the simplest input, a button, to digital sensors on a shared bus, explaining what can go wrong at each step.
Interactive devices covers digital and analog inputs read without blocking. Talk to chips covers the I2C and SPI sensors most projects use, ending with a weather station.
What you will learn
- Read buttons reliably with a pull-up and without blocking.
- Read an analog sensor with the ADC and turn it into a decision.
- Use a light sensor as a voltage divider that moves.
- Read I2C sensors like the BME280 and log to an SD card.
The courses and lessons to take
Every lesson opens in the editor right away, signed in or not, and the simulator checks each step.
- Step 1 路 9 lessons 路 8 h
Interactive devices on the Uno
Inputs, digital and analog.
- Reading a pin, and the pull-upA button with no resistor of its own, an input that must never float, and why pressed reads low. The single most common wiring in embedded work.
- Reading a voltageThe ADC turns a voltage into a number from 0 to 1023. Build a divider, read two taps of it, and work out what a count is worth.
- Deciding from a readingA lamp that fades up when the sensor says dark, and an indicator that does not. What a threshold is, why a ramp looks better than a jump, and where hysteresis comes in.
- Step 2 路 20 lessons 路 10 h
Electronics basics
Why a light sensor is a divider.
- A light sensor is a divider that movesA light-dependent resistor changes its resistance with light. Put it in a divider and the voltage tells you how bright the room is.
- Step 3 路 7 lessons 路 4 h
Talk to chips: I2C, SPI and UART
Sensors on a bus, ending with a weather station.
- I2C: who is on the bus?Two wires, many chips: seven-bit addresses, the acknowledge bit, why I2C needs pull-up resistors, and the scanner sketch every maker runs first on a new board.
- A BME280 and an SSD1306 sharing the busA weather sensor and a screen on the same two wires, then two of each with the same addresses, kept apart by a TCA9548A multiplexer. Read a real sensor and draw on a real screen.
- Boss: a weather station on three busesA BME280 node reads the weather over I2C and sends it over an SPI radio; a gateway shows it on an I2C screen and logs every reading over UART. Every bus in the course, in one build.
Guides and tools on the same subject
Arduino ultrasonic sensor
Open itAnalog vs digital pins and ADC resolution
Open itMaker track
Follow the starter kit you already own, then build a claw machine, a balance bot, a handheld console or an LED cube, each a short course checked by the simulator.
See the whole trackQuestions people ask
Which sensors should a beginner learn first?
A button, a potentiometer and a light sensor. Together they cover digital input, analog input and the voltage divider almost every analog sensor uses.
Why does my sensor reading jump around?
Usually a floating input, noise or no averaging. The lessons show each cause and its fix.
Are there guides for specific sensors?
Yes. There are wiring and code guides for dozens of common modules, linked from each lesson and the parts pages.