Unable to active the pins at output

I am trying to switch on the switches with the condition input from serial.

The code is not working, and tried to print the serial in but i am unable to do it . Also, I tried testing giving a high for LED 2 ( s2a =5;
=6;
s2c =7;) . LED got burnt. I am unable to understand why its happening.

sketch_sep19b.ino (2.54 KB)

   // Serial.println(String(charArray[2]));

Why are you not printing the whole serial input? It may not be what you think it is.

    int One = analogRead(Switch1);
    int Two = analogRead(Switch2); 
    int Three = analogRead(Switch3);

What kind of switches are you using? Exactly how are they connected to the Arduino? Most switches are digital devices - on or off. I've yet to see a switch that could be turned 37% on.

       if (String(charArray[0]) == "1")

This is just plain stupid. Simply test if charArray[0] is '1'. Quit pissing away resources on the String class.

Hi pradeep

LED got burnt.

Can you post a diagram of how your hardware is connected? A photo of a drawing on paper is fine. Attach it using the "Additional Options" button.

Do you have series resistors between the Arduino pins and the LEDs?

Regards

Ray

I have attaches the pictures with the circuit.

That's a crappy picture of the set up, but those look like slide switches. They are digital devices, not analog.

Oh.. ok.. So I will change the input to digital . Will this be fine and will the problem of switch burning would be solved .

Your drawing shows three sets of three output pins from the Arduino. Each set is connected together, then joined to one resistor and one LED.

Joining the output pins is not good! Is that actually what you have? I can't tell from the photo.

It looks like the LEDs are single LEDs with two pins - is that right? What value series resistors are you using?

will the problem of switch burning would be solved .

If you are burning switches, you have something wired incorrectly.

It looks to me like you have some outputs all connected together, and some going HIGH and some LOW at the same time. This is a good way to burn up the output drivers on your Arduino. Why are you doing this?

LEDs are 2 pins and Resitor values are 220ohm.
I am trying to simulate the " relay "working here. A 3 channel RELAY for each connection, which acts like a 3 way switch. . Can you please help in proceeding with this.

We would love to help.

You need to explain things properly.

Firstly, as Nick Gammon points out, you must not connect output pins on the Arduino together - there is no need to do so and it risks damaging the chip if you fail to set whichever pins you connect together, to the same level, either HIGH or LOW, simultaneously. If you think you can "simulate" something by connecting pins together and setting them to different levels, you absolutely do not understand what you are doing. Do not proceed to apply power to your lash-up again until you have made quite sure no pins on the Arduino are connected together.

Secondly, please understand - while you know what "A 3 channel RELAY for each connection, which acts like a 3 way switch" is, it means nothing to anyone else here. You need to explain - if you do not know the common technical terms - what sort of relay you mean, preferably by giving a Web link to or picture of the device you have in mind. Similarly, it will make it much easier to offer you help, to explain clearly what your overall purpose is which will allow us to assess whether you are in any way close to achieving it.

Always when posing questions, you need to keep in mind - what may be obvious to you having seen your problem in your own personal environment is entirely invisible to us - you need to explain every detail. :smiley:

You have also "cross-posted" snippets of your problem in two different forums. I have requested a moderator to fix that.

Secondly, please understand - while you know what "A 3 channel RELAY for each connection, which acts like a 3 way switch" is, it means nothing to anyone else here. You need to explain - if you do not know the common technical terms - what sort of relay you mean, preferably by

I took it to mean that he wished to illuminate a led withe either of two output pins.

If so, that should be done at the logic level, not at all in hardware, unless you have the appropriate stuff to do that.