u/Cool-Bee4990

Hello there! I hope everyone is doing well.

I came to this subreddit to ask for help regarding a small project I am doing as my first steps into electronics. It is also going to be my University's final project for the DLD (Digital Logic Design) course.

Now let me explain what the circuit does. So basically we are using a moisture sensor which is connected between VCC and the pin 3 of the LM393 comparator. There is also a 10k resistor connected to make it act like a voltage divider. So as the resistance of the sensor varies, it varies the voltage across the comparator.

This circuit works perfectly as i've tested it out by connecting a 1k resistor between the output of the comparator (since it's an open collector output) then by driving a transistor to turn on a LED.

I've passed this signal on to the second portion of my circuit: the NE555 timer. The main objective of using this timer is to make sure that we keep the motor on for 5 seconds when the probe is dry so that it waters the plant effectively. I've done this by configuring the timer in a monostable mode: pin 5 and 6 connected to a 100uF capacitor and a 56k resistor. The pin 2 is used as the trigger. pin 4 (Reset) is connected to vcc. and the output of this timer drives another BC54 transistor which then drives a 5v relay.

Now here comes the problem! The circuit is 90% of the way there. The reason for using the relay is that i wanted to run the motor off of a separate battery. However, when i try doing that, the whole circuit misbehaves! The 555 timer never stays on for 5 seconds.

The intended behavior for a scenario:

The probe is wet and becomes dry and immediately goes back to being wet.

The relay should click and turn the motor on for 5 seconds even when the comparator sends that it's wet again. This is to ensure the moisture level rises properly and that the plant is well watered.

What happens:

- The timer never works. It just immediately clicks the motor off even if the probe goes wet.

I don't know what causes this.

I've replaced the motor with a simple LED and the timer starts working.

I've also tried running the motor off of the same supply as the circuit but it makes things worse! The relay just clicks like crazy.

I am not sure if this is some kind of interference issue but i deeply need your help in this. I've been trying to debug this for many days.

The circuit is powered by a USB charger.

Also please forgive my mistakes. This is my first ever time playing with Ic's and what not. :)

I've attached a photo of my circuit on the breadboard. Hope you can help me with this motor issue!

u/Cool-Bee4990 — 16 days ago