marlon360/opcn3-arduino

ESP32 Gives problem with SD Card

Opened this issue · 5 comments

Hi,
I am using this library along with SD Card interfaced to ESP32.
Individually both of them work fine. But as soon as they are connected together, both start to malfunction.

I have used different pins for SS.

Thanks..

Hi Rajesh,

Can you please help me with running only OPC with ESP32? I am getting all values 0 except temperature which also is wrong. Below is the code:

#include <OPCN3.h>

// create new instance (specify SS pin in constructor)
OPCN3 myOPCN3(15);

void setup() {

Serial.begin(9600);

// turn on laser, fan and set high gain
myOPCN3.initialize();
delay(1000);

}

void loop() {

delay(10000);
HistogramData hist = myOPCN3.readHistogramData();

// Get Temperature
Serial.print("Temperature: ");
Serial.println(hist.getTempC());

// Get Relative Humidity
Serial.print("RH (%): ");
Serial.println(hist.getHumidity());

// Get PM values
Serial.print("PM 1: ");
Serial.println(hist.pm1);

Serial.print("PM 2.5: ");
Serial.println(hist.pm2_5);

Serial.print("PM 10: ");
Serial.println(hist.pm10);

}

Below is the output on serial monitor in Arduino IDE:

Capture

Thanks Rajesh for prompt response :)

I'm new to this, so some more explanation will really help. Can you please explain more on "It needs dedicated data pin" and what you mean by standard SPI?

Thank you so much Rajesh for clarification! All The Best!