[Solved] UV meter code, noob needs help!

Hello, i am trying to help my son build a UV meter for his school science fair. I have followed the instructions from this page

Everything was going smooth until I had to install the software.

I tried, I did, but kept getting the following message
LCD5110_Graph.h: No such file or directory

I tried putting everything in different tabs, copying the cpp file to the text editor and putting it in another tab, I thought it would all be solved when i got what i thought was the missing code from:

But no success.

Can someone guide me like you were guiding a baby through the software installation.
I appreciate it very much. This happens to me for overreaching, but now i am deep in this project and I am supposed to be the helper.

Thank you.

It appears you do not have the appropriate library(s) loaded. Try properly posting your code. Is the CPP code in the same folder as the sketch. At this point we will assume the Hardware is OK but subject to operating code.

In the project link you provided:

These instructions should assist:
https://www.arduino.cc/en/guide/libraries

Good luck. Interesting project.

http://www.rinkydinkelectronics.com/library.php?id=48

Just under "Download:" you will find a link to:
LCD5110_Graph.zip

Click on the link to download the library in .zip form.

In the IDE, select Sketch->Include Library->Add .ZIP Library...

Select the downloaded .zip file and install.

That should fix the problem.

Thank you so much, i just read it. no more unzipping stuff. wish me luck!

Thank you for the help, it did not occur to me that it was possible you would answer, so that's an awesome surprise. I'm onto it. We will see soon.
Thank you again

thank you, you are right, I am starting from scratch and i thought, because there is so much available online, that a complete neophyte could manage, but reality hits hard and fast. Good thing is I somehow stumbled with this forum that so far seems full of good souls.

OK, so i followed your instructions and was successful at having the IDE verify the code. But i uploaded it and, nothing happens.

I tried loading the zip library for the UVmeter as it came from the site, but IDE was having none of it, the error reads (Specified folder/zip file does not contain a valid library) so I unzipped it (reluctantly) and then loaded the .ino file and 2 .c files that opened in separate tabs . The LCD zip was added to the IDE as instructed without a flaw, and when i clicked on it, the IDE showed:

#include <LCD5110_Graph.h>

