Switching 12VDC LED Indicator lamp through 12VDC relay.

Dear one,

I have setup a system used to indicate the status of running machine with the help of 3 x 12 VDC LED indicator lamps. The challenge that i am facing is when multiple lamps are to be turned on (multiple relays to be triggered), only single lamp (relay) is triggered. I am attaching the circuit diagram of the LED indicator assembly. Kindly let me know what best is to be done to make it working.

Thank you in Advance.

Regards,
Rishi R Soni.


That circuit seems way over-complicated just to switch an led. Why not just use a transistor? If you can switch the ground connection to the 12V led, you just need an ordinary npn transistor and a base series resistor. If you can only switch the 12V connection to the led, you will need a pnp transistor and an npn, plus some resistors.

However, nothing in the circuit you posted would prevent multiple lamps from being switched on. Perhaps you have a bug in your code. Please post that, but read the forum sticky post first to find out how to post code on this forum.

PaulRB:


That circuit seems way over-complicated just to switch an led. Why not just use a transistor? If you can switch the ground connection to the 12V led, you just need an ordinary npn transistor and a base series resistor. If you can only switch the 12V connection to the led, you will need a pnp transistor and an npn, plus some resistors.

However, nothing in the circuit you posted would prevent multiple lamps from being switched on. Perhaps you have a bug in your code. Please post that, but read the forum sticky post first to find out how to post code on this forum.

Hi Paul,

Appreciate your quick response,

The circuit diagram posted is actually a 12VDC x 4 relay card which is a small part of the larger project. The main project being Surface grinder automator, which has Push buttons, LCD display, Proxy sensors, MPG pendants, stepper motors drives etc. interfaced to the arduino. Now that being said, the code is too lengthy to post on the forum, however the essential codes i will post here.

Also, it is unlikely that there is a bug in the code, as the onboard LEDs for signals on relay card are switching according to the code which means that the code is perfect.

There can be a possibility of incorrect power wiring, hence i am attaching the power wiring and signal transmission diagram along with.

Code for LED Indicator lamps :

const int LED_RUN = 46;
const int LED_STOP = 47;
const int LED_READY = 48;


setup()
{

pinMode(LED_RUN, OUTPUT);
  pinMode(LED_STOP, OUTPUT);
  pinMode(LED_READY, OUTPUT);

}


loop()
{

if (CYC_RUN == 1)
  {
    digitalWrite(LED_RUN, LOW);
  }
  if (CYC_RUN == 0)
  {
    digitalWrite(LED_RUN, HIGH);
  }

  if (CYC_STOP == 1)
  {
    digitalWrite(LED_STOP, LOW);
  }
  if (CYC_STOP == 0)
  {
    digitalWrite(LED_STOP, HIGH);
  }

  if (CYC_READY == 1)
  {
    digitalWrite(LED_READY, LOW);
  }
  if (CYC_READY == 0)
  {
    digitalWrite(LED_READY, HIGH);
  }

}

Regards,

Rishi R. Soni

Note that total power draw (supply and pins) from a Mega on a 12volt supply must be < 150mA.
Anything more will overheat the 5volt regulator.
Leo…


rishrsoni:
...the onboard LEDs for signals on relay card are switching according to the code...

So you are saying that the leds on the relay cards do not match the 12V leds? In that case, I agree the code is not the problem.

rishrsoni:
There can be a possibility of incorrect power wiring, hence i am attaching the power wiring and signal transmission diagram along with.

Unfortunately, neither of those are proper schematic diagrams and do not reveal what the problem is.

I have a question and a suggestion:

The led inside a "12V" led lamp is probably no different to an ordinary led that you would connect directly to an Arduino pin. However, there will be a series resistor built into the lamp of around 500R to allow it to run with 12V. You could connect the lamp directly to the Arduino pin, but it may be a little dim. Can you access and replace that resistor with one of around 180R?

Wawa:
Note that total power draw (supply and pins) from a Mega on a 12volt supply must be < 150mA.
Anything more will overheat the 5volt regulator.
Leo…

Dear Wawa,

Good that you mentioned that, it made me to check voltage at input terminals following which the problem was revealed to me.

  1. With all the peripherals connected to arduino, i checked the INPUT voltage which was just 7.6V instead of 13.5V.
  2. One by one removed the peripherals and found the voltage increasing at the input voltage terminals.
  3. Voltage regulator was considerably hot.
  4. Removed all the connecting peripherals to arduino and found the voltage back to 12V.
  5. Now, when all the peripherals are connected, the relay card gets 7.6V instead of 12V which makes it behave strange.

Solution :

Use different power source for the Arduino and other 12V Peripherals.

Thank you dear members for the help,
Would love to share the video of the project, once done.

Regards,
Rishi R. Soni.

Assuming your 12V PSU has sufficient capacity, you could use a 12V to 5V DC-DC convertor. These are much more efficient than a regulator and should not get hot. You can power the Mega through its 5V pin.

s-l300 (14).jpg

But also address the matter of those LEDs. Using relays to switch LEDs is crazy inefficient in every way! The relay coil will use more power than the led.

s-l300 (14).jpg

PaulRB:
Assuming your 12V PSU has sufficient capacity, you could use a 12V to 5V DC-DC convertor. These are much more efficient than a regulator and should not get hot. You can power the Mega through its 5V pin.

s-l300 (14).jpg

But also address the matter of those LEDs. Using relays to switch LEDs is crazy inefficient in every way! The relay coil will use more power than the led.

Hi Paul,

Yes, removed the relay card from the system and connected the arduino LED output pins directly to the LEDs, they are working amazingly great. Also as per your say, Got a DC-DC converter which steps down arduino supply votlage to 7 VDC which has relieved us from the heating issue.

However, now we face next challenge on interfacing the NPN NO Inductive proxy switch with the same. On connecting the switch to the arduino, the movement of stepper motor is strange.

Following are its specifications,

Supply voltage : 6-36 VDC
Load current : 200 mA
sensing distance : 4mm

Thank you in advance,

Regards,
Rishi R. Soni.

Also as per your say, Got a DC-DC converter which steps down arduino supply votlage to 7 VDC

No, that's not what I suggested. Please check my last post again.

the movement of stepper motor is strange.

Perhaps the dead are attempting to contact you through the medium of a stepper motor?

PaulRB:
No, that's not what I suggested. Please check my last post again.
Perhaps the dead are attempting to contact you through the medium of a stepper motor?

Hahahaha,

Yes, you had suggested something different. As i had to interface many push buttons, LCD and MPG, thought to power arduino at 7VDC, through the voltage regulator.

Fixed the stepper motors to work properly and now i am happy to share the video of what has been made with your help.