Please see Version 2 which includes a Flyback Diode in the Circuit. Do not assemble this version of the Valve Controller¶

Instructions for Assembling Valve Controller using the ESP32 Microcontroller¶

  • This notebook is a slightly modified version of our previous version using the Arduino UNO R3 Clone Microcontroller. You can use ESP32 Microcontroller as well if you want.

Brief Description of Purpose and Working Principles:¶

  • We need to a way to control the flow of liquid through the ChronoSeq Device by shutting down or redirecting flow.
  • To help control the flow with our computer we need to build a Valve Controller that can switch specific valves ON or OFF when it receives a command from the computer.
  • The SMC Valves we have selected for our device can be 2:2 Valves or 3:2 Valves.
    • 2:2 Valves Turn Flow ON or OFF. Most of these will be used to control flow from Individual Reservoirs.
    • 3:2 Valves Redirect Flow from the Input Port to the Main or Bypass Port. We use these as Bypass Valves for Controlling flow into the Microfluidic Chip for each Channel: Cells, Beads and Oil.
  • The 2:2 SMC Valves we have purchased are Normally Closed (NC). Meaning liquid will only flow through them when they are powered ON.
  • The 3:2 Valves allow flow from:
    • The Input Port to the Bypass port when powered OFF. The Bypass port is therefore called the Normally Open (NO) Port.
    • You can identify the NO Port by Looking for the NO Symbol on the Valve near the Port.
    • The Valve allows flow from the Input port to the Main port only when powered ON. This port is therefore called the Normally Closed (NC) Port.
    • You can identify the NC Port by Looking for the NC Symbol on the Valve near the Port.
    • The 3:2 Valves can be converted into 2:2 NC or 2:2 NO Valves by blocking either the NC or NO Port using a Delrin Plug.
3:2 Valve Input Port 3:2 NC and NO Port Locations 2:2 Valve Suggested Input and Output Ports
Location of 3:2 Bypass Valves in Schematic Location of 2:2 Valves in Schematic

Ordering Information for SMC Valves¶

  • SMC Valves are Highly Configurable and the exact product number represents this configuration.
    • For Example this website allows you to generate a product number before ordering.
    • Make sure the Chemicals being used for your application are compatible with the Wetted materials in your Valve Configuration.
  • We will be ordering the LVM10 Series of Valves.
  • The Following product numbers and Quantities were ordered for the two types for Valves:
    • 2:2 Valves: LVM10R6-5A2U . Quantity : 30 Units
      • 22 Units are needed in the Version of the ChronoSeq Device with 16 Timepoint Reservoirs.
      • The remaining 8 were kept as backup replacements.
      • You can order only 22 Valves if you want to save some money.
      • Only 18 Valves are necessary if your device has 12 Timepoint Reservoirs.
    • 3:2 Valves: LVM105R-5A2U . Quantity : 5 Units
      • 3 Units are needed in the Current Version of the ChronoSeq Device.
      • The remaining 2 were kept as backup replacements.
      • You can order only 3 Valves if you want to save some money.
  • SMC has many global suppliers and your local supplier might vary.
    • Different suppliers offer different prices.
    • Its best to find the most competitive local supplier for your area.
    • You can use this website to help you locate a supplier.
  • We ordered our valves from Bay Advanced Technologies located in Orange County, CA.
    • Its best to call them to place an order. Their number is +1 714-241-1031 .
    • You should also email Monica(mgparra@bayat.com) or Derek(dloe@bayat.com) if they still work there.
    • You can also call (+1 213-476-3863) or email Colby(cchristy@bayat.com), a local account Manager in San Diego.
    • We payed by providing our Credit Card Number over the phone.
    • Both the 3:2 and 2:2 Valves Cost 81.60USD Each in April 2024.

Overview of Valve Controller Design¶

  • Both Valves require 24V DC Current to Turn ON and Consume about 1.5W of Power or 60mA of Current.
  • We will be using a 8-Channel Relay Board Connected to an ESP-WROOM-32 Microcontroller to Control the Flow of Current to the Valves.
  • Here is a great Youtube video that explains how this works.
  • The 8-Channel Relay requires an Optically Isolated 5V DC Power Supply.
  • The ESP-WROOM-32 Microcontroller can be operated using the Power from the USB Port Alone.
  • We could have used a separate 5V Power supply to power the 8-Channel Relay. But we will be using a DC-DC Buck Converter to Step Down the 24V DC to 5V DC for the 8-Channel Relay instead. This way we can use a Single Power Source for all the Components.
  • You can watch this Youtube Video to learn how it works.

