Arduino AgNP Control Doc2
Arduino AgNP Control Doc2
Photo of a run in progress. Display of temp (F), Electrode volts (E), and time minutes (T).
Arduino Uno is underneath the LCD Keypad Shield.
Overview: Constant current set for 1.0mA. Two silver electrodes, 12Ga.
Arduino Uno, with LCD Keypad Shield. Starting with distilled water only.
#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 = 10; //electrode voltage alarm set
int timeset = 80; //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
FUNCTIONS:
Two switch states; RUN and STANDBY. In Standby, all systems are off. Display shows volts and time.
When switched to run, LCD displays volts, time and solution temperature in Fahrenheit.
LCD KEYPAD: See diagram. One key turns on the 1W UV LED, another key turns it off. A third keypad
button “jogs” the mixer manually. The mixer is also actuated automatically whenever electrode volts drop
below 25. Above 25 it will cycle, below it stays on.
Time limit: the alarm (Red LED and piezo buzzer) activate when the preset time is exceeded. The time
can be changed in the software, presently set to 80 minutes.
Voltage limit: the alarm (Res LED and buzzer) actuate when the electrode voltage drops below the preset
point of 10V. This value can be changed in software.
Neither alarm states affect run power, it’s up to the user to conclude ther run by switching to standby.
Procedure: Wire up the entire circuit first. Test. When ready for a run, power up the Arduino. And
immediately open the serial window. Then switch to RUN.
When run is completed, be sure to copy the serial window data into Excel and save for later analysis…a
fingerprint of how the run went!
The Arduino is monitoring time, temperature, electrode voltage and several switch states.
Power: requires a 5VDC 1A supply and 27VDC.
Wiring and controls on the LCD Keypad Shield.
Circuit schematic.
Resulting chart from downloading serial data into Excel; electrode volts versus time in minutes.
Far left: RGB LED colorimeter for Arduino, testing of AgNP solutions. Center: Diode laser turbidimeter for
Tyndall Effect. Backround: a collection of ionic/colloidal silver solutions both commercial and homemade
In plastic cuvettes to fit the detector modules.
Bottom view of reaction vessel cap, showing stirring rod, UVLED and temperature sensor. Jar vol =
16fl.oz.
Running in low light. Note UV from under foil. Use of UV reference: Hans Laroo, J Phys Chem Biophys,
2013, 3:5. Colloidal Nano Silver, Its Production Methods, Properties, Standards and Bioefficacy as an
Inorganic Antibiotic.