Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
Bas RutjesB

Bas Rutjes

@Bas Rutjes
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • 💬 Soil Moisture Sensor
    Bas RutjesB Bas Rutjes

    For those who are using the analogue soil moisture sensor in combination with a nano

    Connect the output of the sensor to the A0 of the nano
    connect the gnd of the sensor to the gnd on the nano
    connect th vcc of the sensor to 3v3 on the nano

    the sketch that works for me:
    // Enable debug prints to serial monitor
    #define MY_DEBUG

    // Enable and select radio type attached
    #define MY_RADIO_NRF24
    #define CHILD_ID 0

    #include <MySensors.h>
    // Here we are setting up some water thresholds that we will
    // use later. Note that you will need to change these to match
    // your soil type and environment. It doesn't do much for me because I'm using domoticz
    int thresholdUp = 400;
    int thresholdDown = 075;
    MyMessage msg(CHILD_ID, V_LEVEL);
    unsigned long SLEEP_TIME = 30000;

    // We are setting up the pin A0 on the redboard to be our sensor
    // pin input:
    int sensorPin = A0;

    void presentation()
    {
    present(CHILD_ID, S_MOISTURE);
    }

    void loop()
    {
    int sensorValue;
    sensorValue = analogRead(sensorPin);

    //send back the values
    send(msg.set(sensorValue));
    // delay until next measurement (msec)
    sleep(SLEEP_TIME);
    }

    Announcements
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular