Pressure control

In our previous we’ve got all ready – now wrapping it all up – gas cell’s pressure control!

So Sebi prepared this board below to do the job.

There is an Arduino Nano (that central blue-ish thingy), while that main magic is that black micro-chip-y thing, which is actually an ULN2003 16-Pin Darlington Transistor Array IC. This micro-chip integrates something like SUPPRESSION DIODES FOR INDUCTIVE LOADS – which is quite fancy word for a current relays. It is there to allow Arduino to handle higher voltages for selenoid and air pump operations.

Took few pictures when it’s all mounted to our gas cell.

Having it all connected, we did a first pressurisation test.

So Sebi actually did all the design and coding and testing and here is his working code (if you are really trying to give it a go don’t forget to get this library too).

#include <HX710B.h>

HX710B pressure_sensor;

float currentPsi = 0.0807;
float targetPsi = 0.083;
float targetRadius = 0.001;

String conStatus = "normal";

bool moreOverRide = false;
bool lessOverRide = false;

void setup() {
  pressure_sensor.begin(2, 3);
  pinMode(4, OUTPUT); //input
  pinMode(5, OUTPUT); //output
  pinMode(6, OUTPUT); //motor

void loop() {

  if (pressure_sensor.is_ready()) {

    Serial.print("current PSI: ");

    currentPsi = pressure_sensor.psi();

    Serial.print(currentPsi, 4);
    Serial.print(" target PSI: ");
    Serial.println(targetPsi, 4);

    Serial.println((moreOverRide || lessOverRide));

  if (Serial.available()) {
    targetPsi = Serial.readString().toFloat();

  if ((currentPsi + targetRadius < targetPsi) || (moreOverRide && currentPsi < targetPsi)) {

    digitalWrite(4, HIGH);
    digitalWrite(6, HIGH);
    digitalWrite(5, LOW);

    moreOverRide = true;
    lessOverRide = false;

    conStatus = "need more - 4 - on, 5 - off";
  } else if ((currentPsi - targetRadius > targetPsi) || (lessOverRide && currentPsi > targetPsi)) {

    digitalWrite(4, LOW);
    digitalWrite(6, LOW);
    digitalWrite(5, HIGH);

    moreOverRide = false;
    lessOverRide = true;

    conStatus = "need less - 4 - off, 5 - on";
  } else {
    digitalWrite(4, LOW);
    digitalWrite(6, LOW);
    digitalWrite(5, LOW);

    moreOverRide = false;
    lessOverRide = false;

    conStatus = "all good - 4 - off, 5 - off";

Then finally – voila – here comes it all working!

Well, this is it. Now just to build many of them and scale up! šŸ™‚

UPDATE 14th June 2022

Sebi assumed that this is a good opportunity to test his new PCBs and reorganise those electronic parts from breadboard to there.

We also did few more tests with that new setup.

Leave a Reply