Set more then two analog pins as output

I have a Arduino 8 relay module board that I want to controle via a Arduino UNO that has installed the standardFirmata sketch.

When I test the Arduino and relay board I can control relay 1 to 6 via analog pin A0 until A5.
I use this test tool: and set pin 14 until pin 19 to output. When I change the state LOW/HIGH the relay switches on and off.
In processing I define alle pins as output like so;

void setup() {
arduino.pinMode(14, Arduino.OUTPUT); //A0
arduino.pinMode(15, Arduino.OUTPUT); //A1
 arduino.pinMode(16, Arduino.OUTPUT); //A2 
 arduino.pinMode(17, Arduino.OUTPUT); //A3
 arduino.pinMode(18, Arduino.OUTPUT); //A4
 arduino.pinMode(19, Arduino.OUTPUT); //A5

The problem is that only the first two defined pins react. So when I commend out pin 14 and 15. The code below only changes the state of relay on pin 16 and 17 and so on.

if (btnX == true) {
        arduino.digitalWrite(14, Arduino.LOW); //A0
        arduino.digitalWrite(15, Arduino.LOW); //A1
        arduino.digitalWrite(16, Arduino.LOW); //A2
        arduino.digitalWrite(17, Arduino.LOW); //A3
        arduino.digitalWrite(18, Arduino.LOW); //A4
        arduino.digitalWrite(19, Arduino.LOW); //A5
      if (btnY == true) {
        arduino.digitalWrite(14, Arduino.HIGH); //A0
        arduino.digitalWrite(15, Arduino.HIGH); //A1
        arduino.digitalWrite(16, Arduino.HIGH); //A2
        arduino.digitalWrite(17, Arduino.HIGH); //A3
        arduino.digitalWrite(18, Arduino.HIGH); //A4
        arduino.digitalWrite(19, Arduino.HIGH); //A5

Is there a reason why I can not set more then two analog pins to an output like in the test tool?

How do you power the relays on the relay board? If you power them from the Uno’s 5V pin, you probably are running into power limitations.

Trim your Processing sketch to e,g,

if (btnX == true) {
  arduino.digitalWrite(14, Arduino.LOW); //A0

if (btnY == true) {
  arduino.digitalWrite(14, Arduino.HIGH); //A0

Test (you said it works).

Change 14 to 15 and test.
Change 15 to 16 and test.

Test all pins; do they all work when controlling a single relay? If no, I do not know what the problem is; if yes, I’m sure it’s a power issue and you will need a dedicated power supply for the relays on the relay board.

See e.g. the diagram at 8-channel relay board help (only some working?) - #18 by xl97 - Project Guidance - Arduino Forum


I trimmed the code and it seems there was a conflict that blocked the HIGH/LOW signal.
Thanks for your response


I think that changing A0 to A5 pin mode is restricted to standardFirmata sketch.

Here is useful video

Play with this example