0% found this document useful (0 votes)
16 views8 pages

Arduino Colloidal Silver Controller UPDATE

The document provides updates on the Arduino Colloidal Silver Controller, including schematic corrections and modifications to the Arduino sketch based on data from two runs. It details the setup and loop functions of the Arduino code, which monitors and logs various parameters such as electrode voltage and temperature during the electrochemistry process. Additionally, it analyzes data from a run on 12/12/14, suggesting optimal run conditions and proposing future enhancements for better monitoring and control.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
16 views8 pages

Arduino Colloidal Silver Controller UPDATE

The document provides updates on the Arduino Colloidal Silver Controller, including schematic corrections and modifications to the Arduino sketch based on data from two runs. It details the setup and loop functions of the Arduino code, which monitors and logs various parameters such as electrode voltage and temperature during the electrochemistry process. Additionally, it analyzes data from a run on 12/12/14, suggesting optimal run conditions and proposing future enhancements for better monitoring and control.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 8

Arduino Colloidal Silver Controller, UPDATE,

Nick Cinquino 12/16/2014

Updates include: A couple of schematic corrections, changes to the Arduino


sketch (on the basis of what was learned from 2 runs, 12/6/14 and 12/12/14,
for runs of 400ml of distilled water at 68 Deg.F, and analysis of data collected by
the Arduino AgNP Controller.

Photo from run made 12/12/14. Autostirring is on, note difference in appearance
of the 2 silver electrodes (12ga, 9999). Foil is off for the pic, UV 1W LED is on.
UPDATED SKETCH. Minor changes in red…

//Arduino Colloidal Silver Electrochemistry Process Controller NJC 12/16/14


//Displays elapsed time and electrode voltage. Logs data to serial window.

#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
int analogPin = 1; //analog input at A1, electrode V.
int val = 0; //electrode voltage value
int analogKeypad = 0; //keypad input
float keycode = 0; //keypad value
long previousMillis = 0; //millis() function
int outPin4 = 3; //to stirrer motor
int outPin2 = 11; //to transistor for CC power
int outPin1 = 12; //output to led/buzzer
int outPin3 = 13; //output to UV LED
long interval = 59000; //serial record every 60 secs(59+1)
int trigpoint = 13; //electrode voltage alarm set
int timeset = 110; //time alarm set minutes
int time; // time since powerup minutes
float volts; //analog conversion to volts
int analogTemp =2; //input from LM34DZ
float temp; //Temperature from LM34DZ
float lm34; //temp value
int inPin = 2; // the number of the input pin
int reading; //on/off switch to constant current and uC

void setup()
{
lcd.begin(16, 2); //fire up the LCD
Serial.begin(9600); //start serial comm
pinMode(3, OUTPUT); //pin3 to mixer motor
pinMode(11, OUTPUT); //pin to transistor cc
pinMode(12, OUTPUT); //pin 12 out to LED/Buzzer
pinMode(13, OUTPUT); //pin 13 to UVLED
pinMode(inPin, INPUT); //pin 3 switch input
time = 0;
Serial.println("Arduino Colloidal Silver Run Data");
Serial.println("Date/Time/Notes:");
Serial.println("Time, Volts, TempF, Vtrig, Ttrig, Power");
}

void loop()
{
reading = digitalRead(inPin); //check switch

if (reading == HIGH) //switch condition, RUN


{
digitalWrite (outPin2, HIGH); //const current ON
val = analogRead(analogPin); //read volt data
volts = val * 0.0370; //convert analog to volts
lm34 = analogRead(analogTemp); //get ADC of temperature
temp = lm34/1024*500; //convert to degrees F
unsigned long currentMillis = millis(); //timing func
if (currentMillis - previousMillis > interval)

{
previousMillis = currentMillis;
Serial.print(time); //serial elapsed time data
Serial.print(", ");
Serial.print(volts, 2); //serial electrode voltage data
Serial.print(", ");
Serial.print(temp, 1); //serial temp data F
Serial.print(", ");
Serial.print(trigpoint); //serial voltage trigger data
Serial.print(", ");
Serial.print(timeset); //serial time trigger data
Serial.print(", ");
Serial.println("ON"); //serial power status data
time ++;

lcd.clear();
lcd.setCursor(0, 0);
lcd.print("AgNP RUN"); //print header
lcd.setCursor(10, 0);
lcd.print("F=");
lcd.print(temp,1); //print temp degrees F
lcd.setCursor(0, 1);
lcd.print("E=");
lcd.print(volts, 2); //print electrode voltage
lcd.setCursor(10, 1);
lcd.print("T=");
lcd.print(time); //print elapsed time in minutes
delay(1000); //LCD refresh delay

if ((millis() / 60000) >= timeset || volts <= trigpoint) //timer stop OR Volt stop
{
digitalWrite(outPin1, HIGH ); //alarm on,
}
else digitalWrite(outPin1, LOW); //alarm low,

analogKeypad=analogRead(0); //UV led on


if ((analogKeypad >=90)&&(analogKeypad <=110))
{
digitalWrite(outPin3, HIGH);
}

analogKeypad=analogRead(0); //UV led off


if ((analogKeypad >=250)&&(analogKeypad <=270))
{
digitalWrite(outPin3, LOW);
}

analogKeypad=analogRead(0); //stirrer momentary


if ((analogKeypad >=400)&&(analogKeypad <=420))
{
digitalWrite(outPin4, HIGH);
}
else digitalWrite(outPin4, LOW);

if (volts <=25)
{
digitalWrite(outPin4, HIGH); //stirrer on
}

else { //standby
digitalWrite(outPin1,LOW); //alarm off
digitalWrite(outPin2,LOW); //const current power off
digitalWrite(outPin3,LOW); //1W UVLED off
digitalWrite(outPin4,LOW); //stirrer off
val = analogRead(analogPin);
volts = val * 0.0370;
lm34 = analogRead(analogTemp); //get ADC of temperature
temp = lm34/1024*500; //convert to degrees F
unsigned long currentMillis = millis();
if (currentMillis - previousMillis > interval)

{
previousMillis = currentMillis;
Serial.print(time); //serial time data
Serial.print(", ");
Serial.print(volts, 2); //serial electrode volts data
Serial.print(", ");
Serial.print(temp, 1); //serial temp F data
Serial.print(", ");
Serial.print(trigpoint); //serial V trigger point
Serial.print(", ");
Serial.print(timeset); //serial time trigger set
Serial.print(", ");
Serial.println("OFF"); //serial power status
time ++;
}
lcd.clear();
lcd.setCursor(2, 0);
lcd.print("AgNP STANDBY"); //print header
lcd.setCursor(1, 1); // setup spot for volts value
lcd.print("F=");
lcd.print(temp, 1); //print volts value
lcd.setCursor(9, 1); //setup spot for timer value
lcd.print("E=");
lcd.print(volts); //print elapsed time in minutes

delay (1000); //delay for LCD refresh


}
}
A couple corrections to the schematic (oops, my bad):
The relay should be wired Normally Open, not Normally Closed as originally
shown. The LM334Z temperature compensation resistor should be a 1.5k ohm,
not 150 ohm. Curiously, I built it with both resistors to the side of the LM334Z as
150 ohm and it still runs the correct current of 1mA. Possibly the temperature
compensation is not performing perfectly.
ANALYSIS OF THE 12/12/14 RUN
DATA:

Plot of the raw electrode volts logged by the Arduino. The run was intentionally
allowed to run longer than initially planned. Note upswing at 110 minutes!

Placing known resistors across the electrode terminals and recording the
resulting electrode volts allows calibration of volts to ohms.
Converting ohms to millimhos allows electrode voltage calibration into millimhos.

Run data, converted into conductance vs time. That peak at 110 minutes was I
think the OPTIMUM time to stop the run!
So, does a run of 400ml distilled water, at 1mA make sense from a chemical
standpoint, assuming an expected endpoint should be somewhere in the 10ppm
to 25ppm range? As it turns out it does appear to make good sense!

Note that for the first 30 minutes, we don’t know what the current was, only that it
was rising from some very tiny number up to 1mA. After that, for the rest of the
run, current WAS 1mA. We know this because the constant current supply was
“throttling down” the voltage to hold current at 1mA!

Future projects: In addition to monitoring electrode volts, it’d be nice to have a


logged measure of current from 1 – 30 minutes. Afterward, we know it is 1mA
thanks to the constant current supply. Also, can the Arduino detect that slow
upswing in electrode volts to either notify the operator or auto-stop the run. How
can it handle the maddening propensity of every run acting a bit differently? With
initial current data, can the Coulombs be constantly summed, thus the total silver
summed, and stop the run on that target basis??

You might also like