1
\$\begingroup\$

I am trying to build an automatic plant watering system using ATmega16. We are using moisture sensor for our project. The circuit diagram is as follows:

We are using the following 12V relay:

I have no experience of using relay. How I will connect the relay across D1 as shown in the circuit. I mean which pin of relay (there are 5 in total) will be connected to the two terminals of the diode as shown in the above figure and which two pins will be connected to a dc motor so that I can drive a dc motor. And how will I test the relay is working properly using multimeter (before connecting the motor) when I am getting 5v or 0v from PC0 as output?

\$\endgroup\$
  • \$\begingroup\$ You should be able to figure out any simple relay with an ohm meter which can differentiate connections from winding resistance. You can activate it to resolve any ambiguity between duplicated pins vs. normally closed contacts. As for testing, for starters you should hear it quietly "click". \$\endgroup\$ – Chris Stratton Dec 9 '15 at 3:22
2
\$\begingroup\$

From the data sheet's wiring diagram, we can figure out the pins. The middle pin is the Common pin. The Top Right pin is the Normally Opened switched pin. The Bottom Right pin is the Normally Closed switched pin. The Top and Bottom pins on the Left are the Relay Coil pins.

enter image description here

The diode would be placed, Cathode to the top pin, Anode to the bottom pin. 12V input would be connected to the top pin, the transistor's Collector to the bottom pin.

To test it out, you would use the multimeter's continuity mode to the common pin and the NO pin. When the relay is turned on (PC0 is High, Transistor is on), there will be continuity across the common and NO pin.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.