Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Davide Cogliati
Published © GPL3+

Grove UVA-UVC programmable source board

Start experimenting with UV radiation with this well featured Grove board, programmable and very compact to use.

IntermediateFull instructions provided1 hour167
Grove UVA-UVC programmable source board

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Through Hole Resistor, 10 kohm
Through Hole Resistor, 10 kohm
×2
Resistor 1k ohm
Resistor 1k ohm
×1
5 mm LED: Red
5 mm LED: Red
×1
5 mm LED: Green
5 mm LED: Green
×1
Pushbutton switch 12mm
SparkFun Pushbutton switch 12mm
×2
small protoboard
×1
Jumper wires (generic)
Jumper wires (generic)
×1

Software apps and online services

Seeed Fusion service
> https://www.seeedstudio.com/fusion.html

Hand tools and fabrication machines

Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Wire Stripper & Cutter, 32-20 AWG / 0.05-0.5mm² Solid & Stranded Wires
Soldering iron (generic)
Soldering iron (generic)
Seeed Studio Fusion PCB/PCBA
Seeed Studio Fusion PCB/PCBA

Story

Read more

Custom parts and enclosures

Grove UV Source power board description

In this document you can find a detailed explanation of the board.

EXAMPLE APPLICATION OF UV -1

This is an example on how UV radiation is used, example-1

EXAMPLE APPLICATION OF UV -2

This is a second example on how to use UV.

TESTING THE SKETCH IN GRAPH - LITERAL MODE

Selecting the Monitor or Plot in ARDUINO GUI you can see the Grove UV Power Source Board running.

THE GROVE UVA-UVC IN TEST ON GROWING PLANTS FROM SEED

This box was build to test the UVA-UVC Source board on plants growing from seed, excellent growth was achieved.

Schematics

SCHEMATIC LAYOUT FOR THE PROPOSED ARDUINO CODE

This electrical schematics show how simple is to connect the Grove UV power source board, added two pushbuttons to increment-decrement power and two led to show the press action on the pushbuttons.

FRITZING SCHEMATICS

This schematics show the connection to run the ARDUINO Code in this project.

Code

ARDUINO APPLICATION FOR GROVE UV SOURCE BOARD, CHANGE POWER LEVEL AND READ OUT LIGHT INTENSITY.

Arduino
This simple code can let you manage the power level output on the Grove UV board and read the light / UV intensity reflected back from a front surface. Can be modified to add more functions such as time / intensity curing cycles or just to read out the opacity to UV of a flowing liquid in front of the board.
//*********************************************************************************
//***************  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 **********************************************
   //***************************************************************
   

Credits

Davide Cogliati
8 projects • 8 followers
I develop electronic boards for customers and final 3D products.
Contact

Comments

Please log in or sign up to comment.