Hardware components | ||||||
![]() |
| × | 1 | |||
![]() |
| × | 2 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 1 | |||
![]() |
| × | 2 | |||
| × | 1 | ||||
![]() |
| × | 1 | |||
Software apps and online services | ||||||
| ||||||
Hand tools and fabrication machines | ||||||
![]() |
| |||||
![]() |
| |||||
![]() |
|
It is worth to talk about how I came to this idea, the development of a UV source board, very rich in features, small to lay on your desk, fully programmable but yet with enough power to see the effect of UV radiation.
First of all pay attention not to stay with your sight on the UV power led radiation flux it is very dangerous for eyes. This radiation is hardly visible but can harm seriously your eyes.
For this reason I put on the board a blue led to show the board is working, please pay attention when blue light is on, the board is powered.
I like to raise crops, flowers in home, special plants from seeds, avoid using chemical products to keep low the bacteria on plants leaf. I read about use of UV radiation for this and how it is better to use UVA for one scope and UVC for another, and how application time, intensity, and presence of sunlight can work good as a complement with UV radiation.So I defined the technical specification for the source, type of power led (UV) how to change intensity, application time and how to read out the light intensity on the final destination.
After many choices I approached to design this board and to select the best components I could find at a really reasonable cost.A lot of work on power heating of the board, onboard step up supply chip, on board microcontroller(and initial firmware to drive the board), component positioning, good electrical design.
This take me really lot of time and effort, but in the same time a look carefully over flaws or weak points of the design.Now I am finally ready to present this project developed trough the high professional services of Seeed Fusion services, I thank very much > https://www.seeedstudio.com/fusion.html
ARDUINO APPLICATION FOR GROVE UV SOURCE BOARD, CHANGE POWER LEVEL AND READ OUT LIGHT INTENSITY.
Arduino//*********************************************************************************
//*************** Designed for Seeed Grove UV Source *******************
//*************** outputs UVA and UVC RADIATION *******************
//*************** PROGRAMMABLE LEVEL trough I2C *******************
//*************** READABLE I2C intensity level of light *******************
//*************** *******************
//*************** first release: 1.0 - 08/11/2023 *******************
//*************** Author: Davide Cogliati *******************
//*********************************************************************************
#include <Wire.h>
#define uP 2
#define down 3
#define buttons 4
#define buttons_neg 5
#define LED_up 6
#define LED_down 7
int graph;
//--------------------------------------------------------------------------------
//I2C ADDRESS SCANNER - FINDER loop |
//-------------------------------------------
//checks the presence of a valid I2C sensor online (this part can be omitted
//in final application but use it during setting up for first time the I2C address
// ------------------------
// please check this flag!
// ------------------------
// "boolean search_I2C= false; // //flag= true, to start self test on I2C sensor address ADDRESS"
//
//----------------------------------------------------------------------------------
void setup()
{
graph=1;//0;//1;
Serial.begin(9600);
delay(1000);
if(!graph)
{
Serial.println("UV programmable source board scanning");
Serial.println("Starting....");
Serial.println("------------------------------------");
}
if(graph)
{
//*****************************************
//SET UP THE PLOTTER X-Y READINGS (X= time)
//*****************************************
Serial.print("MAX"); //max line marker
Serial.print(" ");
Serial.print("min");//min line marker
Serial.print(" ");
//*****************************************
//SETUP LABELS NAME
//*****************************************
Serial.print("INTENS");
Serial.print(" ");
Serial.print("UP");
Serial.print(" ");
Serial.print("DOWN");
Serial.print(" ");
Serial.println("elap.time: ");
}
delay(1000);
Wire.begin();
Wire.setClock(100000); // set I2C speed
pinMode(uP, INPUT); // UP BUTTON increase
pinMode(down, INPUT); // DOWN BUTTON decrease
pinMode(buttons, OUTPUT); // + BUTTON enable
pinMode(buttons_neg, OUTPUT); // - BUTTON enable
pinMode(LED_up, OUTPUT); // led BUTTON up enable
pinMode(LED_down, OUTPUT); // led BUTTON down enable
}
//------------------------------------------------------------------------------------
//------------------------------------------------------------------------------------
void loop()
{
int done =1;
boolean search_I2C= false; // //flag= true, to start self test on I2C sensor address ADDRESS
int c;
int val_pwm;
int indevice;
boolean increase=false;
boolean decrease=false;
digitalWrite(buttons, HIGH);
digitalWrite(buttons_neg, LOW);
digitalWrite(LED_up, LOW);
digitalWrite(LED_down, LOW);
boolean changed=false;
//-------------------------------------------------
//GRAPH SCALING MIN-MAX: MODIFY AS YOU LIKE!!!
//-------------------------------------------------
int MAX_scale =30; //setting max Y of plotting
int min_scale =0; //setting min Y of plotting
//-------------------------------------------------
val_pwm=0;
indevice = 5;// I2C address value, AVOID: 0,1,2,3 POSSIBILE VALUES: 5,6,7,8,9
//------------------------------------------------------
//set to low power the UV source AT START UP
//------------------------------------------------------
Wire.beginTransmission(indevice);
Wire.write(val_pwm);
Wire.endTransmission(true);
if(!graph)
{
Serial.println();
Serial.print("Done ! ");
Serial.println();
}
delay(200);
//-------------------------------------------------------------------
// MAIN RUNNING ENDLESS LOOP
//-------------------------------------------------------------------
if(graph)
{
//*****************************************
//SET UP THE PLOTTER X-Y READINGS (X= time)
//*****************************************
Serial.print("MAX"); //max line marker
Serial.print(" ");
Serial.print("min");//min line marker
Serial.print(" ");
//*****************************************
//SETUP LABELS NAME
//*****************************************
Serial.print("INTENS");
Serial.print(" ");
Serial.print("UP");
Serial.print(" ");
Serial.print("DOWN");
Serial.print(" ");
Serial.println("elap.time: ");
}
//**************************************************
while (done)
{
if(!graph)
{
Serial.println();
Serial.print("SENSOR UV..working... ");
}
c=0;
while (search_I2C)
{
indevice = indevice +1 ;
if (indevice > 20)
indevice=5;
Wire.beginTransmission(indevice);
Wire.requestFrom(indevice, 1); // Request 1 bytes from slave device
//------------------------------------------------
// change with this for more data input from I2C
//------------------------------------------------
//Wire.requestFrom(indevice, 3); // Request 3 bytes from slave (OR MORE!)
//-------------------------------------------------
Wire.endTransmission(true);
if(!graph)
{
Serial.print("scanning device = ");
Serial.print(indevice);
Serial.println(" ");
}
delay(1000);
//-----------------------------------------------------------
// SCANNED & FOUND VALID ADDRESS SHOWING REGISTER CONTENT
//-----------------------------------------------------------
//-----------------------------------------------------------
while(Wire.available())
{
c = Wire.read(); // Receive a byte as character I2C addressed to 0x0(indevice)
if(!graph)
{
Serial.println();
Serial.print("working ADDR decimal value: ");
Serial.print(indevice);
Serial.print(" --> light measured level: ");
Serial.print("[ ");
Serial.print((int)c); // Print the ASCII DECIAML value from light sensor on board
Serial.print(" ]");
Serial.println();
}
if(graph)
{
Serial.print(MAX_scale);
Serial.print(" ");
Serial.print(min_scale);
Serial.print(" ");
//------------------------------------------------
Serial.print(c,DEC); // x 10 enhances the sight on the graph
Serial.print(" ");
Serial.print(val_pwm,DEC); // x 10 enhances the sight on the graph
Serial.print(" ");
Serial.print(30,DEC);
Serial.print(" ");
Serial.println("elap.time: ");
}
}
}
if(1) //always active readinbg on I2C
{
Wire.beginTransmission(indevice);
Wire.requestFrom(indevice, 1); // Request 1 bytes from slave device
//------------------------------------------------
// change with this for more data input from I2C
//------------------------------------------------
//Wire.requestFrom(indevice, 3); // Request 3 bytes from slave (OR MORE!)
//-------------------------------------------------
Wire.endTransmission(true);
//-----------------------------------------------------------
// SCANNED READING VALID ADDRESS SHOWING REGISTER CONTENT
//-----------------------------------------------------------
//-----------------------------------------------------------
while(Wire.available())
{
c = Wire.read(); // Receive a byte as character I2C addressed to 0x0(indevice)
if(!graph)
{
Serial.println();
Serial.print("working ADDR: 0X0");
Serial.print(indevice);
Serial.print(" --> light measured level: ");
Serial.print("[ ");
Serial.print((int)c); // Print the ASCII DECIAML value from light sensor on board
Serial.print(" ]");
Serial.println();
}
if(graph)
{
Serial.print(MAX_scale);
Serial.print(" ");
Serial.print(min_scale);
Serial.print(" ");
//------------------------------------------------
Serial.print(c,DEC); // x 10 enhances the sight on the graph
Serial.print(" ");
Serial.print(val_pwm,DEC); // x 10 enhances the sight on the graph
Serial.print(" ");
Serial.print(30,DEC);
Serial.print(" ");
Serial.println("elap.time: ");
}
}
}
increase=digitalRead(uP);
decrease=digitalRead(down);
digitalWrite(LED_up, LOW);
digitalWrite(LED_down, LOW);
delay(500);
if(!graph)
{
if(!increase)
Serial.println(" ++++ INCREASE off: "); // Print the pushbutton UP
if(!decrease)
Serial.println(" ---- DECREASE off: "); // Print the pushbutton DOWN
}
while(increase)
{
increase=digitalRead(uP);
digitalWrite(LED_up, HIGH);
digitalWrite(LED_down, LOW);
val_pwm= val_pwm+1;
if (val_pwm > 30)
val_pwm =30;
if(!graph)
{
Serial.println();
Serial.print("INCREASE radiation: "); // Print the character RECEIVED
Serial.println();
Serial.print(val_pwm); // Print the character RECEIVED
Serial.println();
}
delay(500);
changed=true;
}
while(decrease)
{
decrease=digitalRead(down);
digitalWrite(LED_up, LOW);
digitalWrite(LED_down, HIGH);
val_pwm= val_pwm -1;
if (val_pwm <1)
val_pwm=1;
if(!graph)
{
Serial.println();
Serial.print("DECREASE: "); // Print the character RECEIVED
Serial.println();
Serial.print(val_pwm); // Print the character RECEIVED
Serial.println();
}
delay(500);
changed=true;
}
digitalWrite(LED_up, LOW);
digitalWrite(LED_down, LOW);
if(val_pwm < 3)
{
if(!graph)
{
Serial.println("***********************");
Serial.println("* UV LOW outout ****");
Serial.println("***********************");
}
if(graph)
{
Serial.print(MAX_scale);
Serial.print(" ");
Serial.print(min_scale);
Serial.print(" ");
//------------------------------------------------
Serial.print(c,DEC); // x 10 enhances the sight on the graph
Serial.print(" ");
Serial.print(val_pwm,DEC); // x 10 enhances the sight on the graph
Serial.print(" ");
Serial.print(30,DEC);
Serial.print(" ");
Serial.println("elap.time: ");
}
delay(3000); //if connected I2C with Serial output keep this time > 2000 there is
//interaction between SERIAL / I2C.
}
if(1) //(changed) //--->change this ONLY IF CHANGED VLAUE!
{
//-------------------------------------------------------
//PWM CONTROL - UV INTENSITY
//-------------------------------------------------------
//-------------------------------------
//WRITE TO THE BOARD TROUGH I2C
//-------------------------------------
changed=false;
if(!graph)
{
Serial.println();
Serial.print("writing pwm value ");
Serial.println();
Serial.print(val_pwm);
Serial.println();
}
Wire.beginTransmission(indevice);
Wire.write(val_pwm);
Wire.endTransmission(true);
if(!graph)
{
Serial.println();
Serial.print("Done ! ");
Serial.println();
}
delay(100); //200
//-------------------------------------
}
}
//***************************************************************
} //END OF MAIN LOOP **********************************************
//***************************************************************
Comments
Please log in or sign up to comment.