About
In this post, I’ll show you my automatic soldering sponge water dispenser. I got tired of the soldering sponge drying out, so I built an automatic water dispenser to “water” it.
The dispenser uses a sensor to measure the resistance of the sponge. If the sponge dries out too much, the resistance goes up, the microcontroller detects it and turns on the pump.
This is another one of those projects I started years ago and finally got around to finishing. I started this thing in early 2017, maybe late 2016, then I restarted it somewhere in 2024, and I’m now finally writing a blog post about it. So yeah… It’s been almost a decade since I started it, but better late than never, I guess.
I remembered I actually made a post about the project on Hackaday, and then never finished it.
Project Files
Initial Prototype
Build
int relayControllPin = 0;
int moistureDetectionPin = 7;
int dispenseTime = 1000;
int dispenseThreshold = 600;
int timesDispensed = 0;
int maxTimesDispensed = 10;
int minutesPassed = 0;
int moistureLevel = 0;
void setup()
{
pinMode(relayControllPin, OUTPUT);
//pinMode(moistureDetectionPin, INPUT); //Don't use pinMode() for ADC.
}
void loop()
{
if(minutesPassed > 30 && maxTimesDispensed <= timesDispensed)
{
delay(60000);
return;
}
if(maxTimesDispensed <= timesDispensed)
{
int newMoistureLevel = analogRead(moistureDetectionPin);
//If the new moisture level is within +/- 50 of the old moisture level assume there is no change in the moisture level.
if((moistureLevel+50) > newMoistureLevel && (moistureLevel-50) < newMoistureLevel)
timesDispensed = 0;
minuteDelay();
return;
}
moistureLevel = analogRead(moistureDetectionPin);
if(moistureLevel < dispenseThreshold)
{
dispense();
}
/*else if(moistureLevel > 900)
{
//Sennsor pads probably shorted.
}*/
else
{
minuteDelay();
}
}
void minuteDelay(){
delay(60000); //Delay for a minute.
minutesPassed++;
}
void dispense(){
digitalWrite(relayControllPin, HIGH);
delay(dispenseTime);
digitalWrite(relayControllPin, LOW);
timesDispensed++;
delay(1000);
}





