Totaling all values of sensors

Hello, I am confused if the the values being displayed in the PLX_DAQ are the accumulated values of the sensor (total) or simply the values at the instance it is taken. I am following the code of Aboubakr_El Hammoumi in his project about Real-Time Data Acquisition of Solar Panel Using Arduino. Thank You. This is his code:
/*****************************************************************************
Aboubakr El Hammoumi
*****************************************************************************/

/******************************************************************************
PROJECT : Instrumentation of PV panel characteristics
Function : Real-time data acquisition of solar panel using Arduino and Excel


  •                                                                        *
    
    Written by : Aboubakr El Hammoumi Date : 04/05/2018
  •                                                                        *
    

/initialization function/

void setup() {
//serial connection setup
//opens serial port, sets data rate to 9600 bps
Serial.begin(9600);
//clear all data that’s been place in already
Serial.println("CLEARDATA");
//define the column headings (PLX-DAQ command)
Serial.println("LABEL,t,voltage,current,power");
}
/the main code/
void loop() {
//measuring voltage using "B25 0 to 25V" Voltage Sensor
//measuring current using "INA169" Current Sensor
//reading of the current and voltage from sensors
float voltage = analogRead(A0)55.0/1023; //PV panel voltage
float current = analogRead(A1)5.0/1023; //PV panel current
float power = voltage
current; //PV panel power

//allows the serial port to send data to Excel in real-time
Serial.print("DATA,TIME,"); // PLX-DAQ command
Serial.print(voltage); //send the voltage to serial port
Serial.print(",");
Serial.print(current); //send the current to serial port
Serial.print(",");
Serial.println(power); //send the power to serial port
delay(1000); //wait 1s before repeating
}

Hi, @jeremyross
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

1 Like

Hello,
I don't know what a PLX-DAQ is, you have not provided any information about it.

Where you have Serial.print(something) the value printed is the one most recently measured, not an accumulation of anything.

I've removed the email address from your post as putting email addresses in public is an invitation to spam and worse.

1 Like

You should post code by using code-tags
There is an automatic function for doing this in the Arduino-IDE
just three steps

  1. press Ctrl-T for autoformatting your code
  2. do a rightclick with the mouse and choose "copy for forum"
  3. paste clipboard into write-window of a posting

best regards Stefan

1 Like

thanks, i made a mistake im new to this

I'm sorry I put the email address and thank you. Do you know if the values presented can be a the cuumulated value or total?

Do I have a glas-sphere to look in?
You are working on an informatic project and what is most needed in an informatic project is information.

The minimum you have to provide is

  • a datasheet of the device
  • multiple lines of the serial output posted as a code-section
    which can be done by copying the content of the serial monitor to the clipboard then clicking on the <|>-Button and then paste the clipboard-content

best regards Stefan

I think I already answered that when I said:

I don't think you know the first thing about writing code, nothing wrong with that we all had to start with nothing. I suggest you start learning, there are plenty of examples in the IDE and in the tutorials on this web site and on other web sites. Do a search for C and for C++ tutorials.

Good luck.

1 Like

will do, thanks and sorry for the trouble

It's no trouble, we are here to help beginners.

Enjoy.