Arduino Uno code not working on MeOrion


#1

Hi everyone,

I’m currently trying to use a soil moisture sensor via RJ25 adapter but I’m not able to read any measure. To be sure that there are no issues with the sensor, I uploaded the same code on an Arduino Uno and it’s working perfectly.

The code is the following:

/*************************************************** 
  This is a sketch to test the soil sensor based
  on the SHT10 temperature & humidity sensor 
  
  Written by Marco Schwartz for Open Home Automation
 ****************************************************/

// Include Sensirion library
#include <Sensirion.h>

// Sensor pins
const uint8_t dataPin  =  12;
const uint8_t clockPin =  13;

// Variables for the temperature & humidity sensor
float temperature;
float humidity;
float dewpoint;

// Create sensor instance
Sensirion soilSensor = Sensirion(dataPin, clockPin);

void setup()
{
  Serial.begin(9800);

}

void loop()
{
  // Make a measurement
  soilSensor.measure(&temperature, &humidity, &dewpoint);

  // Print results
  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" C, Humidity: ");
  Serial.print(humidity);
  Serial.print(" %");
  Serial.println("");
  
  // Wait 100 ms before next measurement
  delay(100);  
}

The result I get from the MeOrion is the following:

Temperature: 0.00 C, Humidity: 0.00 %

Which of course is not right. The Arduino Uno reads the correct values.

To be sure I connected the sensor to the right SLOTS (PORT3,SLOT1 and PORT3,SLOT2) I added to leds that are correctly blinking.

Can anyone help me into finding what is wrong with the MeOrion?

Thanks,

Diego


#2

Check out the TestRJ25Adapter example program…

// Include Orion library [!]
#include “MeOrion.h”
// Include Sensirion library
#include <Sensirion.h>
// define the Sensor slot [!]
MePort SensorSlot(PORT_3);
// Sensor pins [!]

// Create sensor instance
/* Hint:
Check the pins, maybe you need to change the order of them to .s2, … .s1
*/
Sensirion soilSensor = Sensirion(SensorSlot.s1, SensorSlot.s2);

void setup()
{
Serial.begin(9800);
}

void loop()
{
// Make a measurement
soilSensor.measure(&temperature, &humidity, &dewpoint);

// Print results
Serial.print(“Temperature: “);
Serial.print(temperature);
Serial.print(” C, Humidity: “);
Serial.print(humidity);
Serial.print(” %”);
Serial.println("");

// Wait 100 ms before next measurement
delay(100);
}

Maybe you need to change the Sensirion.h a bit:
You can reach slot1 like

SensorSlot.dRead1(); /* read SLOT1 level */

Check out the MePort source file in your Arduino folder
<locate_it>\Arduino\libraries\makeblock\src\MePort.cpp
Or on the Makeblock wiki


#3