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)