In the end the software i uploaded to the uno is as follows( I added the 3 ` thingies before and after as the forum bot said):

in the first tab called UVMeter:

#include <LCD5110_Graph.h>

#include <LCD5110_Graph.h>

   //////////////////////////////////////////////
  //            Arduino UV Meter              //
 //            with NOKIA 5110 LCD           //
//           http://www.educ8s.tv           //
/////////////////////////////////////////////

#include <LCD5110_Graph.h>

LCD5110 lcd(8,9,10,12,11);
extern unsigned char BigNumbers[];
extern uint8_t splash[];
extern uint8_t ui[];

String UV = "0"; 

void setup() {
 
 lcd.InitLCD();
 lcd.setFont(BigNumbers);
 lcd.clrScr();
 lcd.drawBitmap(0, 0, splash, 84, 48);
 lcd.update();  
 delay(3000);
 
}

void loop() {
 
 int stringLength = 0; 
  
 UV = readSensor();
 lcd.clrScr();
 lcd.drawBitmap(0, 0, ui, 84, 48);
 
 stringLength = UV.length();
 printUV(stringLength);
 lcd.update();
 delay(150);
}

void printUV(int length)
{
  switch(length)
  {
    case 1:  lcd.print(UV,38,19); break;
    case 2:  lcd.print(UV,24,19); break;
    default:  lcd.print(UV,0,19); break;
  }
}

String readSensor()
{
  String UVIndex = "0";
  int sensorValue = 0;
  
  sensorValue = analogRead(0);                        //connect UV sensor to Analog 0   
  int voltage = (sensorValue * (5.0 / 1023.0))*1000;  //Voltage in miliVolts
  
  if(voltage<50)
  {
    UVIndex = "0";
  }else if (voltage>50 && voltage<=227)
  {
    UVIndex = "0";
  }else if (voltage>227 && voltage<=318)
  {
    UVIndex = "1";
  }
  else if (voltage>318 && voltage<=408)
  {
    UVIndex = "2";
  }else if (voltage>408 && voltage<=503)
  {
    UVIndex = "3";
  }
  else if (voltage>503 && voltage<=606)
  {
    UVIndex = "4";
  }else if (voltage>606 && voltage<=696)
  {
    UVIndex = "5";
  }else if (voltage>696 && voltage<=795)
  {
    UVIndex = "6";
  }else if (voltage>795 && voltage<=881)
  {
    UVIndex = "7";
  }
  else if (voltage>881 && voltage<=976)
  {
    UVIndex = "8";
  }
  else if (voltage>976 && voltage<=1079)
  {
    UVIndex = "9";
  }
  else if (voltage>1079 && voltage<=1170)
  {
    UVIndex = "10";
  }else if (voltage>1170)
  {
    UVIndex = "11";
  }
  return UVIndex;
}

In the second tab called splash.c there is this:

#include <avr/pgmspace.h>

const unsigned char splash []PROGMEM = {
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xF0, 0xF0, 0x00, 0x00, 0x80, 0xE0, 0x80,
0x00, 0x00, 0x00, 0xC0, 0xE0, 0xE0, 0xE0, 0xFC, 0xF8, 0x00, 0xC0, 0x80, 0x00, 0x00, 0x80, 0xC0,
0xF8, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00,
0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0xF0, 0xF0, 0xF0, 0xF0, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x80, 0xCF, 0xFF, 0xFF, 0x7F,
0x3E, 0x1D, 0x0F, 0x07, 0x07, 0x03, 0x03, 0x03, 0x03, 0x03, 0x01, 0x01, 0x03, 0x03, 0x03, 0x03,
0x07, 0x07, 0x0F, 0x0F, 0x17, 0x33, 0xF1, 0xFC, 0xE4, 0xC0, 0x40, 0x40, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0xFF,
0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFE, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x08, 0x0C, 0x1E, 0x3E, 0xFC, 0xFD,
0x1D, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x0F, 0xFF, 0xFC, 0x7C,
0x3C, 0x3C, 0x3C, 0x78, 0xE0, 0xC0, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1F, 0x3F, 0x3F,
0x7F, 0x70, 0x70, 0x7F, 0x7F, 0x3F, 0x1F, 0x00, 0x00, 0x00, 0x01, 0x7F, 0x7F, 0x7F, 0x7C, 0x7F,
0x7F, 0x7F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x10, 0x18,
0x38, 0x79, 0xFB, 0xFF, 0xFC, 0xE0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0,
0xF8, 0xFF, 0xC7, 0x03, 0x03, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0xE0, 0xE0, 0xE0, 0xE0,
0x00, 0xE0, 0xE0, 0xE0, 0x00, 0x00, 0xE0, 0xE0, 0x60, 0x60, 0x00, 0x60, 0x60, 0xE0, 0xE0, 0x60,
0x60, 0x00, 0xE0, 0xE0, 0x60, 0x60, 0x00, 0x00, 0xE0, 0xE0, 0x60, 0x60, 0xE0, 0xC0, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x18, 0x9F, 0x9F, 0xCF, 0xFC, 0xFC, 0xF8, 0xF0,
0x30, 0x20, 0x60, 0x60, 0xC0, 0xC0, 0xC0, 0xC0, 0xC0, 0xE0, 0x20, 0x20, 0xF0, 0xF0, 0xF8, 0xB8,
0x0C, 0x0E, 0x09, 0x03, 0x07, 0x0F, 0x0C, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x01, 0xFF, 0xFE, 0x01, 0xFF, 0xFF, 0x00, 0x00, 0xFF, 0xFF, 0xC6, 0xC6, 0xC0, 0x00,
0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xC6, 0xC6, 0xC0, 0x00, 0xFF, 0xFF, 0x06, 0x06,
0xFF, 0xFB, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x01, 0x01, 0x01, 0x03,
0x03, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00,
0x01, 0x03, 0x03, 0x03, 0x02, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 
};

And in the third tab called ui.c there is this:

#include <avr/pgmspace.h>

const unsigned char ui []PROGMEM = {
0xFF, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0xFD, 0xFD, 0x01, 0x01, 0xFD, 0xFD, 0x01, 0x1D, 0xFD, 0xE1, 0x01, 0xE1, 0xFD, 0x1D,
0x01, 0x01, 0x01, 0xFD, 0xFD, 0x01, 0x01, 0xFD, 0xFD, 0xF1, 0x81, 0xFD, 0xFD, 0x01, 0x01, 0xFD,
0xFD, 0x0D, 0x0D, 0xFD, 0xF9, 0x01, 0x01, 0xFD, 0xFD, 0xCD, 0xCD, 0x01, 0x01, 0x0D, 0xFD, 0xC1,
0xFD, 0x0D, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0xFF, 0xFF, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x4F, 0x5F, 0x58, 0x58, 0x5F, 0x4F, 0x40, 0x40, 0x47, 0x5F,
0x58, 0x5F, 0x47, 0x40, 0x40, 0x40, 0x40, 0x5F, 0x5F, 0x40, 0x40, 0x5F, 0x5F, 0x40, 0x47, 0x5F,
0x5F, 0x40, 0x40, 0x5F, 0x5F, 0x58, 0x58, 0x5F, 0x4F, 0x40, 0x40, 0x5F, 0x5F, 0x58, 0x58, 0x58,
0x40, 0x5C, 0x5F, 0x40, 0x5F, 0x5C, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40,
0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0xFF, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFF, 
};

In terms of my hardware, the only thing that hasn't showed signs of life yet is the LCD_5110 i just bought from somewhere in canada, it looks well, but i did not try to check it on its own ( not that i could have done it before you guys told me how to load the software), but i saw a backlight flash when this program loaded, just for a second and again if i hit the white reset button in the UNO. The Arduino Uno seems to work, we ran a few of the simple projects in the starter kit and had a couple sensors tested alone. I had tested the SMAKN UVM-30A sensor alone before with simple code from electropeak,

   /*
  UVM30A-UV-Module
  Made on 02 Feb 2020
  by Amir Mohammad Shojaee @ Electropeak
  Home

*/
void setup(){ 
  Serial.begin(9600);
}

void loop()
{  
  int sensorValue;

 sensorValue=analogRead(A0);
 Serial.print("The voltage value:");
 Serial.print(sensorValue*5000/1023.0);
 Serial.println("mV");
 delay(1000);
 Serial.print("\n");
}

it worked, gave me some weird readings on the serial screen, but i was indoors at night, so i assumed that was it (I got something similar from a GUVA-S12SD sensor i bought as a backup).

So, although i think i made some progress, I am still stuck, and worst of all is I have no Idea why or how, and much less how to approach the problem. So I would appreciate like a big lot if someone out there can give me a hand. I am sorry for the long message, I just wanted to pour as much info as possible since I don't know what is helpful and what is not.

Thank you again.

Nokia/5110 GLCD
Hello World (uno/328) with no dependencies:

// UNO: Binary sketch size: 1,824 bytes (of a 32,256 byte maximum)

#define PIN_SCE   7
#define PIN_RESET 6
#define PIN_DC    5
#define PIN_SDIN  4
#define PIN_SCLK  3

#define LCD_C     LOW
#define LCD_D     HIGH

#define LCD_X     84
#define LCD_Y     48

static const byte ASCII[][5] =
{
 {0x00, 0x00, 0x00, 0x00, 0x00} // 20  
,{0x00, 0x00, 0x5f, 0x00, 0x00} // 21 !
,{0x00, 0x07, 0x00, 0x07, 0x00} // 22 "
,{0x14, 0x7f, 0x14, 0x7f, 0x14} // 23 #
,{0x24, 0x2a, 0x7f, 0x2a, 0x12} // 24 $
,{0x23, 0x13, 0x08, 0x64, 0x62} // 25 %
,{0x36, 0x49, 0x55, 0x22, 0x50} // 26 &
,{0x00, 0x05, 0x03, 0x00, 0x00} // 27 '
,{0x00, 0x1c, 0x22, 0x41, 0x00} // 28 (
,{0x00, 0x41, 0x22, 0x1c, 0x00} // 29 )
,{0x14, 0x08, 0x3e, 0x08, 0x14} // 2a *
,{0x08, 0x08, 0x3e, 0x08, 0x08} // 2b +
,{0x00, 0x50, 0x30, 0x00, 0x00} // 2c ,
,{0x08, 0x08, 0x08, 0x08, 0x08} // 2d -
,{0x00, 0x60, 0x60, 0x00, 0x00} // 2e .
,{0x20, 0x10, 0x08, 0x04, 0x02} // 2f /
,{0x3e, 0x51, 0x49, 0x45, 0x3e} // 30 0
,{0x00, 0x42, 0x7f, 0x40, 0x00} // 31 1
,{0x42, 0x61, 0x51, 0x49, 0x46} // 32 2
,{0x21, 0x41, 0x45, 0x4b, 0x31} // 33 3
,{0x18, 0x14, 0x12, 0x7f, 0x10} // 34 4
,{0x27, 0x45, 0x45, 0x45, 0x39} // 35 5
,{0x3c, 0x4a, 0x49, 0x49, 0x30} // 36 6
,{0x01, 0x71, 0x09, 0x05, 0x03} // 37 7
,{0x36, 0x49, 0x49, 0x49, 0x36} // 38 8
,{0x06, 0x49, 0x49, 0x29, 0x1e} // 39 9
,{0x00, 0x36, 0x36, 0x00, 0x00} // 3a :
,{0x00, 0x56, 0x36, 0x00, 0x00} // 3b ;
,{0x08, 0x14, 0x22, 0x41, 0x00} // 3c <
,{0x14, 0x14, 0x14, 0x14, 0x14} // 3d =
,{0x00, 0x41, 0x22, 0x14, 0x08} // 3e >
,{0x02, 0x01, 0x51, 0x09, 0x06} // 3f ?
,{0x32, 0x49, 0x79, 0x41, 0x3e} // 40 @
,{0x7e, 0x11, 0x11, 0x11, 0x7e} // 41 A
,{0x7f, 0x49, 0x49, 0x49, 0x36} // 42 B
,{0x3e, 0x41, 0x41, 0x41, 0x22} // 43 C
,{0x7f, 0x41, 0x41, 0x22, 0x1c} // 44 D
,{0x7f, 0x49, 0x49, 0x49, 0x41} // 45 E
,{0x7f, 0x09, 0x09, 0x09, 0x01} // 46 F
,{0x3e, 0x41, 0x49, 0x49, 0x7a} // 47 G
,{0x7f, 0x08, 0x08, 0x08, 0x7f} // 48 H
,{0x00, 0x41, 0x7f, 0x41, 0x00} // 49 I
,{0x20, 0x40, 0x41, 0x3f, 0x01} // 4a J
,{0x7f, 0x08, 0x14, 0x22, 0x41} // 4b K
,{0x7f, 0x40, 0x40, 0x40, 0x40} // 4c L
,{0x7f, 0x02, 0x0c, 0x02, 0x7f} // 4d M
,{0x7f, 0x04, 0x08, 0x10, 0x7f} // 4e N
,{0x3e, 0x41, 0x41, 0x41, 0x3e} // 4f O
,{0x7f, 0x09, 0x09, 0x09, 0x06} // 50 P
,{0x3e, 0x41, 0x51, 0x21, 0x5e} // 51 Q
,{0x7f, 0x09, 0x19, 0x29, 0x46} // 52 R
,{0x46, 0x49, 0x49, 0x49, 0x31} // 53 S
,{0x01, 0x01, 0x7f, 0x01, 0x01} // 54 T
,{0x3f, 0x40, 0x40, 0x40, 0x3f} // 55 U
,{0x1f, 0x20, 0x40, 0x20, 0x1f} // 56 V
,{0x3f, 0x40, 0x38, 0x40, 0x3f} // 57 W
,{0x63, 0x14, 0x08, 0x14, 0x63} // 58 X
,{0x07, 0x08, 0x70, 0x08, 0x07} // 59 Y
,{0x61, 0x51, 0x49, 0x45, 0x43} // 5a Z
,{0x00, 0x7f, 0x41, 0x41, 0x00} // 5b [
,{0x02, 0x04, 0x08, 0x10, 0x20} // 5c ¥
,{0x00, 0x41, 0x41, 0x7f, 0x00} // 5d ]
,{0x04, 0x02, 0x01, 0x02, 0x04} // 5e ^
,{0x40, 0x40, 0x40, 0x40, 0x40} // 5f _
,{0x00, 0x01, 0x02, 0x04, 0x00} // 60 `
,{0x20, 0x54, 0x54, 0x54, 0x78} // 61 a
,{0x7f, 0x48, 0x44, 0x44, 0x38} // 62 b
,{0x38, 0x44, 0x44, 0x44, 0x20} // 63 c
,{0x38, 0x44, 0x44, 0x48, 0x7f} // 64 d
,{0x38, 0x54, 0x54, 0x54, 0x18} // 65 e
,{0x08, 0x7e, 0x09, 0x01, 0x02} // 66 f
,{0x0c, 0x52, 0x52, 0x52, 0x3e} // 67 g
,{0x7f, 0x08, 0x04, 0x04, 0x78} // 68 h
,{0x00, 0x44, 0x7d, 0x40, 0x00} // 69 i
,{0x20, 0x40, 0x44, 0x3d, 0x00} // 6a j 
,{0x7f, 0x10, 0x28, 0x44, 0x00} // 6b k
,{0x00, 0x41, 0x7f, 0x40, 0x00} // 6c l
,{0x7c, 0x04, 0x18, 0x04, 0x78} // 6d m
,{0x7c, 0x08, 0x04, 0x04, 0x78} // 6e n
,{0x38, 0x44, 0x44, 0x44, 0x38} // 6f o
,{0x7c, 0x14, 0x14, 0x14, 0x08} // 70 p
,{0x08, 0x14, 0x14, 0x18, 0x7c} // 71 q
,{0x7c, 0x08, 0x04, 0x04, 0x08} // 72 r
,{0x48, 0x54, 0x54, 0x54, 0x20} // 73 s
,{0x04, 0x3f, 0x44, 0x40, 0x20} // 74 t
,{0x3c, 0x40, 0x40, 0x20, 0x7c} // 75 u
,{0x1c, 0x20, 0x40, 0x20, 0x1c} // 76 v
,{0x3c, 0x40, 0x30, 0x40, 0x3c} // 77 w
,{0x44, 0x28, 0x10, 0x28, 0x44} // 78 x
,{0x0c, 0x50, 0x50, 0x50, 0x3c} // 79 y
,{0x44, 0x64, 0x54, 0x4c, 0x44} // 7a z
,{0x00, 0x08, 0x36, 0x41, 0x00} // 7b {
,{0x00, 0x00, 0x7f, 0x00, 0x00} // 7c |
,{0x00, 0x41, 0x36, 0x08, 0x00} // 7d }
,{0x10, 0x08, 0x08, 0x10, 0x08} // 7e ←
,{0x78, 0x46, 0x41, 0x46, 0x78} // 7f →
};

