Wemos D1 Mini to pressure Transducer 0-5v 1.2Mpa to Cayenne


#1

Wemos D1 Mini to pressure Transducer 0-5v 1.2Mpa
I tried to make the sketch using A0 analogue in to read the out put of pressure trnasducer
but cayenne not updating the readings
Sketch below

define CAYENNE_PRINT Serial
#include <CayenneMQTTESP8266.h>

char ssid[] = "";
char wifiPassword[] = "";

// Cayenne authentication info. This should be obtained from the Cayenne Dashboard.
char username[] = "";
char password[] = "";
char clientID[] = "";

#define SENSOR_PIN  A0
#define VIRTUAL_CHANNEL 2


void setup()
{
  Serial.begin(9600);
  Cayenne.begin(username, password, clientID);
}

void loop()
{
  Cayenne.loop();
}

// This function is called at intervals to send sensor data to Cayenne.
CAYENNE_OUT(VIRTUAL_CHANNEL)
{
  Cayenne.virtualWrite(VIRTUAL_CHANNEL, analogRead(SENSOR_PIN));
}

#2

Can you add a simple analog read code without cayenne code and check whether you are getting readings


#3

HI Thanks it is now updating the analog status in cayenne , can you tell me how to scale to show acquired data to Bar or Pascal now it is showing like 1 to 1024 (0 to 3.3 Volts input )
Thanks


#4

have a look at this topic https://arduino.stackexchange.com/questions/44905/reading-pressure-sensor-using-arduino-analog