eVOLVER Forum

Where are SA slots specified?

I’m curious about applications where I’m adding additional LEDs and/or diodes to the eVOLVER setup. If I’m changing the vial board so that “light” is on pin pair 6… where do I update the info such that “light” commands modulate pin 6?

Is this specified in the same way for python as it is for the GUI/touchscreen, in which I can send a “light” command as well?

to clarify, i’m wondering where the specifications like this are kept, and how they can be altered:
SA Slot 1) Stirring
SA Slot 2) N/A
SA Slot 3) Heating
SA Slot 4) Thermistor
SA slot 5) IR LED
SA slot 6) IR Photodiode (90 degree)
SA slot 7) IR Photodiode (135 degree)
SA slot 8) N/A

1 Like

All the SA boards are controlled by the Arduinos. All Arduinos listen to the same shared serial RS485 line (along with the Raspberry Pi). When the proper serial command is received, it will interpret the command and respond w/ data.

To be clear, on the Python script (DPU), one might send out a command with the following ( for a simpler example, see server_test code):

data = {'param': 'temp', 'value': [4095] * 16, 'immediate': True}
evolver_ns.emit('command', data, namespace = '/dpu-evolver')

This would be sent via Websockets to the Raspberry Pi where it triggers a command to send all the following commands to the Arduinos. The first position in the ‘value’ array corresponds to vial position 0, 2nd position -> vial 1, etc.

All arduinos will see the following command via the shared RS485 but the only Arduino with that particular address programmed into the code will respond to it. There will be a handshake between the Arduino and the Raspberry Pi that everything was properly received.

temp4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,_!

Next, the Arduino interprets the array and stores 4095 as the set value for all 16 vials and then responds with what the current temperature readings are that go back to the Raspberry Pi. Please look at the Arduino code for temperature as an example.

How the particular code deals with the setpoints is up to the specific program itself. For example, in the temperature code, the Arduino will read the thermistor on SA slot 4 across all 16 vials, compare it to the setpoint via a PID control algorithm, and individually tune the heaters on each vial via PWM (pulse width modulation). The specifics of how you actually control the heater and read the thermistor is hardware specific (though very basic schemes can be used for a lot of applications; e.g. PWM and ADC). The arduino allows you to program a custom, modular script to control whatever sensors and actuators you want to control.

For more information, please read pages 2 - 27 of our Supplemental Information of our manuscript. The bioarxiv version can be found here.

Hope this helps clarify some things.

Brandon

1 Like

I am trying to control an LED using this code you gave me, but was having trouble.

I’m using a PWM board that is plugged in to slot 6 and have loaded this on to the arduino controlling slots 5 and 6, however when the eVOLVER is turned on, the LED is on full blast and is unable to be controlled by the GUI or changing the experiment file.

How do I start troubleshooting this?

Thanks

Have you populated all the arduinos with the appropriate code? I remember last time you had a blank slot. If it’s trying to ping an arduino and it gets no response it sometimes doesn’t handle it well.

This is our current setup, let me know if the arduino code we’re using is incorrect.

We have Vial Board Revision C

This is our motherboard setup


We are running:
SA Slot 1) Stirring
SA Slot 2) N/A
SA Slot 3) Heating
SA Slot 4) Thermistor
SA slot 5) IR LED
SA slot 6) LED Light source
SA slot 7) IR Photodiode (135 degree)
SA slot 8) N/A

The Arduino code we’re running is:
Arduino 1) RS485_STIR
Arduino 2) RS485_TEMP
Arduino 3) RS485_OD_LIGHT
Arduino 4) RS485_PD

The current problem is that when the eVOLVER is powered on, the LED light source is on full blast. Changing settings in the eVOLVER GUI does nothing, but perhaps this is because the command sent to the light is setting the vial to ‘object’?


However, I would have thought that the initial LED value would be 0, so the intial state should be off based off of this code from RS485_OD_LIGHT:

int saved_LIGHTinputs[] = {4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095,4095};

void setup() {
  pinMode(12, OUTPUT);
  digitalWrite(12, LOW);

  Tlc.init(LEFT_PWM | RIGHT_PWM,4095);
  Serial1.begin(9600);
  SerialUSB.begin(9600);
  // reserve 1000 bytes for the inputString:
  inputString.reserve(1000);
  while (!Serial1);

  for (int i = 0; i < num_vials; i++) {
    Tlc.set(LEFT_PWM, i, 4095 - saved_LEDinputs[i]);
  }
  while(Tlc.update());

  for (int i = 0; i < num_vials; i++) {
    Tlc.set(RIGHT_PWM, i, 4095 - saved_LIGHTinputs[i]);
  }
  while(Tlc.update());

}

Any help would be much appreciated! Thanks