Two Arduino Uno, Same Matlab code

Hi All,

Newbie here.

Is it possible to run 2 arduino boards at the same time using the same MatLab code?

In short, I have an Arduino Uno running and collecting data from an IR break beam sensor. Now I am trying to time lock the onset of the IR Break Beam to the opening of a solenoid valve. I plan to control the solenoid valves with a PS12DC LabJack power switching board and an other Arduino Uno board.

Is this possible/practical?

Could you point me in the right direction?

Thanks!

It is unclear why you would need 2 Unos and how the communication with Matlab fits in. Perhaps you could describe your project in more detail.

Now I am trying to time lock the onset of the IR Break Beam to the opening of a solenoid valve.

What does this mean? Do you mean delay the solenoid for some time after the beam event?

Okay,

I need to deliver an odor via a pump to a receptacle and begin recording from my IR sensors at the same time. I am using an Uno to control the IR sensors, this takes 3 out of the 14 digital IO pins in my Uno. I use Matlab to control the board and record the resulting data.

The delivery of the odor happens after a solenoid valve is opened. I am using a PS12DC power switching board to control the solenoid valves, I just need to find a way to interface my power switching board with my computer so that I can switch the solenoid valve on and begin recording from the IR sensors at the same time. I have two options, one of it being using an Uno to interface with the power switching board. Ideally, I would control both my IR sensors and power switching board (solenoid valves) with a single Uno and the matlab code I already use to control and record data from my IR sensors. However, my IR senors already take up 3 out of the 14 digital pins in my Uno. The power switching board needs to use 12 of the digital ports plus a ground. (I will attach a PDF describing this connection).

https://labjack.com/sites/default/files/2014/05/LabJack-PS12DC-Datasheet-052014.pdf

I hope this is clearer.

Are you aware that the analog inputs are digital pins by default? They are 6 more digital pins (accessed as digital pins14-19).

I wasn't aware. It shouldn't make a difference then. I'll try this out, thanks!