void LcdCharacter(char character)
{
  LcdWrite(LCD_D, 0x00);
  for (int index = 0; index < 5; index++)
  {
    LcdWrite(LCD_D, ASCII[character - 0x20][index]);
  }
  LcdWrite(LCD_D, 0x00);
}

void LcdClear(void)
{
  for (int index = 0; index < LCD_X * LCD_Y / 8; index++)
  {
    LcdWrite(LCD_D, 0x00);
  }
}

void LcdInitialise(void)
{
  pinMode(PIN_SCE, OUTPUT);
  pinMode(PIN_RESET, OUTPUT);
  pinMode(PIN_DC, OUTPUT);
  pinMode(PIN_SDIN, OUTPUT);
  pinMode(PIN_SCLK, OUTPUT);
  digitalWrite(PIN_RESET, LOW);
  digitalWrite(PIN_RESET, HIGH);
  LcdWrite(LCD_C, 0x21 );  // LCD Extended Commands.
  LcdWrite(LCD_C, 0xB1 );  // Set LCD Vop (Contrast). 
  LcdWrite(LCD_C, 0x04 );  // Set Temp coefficent. //0x04
  LcdWrite(LCD_C, 0x14 );  // LCD bias mode 1:48. //0x13
  LcdWrite(LCD_C, 0x0C );  // LCD in normal mode.
  LcdWrite(LCD_C, 0x20 );
  LcdWrite(LCD_C, 0x0C );
}