3D Printing Valve Controller Housing¶

  • We used a Bambu Lab X1 Carbon to print the Housing.
    • 0.4mm Nozzle
    • Textured PEI Plate
  • We generated a 3MF File with all the Settings we used for the Print. You can open this file on the Orca Slicer.
  • The Original STEP Files and F3D Files can be found in this directory.
  • We recommend getting a 3D Printing Accessories Kit if you haven't purchased one already.
    • Its extremely helpful in removing supports and cleaning up the print.
  • You can watch the Timelapse Videos Below:
In [1]:
%%HTML
<video width="800" height="600" controls>
  <source src="CAD_Files/Valve%20Controller%20ESP32/video_2025-01-13_06-40-05.mp4" type="video/mp4">
</video>
In [2]:
%%HTML
<video width="800" height="600" controls>
  <source src="CAD_Files/Valve%20Controller%20ESP32/video_2025-01-13_02-32-51.mp4" type="video/mp4">
</video>

Soldering the Valves to a Male USB A 2.0 Connector¶

  • You will need a Soldering Kit and Lead Free Solder to get Started.
  • Solder Fumes can cause Asthma and Lung Irritation. Its important to setup your Soldering Station Inside a Fume Hood.
    • Make sure you wear your Lab Coat, Gloves, and Safety Glasses.
    • Setup your Soldering Iron inside the Fume Hood.
    • Keep the Sash Closed with two small opening on the Sides so your Hands can reach inside the Fume hood, while keeping your body protected.
  • On the SMC Valves the Red Wire is for Positive Voltage(+VE) and the Black wire is for Ground(-VE).
  • We will be using 1m long USB 2.0 A Cables for Connecting the Valve Controller to the Valves.
    • We will Solder these USB Cables to the Valves.
    • These USB Cables Only have two wires one red for +VE and one black for -VE.
  • Using the Wire Strippers included in the Soldering Kit remove additional parts of the Wire sheaths for both the SMC Valves and USB Cables.
    • Execute the Cell Below to Watch a Video of the Process.
In [3]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/p1VI65QQhWY?si=CWPvj3usDdU_QkLi" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  • Next Twist the exposed wires for the +VE(Red) and -VE (Black) wires for both the SMC Valve and USB Cable together.
    • Execute the Cell Below to Watch a Video of the Process.
In [4]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/X3Tl9_7uTFo?si=i8DHLYbLa7ghG9fs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  • Inside the Fume Hood solder the Twisted wires together.
    • Then cover the exposed wires with Electrical tape.
    • I used Blue Electrical tape for the -VE wires.
    • I used Red Elecrrical tape for the +VE wires.
    • I then covered both with White Electrical tape.
Solder the Twisted +VE and -VE wires together. Cover the +VE and -VE Wires with Red and Blue Tape Respectively Cover Both Wires with White Electrical Tape
  • Connect the Valve to the USB 2.0 Breakout Board.
    • The +VE Terminal is the VBUS Pin Mount Hole
    • The -VE Terminal is the GND Pin Mount Hole.
  • We can use a Multimeter to make sure the +VE and -VE Wires are not shorted.
    • Set the Multimeter to the correct setting where it beeps whenever its two leads are shorted.
    • You can see connect the probes to VBUS and GND. If you hear beeping then there is a short.
    • Execute the Cell Below to learn how to check for shorts using a Multimeter.
In [5]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/wZQJJu3BVaQ?si=W5087UyYZDekMvWc" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  • To check if the Valve is operating correctly you can use an Adjustable DC Power Supply.
    • Set the Power Supply to 24V DC.
    • Screw the Caps off the +VE and -VE terminals on the Power Supply.
    • Now connect the leads on the Multimeter to the +VE(Red) and -VE(Black) terminals.
    • Connect the Black Probe to the GND and Red Probe to the VBUS Pin Mounting Holes on the USB 2.0 Breakout Board.
    • Press the Output button.
    • If your valve is working correctly, you will hear the Valve Turn on with a Click sound.
    • You can also feel the Mechanical Switching of the Solenoid if you hold the Valve in your hands.
    • About 60mA of Current flow should be shown by the Power supply.
    • Execute the Cell Below to Watch a Video of the Process.
