Navigation

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

    Tmaster

    @Tmaster

    43
    Reputation
    154
    Posts
    1725
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Tmaster Follow

    Best posts made by Tmaster

    • My Shiny Gateway and Irrigation system sHiNyBoX! :P

      Hello everybody.
      Since i discover this awesome project open source (mysensors) and the awesome work done here, i have been converted all my arduinos to Mysensor library ,because i already had Vera lite managing my home.

      so lets share what i already did. **Pictures!!!! **

      First, my gateway:
      i used a round small box , a ftdi adapter,and a 5v promini with 3.3v regulator on nrf24 .
      On picture is a normal nrf24 but then i use a amplified version that have an coaxial cable connected and an 2.4ghz antenna on outside roof(attach to my external TV antenna) ,So i can receive and send information to all my incoming sensors ,in all my garden(+3500m2) and it can receive inside home signal aswell.

      Alt text

      Alt text

      Alt text

      And then ,on 3rd day ,I created an irrigation control......

      Its not tested on vera yet, but at first look i have some work to do before it work properly. And i need replace this power wires for 12vpower adapter ones.

      Look at the switch ... you cant see it ... but its inside top rubber. just press on rubber and its water proof πŸ™‚

      Alt text

      Alt text

      Alt text

      Alt text

      Sory about my English errors ,not my natural language:P

      posted in My Project
      Tmaster
      Tmaster
    • Egg incubator IOT v3.0

      Do you think you've seen all kinds of projects here? So ..think again. πŸ™‚
      There it is my chicken eggs encubator .
      Made from a 25 liters plastic storage box and some foam outside to prevent heat loss.
      i used 2 X 18w halogen g9 bulbs and a 230v dimmer to decrease light brightness.

      There is a diagram above from fritzing. I uses an main arduino that controls a SSR relay for controls halogen light bulbs. this light bulbs are dimmed to half(in my case)
      for hold temperature much time as possible without decrease temperature.That makes SSR stay on for some minutes before goes off again. if halogen light are to powerfull makes the SSR goes on and off many times in short period. the ideal situation is having the dimmer controlled by arduino and hold temperature without turn ligh off ,but i didn't got this dimmer yet(is there any one ready for try it? πŸ˜› ).

      this is the 3rd version i build and all the other version hatch almost all eggs(+/-80%) even with some issues on controlling temperature.i only had 1 fan and that caused some zones that overheated (more on coners).
      Now i have 2x120mm(0.10A) pc fans that can spread hot air the same way in all this box.

      Then i have a secondary arduino that it's for safe features. it controls an alarm buzzer(pc speaker) ,its connected to an temperature sensor (ds18b20) and send temperature to emoncms.com through an nrf24 wireless board
      If temperatures goes over 39ΒΊC or below 30ΒΊC it sound an noisy alarm.Just in case main arduino or DHT22 fail.

      Egg roller its made os aluminium and plastic egg racks cutted and glued with hot glue(screws were better but this is enought to hold eggs).it makes 45ΒΊ each side.
      An High torque servo roll every 60 minutes. Note that an regular servo does not have enough torque should be an high toque version.

      0_1503674323666_IMG_20170825_100105.jpg
      eggs ready to start hatching! note the ds18b20 sensor in the back of the DHT22 sensor.they will stay same height than egg rack.

      0_1503674377143_IMG_20170825_095715.jpg

      0_1503674450331_IMG_20170825_095958.jpg
      2x18w halogen lighs

      0_1503674483401_IMG_20170825_100427.jpg
      lcd screen is configured for simplicity . code have hours and days passed and remaining ,but i decide use just passed days, temperature manual offset and time for next egg roll(minutes),and of course temperature and humidity on first line.

      0_1503674561645_IMG_20170825_100507.jpg

      0_1503674748968_IMG_20170825_100348.jpg

      0_1503674763845_IMG_20170825_100159.jpg
      its a mess of cables ...i know. It's what happening when we always improve our project until it be a final version πŸ˜›
      I used usb cables from computer cases for wire sensors, it work really well .
      There's 2 solid state relays on picture but we only need one.

      Parts:
      2x 12v 120mm pc fan(0.10A -slow speed/low noise)
      1x LM2596
      1x High torque servo or step motor(need additional controller).
      1x 5v Arduino pro mini (or equivalent )
      1x DHT22
      1x 5v relay Or SSR G3MB-202P Solid State
      1x 2 lines I2C 1602 LCD (i2c ,not serial) or 4 lines if you what more info on screen like time left and time spent clock.
      2x monetary switch
      2x 10k resistors
      2x 18w halogen light bulbs
      2x G9 Ceramic Sockets
      1x AC 220V 2000W SCR Voltage Regulator (overkill for 36W i know, but it cost 1.50€ on ebay)

      Optional parts
      1x 3.3v pro mini (or equivalent)
      1x computer speaker(buzzer)
      1x DS18b20
      1x NRF24L01
      1x 4.7K Resistor
      1x 3.7v litio battery (cellphone or 18650 cell)
      1x Battery Protection Board(just for charge battery before start hatching)
      note: this battery just hold main arduino in case of power failure. During normal work it never charge or discharge due 5v on line from LM2526

      FRITZING PROJECT:
      0_1504458462680_eggencubator v2.fzz

      0_1504458420052_egg encobator v2.jpg

      CODE:

      // Servo version of
      // Incubator code with lcd 16x2 ####--->>  I2C (4 wires) <<---  ###
      // ---------------------------------------------
      #include <Wire.h>
      #include <LiquidCrystal_I2C.h>
      
      #include "DHT.h"
      #include <Servo.h>
      #define DHTPIN 4                              // Define the temp sensor data pin
      #define DHTTYPE DHT22                         // define the temp/hum sensor type
      #define RELAY_1  7                              // define the relay 1 and 2 control pin
      #define RELAY_2  8
      
       
      Servo myservo;                                // create servo object to control a servo
      DHT dht(DHTPIN, DHTTYPE);                     //initialize the temp sensor
      
      LiquidCrystal_I2C lcd(0x3F,2,1,0,4,5,6,7,3, POSITIVE);    //set up what port the LCD will use
                            
      int pos = 0;                                  // variable to store the servo position
      int istate = 0;
      
      const int  buttonPin1 = 5;    // the pin that the Up pushbutton is attached to
      const int  buttonPin2 = 6;    // the pin that the Down pushbutton is attached to
      int buttonState1 = 0;
      int buttonState2 = 0;
      float val = 0; //val to increment/decrement (buttons/ threshold)
      
      int is, im, ih, id, ida, iha, ima;                      // variables for time
      float time, s1, m1, h1, d1;                   //  Set up variables to calculate time
      int ic, ip, ik;
      byte thermo[8] = {B00100, B01010, B01010, B01110, B01110, B11111, B11111, B01110}; //thermometer icon
      byte drop[8] = {B00100, B00100, B01010, B01010, B10001, B10001, B10001, B01110}; //drop icon
      byte arrow[8] = { B00100,  B01010,  B10101,  B00100, B10101,  B01010,  B00100,}; // smile icon
      byte tim[8] = {B00000, B01110, B10101, B10101, B10011, B10001, B01110,}; // clock icon
      
      int END = 0;
      unsigned long previousMillis = 0;
      const long interval = 3600000UL; //timer for roll eggs 1HOUR
      
      void setup()
      {
       Serial.begin(9600);
      
        pinMode(buttonPin1, INPUT);
        pinMode(buttonPin2, INPUT); 
        dht.begin();                                //start the temp sensor
        pinMode(RELAY_1, OUTPUT);
        pinMode(RELAY_2, OUTPUT);
        
        lcd.begin (16,2);                          // columns, rows.  use 16,2 for a 16x2 LCD, etc.
        lcd.clear();                                // start with a blank screen
        lcd.setCursor(0, 0);                        // set cursor to column 0, row 0 (the first row)
        lcd.print("Incubatora 1.0");                 // opening line
        lcd.setCursor(0, 1);                        // set cursor to column 0, row 1
        lcd.print("A iniciar!");
        delay(2000);
                                
        lcd.createChar(0, thermo);
        lcd.createChar(1, drop);
        lcd.createChar(2, arrow);
        lcd.createChar(3, tim);
        myservo.attach(9); // servo control is set to pin 9 (usually yellow wire is control, black goes to ground red goes to +5V)
        myservo.write(70); //put the servo at intitial position of 16 degrees
        myservo.detach();
      }
      
      //loop to read the sensor and display
      void loop() {
      
        int buttonState1 = digitalRead(buttonPin1);
        int buttonState2 = digitalRead(buttonPin2);
        delay(10);
      
      if (buttonState1 == HIGH)
           {     
           val-=0.1;
          } 
         else if (buttonState2 == HIGH) 
         { 
          val+=0.1;
         }
          
           
           
        float h = dht.readHumidity();                 // Read the humidity
        float t = dht.readTemperature();              // Read temperature in celsius
        float f = dht.readTemperature(true);          // get the temperature in Fahreheit
        
         //Temperature controller
          if (t >= (37.7 + val))
          {                       //  Set the temperature for the relay to come on (ideal 37.7ΒΊC)     
            digitalWrite(RELAY_1,LOW);          // TO HOT: Turns Relay OFF
          digitalWrite(RELAY_2,LOW);
          }
      
           if (t <= (37.5 + val))
         {                       //  Set the temperature for the relay to come on (ideal 37.7ΒΊC)    
            digitalWrite(RELAY_1,HIGH);          // TO HOT: Turns Relay ON
          digitalWrite(RELAY_2,HIGH);
          }
        
        
        // uncomment to compute heat index in Fahrenheit (the default)
        //float hif = dht.computeHeatIndex(f, h);
        // Compute heat index in Celsius (isFahreheit = false)
        //float hic = dht.computeHeatIndex(t, h, false);
        time = millis();                            //  Get time in milliseconds since tunit turn on
        s1 = time / 1000;                           //  Convert time to seconds, minutes, hours, days
        m1 = s1 / 60;
        h1 = m1 / 60;
        d1 = h1 / 24;
        id = int(d1);  //d                             //  Strip out remainder to leave Days:Hours:Minutes:Seconds
        ih = int((d1 - int(d1)) * 24); //h
        im = int((h1 - int(h1)) * 60); //m
        is = int((m1 - int(m1)) * 60);  //s
       
        
        
        
        // Calculate approximate TIME till hatch (assume 21 days to hatch)   -      not used yet
        ida = 21 - id;
        iha = 24 - ih;   
        ima = 60 - im;
        
      
      
        
        if (isnan(h) || isnan(t) || isnan(f)) {
          // if sensor can't be read
          lcd.clear();
          lcd.setCursor(0, 0);
          lcd.print("Falha No Sensor");
          Serial.print("Falha No Sensor" );
           digitalWrite(RELAY_1,HIGH);          // ERRO: Turns 1 Relay OFF to not kill all the eggs
          digitalWrite(RELAY_2,LOW);
          delay(5000);
          return;
        }
        else {      //  for  LCD 16x2
          //sensor was read succesfully so print values to LCD 16x2
          lcd.clear();                                // Clear the LCD
          //Print temperature and humidity in first two lines
          lcd.setCursor(0, 0);
          // lcd.print("Temperature:");
      
          lcd.write(byte(0));                       // Write the Thermometer icon
           lcd.print(t , 1);
          lcd.print((char)223);
          lcd.print("C  ");
          
          //lcd.setCursor(0,1);
          lcd.write(byte(1));                         // Write the drop icon
          // lcd.print("Humidade:");
           lcd.print(h, 0);
           lcd.print("%");
        //   lcd.print(" ");
        //  lcd.print(ic);
          lcd.setCursor(0, 1);
          
          //lcd.print("  ");
          lcd.write(byte(3));
          lcd.print(" ");
          // Print timein format Time: xxd:xxh:xxm:xxs
        lcd.print(id);
          lcd.print("d ");
         /* lcd.print(ih);
          lcd.print(":");
          lcd.print(im);
          lcd.print(" "); 
          lcd.print(is); lcd.print(" ");*/
          lcd.print(val,1);    
      
      
        if (21 - id <= 3){
             // Print days left till hatch
             lcd.print("!");
           END = 1; //stop move eggs
         }
        
         // this section is to roll the eggs   
      unsigned long currentMillis = millis();
      
       int tleft = ((currentMillis - previousMillis)/ 1000) /60;
      lcd.print(" ");  lcd.write(byte(2));  
       lcd.print(tleft); 
      
       
      if (currentMillis - previousMillis >= interval)
      {
        previousMillis = currentMillis;
       
      if(istate == 0 && END == 0){  
        //myservo.attach(9);
         for (pos = 80; pos <= 155; pos += 1) { // goes from 16 degrees to 80 degrees  in steps of 1 degree
           myservo.attach(9);
           myservo.write(pos);
           istate=1;
           delay(50);
         }
         myservo.detach();
       }
      else if( istate == 1 && END == 0)
      { 
       // myservo.attach(9);        
         for (pos = 155 ; pos >=80; pos -= 1) { // goes from 80 degrees to 0 degrees
          myservo.attach(9);
           myservo.write(pos); 
           istate = 0;
           delay(50);                      // slow the servo down a bit to turn the eggs        
         }
         myservo.detach();
       }
      
      }
        
             // Pause for 2 seconds
         delay(2000);
        }
      }
       
      

      auxiliary/optional arduino

      #define MY_DEBUG
      
      
      
      // ---------------------------------------------
      #define MY_RADIO_NRF24
      
      
      #include <SPI.h>
      #include <MySensors.h>  
      #include <OneWire.h>
      #include <DallasTemperature.h>
      
      
      #define MY_RF24_PA_LEVEL RF24_PA_LOW
      
      // Data wire is plugged into pin 2 on the Arduino
      #define ONE_WIRE_BUS 2
       #define CHILD_ID_EGG 12 //id
      // Setup a oneWire instance to communicate with any OneWire devices 
      // (not just Maxim/Dallas temperature ICs)
      OneWire oneWire(ONE_WIRE_BUS);
       
      // Pass our oneWire reference to Dallas Temperature.
      DallasTemperature sensors(&oneWire);
      const int buzzer = 3; //buzzer to arduino pin 3
      unsigned int al = 0;
      
      bool receivedConfig = false;
      bool metric = true;
      MyMessage msg(CHILD_ID_EGG,V_TEMP);
      
      
      unsigned long previousMillis = 0;        // will store last time sent temperature
      const long interval =900000; //15min
      
      void before()
      {
        // Startup up the OneWire library
        sensors.begin();
      }
      
      void setup()
      {
        
            sensors.begin();
             pinMode(buzzer, OUTPUT); // Set buzzer - pin 9 as an output
      }
      
      
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Temperature eggs", "2.0");
      
       
        // Present all sensors to controller
             present(CHILD_ID_EGG, S_TEMP);
        }
      
      
      
      void loop() {
      
        sensors.requestTemperatures(); // Send the command to get temperatures
      
      
        //Serial.print("Temperature is: ");
      
          float t =sensors.getTempCByIndex(0); 
      
      //Serial.print(t); 
      //-----------------------------timer & send-------------------------------------
       unsigned long currentMillis = millis();
      
        if (currentMillis - previousMillis >= interval) {
             
              previousMillis = currentMillis;
             
      // Send in the new temperature every 5min send(msg.setSensor(t).set(t,1));  
      send(msg.set(t,1));  Serial.print(t); 
        }
      //---------------------------------------------------------------------------------------
      
      //alarm buzzer-------
       if (t >=37.0) {    //(37ΒΊc)
        al=1;                 //save 1 when 1st temperature estabilize. after that "al" will be always 1 until reset/shutdows . This makes the alarm not start when incubator still cold on warm up
         }                      
      
         //Temperature controller alarm
          if (t >= 39.0) {  
            for (unsigned int i=750; i<2500; i++) {  // TO HOT: alarm!
            tone(buzzer, i ,700);
              delayMicroseconds (15);
            }
      delay(2000);
          }
      
              
        if (t <= 30.0 && al == 1) {                       
       
            for (unsigned int i=750; i<2500; i++) {  // TO HOT: alarm!
            tone(buzzer, i ,700);
              delayMicroseconds (15);
            }
      delay(2000);
          }
      
       
          
        }
      
      

      NOTE: English it's not my language. i'm sorry some errors that can happens πŸ˜›

      posted in My Project
      Tmaster
      Tmaster
    • Domoticz with DIY "razberry" card

      hello. like o wrote before my veralite dies after 4 years of work.
      So now i'm on Domoticz.For the dead vera lite i recover the z-wave part. i had some doubts that it works but i have seen n razberry cards that the hardware its the same,so why not try.
      I just cutted the 4 layers pcb and solder 4 wires on zm3102 chip directly(tx,rc,vcc and gnd). some hot glue and some nail polish /or epoxy to seal cutted sides.There are no working leds but how cares. and yea.I have an external antena πŸ™‚ . Everything fits inside vera case aswell(recycling on the best),raspbery,zwave card and mysensors GW.
      in beginning domoticz didn't detect it like in official zwave cards ,there are some procedures to make before,but soon as setup button gets blue ,was just reset or exclude and then include nodes again on Domoticz. until now (24hours later) everything still work like a charm ,And let me say Domoticz is far more complete than mios os.

      3_1520793722430_IMG_20180310_183236_962.jpg 2_1520793722429_IMG_20180310_183202_675.jpg 1_1520793722429_IMG_20180310_183135_708.jpg 0_1520793722429_IMG_20180310_181022_554.jpg

      posted in Domoticz
      Tmaster
      Tmaster
    • CHATGPT My new best friend!

      Hello guys.
      Years after MySensors release , and we still here talking here about, on on my electronic engineer opinion ,the best/usefull open source library ever!!! i say that because all my outdoor appliances, work with this stable library . Water heating solar panels, irrigation systems , outdoor light , main gate and basement gate can report status and command, water level from the irrigation system etc etc. Even for save water because i have timeouts and safe features for not water water or forget plants watering.... i only don't use the inside because my hardware don't fit inside concrete wall boxes....
      Now since i had to debug one of my sensors and realize the power of chatgpt now i just got lazy and don't program my sensors myself. I just explain what i want and the AI do it.
      have you tried it? Amazing .
      This morning i did a water level sensor to replace my sonar one. Asked one mysensors code for 16 hall effect sensors connected to a mux cd74hc4067 and it suggest ; why no use interpolation,why not use sensor
      hysteresis? hyster... what? i didn't its called like that. want cms or percentage....- DO it!! . 10 minutes later i had a hell of compacted code that do what i want WITHOUT BUGS and compile errors!!! yes,it's amazing because i'm not programmer and i can program c++ on arduino code but not much more than this....
      So don't stop your creativity because you are not very good programmer and you don't even know how to start you project. mysensors library it's well known from AI . .thank you my sensors team πŸ‘ πŸ’ͺ

      posted in General Discussion
      Tmaster
      Tmaster
    • RE: Timer (Emergencie)

      if it is an emergency button should be connected directly to relay (connected by hardware). And not using code,because if arduino it's freezed it will not respond and you cant stop it

      posted in My Project
      Tmaster
      Tmaster
    • RE: #define DEFAULT_RFM69_IRQ_PIN

      @zboblamont said in #define DEFAULT_RFM69_IRQ_PIN:

      So long as these are set before including the MySensors library it should indeed override the defaults.

      OMG. this is the problem! i was defining AFTER Including Mysensors library. well i should knew that if i know more about programingπŸ˜– 🀦

      this code now is working comunicating well.

      I still having an issue. termometer doesn't appear on domoticz. i think it's well presented... i'm not sure whats happen. but the axel for angle, that i need is , working good already .

      The corret statement is .
      #define MY_RFM69_IRQ_PIN 3
      #define MY_RFM69_IRQ_NUM 1

      /*
       ->  __  __       ____
       -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
       -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
       -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
       -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
       ->         |___/                      2.3.2
      */
      
      #define MY_DEBUG
      #include <basicMPU6050.h> 
      #define MY_RADIO_RFM69
      #define MY_RFM69_IRQ_PIN 3 //!< DEFAULT_RFM69_IRQ_PIN
      #define MY_RFM69_IRQ_NUM 1
      #include <MySensors.h>
      #include <RunningMedian.h>
      RunningMedian samples = RunningMedian(100);
      
      #define CHILD_ID 98
      #define CHILD_ID_TEMP 99
      
      
      
      MyMessage msg(CHILD_ID, V_LEVEL);
      MyMessage msg1(CHILD_ID_TEMP,V_TEMP);
      // Create instance
      basicMPU6050<> imu; //credits:https://github.com/RCmags/basicMPU6050
       float incl;
       
        static uint8_t sentValue;
      void presentation()
      {
        // Send the sketch version information to the gateway and controller
        sendSketchInfo("TANQUE", "2.3");
      
        // Register all sensors to gw (they will be created as child devices)
          present(CHILD_ID, S_MOISTURE);
           present(CHILD_ID_TEMP,S_TEMP);
      }
      
       
      void setup() {
        // Set registers - Always required
        imu.setup();
      
        // Initial calibration of gyro
        imu.setBias();
      
        
      }
      
      void loop() { 
        // Update gyro calibration 
         imu.updateBias();
        
         incl= imu.ay();
      
         int val = ((incl+1)*50);
      
         int x = val;
        
        samples.add(x); 
       
       //long m = samples.getAverage(); 
        int m = samples.getMedian();
        delay (200);
      
              
        if (m != sentValue)
         {
         
       
         send(msg.set(m));
         float temp = imu.temp();
        send(msg1.set(temp,1));
        sentValue = m;
        delay (5000);
        
         }
      }   
      
      
      posted in General Discussion
      Tmaster
      Tmaster
    • RE: Egg incubator IOT v3.0

      And that is the result . 14 chicks of 25eggs ,but i could say that was 100% sucess because the other eggs were not fertilized. not even a single dead before or after hatch. Its not the arduino the most versatile machine? πŸ™‚

      0_1505665439485_IMG_20170914_145207.jpg

      top left chic just born 10min before i take the picture:P
      0_1505665502812_IMG_20170914_145158.jpg

      posted in My Project
      Tmaster
      Tmaster
    • RE: Will a NRF24L01+PA+LNA help with my signal problems

      Hi to @Greymarvel .Well i already seen this movie before. I bought diferent nrf24 nodes,amplifed ,not amplified,with or without capacitors. In fact i had worst redults with amp nodes. I just change to rfm69hw and w
      . No more low power/high power...etc. now i got my 4000m2 terrain covered (around 80m long).
      I didn't check max range but i never had lost a packet again. I was a very good increment on my network stability.
      That fake nrf24 chips are crazy and unstable and yes,all ebay cheap nodes are fake second i know.

      posted in Development
      Tmaster
      Tmaster
    • RE: Roller shutter(s_cover) on Domoticz

      thank you for reply @mfalkvidd
      Payload like 100 shoud be 100% on domoticz, right? how does domoticz "know" that a blindcover /or shutter is open or close? because it's not respondig to that...

       
       __  __       ____
      |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
      | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
      | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
      |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
              |___/                      2.3.1
      
      16 MCO:BGN:INIT NODE,CP=RRNNA---,REL=255,VER=2.3.1
      26 MCO:BGN:BFR
      28 TSM:INIT
      30 TSF:WUR:MS=0
      34 TSM:INIT:TSP OK
      34 TSF:SID:OK,ID=4
      36 TSM:FPAR
      1257 TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
      1423 TSF:MSG:READ,0-0-4,s=255,c=3,t=8,pt=1,l=1,sg=0:0
      1429 TSF:MSG:FPAR OK,ID=0,D=1
      3264 TSM:FPAR:OK
      3264 TSM:ID
      3266 TSM:ID:OK
      3268 TSM:UPL
      3276 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      3315 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      3321 TSF:MSG:PONG RECV,HP=1
      3325 TSM:UPL:OK
      3328 TSM:READY:ID=4,PAR=0,DIS=1
      3540 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      3567 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      3786 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.1
      4005 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      4046 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=1,sg=0:M
      4263 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=5,sg=0,ft=0,st=OK:Cover
      4483 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:2.0
      4708 TSF:MSG:SEND,4-4-0-0,s=0,c=0,t=5,pt=0,l=22,sg=0,ft=0,st=OK:shuttle for Livingroom
      4716 MCO:REG:REQ
      4929 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      4956 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      4962 MCO:PIM:NODE REG=1
      4964 MCO:BGN:STP
      getting rolltime from eeprom: 
      28.00
      getting state from eeprom: 
      0
      4968 MCO:BGN:INIT OK,TSP=1
      Sending initial value
      5185 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=29,pt=1,l=1,sg=0,ft=0,st=OK:0
      5402 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=30,pt=1,l=1,sg=0,ft=0,st=OK:0
      5619 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=31,pt=1,l=1,sg=0,ft=0,st=OK:1
      5838 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=3,pt=2,l=2,sg=0,ft=0,st=OK:0
      

      .
      .
      .
      .
      after I give an order of CLOSE (DOWN) shutter (v_percentage=0)

      ------------     *(HERE WAS AT 100% AND I ORDER TO GO 0%(CLOSED)* -------------------
      
      exiting incoming message
      Shutters going down
      612509 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=29,pt=1,l=1,sg=0,ft=0,st=OK:0
      612728 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=30,pt=1,l=1,sg=0,ft=0,st=OK:1
      612947 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=31,pt=1,l=1,sg=0,ft=0,st=OK:0
      613167 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=3,pt=2,l=2,sg=0,ft=0,st=OK:100
      99
      98
      
      
      
      (...)
      
      7
      6
      5
      4
      3
      2
      1
      0
      Shutters halted X
      saving state to: 
      0
      645519 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=29,pt=1,l=1,sg=0,ft=0,st=OK:0
      645738 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=30,pt=1,l=1,sg=0,ft=0,st=OK:0
      645957 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=31,pt=1,l=1,sg=0,ft=0,st=OK:1
      646176 TSF:MSG:SEND,4-4-0-0,s=0,c=1,t=3,pt=2,l=2,sg=0,ft=0,st=OK:0
      
      ------------    *(HERE REACH 0%)* -------------------
      
      posted in Domoticz
      Tmaster
      Tmaster
    • RE: bluetooth instead of wifi

      because wifi is not the most safe for humans... sleeping etc

      what are you talking about???
      are you the ones that say wifi boils water on a cup?

      mysensors library works on nrf24l01+ modules, Not wifi. its a kind of Bluetooth already... anyway Bluetooth is 2.4ghz like wi-fi, but Bluetooth consumes less power (Theoricly)

      posted in My Project
      Tmaster
      Tmaster

    Latest posts made by Tmaster

    • RE: CHATGPT My new best friend!

      It's not tested because i didn't finish the hardware yet ,but should be pretty close from what i want ..and clean..

      #include <MySensors.h>
      
      #define CHILD_ID_LEVEL 1
      #define CHILD_ID_DIRECTION 2
      
      #define TOTAL_SENSORS 16
      #define TOTAL_HEIGHT_CM 150.0  // for internal reference only, we won't send cm
      
      // Pins for the CD74HC4067 multiplexer
      const int S0 = 4;
      const int S1 = 5;
      const int S2 = 6;
      const int S3 = 7;
      const int SIG_PIN = A0;
      
      MyMessage msgLevel(CHILD_ID_LEVEL, V_LEVEL);
      MyMessage msgDirection(CHILD_ID_DIRECTION, V_STATUS);
      
      float lastReportedPosition = -1;
      float previousReading = -1;
      int confirmationCounter = 0;
      const int CONFIRMATION_THRESHOLD = 3;
      
      unsigned long lastReadTime = 0;
      const unsigned long readInterval = 5000; // 5 seconds (adjust as needed)
      
      void before() {
        pinMode(S0, OUTPUT);
        pinMode(S1, OUTPUT);
        pinMode(S2, OUTPUT);
        pinMode(S3, OUTPUT);
      }
      
      void presentation() {
        sendSketchInfo("Interpolated Water Level Sensor 49E", "1.1");
        present(CHILD_ID_LEVEL, S_LEVEL);
        present(CHILD_ID_DIRECTION, S_INFO);
      }
      
      void setup() {}
      
      void loop() {
        unsigned long now = millis();
        if (now - lastReadTime < readInterval) return;
        lastReadTime = now;
      
        int readings[TOTAL_SENSORS];
        for (int i = 0; i < TOTAL_SENSORS; i++) {
          selectMuxChannel(i);
          delay(5);
          readings[i] = analogRead(SIG_PIN);
        }
      
        // Find the pair of consecutive sensors with the highest sum of readings
        int maxSensor = -1;
        int maxValue = -1;
        for (int i = 0; i < TOTAL_SENSORS - 1; i++) {
          int sum = readings[i] + readings[i + 1];
          if (sum > maxValue) {
            maxValue = sum;
            maxSensor = i;
          }
        }
      
        if (maxSensor < 0) return;
      
        float v1 = readings[maxSensor];
        float v2 = readings[maxSensor + 1];
        float frac = (v1 + v2 == 0) ? 0 : (float)v1 / (v1 + v2);
      
        // Relative position [0, TOTAL_SENSORS-1], inverted (top = 100%)
        float sensorPosition = maxSensor + (1.0 - frac);
      
        // Calculate level as percentage [0..100%]
        float levelPercent = (1.0 - sensorPosition / (TOTAL_SENSORS - 1)) * 100.0;
      
        // Hysteresis with 0.5% margin
        if (abs(levelPercent - previousReading) < 0.5) {
          confirmationCounter++;
        } else {
          confirmationCounter = 1;
        }
        previousReading = levelPercent;
      
        if (confirmationCounter >= CONFIRMATION_THRESHOLD && abs(levelPercent - lastReportedPosition) > 0.5) {
          send(msgLevel.set(levelPercent, 1)); // send percentage with 1 decimal place
      
          int direction = (levelPercent < lastReportedPosition) ? 1 : 0; // 1 = rising, 0 = falling
          send(msgDirection.set(direction));
      
          Serial.print("Level (%): ");
          Serial.print(levelPercent, 1);
          Serial.print(" - Direction: ");
          Serial.println(direction == 1 ? "RISING" : "FALLING");
      
          lastReportedPosition = levelPercent;
        }
      }
      
      void selectMuxChannel(int channel) {
        digitalWrite(S0, bitRead(channel, 0));
        digitalWrite(S1, bitRead(channel, 1));
        digitalWrite(S2, bitRead(channel, 2));
        digitalWrite(S3, bitRead(channel, 3));
      }
      
      

      And theres more.... i asked for he..she..it.. explain me the behavior of the code and this is what it explain:

      
      🎯 Purpose of the Code
      This Arduino sketch reads analog values from 16 linear Hall effect sensors (49E) connected via a CD74HC4067 16-channel analog multiplexer to measure the position of a floating magnet (e.g., on water). It calculates the water level as a percentage (0% = bottom, 100% = top) and detects the direction of change (rising or falling water level). The data is then sent via MySensors to a gateway/controller.
      
      πŸ”Œ Hardware Involved
      16 Hall Effect Sensors (49E) arranged vertically to detect a magnet's position.
      
      CD74HC4067 multiplexer to connect all 16 sensors to a single analog pin (A0).
      
      MySensors library for wireless communication (e.g., with an MQTT or home automation gateway).
      
      βš™οΈ Main Code Behavior
      1. Initialization
      before(): Configures the multiplexer select lines S0 to S3 as outputs.
      
      presentation(): Sends node and sensor info to the MySensors controller.
      
      setup(): Empty in this version (can be used for future initialization).
      
      2. Main Loop (loop())
      Runs every 5 seconds (readInterval = 5000 ms):
      
      a. Read Sensor Values
      Iterates through all 16 channels of the multiplexer.
      
      For each channel, selects the sensor via selectMuxChannel(i) and reads its analog value from pin A0.
      
      Stores all values in the readings[] array.
      
      b. Find Position of the Magnet
      Finds the pair of consecutive sensors with the highest combined reading (indicating proximity of the magnet).
      
      Uses those two sensors to calculate a more accurate interpolated position (sensorPosition), including fractional values.
      
      c. Convert to Water Level Percentage
      Translates the sensor position to a percentage level, with 100% at the top sensor and 0% at the bottom.
      
      Uses:
      
      cpp
      Copiar
      Editar
      float levelPercent = (1.0 - sensorPosition / (TOTAL_SENSORS - 1)) * 100.0;
      d. Hysteresis Filtering
      Uses a confirmation counter to avoid sending data for small noise fluctuations.
      
      Only reports new data if the level has changed significantly (by more than 0.5%) and remains stable for 3 readings.
      
      e. Send Data (if changed significantly)
      Sends the level as a float with 1 decimal point.
      
      Sends the direction:
      
      1 for rising water level
      
      0 for falling water level
      
      Prints this info to the serial monitor as debug output.
      
      🧠 Smart Features in the Code
      Interpolation: Instead of picking a single sensor, it uses interpolation between the two strongest sensors to increase resolution.
      
      Noise Filtering: Uses hysteresis and confirmation logic to avoid spamming updates due to noise.
      
      Direction Detection: Reports whether the water is rising or falling.
      
      πŸ“€ Output (via MySensors & Serial)
      V_LEVEL message: Water level percentage (e.g., 72.5%)
      
      V_STATUS message: Direction (1 = up/rising, 0 = down/falling)
      
      Serial example output:
      
      mathematica
      Copiar
      Editar
      Level (%): 72.5 - Direction: RISING
      πŸ§ͺ Use Cases
      Smart water tank monitoring
      
      Sump pit level monitoring
      
      Reservoir or hydroponics water level sensing
      
      Any linear position tracking using a magnet + Hall sensors
      
      Let me know if you’d like a diagram or simulation example of how this works!
      
      posted in General Discussion
      Tmaster
      Tmaster
    • CHATGPT My new best friend!

      Hello guys.
      Years after MySensors release , and we still here talking here about, on on my electronic engineer opinion ,the best/usefull open source library ever!!! i say that because all my outdoor appliances, work with this stable library . Water heating solar panels, irrigation systems , outdoor light , main gate and basement gate can report status and command, water level from the irrigation system etc etc. Even for save water because i have timeouts and safe features for not water water or forget plants watering.... i only don't use the inside because my hardware don't fit inside concrete wall boxes....
      Now since i had to debug one of my sensors and realize the power of chatgpt now i just got lazy and don't program my sensors myself. I just explain what i want and the AI do it.
      have you tried it? Amazing .
      This morning i did a water level sensor to replace my sonar one. Asked one mysensors code for 16 hall effect sensors connected to a mux cd74hc4067 and it suggest ; why no use interpolation,why not use sensor
      hysteresis? hyster... what? i didn't its called like that. want cms or percentage....- DO it!! . 10 minutes later i had a hell of compacted code that do what i want WITHOUT BUGS and compile errors!!! yes,it's amazing because i'm not programmer and i can program c++ on arduino code but not much more than this....
      So don't stop your creativity because you are not very good programmer and you don't even know how to start you project. mysensors library it's well known from AI . .thank you my sensors team πŸ‘ πŸ’ͺ

      posted in General Discussion
      Tmaster
      Tmaster
    • RE: hlk-pm01 are to noisy for rfm69?

      Maybe you are right and it's the proximity to a switching tranformer like this hlk-pm01 .They are all on same protoboard aprox 50x60mm. i could build a sheld on it but....now its working with the rfm69version W ok for a few days.
      The strange part is this combo was very used a few years now on made pcbs the on forum wher they had the maker/developer contest and never seen a line of this problem...

      posted in Hardware
      Tmaster
      Tmaster
    • RE: hlk-pm01 are to noisy for rfm69?

      i believe this problem has to be with rfm69CW and not the rfm69W . i have boot versions 868mhz and normally always the CW cause me this issues if is not batery powered even with 100uf +100nf caps filtering on transformer out, caps on the rfm60 power etc... maybe they are fake or have any problem. . i just ordered new rfm69W board and let me see if get better. right now i have like 10 nodes running outdoor on irrigation ,controlling relays and lights ,and metering temperatures. all with RFM69W ans HW ,this CW always give problems...

      posted in Hardware
      Tmaster
      Tmaster
    • hlk-pm01 are to noisy for rfm69?

      Hello . it's the 3rd node that i build with the combo arduino promini 3.3v + hlk-pm01 + rfm69 and all need wire ground to earth (on wallsocket) to let rfm69 comunicate.
      otherwise will fail on every comunication even near Gateway...
      Personally i only think in noise.but everyone say that hlk-pm01 are low noise.
      I'm not using any cap after hlk-pm01 for snooth voltage but i already try it before without better result.
      rfm69 is powered by the pro mini integrated regulator.
      Any one had this problem?

      posted in Hardware
      Tmaster
      Tmaster
    • RE: #define DEFAULT_RFM69_IRQ_PIN

      Now is working. so what i did is call to children 0 and 1 and #define MY_NODE_ID 101 ,so next node appear on harware/mysensors gw ,and apear on devices as IDX 99 and 100... The auto node idx from domoticz shoud have caused some issue.... now is working

      posted in General Discussion
      Tmaster
      Tmaster
    • RE: #define DEFAULT_RFM69_IRQ_PIN

      this is my gw . in fact i never understud very well the child thing. last one is "tanque"( tank) is ths node that we talk and is showing as 13 ?? why?

      normally what i do is go to devices ,see what next id is available and atribute it to children..worked until now but i think its wrong
      f822faf0-b88a-40a5-b65c-0402bc01db48-image.png

      posted in General Discussion
      Tmaster
      Tmaster
    • RE: #define DEFAULT_RFM69_IRQ_PIN

      @zboblamont said in #define DEFAULT_RFM69_IRQ_PIN:

      ode sketch to print locally over serial t

      this is local log already. thal last line: 11233 TSF:MSG:SEND,4-4-0-0,s=99,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:36.5
      is the message sending 36.5 degrees to gateway.

      domoticz log report message received from this node...but is not even on devices...

      posted in General Discussion
      Tmaster
      Tmaster
    • RE: #define DEFAULT_RFM69_IRQ_PIN

      this is the log. everything appear be fine with presetation of gyro termometer .But never show on devices. someting wrong with my gateway...

      1282 TSF:MSG:READ,7-7-4,s=255,c=3,t=8,pt=1,l=1,sg=0:1
      2050 TSM:FPAR:OK
      2050 TSM:ID
      2052 TSM:ID:OK
      2054 TSM:UPL
      2062 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1
      2101 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1
      2107 TSF:MSG:PONG RECV,HP=1
      2111 TSM:UPL:OK
      2113 TSM:READY:ID=4,PAR=0,DIS=1
      2326 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100
      2353 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100
      2572 TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.2
      2791 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0
      2828 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=1,sg=0:M
      3250 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=6,sg=0,ft=0,st=OK:TANQUE
      3469 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:2.3
      3688 TSF:MSG:SEND,4-4-0-0,s=98,c=0,t=35,pt=0,l=0,sg=0,ft=0,st=OK:
      3905 TSF:MSG:SEND,4-4-0-0,s=99,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK:
      3911 MCO:REG:REQ
      4124 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2
      4151 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1
      4157 MCO:PIM:NODE REG=1
      4159 MCO:BGN:STP
      10801 MCO:BGN:INIT OK,TSP=1
      11014 TSF:MSG:SEND,4-4-0-0,s=98,c=1,t=37,pt=2,l=2,sg=0,ft=0,st=OK:49
      11233 TSF:MSG:SEND,4-4-0-0,s=99,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:36.5
      
      
      
      posted in General Discussion
      Tmaster
      Tmaster
    • RE: #define DEFAULT_RFM69_IRQ_PIN

      @zboblamont said in #define DEFAULT_RFM69_IRQ_PIN:

      So long as these are set before including the MySensors library it should indeed override the defaults.

      OMG. this is the problem! i was defining AFTER Including Mysensors library. well i should knew that if i know more about programingπŸ˜– 🀦

      this code now is working comunicating well.

      I still having an issue. termometer doesn't appear on domoticz. i think it's well presented... i'm not sure whats happen. but the axel for angle, that i need is , working good already .

      The corret statement is .
      #define MY_RFM69_IRQ_PIN 3
      #define MY_RFM69_IRQ_NUM 1

      /*
       ->  __  __       ____
       -> |  \/  |_   _/ ___|  ___ _ __  ___  ___  _ __ ___
       -> | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __|
       -> | |  | | |_| |___| |  __/ | | \__ \  _  | |  \__ \
       -> |_|  |_|\__, |____/ \___|_| |_|___/\___/|_|  |___/
       ->         |___/                      2.3.2
      */
      
      #define MY_DEBUG
      #include <basicMPU6050.h> 
      #define MY_RADIO_RFM69
      #define MY_RFM69_IRQ_PIN 3 //!< DEFAULT_RFM69_IRQ_PIN
      #define MY_RFM69_IRQ_NUM 1
      #include <MySensors.h>
      #include <RunningMedian.h>
      RunningMedian samples = RunningMedian(100);
      
      #define CHILD_ID 98
      #define CHILD_ID_TEMP 99
      
      
      
      MyMessage msg(CHILD_ID, V_LEVEL);
      MyMessage msg1(CHILD_ID_TEMP,V_TEMP);
      // Create instance
      basicMPU6050<> imu; //credits:https://github.com/RCmags/basicMPU6050
       float incl;
       
        static uint8_t sentValue;
      void presentation()
      {
        // Send the sketch version information to the gateway and controller
        sendSketchInfo("TANQUE", "2.3");
      
        // Register all sensors to gw (they will be created as child devices)
          present(CHILD_ID, S_MOISTURE);
           present(CHILD_ID_TEMP,S_TEMP);
      }
      
       
      void setup() {
        // Set registers - Always required
        imu.setup();
      
        // Initial calibration of gyro
        imu.setBias();
      
        
      }
      
      void loop() { 
        // Update gyro calibration 
         imu.updateBias();
        
         incl= imu.ay();
      
         int val = ((incl+1)*50);
      
         int x = val;
        
        samples.add(x); 
       
       //long m = samples.getAverage(); 
        int m = samples.getMedian();
        delay (200);
      
              
        if (m != sentValue)
         {
         
       
         send(msg.set(m));
         float temp = imu.temp();
        send(msg1.set(temp,1));
        sentValue = m;
        delay (5000);
        
         }
      }   
      
      
      posted in General Discussion
      Tmaster
      Tmaster