Help needed with choosing the type of output to use with digital pins

Hi All,
I am currently trying to use an arduino uno board, with the Matlab support package, as a data acquisition device. The goal is to be able to input potentials and read potentials at points within a circuit (schematic of test circuit attached). I am using the 5V pin as the main source in the schematic (not 10V). The code I am currently using:

configureAnalogPin(a,1,'input'); %initialize analog pin 1 to input mode
configureAnalogPin(a,2,'input'); %initialize analog pin 2 to input mode
configureAnalogPin(a,3,'input'); %initialize analog pin 3 to input mode
configureAnalogPin(a,4,'input'); %initialize analog pin 4 to input mode

% for and if/elseif sequence to collect the perturbed states and wild type
% state, generating row vectors to be used in the calculation of the A
% matrix containing the coefficients related to the circuit control
% equations

for i = 0:4
    if i == 0
        writeDigitalPin(a,2,0);
        writeDigitalPin(a,3,0);
        writeDigitalPin(a,4,0);
        writeDigitalPin(a,5,0);
        w = [readVoltage(a,1), readVoltage(a,2), readVoltage(a,3), readVoltage(a,4)];
    elseif i == 1      
        writeDigitalPin(a,2,1);
        writeDigitalPin(a,3,0);
        writeDigitalPin(a,4,0);
        writeDigitalPin(a,5,0);
        per1 = [readVoltage(a,1), readVoltage(a,2), readVoltage(a,3), readVoltage(a,4)];
    elseif i == 2
      writeDigitalPin(a,2,0);
      writeDigitalPin(a,3,1);
      writeDigitalPin(a,4,0);
      writeDigitalPin(a,5,0);
      per2 = [readVoltage(a,1), readVoltage(a,2), readVoltage(a,3), readVoltage(a,4)];
    elseif i == 3
      writeDigitalPin(a,2,0);
      writeDigitalPin(a,3,0);
      writeDigitalPin(a,4,1);
      writeDigitalPin(a,5,0);
      per3 = [readVoltage(a,1), readVoltage(a,2), readVoltage(a,3), readVoltage(a,4)];
    elseif i == 4
      writeDigitalPin(a,2,0);
      writeDigitalPin(a,3,0);
      writeDigitalPin(a,4,0);
      writeDigitalPin(a,5,1);
      per4 = [readVoltage(a,1), readVoltage(a,2), readVoltage(a,3), readVoltage(a,4)];
    end
end

Summary of the code:
In the initial iteration, take a reading of the normal values. Second iteration, perturb the circuit by sending a signal through digital pin 2 to the first point of interest (node 1), leave the other points (nodes) alone, take reading. Third iteration, perturb node 2, by sending a signal through digital pin 3, turn digital pin 2 off again. Repeat for the remaining nodes and pins until each node has been perturbed.

I will admit here and now I am a novice, so please excuse any egregious errors. The problem I would like to resolve is that in the initial iteration the readings are much lower than expected (I have done this previously the brute force way and know what the normal values should be). All of the perturbations also suffer from this as well. Any help is greatly appreciated

Example Circuit draw.pdf (31 KB)

Have you analysed the circuit using Kirchoffs law etc to see what should be read?

Then have you read the nodes with a multimeter to see what you get?

Weedpharma

Yes, I have done both. I have worked with this test circuit under the same conditions utilized with this current project, using brute force methods of analysis. The circuit has also been simulated with Multisim, which matched the theoretical expectation and observations. I think I may not fully understand what the digital pins output exactly, from what I have read and observed it appears to be a 5V signal when set to 'HIGH'. Please correct me if I am wrong and/or elaborate on the precise nature of the signal, please. As always, all help, comments and criticisms are greatly appreciated.

High does output 5v but you may be having a problem due to current draw from the output pin. They are only capable of supplying a max of 40mA. With your circuit it may be drawing more so limiting the voltage.

You may be better off using the Arduino to control relays that can switch full current from a 5v supply.

Weedpharma

Are the outputs DC, AC or otherwise?I just simulated the circuit with Multisim, with DC sources used for the digital inputs. I noticed that node 4 draws 100mA in the sim. Odd though because the board does not seem damaged, I will physically test tomorrow. Thanks again.

The outputs are DC.

If you draw over 40mA you have damaged your pins, although you might not be able to see that damage in a test but that pin will fail sooner than it otherwise would.

As you draw more current from a pin the voltage you get from the pin drops off from 5V to a lower voltage. at 20mA draw you might only have 4.2V.

Make all those resistors ten times higher to avoid excessive current draw.

I added 1k resistors between the nodes and the output from the digital pins and have gotten the results as expected. It works! Thank you all!