Arduino Colloidal Silver Controller UPDATE
Arduino Colloidal Silver Controller UPDATE
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…
#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
{
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,
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
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!