Relay and Determining the State of the Relay

Hi everyone! This is a set-up for switching our relay and determining the state of the relay. The problem is that if multiple loads (2 or more) are already connected in parallel, the load (which is a light bulb) won’t follow through the command, say we wanted to switch on the bulb, the light bulb won’t switch on unless all relays are commanded to switch on their respective loads.

The connection from the common of the relay to the arduino analog pin is used to determine the state of the relay.

Is it possible that there is something WRONG with our set-up or the way we connected the common of the relay to the led and the analog pin? If so, what alternate routing or connection could I do? Any suggestions/advise/recommendation?

I’m using a relay module that is suited for Arduino. All relays are supplied by the 5V / VCC pin of the board. This is not seen through the schematic since I can’t find a relay module representation in Proteus.

Relay's need a separate power supply. google (images) "arduino connect relay" and you will get nice schema.

eg - http://www.electroschematics.com/8975/arduino-control-relay/ -

I forgot to state that the relays are connected to the VCC pin of the Arduino (or 5V ). I'm using a relay module that is suited for Arduino.

Still a (mechanical) relay draws quite some current, and an Arduino can only deliver 20mA per pin - for short time!!

So do you have a link to the datasheet of the Relays - to check they draw much less. - please post

Check out http://www.instructables.com/id/Home-Automation-How-to-Add-Relays-to-Arduino/ or http://www.forward.com.au/pfod/HomeAutomation/OnOffAddRelay/index.html for details on selecting and driving relays from Arduino

I noticed that you send the alternative source to the Arduino ground directly through a diode and a resistor. If the alternative source is the main then I would definitely not advise to do that. I'm not familiar with electronics engineering but as a maintenance technician I get to open and study many different electronic devices and I've never seen anything like this. The microcontroller is supposed to be isolated from the main.

If you get how to drive a relay (which should be done with a transistor driven by the Arduino that connects a sufficient 5V source to the relay, I used to do it with the 5V source from the Arduino but not from a digital output), then your program should be able to determine itself if the relay is on or off. If you really need a feedback from the mains (for example for being able to determine if the light bulb is blown), it should be done via a galvanic insulator such as an optocoupler.

Also when using a relay it is advised to put a free wheel diode with the cathode on the +5V side of the coil and the anode to the ground side. When the power is cut on such a coil it produces a voltage spike which can damage the microcontroller. The diode allows to limit the voltage of that spike and dissipate the current flowing from the coil.