Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. JohanRC
    3. Topics
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Topics created by JohanRC

    • JohanRC

      Dallas DS18B20 compiling error
      Troubleshooting • • JohanRC  

      3
      0
      Votes
      3
      Posts
      1729
      Views

      JohanRC

      Thanx The compiling errors are now solved! Unfortunately the problem is not solved yet, the led L flashes a couple of times when starting and after that it starts to burn softly. It looks like it stops working after this. The Nano and Dallas sensors are connected OK, when I check it with a simple sketch I can reed the temperatures through the serial connection.
    • JohanRC

      Wind speed sensor node
      Hardware • • JohanRC  

      21
      0
      Votes
      21
      Posts
      10984
      Views

      JohanRC

      Yesterday I found some example code on the Domoticz forum. With some modifications I get numbers in wind As below my current sketch that sends values, I will modify it untill it is what I like and will post it here. #include <SPI.h> #include <MySensor.h> #define CHILD_ID_WIND 20 #define LED_PIN 8 #define ID_WIND 170 #define WIND_SENSOR_ANALOG_PIN 1 MySensor gw; unsigned int val_wspeed; unsigned int val_wgust; unsigned int val_wdirection; unsigned int last_wspeed; unsigned int last_wgust; unsigned int last_wdirection; boolean metric = true; unsigned long currentTime; unsigned long SEND_FREQUENCY = 10000; unsigned long lastSend; MyMessage msgWSpeed(CHILD_ID_WIND, V_WIND); MyMessage msgWGust(CHILD_ID_WIND, V_GUST); MyMessage msgWDirection(CHILD_ID_WIND, V_DIRECTION); //Setup routine void setup() { // Initialize library and add callback for incoming messages gw.begin(); // Send the Sketch Version Information to the Gateway gw.sendSketchInfo("Windsensor", "0.1"); // Register all sensors to gw (they will be created as child devices) gw.present(CHILD_ID_WIND, S_WIND); metric = gw.getConfig().isMetric; lastSend = 0; pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN,1); } //Main loop void loop() { gw.process(); currentTime = millis(); unsigned int val_wspeed = (analogRead(WIND_SENSOR_ANALOG_PIN))/31.605; if(last_wspeed != val_wspeed) { last_wspeed = val_wspeed; gw.send(msgWSpeed.set(val_wspeed, 1)); Serial.print("WS: "); Serial.println(val_wspeed); } unsigned int val_wgust = (analogRead(WIND_SENSOR_ANALOG_PIN))/31.605; if(last_wgust != val_wgust) { last_wgust = val_wgust; gw.send(msgWGust.set(val_wgust, 1)); Serial.print("WG: "); Serial.println(val_wgust); } unsigned int val_wdirection = (analogRead(WIND_SENSOR_ANALOG_PIN))/2.842; if(last_wdirection != val_wdirection) { last_wdirection = val_wdirection; gw.send(msgWDirection.set(val_wdirection, 1)); Serial.print("WD: "); Serial.println(val_wdirection); } }