In [6]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/eU7W66oj7ew?si=qCxQSxp7oD1-nW6u" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  • Repeat the above steps for all the Valves you plan to use with the ChronoSeq Device.

Soldering Header Pins to the USB Breakout Board¶

  • Break off 4 header pins from the Header Pin Strip.
  • Inside the Fume Hood Solder these pins to the USB Breakout Boards.
Soldered Header Pins Top View. Soldered Header Pins Bottom View
  • You will need to solder 8 USB Breakout Boards for each Valve Controller.
    • Check for shorts between the VBUS and GND Pins using the Multimeter.
    • There should be no beeping if you did everything right.

Attaching the Breakout Boards to the Valve Controller Housing¶

  • We will now attach these USB Breakout Boards to the Bottom Valve Controller Housing. For this you will need:
    • An Electronics Screwdriver set.
    • M3 Self Tapping Screw set.
Screwdriver Set Self Tapping Screw Set
  • Using M3 6mm Self Tapping Screws and the 3.0(PH0) Screwdriver Head:
    • Screw the USB Breakout Boards in the positions shown in the Bottom Valve Controller Housing below.
  • Check to make sure you can easily place the Valve Controller Top Housing on the Bottom Housing without any obstruction.
    • Do not screw the Housing together. We are just checking for obstruction.
    • Adjust the Breakout Boards if necessary to Align with the holes in the Top Housing.

Assembling the Breadboard PCB with Header Pins¶

  • The Breadboard PCB has Horizontal and Vertical Pin Mouting Holes that are connected to each other through Vias.
  • Each Horizontal Line and Vertical Line therefore will be at the same Voltage/Potential Difference because of this connection.
Breadboard PCB Front View Breadboard PCB Back View
  • We will solder this Breadboard PCB to make it easier to connect the Valves to the 8 Channel Relay.
  • First we will solder 9 pins to the upper +VE Horizontal strip from Positions 18-26. These 9 Pins will be at 24V (+VE).
  • Next we sill solder 9 pins to the lower -VE Horizontal strip from Positions 18-26. These 9 Pins will be at Ground(0V).
  • Now we need Headers to connect the 8-Channel relay to the VBUS(+VE) for the 8 USB 2.0 Breakout Boards. This way the Valves will only be energized when these headers are at 24V.
    • We will add 8 Headers for E7-E14
    • We will also add 8 Headers for A7-A14.
    • All the A Headers will be connected to their corresponding E Header through the Vertical Vias on the PCB. (Eg. A7->E7)
  • Check for Shorts on the Breadboard PCB using the Multimeter.
  • Using M3 6mm Self Tapping Screws and the 3.0(PH0) Screwdriver Head:
    • Screw the Breadboard PCB to the positions shown in the Bottom Valve Controller Housing below.

Assembling Input DC Barrel Connector¶

  • We will need a 24V DC Power Supply for our Valve Controller.
    • The symbol indicated below on the power supply tells us what parts of the Adapter DC Barrel Plug is positive and which part is negative (Ground)
  • The DC Power Supply is a Male Type connector, we need a DC Female Connector to power our Valve Controller.
  • The DC Female Connector Breaks out into three pin on the back.
    • These pins are of three sizes. Small, Medium and Large.
    • The smallest pin is connected to the inner part of the DC Barrel connector. Therefore this pin will be +VE 24V.
    • The Medium sized pin is connected to the outer part of the DC Barrel connector. Therefore this pin will be -VE (Ground).
Large Pin for Female DC Barrel Medium Pin for Female DC Barrel (-VE/Ground) Small Pin for Female DC Barrel (+VE 24V DC)
  • Strip and cut 11cm of Red and Black Electrical wire.
    • Twist the ends of the Exposed wire
    • Twist and Tie the Red Wire through the Smallest Pin of the Female DC Barrel.
    • Twist and Tie the Black Wire though the Medium Size Pin of the Female DC Barrel.
  • Inside the Fume Hood, Solder the Tied Wires to their respective pins in the Female DC Barrel.

