Navigation

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

    Topics created by Hausner

    • Hausner

      Local heating override.
      My Project • • Hausner  

      1
      0
      Votes
      1
      Posts
      751
      Views

      No one has replied

    • Hausner

      Same value from 2 different placed DS18B20
      Troubleshooting • • Hausner  

      2
      0
      Votes
      2
      Posts
      1412
      Views

      BulldogLowell

      @Hausner send: 41-41-33-0 s=0,c=1,t=0,pt=7,l=5,st=ok:27.0 send: 41-41-33-0 s=1,c=1,t=0,pt=7,l=5,st=ok:24.1 Even though you are converting to floats, these sensors still return integers, so you may be seeing the (not so obvious) limitations of the precision of the sensors. the numbers (if different) are close, so you should put a heat source near one (hair dryer?) to get them to be at a much bigger differential. Or return fahrenheit for one of the two like this: if (i == 0) { float temperature = static_cast<float>(static_cast<int>sensors.getTempCByIndex(i)* 10.) / 10.; } else { float temperature = static_cast<float>(static_cast<int>sensors.getTempFByIndex(i)* 10.) / 10.; } So you can really see what's happening.
    • Hausner

      Motion (PIR), actuator and Temp sensor
      Hardware • • Hausner  

      7
      0
      Votes
      7
      Posts
      3766
      Views

      Hausner

      Ok, finally got it to work with this: // Example sketch showing how to control physical relays. // This example will remember relay state even after power failure. #include <MySensor.h> #include <SPI.h> #include <DallasTemperature.h> #include <OneWire.h> #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected #define MAX_ATTACHED_DS18B20 16 OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors=0; //boolean receivedConfig = false; boolean metric = true; #define RELAY_1 5 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define RELAY_2 6 #define RELAY_ON 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay // Motion sensor defs unsigned long SLEEP_TIME = 10000; // Sleep time between reports (in milliseconds) #define DIGITAL_INPUT_SENSOR 4 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) //#define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway) #define CHILD_ID 3 // Id of the sensor child boolean lastTrippedState; MySensor gw; // MyMessage msgTemp(0, V_TEMP); MyMessage msgRelay2(2, V_LIGHT); MyMessage msgMotion(3, V_TRIPPED); void setup() { gw.begin(incomingMessage, AUTO, true); gw.sendSketchInfo("Temp/Relay/Motion Sensor", "1.0"); // gw.present(1, S_LIGHT); pinMode(RELAY_1, OUTPUT); // gw.present(2, S_LIGHT); pinMode(RELAY_2, OUTPUT); digitalWrite(RELAY_1, gw.loadState(1)? RELAY_ON : RELAY_OFF); digitalWrite(RELAY_2, gw.loadState(1)? RELAY_ON : RELAY_OFF); pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input // gw.present(CHILD_ID, S_MOTION); // Fetch the number of attached temperature sensors //numSensors = sensors.getDeviceCount(); // Present all sensors to controller //for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { gw.present(0, S_TEMP); //} } // void loop() { gw.process(); boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; if (tripped != lastTrippedState) { Serial.println(tripped? "tripped" : "not tripped"); gw.send(msgMotion.set(tripped?"1":"0")); // Send tripped value to gw// //digitalWrite(RELAY_1, tripped? 1 : 0); } lastTrippedState = tripped; // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); // Read temperatures and send them to controller //for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(0):sensors.getTempFByIndex(0)) * 10.)) / 10.; // Only send data if temperature has changed more then 1 degC and no error if (int(lastTemperature[0]) != int(temperature) && temperature != -127.00) { //added integer // Send in the new temperature gw.send(msgTemp.setSensor(0).set(temperature,1)); lastTemperature[0]=temperature; } //} } void incomingMessage(const MyMessage &message) { // if (message.type==V_LIGHT && message.sensor == 2) { // Change relay state digitalWrite(RELAY_2, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom gw.saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
    • Hausner

      Monitor a DIY solarpanel with ASC712 - HELP
      Troubleshooting • • Hausner  

      5
      0
      Votes
      5
      Posts
      2473
      Views

      RJ_Make

      @Hausner So the problem is with the node transmitting anything to the gateway? Post the radio messages from the serial monitor and hopefully someone can tell you what's going on..
    • Hausner

      Motion/actuator sensor
      Troubleshooting • • Hausner  

      5
      0
      Votes
      5
      Posts
      1852
      Views

      Hausner

      Turned out that the Nano was faulty. I rebuilded the setup with a new Nano, and it's now working as designed
    • Hausner

      Light motion sensor i "bedroom"
      General Discussion • • Hausner  

      1
      0
      Votes
      1
      Posts
      776
      Views

      No one has replied

    • Hausner

      Non Polarized Capacitor .22 uF rated 400 volt
      Hardware • • Hausner  

      5
      0
      Votes
      5
      Posts
      1697
      Views

      Hausner

      The plan is to make some LED lights without the need for a wall plug transformer, as they take up space and are fairly hard to hide away. So I'm planning to make some small 220vac->12/5vdc converters with as little components as possible. Link to plan: http://www.instructables.com/id/LED-TUBE-LGHT-AC/
    • Hausner

      Motion/Relay sensor sketch help
      Development • • Hausner  

      9
      0
      Votes
      9
      Posts
      7768
      Views

      mfalkvidd

      @Marco-MicrOchip-Acquadro Great. Maybe the relay example with button can help you get started. It works with MySensors 2.x.
    • Hausner

      Motion, Temperature and Relay in 1 node
      Hardware • • Hausner  

      5
      0
      Votes
      5
      Posts
      2904
      Views

      Hausner

      Cool This is my initial sketch, but i'm still tuning it. http://forum.mysensors.org/topic/597/motion-relay-sensor-sketch-help I need to figure out only to send GW messages on an update.
    • Hausner

      Communication problem (maybe)
      Troubleshooting • • Hausner  

      30
      0
      Votes
      30
      Posts
      9247
      Views

      Hausner

      @daulagari Thank you. I'm gonna try with this if (abs(lastTemperature[i] - temperature) >= 0.2 && temperature != -127.00) {
    • Hausner

      MQTT batterylevel reporting
      OpenHAB • • Hausner  

      3
      0
      Votes
      3
      Posts
      1832
      Views

      Hausner

      I'm using OpenHab as controller. It worked pretty good when i had a raspberry as a serial gateway reporting to Openhab, but now I've switched to a MQTT gateway on an UNO. That works fine for a few temp sensors, but i'm having serious trouble getting a 8-channel relay node to work. It works for about 1-2 hours then it stops responding Then i have to powercycle it, to get it running again. Currently the temp sensors report this: 0;0;3;0;9;read: 1-1-0 s=255,c=3,t=0,pt=1,l=1:81 for a battery reading (81%).
    • Hausner

      Static ParentID
      Troubleshooting • • Hausner  

      5
      0
      Votes
      5
      Posts
      2293
      Views

      Hausner

      @hek Thank you! It looks like it's working. The relay is now talking directly to the GW. The 2 right-side temp sensors however, are now using the relay node as a repeater I can live with that (still working as designed) only thing now, is that I think I have a faulty wirering connection to the radio on the relay node. After a while it goes "offline", but the fun part is that if I powercycle it, it's back online.
    • Hausner

      Temperature sensor WITH battery monitor
      Troubleshooting • • Hausner  

      10
      0
      Votes
      10
      Posts
      4961
      Views

      Markus.

      Anyone here an idea how i can get the voltage send tomthe gateway? Works great so far except the send of the voltage ....:-(