The Planted Tank Forum banner
1 - 1 of 1 Posts

·
Registered
Joined
·
1 Posts
Discussion Starter · #1 · (Edited)


That's about 40 dollars in parts if you get the Sainsmart Nano v3 board for 15 which includes ribbon cables and USB cord to program it. The value of the potentiometer doesn't really matter. You can put the solenoid on a 15490-2 manifold also from Clippard and a 11752-1 barb on the output of the manifold 1/8" tubing to hook up to your CO2 reactor.

Simple code for the Nano can look like this, and with some playing around you could control 8 different solenoids with little knobs.

Code:
int inPins[] = {A0,A1,A2,A3,A4,A5};
int outPins[] = {2,4,7,8,12,13};
int val = 0;              // the value of the current reading
int openTime = 100; // 200 milliseconds on time

void setup()  {
   // initialize serial communications at 9600 bps:
   Serial.begin(9600);
   for (int c=0; c<6;c++) {
     pinMode(outPins[c],OUTPUT);
   }
}

void loop() {
    val = analogRead(inPins[0]);
    digitalWrite(outPins[0],HIGH);
    delay(openTime);
    digitalWrite(outPins[0],LOW);
    delay(val*5);  
}
 
1 - 1 of 1 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top