Assembling the DC-DC Buck Converter¶

  • Strip the Sheath off the other ends of the Red and Black Wires connected to the Female DC Barrel.
    • Remember to then twist the exposed wires.
  • Solder the Red Wire to the +VIN Mount Hole and the Black wire on the -VIN Mount Hole on the Buck Converter.
    • Apply solder on the back side of the Buck Converter PCB.
  • Using M3 6mm Self Tapping Screws and the 3.0(PH0) Screwdriver Head:
    • Screw the Buck Converter in the positions shown in the Bottom Valve Controller Housing below.
    • Apply one screw to the top left corner and another screw to the bottom left corner position on the Buck Converter PCB.
  • Use the Multimeter to check for Shorts between the +VIN and -VIN Terminals of the Buck Converter.
  • Using the included Nut and Spacer with the Female DC Barrels:
    • Screw the Barrel into the back of the Bottom Valve Controller Housing, as shown below:
Mounted Female DC Barrel Top View Mounted Female DC Barrel Back View

Setting the Buck Converter to an Output Voltage of 5V¶

  • We will first check to make sure there are no incorrect shorts in our assembled circuit.
    • Make sure the +VIN is connected to the +VIN of the Screw Terminal.
    • Also make sure the -VIN is connected to the -VIN of the Screw Terminal.
    • The +VIN should also be connected to the Shortest pin of the DC Female Barrel Connector.
    • The -VIN should be connected to the Medium pin of the DC Female Barrel Connector.
    • The -VIN and -VOUT should also be connected.
    • The +VIN and -VIN should not be connected.
  • There is a Button on the right side of the Buck Converter PCB that displays the input and output voltages.
  • The LED Indicator tells you whether its showing you the input voltage or output.
  • Press the Button once to display the Input Voltage and then check this voltage using the Multimeter.
    • Always trust the Multimeter Value above the Buck Converter value.
    • The Buck Converter displayed value gives a good estimate but the Mulitimeter should be considered the Gold Standard.
  • Press the Button again to display the Output Voltage.
  • Now using a Flat head 1.5 Screw head rotate screw on the top of the Buck Converter Anti-clockwise till you see the Output Voltage going down.
  • Keep rotating the screw anti-clockwise till you are close to 5V.
  • Verify this voltage using the Multimeter.
  • We made a video for the previous version of this Valve Controller. Execute the Cell below to watch a video of the process.
In [16]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/NSGyDSS8A6o?si=Hj2SeqhVqWXHubWR" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Connecting the 8-Channel Relay¶

  • Using M3 6mm Self Tapping Screws and the 3.0(PH0) Screwdriver Head:
    • Screw the 8-Channel Relay Board into the Position shown below.
    • Place a screw only in the Top-left and Top-right screw holes.
  • You will see a Yellow Cap Connecting the VCC to JDVCC on the 8-Channel Relay Board.
    • We will remove this Yellow Cap to Optically Isolate the Relays and Provide Separate power to the Relay Board.
Yellow Cap Connecting JDVCC to VCC With Yellow Cap Removed
  • Now disconnect the 24V DC Power. Remember to only make new connections when the POWER IS DISCONNECTED.
  • Now all Connection we make will be made using Jumper Ribbon Cables.
  • You will need a 3.0(PH0) Screwdriver Head to unscrew the +VOUT and -VOUT Screw Terminals.
  • You will also need two Male to Female Jumper Cables.
    • For the first Cable, connect the Male Exposed Contact of the Jumper Cable to the +VOUT of the Buck Converter.
      • Now Connect the Female Contact to the JDVCC Pin on the 8-Channel Relay.
    • For the second Cable, connect the Male Expose Contact of the Jumper Cable to the -VOUT of the Buck Converter.
      • Now Connect the Female Contact to the GND Pin on the 8-Channel Relay.
    • We are now suppling 5V DC Optically Isolated Power to the 8-Channel Relay via our Buck Converter.
    • We made a video for the previous version of this Valve Controller. Execute the Cell Below to watch a Video of the Process:
In [8]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/AeBoMDQxR0c?si=SnWP-SDf5ORfmEci" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  • Using M2.5 6mm Self Tapping Screws and the 3.0(PH0) Screwdriver Head:
    • Screw the ESP-WROOM-32 Microcontroller into the Position shown below.
    • Make sure the Micro USB Port is facing towards the opening.
    • Make sure the header pins are pointing up towards you.
  • We will now connect our Breadboard PCB to +24V DC using the Input Screw Terminals on the Buck Converter. You will need two Male to Female Jumper cables:
    • For the first Cable, connect the Male Exposed Contact of the Jumper Cable to the +VIN of the Buck Converter.
      • Now Connect the Female Contact to Position 26 header on the Upper Positive Rail on the Breadboard PCB.
    • For the second Cable, connect the Male Expose Contact of the Jumper Cable to the -VIN of the Buck Converter.
      • Now Connect the Female Contact to Position 26 header on the Lower Negative Rail on the Breadboard PCB.
  • Connect the 24V Power Supply.
  • You can verify the Potential Difference between the Upper and Lower Rails is now +24V by using the Multimeter.
  • Disconnect the 24V Power Supply.
  • Using a Female to Female Jumper Cable, Connect the 3V3 Pin on the ESP32 to the VCC Pin on the 8-Channel Relay as Shown Below.
  • We now want to test our 8-Channel relay.
    • Using a Female to Female Jumper Cable, Connect Pin RX2 on the ESP32 to the In1 Pin on the 8-Channel Relay.
    • We can now control the rightmost relay using our ESP32.