void LcdString(char *characters)
{
  while (*characters)
  {
    LcdCharacter(*characters++);
  }
}

void LcdWrite(byte dc, byte data)
{
  digitalWrite(PIN_DC, dc);
  digitalWrite(PIN_SCE, LOW);
  shiftOut(PIN_SDIN, PIN_SCLK, MSBFIRST, data);
  digitalWrite(PIN_SCE, HIGH);
}

void setup(void)
{
  LcdInitialise();
  LcdClear();
  LcdString("Hello World!");
}

void loop(void)
{
}


I had the LCD pins backwards, I may have killed it, I just realized it and fixed it. The backlight flashes i saw may have been it dying. i loaded the code Mr burnett sent me and it does nothing.

Quick update. After failing with Nokia 5110 LCD( and likely killing it. I switched gears and pulled out a GeeekPi LCD 2004 Module with I2C Interface Adapter Blue Backlight 2004 20x4 LCD that i also bought. I used some basic code to make it work, then modified the text and high-fived myself when it worked(also took pics for my kids)

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.init();
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("--------------------");
  lcd.setCursor(6,1);
  lcd.print("GEEEKPI");
   lcd.setCursor(1,2);
  lcd.print("Arduino IIC Screen");
   lcd.setCursor(0,3);
  lcd.print("--------------------");
}

