Touchless hand sanitiser dispenser
Hold your hand under it and a metal-gear servo presses the pump for you.
Shop by category
Shop all componentsCytron's MDDS10 drives two brushed DC motors at up to 10 A each from 7-35 V. It uses MOSFETs, so it wastes far less power than the old L298N. It accepts several input types; in PWM mode, each motor needs one PWM pin for speed and one pin for direction. This project sets the driver to PWM mode and lets two potentiometers control each motor's speed and direction, the same code a tank-steer robot uses.
Disconnect power before changing motor wires.
Tick anything you already have and the total updates.
Cytron MDDS10 dual 10 A motor driver
Follow the colours: red is power, dark grey is ground, blue is a signal.
12 V adapter into the MDDS10; the Nano runs from USB.
mdds10.inoVerify & upload in Electrolarkconst int PWM1 = 9, DIR1 = 8, PWM2 = 10, DIR2 = 7;
void drive(int pwmPin, int dirPin, int speed) { // speed -255..255
digitalWrite(dirPin, speed >= 0 ? HIGH : LOW);
analogWrite(pwmPin, constrain(abs(speed), 0, 255));
}
int knob(int pin) {
int v = map(analogRead(pin), 0, 1023, -255, 255);
return abs(v) < 20 ? 0 : v; // dead zone in the middle
}
void setup() {
pinMode(DIR1, OUTPUT); pinMode(DIR2, OUTPUT);
}
void loop() {
drive(PWM1, DIR1, knob(A0));
drive(PWM2, DIR2, knob(A1));
delay(20);
}
The DIP switches are not in PWM mode; check the manual's table.
The direction wire is not connected or on the wrong pin.
The supply is below 7 V or a motor is shorted.
Yes, anything from 7 to 35 V, such as a 3S or 4S LiPo.
Yes, it has an RC input mode selected with the DIP switches.
The L298N drops about 2 V and gets hot; the MDDS10 handles far more current.
7 parts: Cytron 10A 7V-35V SmartDrive Dual Channel DC Motor Driver (MDDS10), Generic Nano CH340 Development Board (Soldered), 2 × 200RPM 12V Low Noise Dc Motor With Metal Gears - Grade A, 2 × Rotary Potentiometer Module 10k (3-Pin), DC Power Adapter (5.5x2.1mm), Solderless Breadboard and Dupont Jumper Wires (40 pcs). Tools: Digital Multimeter. 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 2 hours. The build on this page has 6 steps.
No. This page has the complete, tested code (mdds10.ino).
About ₹7,360 for the parts at the prices on this page, plus tools if you do not have them. Quantity price breaks lower the cost when you build several.
Sign-magnitude PWM control; Why MOSFET drivers run cooler; Choosing a driver for your motor current.
Disconnect power before changing motor wires.
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.