Connecting the ESP32 to the Computer and Uploading a Sketch¶

  • We need to install a Driver to connect the ESP32 to our computer.
    • Install the CP210X Driver for X64 Windows Machines.
  • We will now connect our ESP32 to our Windows Computer using a MicroUSB to USB A Cable.
  • Download and Install the Arduino IDE.
  • You will need to open the Relay Control Sketch for ESP32.
  • Execute the Cell Below to Watch a Video on how to Upload the Sketch to your ESP-WROOM-32 Microcontroller Board.
In [3]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/uWn-Gapz5Ao?si=G1uaT5_VHeuVJXGs" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
  • Connect the 24V DC Power supply.
  • You can now send commands to the ESP32 using the Serial Monitor on the Arduino IDE.
  • In our case we will be sending a string of 8 Numbers. These numbers can be either a 0 or a 1.
  • Each Relay has three Terminals.
    • The Middle terminal is the floating/Common (COM) terminal and can be connected to the left or right terminal.
    • The left terminal is called the Normally Closed (NC) terminal since it gets connected to the Middle Terminal(COM) only when its powered ON.
    • The right terminal is called the Normally Open (NO) terminal sinces its normally connected to the Middle Terminal(COM) when there is no power.
    • You would have noticed this terminology is very similar to the NO and NC Ports on a 3:2 SMC Valve.
  • Since we have wired up the rightmost Relay we can turn the relay on by sending the string "00000001" to the ESP32.
  • We can then turn off the Relay by sending the string "00000000". The last digit represents whether the rightmost relay is on or not.
  • Execute the Cell Below to watch a video of the Relay switching in action.
In [1]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/ImgJoVmVWQc?si=RQ9wd_44Z4rsAW5-" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Connecting the 8-Channel Relay to SMC Valve¶

  • Although we developed these steps for the previous version of our Valve Controller. These following steps are exactly the same unless mentioned otherwise.
  • Disconnect the 24V Power Supply.
  • We will need four Jumper Wires to Connect the rightmost USB 2.0 Breakout Board with the rightmost Relay.
    • You will need a 3.0(PH0) Screwdriver Head for the Screw Terminals on the Relay Board.
    • Remember to Screw the Male Jumper Contact Pin all the way into the Screw Terminal.
    • Try Tugging the Male Jumper out to make sure the Connection to the Screw Termial is secure.
    • Using a Male-to-Female Jumper Wire :
      • Connect the Middle(COM) Terminal of the Rightmost relay to Position 25 on the Upper Positive Rail on the Breadboard PCB.
      • The COM Terminal will now be at +24V DC when the power supply is connected later.
    • Using a Male-to-Female Jumper Wire :
      • Connect the Left(NC) Terminal of the rightmost relay to Position E14 on the Breadboard PCB.
      • Now E14->A14 will have the same voltage as the NC Terminal of the rightmost relay.
    • Using a Female-to-Female Jumper Wire :
      • Connect the GND Header of the rightmost USB Breakout board to Position 25 on the lower Negative Rail on the Breadboard PCB.
      • Now our GND on the rightmost USB Breakout board is at the same voltage as GND/-VE as the 24V DC Power Supply.
    • Using a Female-to-Female Jumper Wire:
      • Connect the VBUS(+VE) Header of the rightmost USB Breakout board to A14 on the Breadboard PCB.
      • Now VBUS(+VE) on the rightmost USB Breakout board is at the same voltage as the NC Terminal of the rightmost relay.
  • Connect an SMC Valve to the rightmost USB Breakout Board via the USB Port.
  • Connect the 24V Power Supply.
  • We can now turn our Valve ON or OFF using our Computer. Execute the Cell Below to Watch a Video of the Process.
