Navigation

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

    markjgabb

    @markjgabb

    9
    Reputation
    86
    Posts
    615
    Profile views
    0
    Followers
    1
    Following
    Joined Last Online

    markjgabb Follow

    Best posts made by markjgabb

    • RE: Are folks here happy with Domoticz?

      @sundberg84 i dont know about you, but i use imperihome as a front end over the top of domoticz with mydomoathome.....that way you get the strong base of domoticz, but i more user friendly and customisable front end

      posted in Domoticz
      markjgabb
      markjgabb
    • RE: (SOLVED) complete reset for registration and adding

      this solution has worked perfectly
      thanks guys for all your advice...domoticz definatly cant un ignore anyway that i can find either

      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: 💬 Easy/Newbie PCB for MySensors

      on the subject of batteries i have to say im really impressed with the setup of these boards....
      ive got a DHT and lux resistor measuring every 10 minutes, and i cant even remember how long ago i last changed the batteries...i think its about 3-4 months now....nothing special, just aldi batteries (australian cheap shopping chain)

      last check they are still 65%

      posted in OpenHardware.io
      markjgabb
      markjgabb
    • RE: devices a long time away from controller.....

      @mfalkvidd
      thanks for that....judging by his operation of the device it shouldnt matter how long its away..seems to be only thing he did was use a static ID, as im guessing it might change if its away for long enough....

      seems pretty simple as its a send only device.....
      only thing that i can think of that i may want feedback for is to light up buttons when they are available....

      not sure if im going to do these as powered by car...or if they should be battery powered...im guessing if battery powered lit up buttons is a bad idea

      posted in General Discussion
      markjgabb
      markjgabb
    • RE: first battery powered DHT lux

      @sundberg84 champion and here is completed sketch which compiles without errors

      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      #define MY_NODE_ID 14
      #define MY_PARENT_NODE_ID 100
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <DHT.h>  
      
      #define CHILD_ID_HUM 0
      #define CHILD_ID_TEMP 1
      #define CHILD_ID_LIGHT 2
      #define HUMIDITY_SENSOR_DIGITAL_PIN 3
      #define LIGHT_SENSOR_ANALOG_PIN A1
      unsigned long SLEEP_TIME = 120000; // Sleep time between reads (in milliseconds)
      
      #define SKETCH_NAME "loungeroom living sensor #1"        // Change to a fancy name you like
      #define SKETCH_VERSION "1"                    // Your version
      
      DHT dht;
      float lastTemp;
      float lastHum;
      boolean metric = true; 
      int LightLevel = 0;
      int lastLightLevel;
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      MyMessage LightMsg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
      
      //=========================
      // BATTERY VOLTAGE DIVIDER SETUP
      // 1M, 470K divider across battery and using internal ADC ref of 1.1V
      // Sense point is bypassed with 0.1 uF cap to reduce noise at that point
      // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts
      // 3.44/1023 = Volts per bit = 0.003363075
      #define VBAT_PER_BITS 0.003363075  
      #define VMIN 1.9                                  //  Vmin (radio Min Volt)=1.9V (564v)
      #define VMAX 3.0                                  //  Vmax = (2xAA bat)=3.0V (892v)
      int batteryPcnt = 0;                              // Calc value for battery %
      int batLoop = 0;                                  // Loop to help calc average
      int batArray[3];                                  // Array to store value for average calc.
      int BATTERY_SENSE_PIN = A0;                       // select the input pin for the battery sense point
      //=========================
      
      void setup()  
      { 
       analogReference(INTERNAL);             // For battery sensing
      
        delay(500); // Allow time for radio if power used as reset
        
        dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
      
        metric = getConfig().isMetric;
      }
      
      void presentation()  
      { 
        // Send the Sketch Version Information to the Gateway
       // Send the Sketch Version Information to the Gateway
        sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
      
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID_HUM, S_HUM);
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
      }
      
      void loop()      
      {  
        delay(500); // Allow time for radio if power used as reset
        delay(dht.getMinimumSamplingPeriod());
       
        // Fetch temperatures from DHT sensor
        float temperature = dht.getTemperature();
        if (isnan(temperature)) {
            Serial.println("Failed reading temperature from DHT");
        } else if (temperature != lastTemp) {
          lastTemp = temperature;
          send(msgTemp.set(temperature, 1));
          Serial.print("T: ");
          Serial.println(temperature);
        }
        
        // Fetch humidity from DHT sensor
        float humidity = dht.getHumidity();
        if (isnan(humidity)) {
            Serial.println("Failed reading humidity from DHT");
        } else if (humidity != lastHum) {
            lastHum = humidity;
            send(msgHum.set(humidity, 1));
            Serial.print("H: ");
            Serial.println(humidity);
        }
        int lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; 
        Serial.println(lightLevel);
        if (lightLevel != lastLightLevel) {
            send(LightMsg.set(lightLevel));
            lastLightLevel = lightLevel;
        }
            
        batM();
        sleep(SLEEP_TIME); //sleep a bit
      }
      
      void batM() //The battery calculations
      {
         delay(500);
         // Battery monitoring reading
         int sensorValue = analogRead(BATTERY_SENSE_PIN);    
         delay(500);
         
         // Calculate the battery in %
         float Vbat  = sensorValue * VBAT_PER_BITS;
         int batteryPcnt = static_cast<int>(((Vbat-VMIN)/(VMAX-VMIN))*100.);
         Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %");  
         
         // Add it to array so we get an average of 3 (3x20min)
         batArray[batLoop] = batteryPcnt;
        
         if (batLoop > 2) {  
           batteryPcnt = (batArray[0] + batArray[1] + batArray[2] + batArray[3]);
           batteryPcnt = batteryPcnt / 3;
       
         if (batteryPcnt > 100) {
           batteryPcnt=100;
       }
       
           Serial.print("Battery Average (Send): "); Serial.print(batteryPcnt); Serial.println(" %");
             sendBatteryLevel(batteryPcnt);
             batLoop = 0;
            }
           else 
           {
           batLoop++;
           }
      }
      
      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: 💬 Easy/Newbie PCB for MySensors

      @mfalkvidd ahhhhh That answers my question perfectly....i was just dumping it into notepad ++ ill try that first thing in the morning.

      posted in OpenHardware.io
      markjgabb
      markjgabb
    • RE: What did you build today (Pictures) ?

      thanks to assistance of some of the people here i now have up and running a front gate controller for my double front gates (Solar powered)

      now have a node that monitors the batteries, knows if the gate is open or closed and has a relay for activating the gate

      posted in General Discussion
      markjgabb
      markjgabb
    • RE: loungeroom sketch transport failure

      @sundberg84 solved the light sensitivity level by swapping the 10k for a 100k...
      makes it more acurate in lighter enviroments, but less so in dark enviroments

      but by my theory after its a little dim im counting it as dark all the way to full dark for lighting purposes anyway

      cheers for all your help....

      posted in Troubleshooting
      markjgabb
      markjgabb

    Latest posts made by markjgabb

    • RE: Electric fence tester

      that quite likely a good idea... as its outside i could even drop a solar panel on it... as in this situation with 1 read every second (give take) the node wont get a a chance to sleep at all as i would be sending back to the gateway constantly...

      posted in General Discussion
      markjgabb
      markjgabb
    • Electric fence tester

      hi all
      after advice on an electric fence sensor node for mysensors

      so I have a small 5KV Electric fence energizer which sends pulses of 5KV down the line in 1-2 second pulses
      I'm trying to work out how to monitor it..
      Ideally id love it to be self powered, but I'm tipping that's out of the questions, as the capacitor requirement I think would be huge to stop overloading....

      so my two options I thought of were either a voltage divider (Research shows this probably wont work)
      or a hall effect current sensor, but I've never worked with one of these and am unsure of how this one should go.

      I know my main issue is going to be protecting to Arduino from the raw voltage as it would fry it in seconds.

      has anyone worked on a similar project or able to advise on a good place to start?

      posted in General Discussion
      markjgabb
      markjgabb
    • RE: What did you build today (Pictures) ?

      thanks to assistance of some of the people here i now have up and running a front gate controller for my double front gates (Solar powered)

      now have a node that monitors the batteries, knows if the gate is open or closed and has a relay for activating the gate

      posted in General Discussion
      markjgabb
      markjgabb
    • RE: Gate controller with Battery Checker

      Yeah I'm changing up the circuit die to inaccuracy...
      Is a arduino nano 5v powered from usb.....

      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: Gate controller with Battery Checker

      Is anyone able to confirm if the calculations in this image are correct? I would need to multiply the result by 6 to get accurate numbers

      I'm just currently stuggling with acuracy on my current design and figure bringing the max reading down would help
      It's a 24v battery with solar cut off of 28.4v so it will never go over 30 anyway

      Screenshot_20200914-224511.png

      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: Gate controller with Battery Checker

      think i have figured it out

      adjusted the math based on another page
      Vin = (Pin * 5.0) / 1023;

      removed the factor of 11 stuff and i think it wasn't necessary?

      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: Gate controller with Battery Checker

      @mfalkvidd you are correct you can do double and it works

      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: Gate controller with Battery Checker

      now compiles beautifully...

      but am getting weird voltage readings... ive just connected a double set of AA batteires and am getting a reading of 11.8-11.9

      im using a 100k and a 10k resistor as per this guide.... obviously i stuffed up something in my math....

      this always seems to be my way 🙂

      source for voltage reader code
      https://www.codrey.com/arduino-projects/nano-digital-volt-meter/

      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: Gate controller with Battery Checker

      @mfalkvidd cheers

      ive added that instead but still get the following

      call of overloaded 'set(float&)' is ambiguous

      posted in Troubleshooting
      markjgabb
      markjgabb
    • RE: Gate controller with Battery Checker

      final bug

      when i try to compile the following code
      i Get this error
      exit status 1
      call of overloaded 'set(double&)' is ambiguous googling tells me that my msg need to be defined better for the purpose but im not sure, as i can see in my void that i have declared it as double, but for some reason it doesnt understant that when i go to send my message

      void batM()
      {
      int Pin; // 0-1023 I/P
      double Vin;
      Pin = analogRead(A0); // Probe Input
      Vin = Pin * (5.0*11 / 1023); // Pin to Vin (Reduction Factor 11)
      Serial.print(Vin);
      Serial.println(" VOLT DC ");\
      
      send(power.set(Vin));
      }
      
      posted in Troubleshooting
      markjgabb
      markjgabb