How Ultrasonic Distance Sensors Work (HC-SR04)
The physics behind the HC-SR04, how to wire it to an Arduino, code that converts echo time to centimeters, and how to get stable readings.
→ µs ÷ 58 = cm
section 3, the orange band
How distance, temperature and motion sensors really work.
The physics behind the HC-SR04, how to wire it to an Arduino, code that converts echo time to centimeters, and how to get stable readings.
→ µs ÷ 58 = cm
Accuracy, wiring, code and best uses for the three most popular hobby temperature sensors, so you can pick the right one for your project.
→ reads -127 °C? missing 4.7k pull-up
How passive infrared sensors detect people, how to set the HC-SR501 sensitivity and delay knobs, and code for a motion-activated light.
→ wait 60 s before trusting it
How potentiometers and analog thumb joysticks work, how to wire and read them, and how to add a dead zone and smoothing for steady control.
→ joystick center isn't exactly 512, add a dead zone
How photoresistors and the BH1750 digital light sensor work, how to wire and read each, and which one to choose for night lights, logging or measuring lux.
→ LDR gives brighter/darker, BH1750 gives real lux
How Hall effect sensors detect magnets, the difference between digital switches like the A3144 and linear sensors like the 49E, with wiring and Arduino code for both.
→ the flat face must see the magnet
How resistive and capacitive soil moisture sensors work, why the cheap forked ones corrode, how to wire and calibrate each with Arduino, and which one to buy.
→ calibrate dry and wet, every sensor differs
Build a digital scale with a bar load cell and the HX711 amplifier: how load cells work, wiring, mounting, a calibration sketch and code that reads weight in grams.
→ Calibrate with a known weight, every time
Read any TV-style infrared remote with a VS1838B or TSOP receiver, find the code of each button, and use them to switch LEDs or relays. Wiring, IRremote library code and troubleshooting.
→ Read your remote's codes first, then use them
How a rotary encoder's quadrature signals show direction, wiring the KY-040 module, and reliable Arduino code using interrupts and a state table that never skips or double-counts, plus the push button.
→ Two pins, a quarter step apart, tell you the direction
Wire a DHT11 or DHT22 sensor to an Arduino, read temperature and humidity with the Adafruit DHT library, avoid the NaN error, and choose between the two sensors. Wiring table, code and fixes.
→ Read no faster than once every 2 seconds
How the 4-pin KY-024 Hall effect module works, what the A0, G, + and D0 pins do, how to set the threshold potentiometer, and Arduino code that reads both outputs and detects either magnet pole.
→ set the trimmer just past the switching point
How the JSN-SR04T waterproof ultrasonic sensor differs from the HC-SR04, its 25 cm blind zone and wide beam, wiring, reliable Arduino code with filtering, and tips for tanks, cars and outdoor projects.
→ nothing closer than 25 cm