Touchless hand sanitiser dispenser
Hold your hand under it and a metal-gear servo presses the pump for you.
Shop by category
Shop all componentsThis joins a sensor to an actuator: the DHT11 reads the temperature every 2 seconds and the Arduino turns the L298N fan on above 30 degrees C and off when it falls back. It is a closed loop, the same idea as a thermostat. A 1-degree gap between on and off (hysteresis) stops the fan chattering right at the limit.
Li-ion cells: insert them the right way round, never short the holder's wires, and switch the holder off when you finish.
Keep fingers and hair away from the spinning fan blade.
Every part for this build comes in the Geekobot Spark Kit box, a Geekobot exclusive, together with the parts for all 24 projects, from a first blinking LED to a smart fan and a reaction game. The wiring below is the kit's own wiring.
Tick anything you already have and the total updates.
The brain of every Spark Kit project
DHT11 temperature and humidity module
Female-to-female or male-to-female leads for the modules
Sensor Shield v5.0 from the kit: every pin has its own G, V, S header, so modules plug in with female jumpers
Follow the colours: red is power, dark grey is ground, blue is a signal.
The motor runs from the 2 x 18650 pack through the L298N; the Arduino and DHT11 run from USB. Join the grounds.
spark_kit_20_smart_fan.inoVerify & upload in Electrolark// Spark Kit 20: smart fan
#include <DHT.h>
#define DHTPIN 2
#define DHTTYPE DHT11
DHT dht(DHTPIN, DHTTYPE);
int IN1 = 8;
int IN2 = 9;
float ON_AT = 30.0; // fan on above this (degrees C)
float OFF_AT = 29.0; // fan off below this
bool fanOn = false;
void setup() {
pinMode(IN1, OUTPUT);
pinMode(IN2, OUTPUT);
Serial.begin(9600);
dht.begin();
}
void loop() {
float t = dht.readTemperature();
if (!isnan(t)) {
if (t > ON_AT) fanOn = true;
if (t < OFF_AT) fanOn = false;
Serial.print("Temp: "); Serial.print(t, 1);
Serial.println(fanOn ? " C fan ON" : " C fan OFF");
}
digitalWrite(IN1, fanOn ? HIGH : LOW);
digitalWrite(IN2, LOW);
delay(2000);
}
Use the kit's USB cable (some phone cables carry power only), install the CH340 driver on Windows if the port does not appear, and pick Tools > Board > Arduino Uno.
The room is below 30 degrees C. Lower ON_AT and OFF_AT to test, and check the battery switch.
Keep the DHT11 out of the fan's airflow, or it cools itself and switches the fan off.
Using two limits, on at 30 and off at 29, so the fan does not flick on and off when the temperature hovers at one value.
Yes: remove the ENA jumper, wire ENA to D10 and use analogWrite(10, speed) for a fan that speeds up as it gets hotter.
Yes. It is one of the 24 projects in the Geekobot Spark Kit, and every part on the list comes in the kit box. You can also buy the parts one by one from the list above.
No. Every Spark Kit project is wired on the breadboard or the Sensor Shield with jumper wires.
10 parts: Uno R3 CH340G ATmega328p Compatible Development Board, Arduino USB-A to USB-B Data Cable for UNO/MEGA, Generic DHT11 Digital Temperature & Humidity Sensor Module, L298N Dual H-Bridge Motor Driver Module, Hobby DC Motor (130 / 180 Size), DC Motor Fan Blade (Toy Propeller), 18650 Battery Holder, 2 × 18650 Li-ion Rechargeable Cell, Dupont Jumper Wires (40 pcs) and Arduino Sensor Shield V5 Expansion Board. On this page you can tick the parts you already have and add only the rest to your cart.
It is a intermediate project and takes about 1 hour. The build on this page has 6 steps.
No. This page has the complete, tested code (spark_kit_20_smart_fan.ino).
About ₹948 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.
Automation from a sensor reading; Combining a sensor with an actuator; Closed-loop control and hysteresis.
Li-ion cells: insert them the right way round, never short the holder's wires, and switch the holder off when you finish. Keep fingers and hair away from the spinning fan blade.
Hold your hand under it and a metal-gear servo presses the pump for you.
Wave your hand and the lid lifts by itself, then closes after three seconds.
Your first motion project: turn the knob and the servo follows.
Dial in an exact servo angle, 2° per click, shown on screen.
Lessons are free to read. Maker (₹499/month) and Pro add quizzes, worked problems and certificates, paid with your Geekobot account. See plans
Learning project. Check every circuit and the datasheet of each part before you power it up.