Serial to Excel

Hi

Is it possible to extract values/readings out from Serial Monitor to Excel?
(Without using particle.publish, only using serial.print)

Thanks

Hi, and welcome to the community!

I have not seen any projects like this in Particle myself, but I searched on the web and I got this that perhaps can get you inspired on how it can be done:

my original search:
https://www.google.com/search?q=arduino+serial+to+excel

cheers

Hi Gus,

I’ve tried the Data Streamer offered by Microsoft, however, it only works with Arduino.
No data gets streamed in when I tried with Particle Argon.

@tan, can you share your code or at least the parts writing out the values to the Argon Serial port? Indicating that you “tried” something without showing “how” you tried it makes it difficult for us to assist.

1 Like

Hiii

Its a very simple code, all it does is read Temperature, Pressure and Humidity values from a BME280 sensor and publishes them via serial. I have been monitoring the readings using serial monitor from Particle Workbench.

#include <Adafruit_BME280.h>

Adafruit_BME280 bme;

void setup() {
  Serial.begin(9600);
  if (!bme.begin()) {
    Serial.println("Could not find a valid BME280 sensor, check wiring!");
    while (1);
  }
}


void loop() {
  
  Serial.print("Temperature: "); Serial.print(String::format("%0.2f", bme.readTemperature()));
  Serial.print("°C\tPressure: "); Serial.print(String::format("%0.2f", bme.readPressure() / 100.0F));
  Serial.print("hPa\tHumidity: "); Serial.print(String::format("%0.2f", bme.readHumidity()));
  Serial.println("%");
  delay(1000);
}

@tan, looking at the examples for the Streamer, the names of the fields are not sent to serial, just the data. Also, I am not sure why you send the “%” at the end as this is not shown in any example, only the `Serial.println()" to force a linefeed.

Finally, using the “regular” Serial.print() command, you can avoid the String::format() thing by simply specifying the number of decimals in a float. For example:

Serial.print(String::format("%0.2f", bme.readTemperature())); become:
Serial.print(bme.readTemperature(), 2);
1 Like

I couldn’t find an exact console output in that project, but how does your code compare to what they mention in step 7?

Serial.print(sensorReading1); 
Serial.print(","); 
Serial.print(sensorReading2); 
Serial.print(","); 
Serial.println();

I suggest you follow more closely what the streamer expects :wink:

1 Like

To throw in another suggestion.
First avoid while(1); in your setup() as it will throw off the Argon’s cloud connection.
And for your data I’d go with

Serial.printlnf("%.2f,%.2f,%.2f"
               , bme.readTemperature()
               , bme.readPressure() / 100.0
               , bme.readHumidity()
               );

If you wish you could add this in setup() to emit the column header names

Serial.println("Temperature,Pressure,Humidity");

BTW, some localization call for semicolon (;) instead of comma (,) as column separator (e.g. German :blush:)


Some more digging revealed that this seems to be an issue with other micro controllers too (e.g. ESP32). The problem is that many modern micros with inbuilt USB won’t handshake the same way as Arduinos do (i.e. not sending an RTS signal) but MS Data Streamer expects that.

3 Likes

New to the forum (but not particle). If you are still interested in this topic, I would seriously explore using Google Sheets as they have rich javascript integration support.

Here is a (presentation)[Intro to IoT & JavaScript - Google Slides] I did for a technical conference in FL for the amateur radio community.

If there is interest, I can post the code as well.

4 Likes

@tishihtzu Thanks for the information. I for one, would enjoy seeing the code.

Thank you