In [2]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/wVSTnvjBN8k?si=Z9SSMWAJQ06cb4FA" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Finishing the remaining Connections¶

  • Disconnect the 24V DC Power Supply.
  • Now that we know how to wire up the connection for one Valve, we can do it for the remaining 7 easily.
  • This part is different from the Previous Version and only applies to the ESP32.Using Female to Female Jumper Wires Connect Pins:
    • In1 on 8-Channel Relay to RX2 on ESP32
    • In2 on 8-Channel Relay to TX2 on ESP32
    • In3 on 8-Channel Relay to D18 on ESP32
    • In4 on 8-Channel Relay to D19 on ESP32
    • In5 on 8-Channel Relay to D27 on ESP32
    • In6 on 8-Channel Relay to D26 on ESP32
    • In7 on 8-Channel Relay to D33 on ESP32
    • In8 on 8-Channel Relay to D32 on ESP32
  • Connect the COM Terminal of Relays from right to left to 24->18 Headers on the Breadboard PCB Upper Positive rail respectively.
  • Connect the NC Terminal of Relays from right to left to E13->E7 Headers on the Breadboard PCB respectively.
  • Connect the GND Header on the USB Breakout boards from right to left to 24->18 Headers on the Breadboard PCB Lower Negative rail respectively.
  • Connect the VBUS Header on the USB Breakout boards from right to left to A13->A7 Headers on the Breadboard PCB respectively.
  • Now all we need to do is one final check to make sure its working as expected.
  • Connect the 24V DC Power Supply.
  • Execute the Cell Below to watch a video of the process.
In [21]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/_w2bWsCGiAE?si=ii3kAeFvO5dK6Xok" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Close the Housing¶

  • Disconnect the 24V DC Power Supply.
  • Disconnect the USB Cable.
  • Press down the Top housing on the Bottom Housing.
  • Make sure the Holes on top are aligned.
  • Using M3 8mm Self Tapping Screws and the 3.0(PH0) Screwdriver Head:
    • Insert the screws in all four corners and tighten.
    • Make sure there are no wires stuck in between the Top and Bottom Housing.
  • Execute the Cell Below to Watch a Video of the Final Product.
In [22]:
%%HTML
<iframe width="800" height="600" src="https://www.youtube.com/embed/8OTM_BlqqBo?si=H4VLlSMjX1JK4MVz" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>

Controlling the Valve Controller with Python in Jupyter Notebooks¶

  • Since we have already programmed our Valve Controller to respond to 8 Bit Binary Strings we can now use this to control it within Jupyter notebooks.
  • Connect your Valve Controller to 24V DC.
  • Connect your Valve Controller Via USB to your Computer.
  • You can Identify the COM Port by Connecting and then Disconnecting the Controller and then checking which new COM Port Shows up in Arduino IDE.
    • In our case we can see the Port is COM14
  • Close the Arduino IDE. Closing the IDE Severs the Connection to the Valve Controller. Only one program can connect to the Valve Controller at a Time.
  • We will now Connect to the Valve Controller using PySerial.
In [17]:
import serial
import time
valveControllerCOMPort="COM14"

ValveController=serial.Serial(valveControllerCOMPort, timeout=1, write_timeout=0)
time.sleep(5.0)
print(ValveController.is_open)
print(ValveController.get_settings())
True
{'baudrate': 9600, 'bytesize': 8, 'parity': 'N', 'stopbits': 1, 'xonxoff': False, 'dsrdtr': False, 'rtscts': False, 'timeout': 1, 'write_timeout': 0, 'inter_byte_timeout': None}
  • We can now send commands to the ValveController by writing to the Serial Port
  • Lets Turn all the Relays ON. You should hear a clicking sound.
In [18]:
##This will turn all the Relays ON
ValveController.write("11111111\n".encode())
time.sleep(5.0)
  • Now Lets Turn all the Relays OFF. You should hear another clicking sound.
In [19]:
##This will turn all Relays OFF
ValveController.write("00000000\n".encode())
time.sleep(5.0)
  • Now we can close the connection to the Valve Controller.
In [20]:
ValveController.close()

So now we are done. We have successfully assembled and controlled our Valve Controller with Python in our Jupyter Notebook. We will slowly build the other components and bring them all together to assemble our Complete ChronoSeq Device. We can then start orchestrating them together in a single Notebook for more complex behaviors.