void loop()
{
// Just loop, do nothing. 
}

Then I went back to try the UV sensor on its own with this:

1. *
2. A simple program designed to setup and demonstrate the UVM-30A ultraviolet sensor module - BDAA100001
* The program monitors a connected analog pin and outputs the value to the
3. serial monitor.
* modified 5th July 2019
4. by Sebastian Karam - Flux Workshop
5. */
6. int analogApin = 0; // define OUT signal pin
7. int analogA; // define variable to store value read from pin
* void setup() {
8. pinMode(analogApin, INPUT); // set the OUT signal pin as an input
9. Serial.begin(9600); // launch the serial monitor
10. Serial.println("Flux Workshop Example");
11. }
* void loop() {
12. analogA = analogRead(analogApin); // read the voltage level on the A0
13. Serial.println((String)"UV level: " + analogA); // send the result to the serial monitor
14. delay(200); // pause for a moment before repeating
15. }

And finally i figured out how to make a Frankencode, and it worked!!

#include <Wire.h> 
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27,20,4);  // set the LCD address to 0x27 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd 
  lcd.init();
int sensorValue;

 sensorValue=analogRead(A0);
  
  // Print a message to the LCD.
  lcd.backlight();
  lcd.setCursor(0,0);
  lcd.print("Marco UV METER");
  lcd.setCursor(1,1);
  lcd.print(sensorValue*5000/1023.0);
   lcd.setCursor(1,2);
  lcd.print("mV");
   lcd.setCursor(0,3);
  lcd.print("Let's go Seahawks!!");
  
}

void loop()
{
// Just loop, do nothing. 
}

Now I just need to figure out how to make a delay and repeat measurement without having to hit the reset button so we can have a few measurements to average for each sample. Can you guys see any glaring mistakes in the code that will make the whole thing blow in my face? maybe an easy improvement to make?

Thank you very much, guys, I now need to test it outside with daytime light. I am very excited. I will then have to spend a couple of days to reverse engineer it, documenting it back and forth so i remember and then have my son put it together by himself with my expert assistance. This is awesome!

at the moment you have code only at setup ?... well it will only execute once after reset.
put it inside micro and make a delay... or use a polling where you check if it is time to update the measurement
search the web for analog measurements. they take some sample and average it´s an easy process.

Thank you Osval, i will look into it in the morning, I am gonna try to get readings every second for a total of 5 or 6 and then average them. If i keep getting lucky then i will find a way to play a sound when its all over so that we can move the sample. I think it may be a good idea to keep the reset button to start the process once the sunscreen sample is properly positioned.
Thank you all guys for the help. It's going great compared with 24 hrs ago, and i think I now understand about 2 or 3 code commands.

i am closing this thread. I started another one for this project before i knew better. So it will continue there since I still have questions and kinks to solve.
Thank you all.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.