As an Amazon Associate we earn from qualifying purchases.
This page collects our sensor projects in one place. Each one covers a common measurement task: how much current a circuit draws, whether a magnet is nearby, and how warm a room or component is. Pick a project below, then read the notes under it to see what the sensor does and what to watch for.
Sensor project index
- CURRENT SENSOR – ACS712
- HALL EFFECT SENSORS
- HALL EFFECT SENSORS – DRV5023 Digital South Pole Sensor
- LM35 – TEMPERATURE INDICATOR AND FAN CONTROLLER
These projects work well with Arduino-style boards and other microcontrollers. If you are still choosing parts, our guide to the best sensors for Arduino projects is a good companion to this list.
ACS712 current sensor
The ACS712 is a Hall-effect current sensor on a small breakout board. It sits in series with the load, and the current flowing through it produces an analog voltage on the output pin. Because the measured path is separate from the signal side, your microcontroller is not wired directly into the load circuit.
How it works
With no current flowing, the output sits at about half the supply voltage. On a 5 V supply that is roughly 2.5 V. Current in one direction pushes the output above that midpoint, and current in the other direction pushes it below. This is why the sensor can measure both directions.
The chip comes in several current ranges, commonly 5 A, 20 A and 30 A. A lower range gives a larger voltage change per amp, so it reads small currents more precisely. Check which version your board uses and take the sensitivity from the datasheet instead of guessing.
Tips for better readings
- Read the zero-current output at startup and use it as your offset. Boards vary a little.
- Average several samples to reduce noise.
- For AC loads, sample quickly and calculate an RMS value instead of reading a single point.
- Keep the supply stable. The output is tied to the supply voltage, so a drifting supply shifts your results.
Safety note: if you measure mains voltage, use a proper enclosure, insulated wiring and a fused supply. If you are not experienced with mains wiring, test with a low-voltage DC load first. For voltage measurement alongside current, see our guide to Arduino voltage sensors.
Hall effect sensors
A Hall effect sensor detects a magnetic field. It is useful because it has no contact parts to wear out, and it works through plastic, wood and other non-magnetic materials. Typical uses include detecting a door or lid position, counting wheel or shaft rotations, and checking whether a moving part has reached the end of its travel.
Digital and analog types
Digital Hall sensors act like a switch. Their output changes state when the magnetic field passes a threshold. Analog (linear) Hall sensors give an output that changes with field strength, which is useful when you need to know how close a magnet is rather than just whether it is there.
Many digital sensors respond to only one magnetic pole. That is helpful in a project, because you can tell a magnet’s orientation apart and avoid false triggers from stray fields.
DRV5023 digital south pole sensor
The DRV5023 is a digital-switch Hall sensor from Texas Instruments. It responds to the south pole of a magnet. When the south pole faces the sensor’s marked side with enough strength, the output switches. When the field is removed, it switches back.
The output is open-drain, so it needs a pull-up resistor to the logic voltage you want to read. The part also accepts a wide supply range, which makes it easy to power from different rails. Confirm the exact limits and the pinout for your package in the datasheet before wiring it.
- Use a pull-up resistor on the output pin.
- Place the magnet so its south pole faces the sensor. If nothing happens, flip the magnet.
- Add a small decoupling capacitor close to the supply pin.
- Test the trigger distance with your own magnet, since magnet strength varies a lot.
LM35 temperature indicator and fan controller
The LM35 is an analog temperature sensor that outputs 10 mV for every degree Celsius. A reading of 250 mV means about 25 °C. There is no lookup table and no complicated formula, which makes it a good first temperature sensor.
What the project does
The project reads the LM35, shows the temperature through an indicator, and switches a fan on when things get too warm. The fan is not driven from the microcontroller pin directly. A transistor or MOSFET handles the fan current, and a diode across the fan protects the circuit from voltage spikes when it switches off.
Getting stable control
- Add hysteresis. Turn the fan on at one temperature and off a few degrees lower. Otherwise it may switch on and off rapidly around the threshold.
- Average readings. The LM35 output is small, so electrical noise shows up as temperature jitter.
- Mind the reference voltage. A lower ADC reference gives finer resolution, as long as the sensor output stays within range.
- Keep leads short or add a small filter if the sensor is far from the board.
If you would rather buy a ready-made unit than build one, see our roundup of smart temperature sensors.
Choosing the right sensor
- Measuring power use or load current: ACS712.
- Detecting a magnet, position or rotation: a Hall sensor such as the DRV5023.
- Reading and reacting to temperature: LM35.
For connected builds that send data over Wi-Fi, take a look at our ideas for sensors for IoT projects.
FAQ
Can the ACS712 measure both AC and DC current?
Yes. For DC, you read the output and compare it with the zero-current offset. For AC, you sample the signal many times per cycle and calculate an RMS value in code.
Why does my Hall sensor not trigger?
The most common causes are a magnet facing the wrong way, a magnet that is too weak or too far away, or a missing pull-up resistor on an open-drain output. For a south pole sensor like the DRV5023, try flipping the magnet.
Is the LM35 accurate enough for a home project?
For a fan controller or room indicator, yes. Accuracy depends on your supply, wiring and ADC. Averaging samples and checking against a trusted thermometer will improve results.
Can I drive a fan straight from the microcontroller?
No. Microcontroller pins supply only a small current. Use a transistor or MOSFET as a switch, and add a diode across the fan to protect against voltage spikes.