Navigation

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

    Best posts made by sundberg84

    • Clearance, creepage and other safety aspects in "MySensors" PCBs.

      I have been reading much lately about safety around PCBs and we also see a incresing numbers of PCBs @ openhardware.io which involves more than low DC power. With freeware CAD programs and cheap chinese pcb manufacturer alof of amatures like myself have the ability to create pcbs - in worst case not safe pcbs. This is what i gathered so far, so here we go:

      Terms used

      CREEPAGE

      The shortest path between two conductive parts, or between a conductive part and the bounding surface of the equipment, measured along the surface of the insulation (Figure 1).

      CLEARANCE

      The shortest path between two conductive parts, or between a conductive part and the bounding surface of the equipment, measured through air (Figure 1).
      0_1467050010441_Fig1.png

      A minimum clearance table for 150 and 300v [Ref]

      0_1467095683337_clearance.png

      MATERIAL GROUP / Insulant

      DIN EN 60664-1 (VDE 0110-1) divides the insulants according to their CTI values in four groups. These are:
      Insulant I: 600 ≤ CTI
      Insulant II: 400 ≤ CTI < 600
      Insulant IIIa: 175 ≤ CTI < 400
      Insulant IIIb: 100 ≤ CTI < 175
      [Ref][Ref]

      Fr4 material (normal cheap-as PCBs) is normally 175 - 250CTI which is insulation material group IIIa. Ask your PCB house for your CTI value to be able to determine your material group.

      POLLUTION LEVEL / Degree of contamination / Contamination level

      The influence of the contamination is considered with the calculation of air and creepage distances by degrees of pollution.

      • Contamination level 1
        No contamination or only dry, non-conductive contamination occurs. The contamination has no influence.
      • Contamination level 2
        Only non-conductive contamination occurs. However, occasional temporary conductivity must be expected as a result of moisture condensation.
      • Contamination level 3
        Conductive contamination occurs; dry, non-conductive contamination which becomes conductive as a result of moisture condensation may also occur.
      • Contamination level 4
        Impurities in the form of conductive dust, rain or humidity result in permanent conductivity.
        [Ref]

      0_1467050235504_Pollution2.png

      Note that if you put a PCB inside a sealed component you get pollution level 1

      ISOLATION/INSULATION

      This is one of the most important parts - by knowing your isolation group/type you need to have for safety you enter this into the creepage calculator to get your creepage distance.

      “Isolation means that no direct electrical connection, or conductor, exists between two or more circuits or between circuits and accessible parts.” … “You use safety isolation to isolate hazardous, or "live," voltages greater than 30V rms and 42.4V peak or 60V dc from user-accessible SELV (safety extra-low-voltage) circuits. Safety isolation also minimizes the possibility of transient voltage arc-over or -through insulation to user-touchable circuits and enclosures.”[Ref]

      Isolation and insulation
      Users have access to voltage and current through touchable connectors, cables, and user-interface devices you find on most products. Voltages must be less than or equal to 42.4V÷60 peak dc to meet safe limits and to be SELV. SELV circuits are considered safe to touch and are double-insulated from hazardous voltages in case of a single fault. SELV circuits are commonplace and find use in product inputs/outputs and interconnection, such as logic circuits for printers, PC keyboards, and telecommunications devices.[Ref]

      There are five types of insulation: functional, basic, supplementary, double, and reinforced. Functional insulation is necessary only for the correct functioning of a product. Functional or operational insulation does not protect or isolate against electrical shock. Basic insulation is a single level of insulation that provides basic protection against shock. Supplementary insulation is an independent insulation that manufacturers apply in addition to basic insulation to reduce the risk of electrical shock in the event of a failure of basic insulation. Double insulation comprises both basic and supplementary insulation. Reinforced insulation is a single insulation system that provides electrical-shock protection equivalent to double insulation.[Ref]

      Double, reinforced, and basic insulations are the most important insulation types for safety isolation. The minimum spacing requirements for safety insulation are double from hazardous live to SELV—for example, 3 mm on printed-wiring board. You use functional insulation between circuits to maintain the operation of the product, but you do not rely on it for safety isolation.

      You should use basic insulation between hazardous voltage circuits, but the requirement depends on the applicable safety standard, function of the product, environment, and testing.[Ref]

      When a breakdown can create a hazardous voltage on user accessible conductive parts (such as in case of insulation between mains circuits and low-voltage secondary circuits), a double or reinforced insulation is required. [Ref]

      • Functional insulation is that which is only
        necessary for circuit operation. It is assumed
        to provide no safety protection.
      • Basic insulation provides basic protection
        against electric shock with a single level;
        however this category does not have a
        minimum thickness specification for solid
        insulation and is assumed to be subject to
        pinholes. Safety is provided by a second level
        of protection such as Supplementary
        insulation or protective earthing.
      • Supplementary insulation is normally used
        in conjunction with Basic insulation to
        provide a second level of protection in the
        event that the Basic level fails. A single layer
        of insulating material must have a minimum
        thickness of 0.4 mm to be considered
        Supplementary insulation.
      • Double insulation is a two-level system,
        usually consisting of Basic insulation plus
        Supplementary insulation.
      • Reinforced insulation is a single-insulation
        system equivalent to Double insulation. It
        also requires a minimum thickness of 0.4 mm
        for use in a single layer. [Ref]

      How does this all come togheter?

      The main question is how much space do I have to have between my traces/components on my PCB to make it safe? To know there are many calculators and tables online. One example is http://creepage.com/. To be able to use these calculators or to read the tables you need to figure out all this above.

      For example, we want to know the space between AC traces for a PCB that can be used in all enviroments.
      If we enter this into a calculator for example creepage.com we get this:

      Insulation: Basic (we know it should be basic from above)
      Pollution Degree 3 (for example, we want it to work in areas where condensation occurs)
      Material Group IIIa or IIIb (we know it should be IIIb from above since its a normal FR-4 PCB)
      Working Voltage 250 Vrms or Vdc

      Creepage is 4.0 mm or 157.5 mils
      We need 4.0mm between AC circuit to be on the safe side!

      Also if you have a AC (primary) hazardous side and a DC low voltage/SELV ciriut if we want to have a PCB within ALL limits we need to have reinforced insulation and then hits 8mm creepage between AC and DC side.

      0_1467060461797_insulation.png
      This is a example of a AC primary and DC secondary - but the distance is not 8mm between so it does not meet the reinforced insulation rules if you have a pollution degree of 3 or more.

      More about that here:

      "PCB shall be constructed so that creepage distances are not less than those appropriate for the working voltage, taking into >account the material group and the pollution degree. Hence creepage distance depends of the CTI's material (Comparative Tracking Index) and pollution degree. European main standard are for Household Appliance (EN60335) and Information technology (EN 60950). As Reference value, in the worst case (Household appliance), for reinforced insulation between High voltage (220 Vrms) and low voltage (<50Vrms) on the same layer (top or bottom), you should an 8mm creepage distance between tracks (Fig. 1) as required for standard EN 60335-1-2, table 17. These distance are lower with better CTI and Pollution degree. If you can’t maintain these distances, you need a milling (cutting of material large at least 1.5mm) between the two points that do not meet the minimum safety distances (fig.2)." (Link)

      Same general tip from this article

      "A minimum of 8 mm separation between primary and secondary circuits also prevents problems. "

      Conclusion

      First of all its important to not mix AC high voltage and DC low voltage systems. These should be seperated with a "reinforced insulation".
      Assuming MySensors nodes are normally in a normal indoor enviroment (Pollution dgr 2) we need to have atleast 5,0mm seperation between AC circuit and DC circuit if you are using 240v.

      Also the distance inside the AC circuit between the high voltage traces should be 2,5mm since this insulation is recommended to be "basic".

      0_1467050340590_MinCreepage.JPG

      Conclusion 2

      If you seal your box completely (see IP classifications) to avoid contamination from your environment you can design your board with distansens from pollution degree 1. This means pretty much clearance and creepage are the same. This means you need at 250v 0.56 mm [ref] between AC circuit (basic insulation) and 3.3mm between AC high voltage and DC low voltage. This has alot to do with material quality so I would add some extra space to be sure.

      Conclusion 3

      If you can’t maintain creepage distances, you need a milling (cutting of material large at least 1.5mm) between the two points that do not meet the minimum safety distances.

      Disclaimer:

      My disclaimer is still: I can not guarantee this info is safe! I have not made any professional tests. This is DIY and do not use this if you dont know what you are doing. It may hurt or kill you and damage your property. This thread is more of a question and discussion than a statement. Do not reference this thread. My goal is to figure out the safest way to make a MySensors PCB and the info above might not be correct.

      Other Links

      http://www.denverpels.org/Downloads/Denver_PELS_20090915_Aldous_Insulation_Coordination.pdf)
      http://blog.optimumdesign.com/clearance-and-creepage-rules-for-pcb-assembly
      http://learnemc.com/pcb-layout
      http://www.itesafety.com/en_e3.pdf
      http://sisko.colorado.edu/CRIA/FILES/REFS/Electronics/IPC_2221A.pdf
      https://en.wikipedia.org/wiki/Insulator_(electricity)

      The end?

      Please add your thoughts, questions and most of all knowledge to this thread. I will update the first post to make it easy to find info. Try to keep it in a amature language and avoid technical terms without explaining them.

      posted in Hardware
      sundberg84
      sundberg84
    • Easy/Newbie PCB for MySensors

      "Update - please use https://forum.mysensors.org/topic/2740/easy-newbie-pcb-for-mysensors to discuss this PCB"

      Hello!

      I have created my own PCB.
      This is a PCB that only contains the basic functions for MySensors but is somewhat dynamic.
      The main goal was to eliminate the build time soldering wires between the Arduino Pro Mini and the Radio.
      Its a PCB for all newbies that wants to do basic nodes like myself out there... 🙂

      It is a PCB for all that only wants the basic part of MySensors documented in the website!
      This cuts my work with one node from a couple of hours soldering wires to 20-30min

      All info can be found @ https://www.openhardware.io/view/4

      3.jpg

      posted in Hardware
      sundberg84
      sundberg84
    • In wall - PCB, (AC to DC 5v)

      This post is archived!
      Please use this thread to post questions:

      https://forum.mysensors.org/topic/2783/in-wall-ac-dc-pcb-for-mysensors

      Project can be found here:
      https://www.openhardware.io/view/13/In-Wall-ACDC-Pcb-for-MySensors







      Hi!

      As i mentioned in another post i had this idea to stack two PCB on top of each other to fit inside a wall appliance box. This idea has evolved (see below).

      Im aware of the big security risk here, and have tried to read:

      • http://forum.mysensors.org/topic/1607/safe-in-wall-ac-to-dc-transformers
      • http://forum.mysensors.org/topic/1540/110v-230v-ac-to-mysensors-pcb-board

      EDIT 03/1/2016
      After discussion on this here are the findings of this thread (as of now):

      I will update this post with BOM and eagles files as soon as i get a node running.

      1.JPG

      ...............................
      BOM/README: http://1drv.ms/1kCzue5
      GERBER: InWallMySensor3.0.rar
      EAGLES: InWallMySensor3.0Eagles.rar
      Build images: http://1drv.ms/1lsleox
      ...............................

      If you are using this design, please know about the risks when you work with high power. This design has no guarantee s so use it on your own risk!

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Some weeks ago I made a video with my children and i had this idea to do something with electronics... so mostly as a testproject I made a introduction video for EasyPCB. I kinda like it... but my English isnt the best in some places.

      Easy/Newbie PCB for MySensors – 08:01
      — Andreas Sundberg

      posted in General Discussion
      sundberg84
      sundberg84
    • What did you build today (Pictures) ?

      I think we need a thread (and it would be fun) where old and new users can post a picture with a small text with "look what I did today". Its a steal from another forum i watch but its a really fun thread to follow like-minded people in their daily work.

      The rules are simple - keep it simple with one picture (or a few) with a small text including a small explanation. If you want to comment on a particular post please create a new thread ("Reply as topic") or keep it really short. The idea is to get a flow with pictures. It does absolutely not needs to be a finished project - it can be a sketch of an idea or a process of something. Anything you can take a picture off from the MySensors / Home automation world.

      I hope this is not violating any forum rules and if it does, please remove - but I think this can be a fun addition to the forum.

      Let me start!
      0_1508438347617_171019-IMG_20171019_203715.jpg
      Today i created a second motion detector based on Slim Node from @m26872. Its a 1mhz bootloader and modified hc-sr501(3.3v "hack"). Its currently "deployed" in my kitchen (replaced the old one) in the spice-rack above the stove... low WAF but high camouflage! Might work 🙂

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

      Today I introduced my 5 year old to soldering...

      0_1510237029170_171109-IMG_20171109_151533.JPG

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 💬 In Wall AC/DC Pcb (with Relay) for MySensors (SMD)

      Everything is moving along slowly... 🙂

      Today i tested the relay function, the AC - DC (HLK) and if everything fitted inside the 3d box.

      Found some issues with the relay... it opens ok, but I cant close it again so the relay remains open... I need to figure out (or ask) if there is something wrong with my schematics or if the relay I used was bad.

      Also I have to add some mm on the 3dbox in the holes for the relay and HLK.

      0_1470155716207_1.jpg

      I have uploaded some images and the eaglesfiles - but I would not recommend to create any pcbs yet - im not satisfied with the result and things will change on the layout and other.

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

      Let me present - How NOT to deploy a MySensors Node! Here is how you do: 1) Skrew everything solid to a wall 2) Power it up and make sure you have shorted a SDA / GND or VCC on your BMP sensor just because you dont doublecheck the colors 3)Forget to enable # My debug 4)Fetch your last BMP sensor but drop it on the lawn (pitch dark outside) 5) Spend 30min with a flashligh in 5dgr C searching for the sensor and try it out once you find it. 6) Nothing works so Un-screw everything and connect it to FTDI inside at your computer, reupload the sketch with debug. - Now everything works fine (with the first sensor) for some unknown reason. 7) Skrew everything back again! 😎 Find out the BMP sensor is not working 9) Debug Serial (atleast I got to use my new logger) 10) Find out a short on the MysX connector due to bent wire.

      0_1509477265850_upload-4cb4d2db-19b0-4c15-bb7c-85ae142145cc
      New and old sensor - side by side.

      0_1509477296115_upload-7e59bd8a-9c85-4db3-8a88-c86e21d1c7a4

      posted in General Discussion
      sundberg84
      sundberg84
    • Robotic lawn mower supervisor

      Just dropping a small project i made here for the upcoming season.

      Its a motion and distance combined sensor sitting besides my robotic lawn mower. Whenever there is a movement it measures the distance, and therefore I can see if my mower is out or charging.

      0_1460478573291_1.jpg

      Why not only a motion detector - well I have alot of other things happening in the shed as well (cats, children, rabbits) and i also wants to know if the mower is charging or out cutting gras.

      0_1460478679125_2.JPG

      With a small lua script in Domoticz i hope to achieve a push notise whenever its trapped outside for to long.

      Its made of my EasyPCB, a Arduino Pro mini 5v, Nrf24l01+ radio, HC-SR04 distance sensor and HC-SR501 motion sensor.

      0_1460478780523_3.JPG

      Code for 2.0

      // Enable debug prints
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      //#define MY_RADIO_RFM69
      
      // #define MY_NODE_ID 12
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <NewPing.h>
        
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define CHILD_ID 1   // Id of the sensor child
      #define CHILD_ID_DIST 2
      #define TRIGGER_PIN  6  // Arduino pin tied to trigger pin on the ultrasonic sensor.
      #define ECHO_PIN     5  // Arduino pin tied to echo pin on the ultrasonic sensor.
      #define MAX_DISTANCE 300 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
      
      // Initialize motion message
      MyMessage msg(CHILD_ID, V_TRIPPED);
      
      // Initialize distance message
      NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
      MyMessage msgdist(CHILD_ID_DIST, V_DISTANCE);
      int lastDist;
      boolean metric = true;
      int oldTripped = 0;
      int tripped = 0; 
      unsigned long lastRequest = 0;
      
      void setup()  
      {  
        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the motion sensor digital pin as input
        metric = getConfig().isMetric;
      }
      
      void presentation()  {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("Distance and Motion", "1.3");
      
        // Register all sensors to gw (they will be created as child devices)
        present(CHILD_ID, S_MOTION);
        delay(100);
        present(CHILD_ID_DIST, S_DISTANCE);
      }
      
      void loop(){     
      
      unsigned long now = millis();
      
      //Read digital motion value
      tripped = digitalRead(DIGITAL_INPUT_SENSOR);
      if (tripped != oldTripped){
        lastRequest = now;
        
        // Distance?
        int dist = metric?sonar.ping_cm():sonar.ping_in();
        Serial.print("Ping: ");
        Serial.print(dist); // Convert ping time to distance in cm and print result (0 = outside set distance range)
        Serial.println(metric?" cm":" in");
        if (dist == 0){
          return; //read again if 0, because 0 is error!
        }
      
        if (dist != lastDist) {
            send(msgdist.set(dist));
            lastDist = dist;
        }
         // Motion?
        send(msg.set(tripped?"1":"0"));  // Send tripped value to gw 
        oldTripped = tripped;
      }
      
      if ((now - lastRequest) > (60UL * 1000UL * 60UL)){
      lastRequest = now;
      Serial.print("Heartbeat");
      sendHeartbeat();}
      }
      
      posted in My Project
      sundberg84
      sundberg84
    • RE: Your workshop :)

      0_1519674968503_IMG_20180226_203325.jpg

      After changing my HA and network to new location I made some changes to my workshop. Still some work in progress.

      posted in General Discussion
      sundberg84
      sundberg84
    • Debug flowchart - feedback wanted.

      Hi!

      I have created a flowchart to make it easier to debug - and now I need feedback.

      • Is it a clear flow?
      • I tried to collect the most asked questions in the forum and add them - is there anything you are missing?
      • Also, language - since english isnt my first language, please correct me if something is wrong or unclear.
      • Or anything else you can think of 🙂 Lets try to make it as easy as possible for all...

      0_1454268203092_1.jpg

      posted in Troubleshooting
      sundberg84
      sundberg84
    • RE: 💬 In Wall AC/DC Pcb (with Relay) for MySensors (SMD)

      I received my boards today. Away for a week but will assemble, test and release files asap.

      0_1468246194526_20160711_160848.jpg

      posted in OpenHardware.io
      sundberg84
      sundberg84
    • RE: Internet of Poultry - Fully automated chicken shed

      Damn... now i have to get chickens 😉

      posted in My Project
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Another EasyPCB video - a complete build of a 5v node with a radiotest and cleareeprom.

      Complete build! - Easy/Newbie PCB (Nrf24l01+) for MySensors – 15:44
      — Andreas Sundberg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 💬 In Wall AC/DC Pcb (with Relay) for MySensors (SMD)

      Updated the 3dbox with some variants...
      From left...
      Box with access to MysX Connector
      Box wthout any access to inside (except AC screw terminal)
      Box with hole for a g3mc-202 relay and no other access.
      0_1471547221319_1.jpg

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

      Today I built a led dimmer and motion detector for my kitchen. Running on 12v and a led list of about 2m.

      0_1522338565517_IMG_20180329_174732.jpg

      Everything is built on my MysX led board and it was so easy to assemble everything and it's really small.

      0_1522338630780_IMG_20180329_174759.jpg

      0_1522338653800_IMG_20180329_174549.jpg

      0_1522338665121_IMG_20180329_174525.jpg

      I have documented this project and will show you in a video when edited.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Debug to a sd-card module?

      Old topic, and I will probably create a project on openhardware but im making some progress with this... hardware section is under testing... software for SD-card needs to be developed so still some time ahead before finished. 2 revision of the PCB and it probably needs another round (6 weeks delivery, yay!)

      My next step as hardware developer will be some sort of sales from openhardware with assembled modules and not only PCB but my goal will be to sell them 1 and 1 for a resonable price for all that needs a debug machine.

      And the name? Easy Debugger Module - The Serial Debug Killer! 😂

      0_1502273490834_1.JPG
      0_1502273919282_2.JPG

      posted in Development
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Im getting so tired of soldering extra wires and stuff so today im doing a "MysX to All common sensors breakout board"...

      0_1540411084071_4f9ac007-2ce9-41a9-8bc6-b954f193b964-image.png

      Dont know if this will work... but worth a shot.

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

      Today i fired up my controller after 6 months houserenovation. Upgraded to new 2.3 version and instantly some old nodes started reporting again 😀. Yes, there were some without battery but several temp and binary nodes survived 6 months without supervision. 0_1577797816208_1577797801960606374482477635708.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: $8 Lamp (Outlet) "Smart Plug" Module

      @petewill
      Now i got three working relays thanks to you, so again, great video!
      Wanted to thank you and also show my sollution.
      I hade some 433mhz cheap (not good working) relays with perfect case i could re-use:
      The case had a status-led and a switch i use as well.

      Relay.jpg

      posted in My Project
      sundberg84
      sundberg84
    • RE: 💬 In Wall AC/DC Pcb for MySensors

      @Sefi-Ninio - Yea I should. Im working on Rev 4 and there is more creepage both between primary (220) and secondary (5) and also internally in primary. Everything is ordered but nothing recieved yet, but let me give you a small peak:

      0_1457550900902_3dboxTop.JPG

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

      Completely unrelated but a impossible project for me it seems...

      Im building a wifi "babywatch" in a USB stick.
      It sends sounds to a app/software which is build to run in the background. This to be able to game or watch video with headphones and still know if you have a angry child.

      0_1516361802397_ab5d4e10-3c7b-4c08-80ae-5300238cc55f-image.png

      So pretty much Mic -> Amp -> ADC -> Esp8266 -> Wifi -> Software/App.

      0_1516361828016_62fcbb13-a9fd-40d9-8b31-d64ebfd3dbce-image.png

      0_1516361845702_ca39662b-fd8e-4949-9481-d48e073b0e9f-image.png

      This seems impossible to do with all the interference. Everything works now (Rev1) but im now on Rev 6+ or something and I cant get rid of the noice in the Audio.

      Seperate power supply + ground for analog and digital side but It seems like the Esp8266 inserts to much noice.

      Well, it was a great idea but hard to accomplish.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Easy/Newbie PCB for MySensors

      Hi!

      Just wanted to comfirm that REV. 7 with the MysX connector works great so I have removed the Rev6 option from first post.

      1.JPG

      Offcourse i allready have some ideas for Rev 8... but ill do that later.

      In the meantime please enjoy the rev. history (aka learning curve) 🙂

      Rev.JPG

      posted in Hardware
      sundberg84
      sundberg84
    • RE: 💬 Easy/Newbie PCB for MySensors

      Hi all!

      This has now been update to Rev 10.
      New revision has been sent to PCB manufacturer but It will take some days for them to update their Gerber. (When you order, make sure it says M.Rev 6!

      0_1528107591933_8daa3f55-a3e9-456a-86fe-cbb70d43c8fd-image.png

      Openhardware page has been updated, let me know if you find anything strange.

      RFM69 version will be updated soon as well.

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

      I built my first MysX daughter board which I will connect to my EasyPCB to drive a led strip.
      This will power everything from 12v so 2 things. Power main board and dim LED strip.

      0_1517346818295_f17d0698-17e1-4842-997e-fa8ddc1d8019-image.png

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 💬 Easy/Newbie PCB for MySensors

      We must be ordering EasyPCB alof from PCBway since they used it as an example board for this youtuber:

      PCBWay Circuit Boards - 2 Minute Review📦🛠🔎 – 02:57
      — MKme Lab

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

      A video of my Ledstrip project in the kitchen:

      MySensors LED Strip Dimmer - EasyPCB (Nrf24l01+) and Led Board. – 19:12
      — Andreas Sundberg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Domotiocz + Rain gauge

      This is my rainsensor/tipping bucket for MySensors that works with Domoticz.

      It uses 2xAA as power source, a Pro Mini 3.3v with a 0.9 to 3.3 booster.
      The bucket has a magnet which triggeras a reed switch which triggers an interrupt pin.
      I also use battery sensing with voltage divider.

      // Enable debug prints to serial monitor
      #define MY_DEBUG 
      #define MY_RADIO_NRF24
      #define MY_NODE_ID 7
      
      #include <SPI.h>
      #include <MySensor.h>  
      
      // Running this in Domoticz stable version 2.5 will not work - upgrade to beta.
      
      #define DIGITAL_INPUT_SENSOR 3                  // The reed switch you attached.  (Only 2 and 3 generates interrupt!)
      #define INTERRUPT DIGITAL_INPUT_SENSOR-2        // Usually the interrupt = pin -2 (on uno/nano anyway)
      
      #define CHILD_ID 1                              // Id of the sensor child
      #define SKETCH_NAME "Rain Gauge"                // Change to a fancy name you like
      #define SKETCH_VERSION "1.1"                    // Your version
      
      unsigned long SLEEP_TIME = 18*60000;            // Sleep time (in milliseconds).
      //unsigned long SLEEP_TIME = 20000;             // use this instead for debug
      
      float hwRainVolume = 0;                         // Current rainvolume calculated in hardware.
      int hwPulseCounter = 0;                         // Pulsecount recieved from GW
      float fullCounter = 0;                           // Counts when to send counter
      float bucketSize = 0.5;                           // Bucketsize mm, needs to be 1, 0.5, 0.25, 0.2 or 0.1
      boolean pcReceived = false;                     // If we have recieved the pulscount from GW or not 
      boolean reedState;                              // Current state the reedswitch is in
      boolean oldReedState;                           // Old state (last state) of the reedswitch
      unsigned long lastSend =0;                      // Time we last tried to fetch counter.
      
      MyMessage volumeMsg(CHILD_ID,V_RAIN);
      MyMessage lastCounterMsg(CHILD_ID,V_VAR1);
      
      //=========================
      // 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 presentation() {
      
        // Send the Sketch Version Information to the Gateway
        sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
      
        // Register this device as Rain sensor (will not show in Domoticz until first value arrives)
        present(CHILD_ID, S_RAIN);       
      }
      
      
      void setup()  
      {  
        // use the 1.1 V internal reference
        analogReference(INTERNAL);             // For battery sensing
        
        pinMode(DIGITAL_INPUT_SENSOR, INPUT_PULLUP);  // sets the reed sensor digital pin as input
      
        reedState = digitalRead(DIGITAL_INPUT_SENSOR); // Read what state the reedswitch is in
        oldReedState = reedState; // Set startup position for reedswitch 
        
        Serial.println("Startup completed");
      }
      
      void loop()     
      { 
      unsigned long currentTime = millis();
      
          //See if we have the counter/pulse from Domoticz - and ask for it if we dont.
          if (!pcReceived && (currentTime - lastSend > 5000)) {      
            request(CHILD_ID, V_VAR1);
            lastSend=currentTime;
            return;
          }
          if (!pcReceived) {
            return;
          }
          
      //Read if the bucket tipped over
      reedState = digitalRead(DIGITAL_INPUT_SENSOR);
      boolean tipped = oldReedState != reedState; 
      
          //BUCKET TIPS!
          if (tipped==true) {
          Serial.println("The bucket has tipped over...");
          oldReedState = reedState;
          hwRainVolume = hwRainVolume + bucketSize;
          send(volumeMsg.set((float)hwRainVolume,1));
          wait(1000);
          fullCounter = fullCounter + bucketSize;
      
            //Count so we send the counter for every 1mm
            if(fullCounter >= 1){
            hwPulseCounter++;
            send(lastCounterMsg.set(hwPulseCounter));
            wait(1000);
            fullCounter = 0;
            }
            
          }
          
          if (tipped==false) {
      
           //No bucket tipped over last sleep-period, check battery then...
           batM(); 
          }
      
      lastSend=currentTime;
      sleep(INTERRUPT, CHANGE, SLEEP_TIME); 
      //The interupt can be CHANGE or FALLING depending on how you wired the hardware.
      }
      
      //Read if we have a incoming message.
      void receive(const MyMessage &msg) {
          if (msg.type==V_VAR1) {
          hwPulseCounter = msg.getULong();
          hwRainVolume = hwPulseCounter;
          pcReceived = true;
          Serial.print("Received last pulse count from gw: ");
          Serial.println(hwPulseCounter);   
          }
      }
      
      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 > 1) {  
           batteryPcnt = (batArray[0] + batArray[1] + batArray[2]);
           batteryPcnt = batteryPcnt / 3;
       
         if (batteryPcnt > 100) {
           batteryPcnt=100;
       }
       
           Serial.print("Battery Average (Send): "); Serial.print(batteryPcnt); Serial.println(" %");
             sendBatteryLevel(batteryPcnt);
             batLoop = 0;
             
           //Sends 1 per hour as a heartbeat.
           send(volumeMsg.set((float)hwRainVolume,1));   
           send(lastCounterMsg.set(hwPulseCounter));
           }
           else 
           {
           batLoop++;
           }
      }
      
      posted in Domoticz
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      These arrived today...
      New gateway and nodes with signing is first on my list.

      0_1523470226809_IMG_20180411_200901.jpg

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

      A temp-node on 2xAA. Also a sneak-peak on EasyPCB rev 10...

      MySensors Battery Node 2xAA - EasyPCB (Nrf24l01+) and Temp Sensor. – 17:53
      — Andreas Sundberg

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

      Today i recieved my new mini-easy-pcb i posted some info about 3 months ago. This with a breakoutboard-daugher board for all "common" sensors in the MySensors shop. I want to create a small motherboard which can be powered using a battery but also can use the battery for UPS/backup if powered from another daugherboard. The motherboard should be standard and then I would be able to add 1-2 daugherboards to specify the node.

      The breakoutboard is just for test, but can be used by newbies offcourse.
      My wish is to create the ultimate security sensor running on 12v but with a battery backup. It should include motion, temp, smoke and light.

      0_1548081587912_377d9c22-187f-4482-812f-80bb7d553bce-image.png

      0_1548081617961_8349e553-898f-4e17-b29d-87eba091e53c-image.png

      Il will get back in another 3 months when tested 😉

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

      Today I designed a case for EasyPCB with 2xAA holder on the back.

      e63319a9-b160-47ea-be2b-6b3353636e06-image.png
      a7bd451f-72d7-4004-88b0-64c43dd0e192-image.png

      and a case that slides just over.

      269327e4-e5b7-4e28-85d6-183862119e61-image.png

      It works with 3x5 version so for this you accually have to use the more advanced option and reflash the fuses on your pro mini to make it 3x5. The normal EasyPCB with booster is 5x5, but Im thinking of just stretching this for another version.

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

      Updated my GW with the code @mfalkvidd provided to monitor OK and NACK

      a2a53f2e-6227-451f-baf6-bc2ed2d66111-image.png

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Option non blocking registration at gateway

      I would love to see an start on this - maybe a relay example that works without the gateway. As @TheoL said, lights - and i think thats one end to start. The best would offcourse be to make some generic thing that works for all nodes.

      posted in Feature Requests
      sundberg84
      sundberg84
    • RE: Easy/Newbie PCB for MySensors

      Hello!

      I have updated to rev 7.
      Instead of a random assignments of the pinheads its now arranged into MysX 1.4.

      I dont think this will make it less newbie friendly and it will also add the possibility for others to create shields using the MysX connector.
      I hope you like it and thank you @Anticimex for putting up with all the questions...

      1.jpg

      Also it has not been tested yet, so if you want 100% please use Rev 6 and let me try this one out first.
      See the first post for the files.

      posted in Hardware
      sundberg84
      sundberg84
    • RE: Your workshop :)

      0_1459700377884_1459700348657-119485172.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: My new project : texboard pcb

      @linkos nice work! One small suggestion is that you move the antenna on the radio outside the pcb. All the metal in traces and components might interfere with the signal.

      posted in My Project
      sundberg84
      sundberg84
    • RE: In wall - PCB, (AC to DC 5v)

      So, just a small update - im waiting for new PCB and parts (going to SMD components), almost everything has arrived but some nessecary things still missing.

      I will leave this project here but not develop this version any more.
      Instead I will create a new thread with the new SMD version!

      posted in Hardware
      sundberg84
      sundberg84
    • RE: [newbie] After the first euphoria: Safety? Security?

      @pellusfromtellus - I have spent alof of time with the safety question (AC to DC mostly and power supplies) - and it boils down to reading official guidelines and understanding that the more you read the more scary it gets... There is alof of discussions on this forum you can read! Start here for example.

      • http://forum.mysensors.org/topic/1607/safe-in-wall-ac-to-dc-transformers
      • https://forum.mysensors.org/topic/4175/clearance-creepage-and-other-safety-aspects-in-mysensors-pcbs (with alof of links)
      • http://lygte-info.dk/review/Power Mains to 5V 0.6A Hi-Link HLK-PM01 UK.html
      • https://skippy.org.uk/quick-look-at-the-hlk-pm01/
      • https://www.ieee.li/pdf/essay/safety_considerations_in_power_supply_design.pdf

      General tip is that cheap is bad (both power and safety) when it comes to power supplies. All you can do is stick to official rules for your country and understand if shit hits the fan you are probably in trouble since its DIY. If you want to be really safe (like OK from your insurance company) you need a official certification like CE or FEE on your product.

      And yes, I had incidents... https://forum.mysensors.org/topic/1607/safe-in-wall-ac-to-dc-transformers/36

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Clearance, creepage and other safety aspects in "MySensors" PCBs.

      @TNI - Thanks for your input!

      • How do you find the right product standard for your product? Ie, a AC/DC PCB board?

      • So when you find your standard (I think I have been working alot with the standard for high voltage boards?) you find which creepage/clearance you need to work with? Can you give an example?
        -Simulating and calculating by engineers isnt a option for us, this is open source hardware / DIY and this means "we do it on our own risk"... thats why im trying to gather as much info as possible - what would your recommendations be?

      • I have noted Basic/reinforces above, but not connected the info to Impulse voltage. Can you give an example or my conclusions regargind Basic/reinforces isnt correct?

      Thanks for your info Thomas! If possible I would be glad to keep the discussion here for others to see... thats what open source is all about 🙂

      posted in Hardware
      sundberg84
      sundberg84
    • RE: The examples on the website need love

      Mysensors have 5k + users and first time I hear somebody complain about this so hard. It clearly states "focusing on do-it-yourself home automation". If someone wants plug & play (and not the diversity which MySensors offers) why not buy something off the shelf? There is no such thing like wasting a Sunday on MySensors if you are here for the right reasons.

      Worst of all? The attitude... how about instead being humble about this has been created by a hard working team on their free time instead of claiming their work need some love, talking about wasted a lot time and listing everything that is bad.

      Its good that you want to help but why not try the friendly way like - how can I make this better for the community? Can I help and how do i contribute? Did you guys think about this? You dont start a post like this. Im sure you will have much better luck this way.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: NRF24 / RFM69????

      @Roloz - they all have its + and -.
      I use it like this:

      MySensors Nrf24: My default radio, cheap but might need some work sometimes to get it to work - DIY
      MySensors RFM69: More expensive radio and also DIY but I find it a bit more reliable. I use this mostly for long range like garden and outdoor.
      RFLink: I use this to switch my AC mains, because then I can buy switches (433mhz) which are approved to switch main power. This only because of safety.

      Note that RFLink isnt MySensors so you need a RFLInk gateway for that one.

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Last night I made a enclosure to my new outdoor weather station/node. It is made from 2x 70mm sewer pipe end caps and a small sewer pipe to keep them together. Works surprisingly great and looks good.
      Now its painted black and drying - lets hope I can find any daylight this week and mount/deploy it.

      0_1509350485595_upload-60220e56-06da-42b0-9171-f503ceb23d78
      0_1509350504395_upload-1b94da77-a353-4562-912b-5dd9ba426169

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Which are trustworthy brands for a simple USB wall charger?

      @NeverDie - I have also posted pictures in this forum and other forum about personal issues with "genuine" (fake!) iphone/samsung charger. Just a search on ali/ebay makes it impossible with that amount of results to know which one is good vs bad... i guess it some way you pay more for good.

      My guess is that we are going to see more fires... I watched a morningshow here in Sweden some time ago and it was considered safe so far with the chargers (13 fires / year) verses stove fires (1500+/year) but the last linked charger (samsung) was bought at a market here in sweden in a nice packaging sold as a genuine... it was not so i guess the market is getting quite flooded with fake ones.

      My second guess is as the charger is safer using it as just a charger than putting a unknown DIY load as well. Might be the work fine charging phones but what happens when you add to much load to them?

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Today I made a pogo pin programming board for my Logger. (The logger works except one last thing... Rev 5 here we come!)
      0_1511353120457_15113530928851279978681.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Easy/Newbie PCB for MySensors

      @helvetian - just so you dont miss this. A Atmega328 (Pro mini if you are using EasyPCB) can be run without a booster by reprogramming the fuses/bootloader. This is more advanced but possible. Then you can run the pro mini with a 8mhz or 1mhz internal clock down to the radio minimum 1.9v. This is a better option compared to boosters but harder to achieve.

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Building some loggers which i might sell later on.
      0_1514554953843_1514554934776246379576.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: I have great problem with raspberry and domoticz and mysensors gateway !

      @Reza - there are different ways to do this, and Im no expert.
      Please have a look and continue from there...

      https://domoticz.com/forum/viewtopic.php?f=28&t=8788

      • Make system read only http://blog.pi3g.com/2014/04/make-raspb ... read-only/
      • Run system from external HD http://raspberrypihobbyist.blogspot.nl/ ... drive.html
      • Boot from USB http://jonathanmh.com/boot-raspberry-pi ... usb-stick/
      posted in Troubleshooting
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      0_1517069081859_IMG_20180127_170256.jpg

      I'm building a wine rack for my wife in a celler room (currently 14 dgr with 4 dgr outside). I mowed my beer cooler temp node (rfm radio) to measure how much the temp changed over the day. I wrote a script in Lua/Domoticz that each time it changes 1dgr it should notify me. Apparently is a stable temp the most important to store wine.

      All ideas how I can automate the shit out of this wine-room are appreciated.

      • LCD display with temp/hum (both on the floor and celling) (Red needs apparently cooler than white wine... Or the opposite).

      • I'm thinking about to try a passive cooler. A burried hose/pipe in a loop with a 12v fan/pump and temp. My idea is that if I rotate the 14dgr air in a say 20m pipe under ground it should cool the air some . This needs to be automated to keep the temp stable.

      • light. Some sort of led strips.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 💬 Easy/Newbie PCB for MySensors

      First battery node with rev 8 is up and running... need to test 5v version as well but looks good so far
      0_1456177952831_20160222_213338.jpg

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

      I made a MysX template for anyone who wants to create a MysX board to any EasyPCB in KiCadd.
      Found here: https://github.com/sundberg84/HomeAutomation/tree/master/MysX template EasyPCB

      0_1518893898944_pcb.JPG

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 💬 In Wall AC/DC Pcb for MySensors

      This PCB has been updated to Rev 4.1 with the following changes:
      (Note that this thread contains the non SMD version)

      • Complete redesign of traces to improve size and stability.
      • Nrf24l01+ now on the bottom side to make more room (with hope not RF disturbace from HLK or AC traces).
      • Added silkmask with AC-DC seperation (Rev 4.1 > 5mm)
      • AC clearance 2.5mm minimum
      • Changed one AC trace from botton to top to increace creepage and changed milling
      • MysX 2.3 + Analog IO
      • Safety recommendations: This PCB meets the criteria of pollution level II (2,5mm (Basic) AC seperation and 5mm (Reinforced) AC-DC sepertion) and can be used "where only non-conductive contamination occurs. However, occasional temporary conductivity must be expected as a result of moisture condensation." Always use a sealed case to avoid contamination. Always read disclaimer.txt before using this PCB.

      0_1482862303483_1.JPG

      Images on https://www.openhardware.io/view/13/In-Wall-ACDC-Pcb-for-MySensors has been updated.

      Please wait for PCB house to update to new gerber files before ordering (It should say M.Rev 2 (Manufacturer rev 2) for latest revision when selecting PCB house)

      Im currently testing this rev...
      If you want to be 100% sure, download and prev. revision.

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

      It is always those last connections...

      0_1521574134168_9996122e-87ce-4f0b-97b5-9fe9b70ec2d2-image.png

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 💬 Easy/Newbie PCB (RFM69 HW/W edition) for MySensors

      @gohan - looking better on that SMA connector...
      0_1494441088218_Ant.JPG

      Anyone knows if its possible to have a SMA and Hole for DIY antenna on the same PCB like this?

      Edit:
      Well, so far tonight... a couple of hours work and im happy 🙂 some small stuff to fix before production.
      0_1494445821526_SoFar.JPG

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

      0_1525710585979_1525710576865460597546.jpg

      ...and deployed.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 💬 Connecting the Radio

      @hek - I can look into that.

      posted in Announcements
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Redesigning my nodes in the RFM69 network to be signed using EasyPCB 10. Today it was my beer cooler node (because it's very important the beer temperature is secured). In the same time I'm implementing @gohan idea with two temp points (top and bottom).

      0_1528134204572_IMG_20180604_194024.jpg

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

      Playing with how small I could create a EasyPCB if I only used SMD components and footprints for both RFM69 and Nrf24l01+... including MysX, Signing, Flash offcourse... and a coincell...

      0_1539893069382_cb02fc1b-387a-48e0-b07b-36097509582a-image.png

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

      0_1552926495997_15529264809961412241838.jpg

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

      But it's something...

      0_1554651767460_15546517582521430623468.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Domotiocz + Rain gauge

      This is great!
      1 year - times fly by, but my rainsensor is going strong!

      I just wanted to celebrate 1 year for my Rainsensor on batteries, reporting every hour (or less when it rains). Still going strong and 81% battery left! Except for some range issues in the beginning you can see its working as it should:

      Also It will be my (almost) 1000th post so thank you all for making MySensors such a great community. I just love every minute here!

      0_1474871808445_1.jpg

      posted in Domoticz
      sundberg84
      sundberg84
    • My outdoor weather-sensor (5v powered combined temp, hum, pressure, and light)

      Hello!
      My first sensor not powered with battery - a outdoor sensor.

      A old temp sensor from a weather station was remade as box.
      With some drilling everything fit good inside.

      Inside DHT22 (Temp and Hum), LM393 (Light) and BMP085 (Pressure (Temp disabled)).

      Some build pictures:build.png

      and the final result:
      done.jpg

      Everything seems to work perfect in controller... now i can start making some relays to my window lamps so they can power up only when dark enough 🙂

      The code as well offcource:

      #include <SPI.h>
      #include <MySensor.h>  
      #include <Wire.h>
      #include <Adafruit_BMP085.h>
      #include <DHT.h>  
      
      //Sketch/Node
      #define SketchName "Ute sensor x4"
      #define SketchVer "1.3"
      #define NodeID 5
      
      //Bmp
      #define BARO_CHILD 0
      #define TEMP_CHILD 1 
      #define MetersAboveSeaLevel 130
      //DHT
      #define CHILD_ID_HUM 2
      #define CHILD_ID_TEMP 3
      #define HUMIDITY_SENSOR_DIGITAL_PIN 3
      //Light/LUX
      #define CHILD_ID_LIGHT 4
      #define LIGHT_SENSOR_ANALOG_PIN 0
      
      unsigned long SLEEP_TIME = 1*60000;
      //unsigned long SLEEP_TIME = 10000; //debug
      
      Adafruit_BMP085 bmp = Adafruit_BMP085();      // Digital Pressure Sensor 
      DHT dht;
      
      MyMessage tempMsg(TEMP_CHILD, V_TEMP);
      MyMessage pressureMsg(BARO_CHILD, V_PRESSURE);
      MyMessage forecastMsg(BARO_CHILD, V_FORECAST);
      
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      
      MyMessage msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
      
      MySensor gw;
      
      //BMP
      float lastPressure = -1;
      int lastForecast = -1;
      int heartbeatBMP = 0;
      //float pressureSamples[180];
      
      const char *weather[] = { "stable", "sunny", "cloudy", "unstable", "thunderstorm", "unknown" };
      enum FORECAST
      {
      STABLE = 0,         // Stable weather
      SUNNY = 1,          // Slowly rising HP stable good weather
      CLOUDY = 2,         // Slowly falling Low Pressure System, stable rainy weather
      UNSTABLE = 3,       // Quickly rising HP, not stable weather
      THUNDERSTORM = 4,   // Quickly falling LP, Thunderstorm, not stable
      UNKNOWN = 5         // Unknown, more time needed
      };
      
      const int LAST_SAMPLES_COUNT = 5;
      float lastPressureSamples[LAST_SAMPLES_COUNT];
      #define MULTIPLIER (65.0/1023.0)
      
      int minuteCount = 0;
      bool firstRound = true;
      float pressureAvg[7];
      float dP_dt;
      boolean metric; 
      
      //DHT
      float lastTemp;
      float lastHum;
      
      //Light/LUX
      int lastLightLevel;
      int heartbeatLUX = 0;
      
      void setup() {
        gw.begin(NULL, NodeID, false);
        //incomingMessageCallback - Callback function for incoming messages from other nodes or controller and request responses. Default is NULL.
        //nodeId - The unique id (1-254) for this sensor. Default is AUTO(255) which means sensor tries to fetch an id from controller.
        //repeaterMode - Activate repeater mode. This node will forward messages to other nodes in the radio network. Make sure to call process() regularly. Default in false
      
        // Send the sketch version information to the gateway and Controller
        gw.sendSketchInfo(SketchName, SketchVer);
      
        if (!bmp.begin()) {
          Serial.println("Could not find a valid BMP085 sensor, check wiring!");
          while (1) { }
        }
        
        //Setup DHT
        dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); 
      
        // Register sensors to gw (they will be created as child devices)
        gw.present(BARO_CHILD, S_BARO);
        gw.present(TEMP_CHILD, S_TEMP);
        
        gw.present(CHILD_ID_HUM, S_HUM);
        gw.present(CHILD_ID_TEMP, S_TEMP);
      
        gw.present(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
        metric = gw.getConfig().isMetric;
      }
      
      void loop() {
      
        //-----------------------------------------------------------------------------//DHT
        delay(dht.getMinimumSamplingPeriod());
        float temperature = dht.getTemperature();
        
        if (isnan(temperature)) {
            Serial.println("Failed reading temperature from DHT");
        } else if (temperature != lastTemp) {
          lastTemp = temperature;
          if (!metric) {
            temperature = dht.toFahrenheit(temperature);
          }
          gw.send(msgTemp.set(temperature, 1));
          Serial.print("T: ");
          Serial.println(temperature);
        }
      
        float humidity = dht.getHumidity();
        if (isnan(humidity)) {
            Serial.println("Failed reading humidity from DHT");
        } else if (humidity != lastHum) {
            lastHum = humidity;
            gw.send(msgHum.set(humidity, 1));
            Serial.print("H: ");
            Serial.println(humidity);
        }
      
      //-----------------------------------------------------------------------------//BPM 
      
        float pressure = bmp.readSealevelPressure(MetersAboveSeaLevel)/100; // 130 meters above sealevel
        int forecast = sample(pressure);
        //Temp fetched from DHT
      
        Serial.print("Temperature = ");
        Serial.print(temperature);
        Serial.println(metric?" *C":" *F");
        Serial.print("Pressure = ");
        Serial.print(pressure);
        Serial.println(" Pa");
        Serial.println(weather[forecast]);
      
       if (isnan(pressure)) {
        Serial.println("Failed readin pressure");
       } else {
         
         if (pressure != lastPressure) {
          gw.send(pressureMsg.set(pressure, 0));
          lastPressure = pressure;
        heartbeatBMP = 0;
       
        }
        else
        {
          heartbeatBMP++;
          if (heartbeatBMP >= 24) {
            
          gw.send(pressureMsg.set(pressure, 0));
            heartbeatBMP = 0;
          }
        }
      }
      
        if (forecast != lastForecast) {
          gw.send(forecastMsg.set(weather[forecast]));
          lastForecast = forecast;
        }
        
        /*
         DP/Dt explanation
      
         0 = "Stable Weather Pattern"
         1 = "Slowly rising Good Weather", "Clear/Sunny "
         2 = "Slowly falling L-Pressure ", "Cloudy/Rain "
         3 = "Quickly rising H-Press",     "Not Stable"
         4 = "Quickly falling L-Press",    "Thunderstorm"
         5 = "Unknown (More Time needed) 
        */
      //-----------------------------------------------------------------------------//LJUS
      
        int lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; 
        Serial.print("Light: ");
        Serial.println(lightLevel);
        if (lightLevel != lastLightLevel) {
            gw.send(msg.set(lightLevel));
            lastLightLevel = lightLevel;
            heartbeatLUX = 0;
       
        }
        else
        {
          heartbeatLUX++;
          if (heartbeatLUX >= 24) {
            
            gw.send(msg.set(lightLevel));
            heartbeatLUX = 0;
          }
        }
      
      //-----------------------------------------------------------------------------//SLEEP
      
      gw.sleep(SLEEP_TIME); //sleep a bit
      }
      float getLastPressureSamplesAverage()
      {
      float lastPressureSamplesAverage = 0;
      for (int i = 0; i < LAST_SAMPLES_COUNT; i++)
      {
          lastPressureSamplesAverage += lastPressureSamples[i];
      }
      lastPressureSamplesAverage /= LAST_SAMPLES_COUNT;
      
          return lastPressureSamplesAverage ;
      }
      
      // Algorithm found here
      // http://www.freescale.com/files/sensors/doc/app_note/AN3914.pdf
      
      int sample(float pressure) {
      
      // Calculate the average of the last n minutes.
      int index = minuteCount % LAST_SAMPLES_COUNT;
      lastPressureSamples[index] = pressure;
      
      minuteCount++;
      if (minuteCount > 185)
          minuteCount = 6;
      
      if (minuteCount == 5) {
          pressureAvg[0] = getLastPressureSamplesAverage();
      }
      else if (minuteCount == 35) {
          pressureAvg[1] = getLastPressureSamplesAverage();
          float change = (pressureAvg[1] - pressureAvg[0]);
          if (firstRound) // first time initial 3 hour
              dP_dt = (MULTIPLIER * 2 * change); // note this is for t = 0.5hour
          else
              dP_dt = ((MULTIPLIER * change) / 1.5); // divide by 1.5 as this is the difference in time from 0 value.
      }
      else if (minuteCount == 65) {
          pressureAvg[2] = getLastPressureSamplesAverage();
          float change = (pressureAvg[2] - pressureAvg[0]);
          if (firstRound) //first time initial 3 hour
              dP_dt = (MULTIPLIER * change); //note this is for t = 1 hour
          else
              dP_dt = ((MULTIPLIER * change) / 2); //divide by 2 as this is the difference in time from 0 value
      }
      else if (minuteCount == 95) {
          pressureAvg[3] = getLastPressureSamplesAverage();
          float change = (pressureAvg[3] - pressureAvg[0]);
          if (firstRound) // first time initial 3 hour
              dP_dt = ((MULTIPLIER * change) / 1.5); // note this is for t = 1.5 hour
          else
              dP_dt = ((MULTIPLIER * change) / 2.5); // divide by 2.5 as this is the difference in time from 0 value
      }
      else if (minuteCount == 125) {
          pressureAvg[4] = getLastPressureSamplesAverage();
          float change = (pressureAvg[4] - pressureAvg[0]);
          if (firstRound) // first time initial 3 hour
              dP_dt = ((MULTIPLIER * change) / 2); // note this is for t = 2 hour
          else
              dP_dt = ((MULTIPLIER * change) / 3); // divide by 3 as this is the difference in time from 0 value
      }
      else if (minuteCount == 155) {
          pressureAvg[5] = getLastPressureSamplesAverage();
          float change = (pressureAvg[5] - pressureAvg[0]);
          if (firstRound) // first time initial 3 hour
              dP_dt = ((MULTIPLIER * change) / 2.5); // note this is for t = 2.5 hour
          else
              dP_dt = ((MULTIPLIER * change) / 3.5); // divide by 3.5 as this is the difference in time from 0 value
      }
      else if (minuteCount == 185) {
          pressureAvg[6] = getLastPressureSamplesAverage();
          float change = (pressureAvg[6] - pressureAvg[0]);
          if (firstRound) // first time initial 3 hour
              dP_dt = ((MULTIPLIER * change) / 3); // note this is for t = 3 hour
          else
              dP_dt = ((MULTIPLIER * change) / 4); // divide by 4 as this is the difference in time from 0 value
      
          pressureAvg[0] = pressureAvg[5]; // Equating the pressure at 0 to the pressure at 2 hour after 3 hours have past.
          firstRound = false; // flag to let you know that this is on the past 3 hour mark. Initialized to 0 outside main loop.
      }
      
      int forecast = UNKNOWN;
      if (minuteCount < 35 && firstRound) //if time is less than 35 min on the first 3 hour interval.
          forecast = UNKNOWN;
      else if (dP_dt < (-0.25))
          forecast = THUNDERSTORM;
      else if (dP_dt > 0.25)
          forecast = UNSTABLE;
      else if ((dP_dt > (-0.25)) && (dP_dt < (-0.05)))
          forecast = CLOUDY;
      else if ((dP_dt > 0.05) && (dP_dt < 0.25))
          forecast = SUNNY;
      else if ((dP_dt >(-0.05)) && (dP_dt < 0.05))
          forecast = STABLE;
      else
          forecast = UNKNOWN; // Unknown
      
      return forecast;
      }
      

      Edit: Updated the code for right forecast algorithm See here

      posted in My Project
      sundberg84
      sundberg84
    • RE: 💬 Power Meter Pulse Sensor

      @gohan - is Domoticz updating anything (except switches) faster than 5 min? I dont think so...

      posted in Announcements
      sundberg84
      sundberg84
    • RE: upgrading to 2.0

      @parachutesj - I couldnt get my old gateway to work with 2.0 nodes and tekka wrote its recommended to upgrade all. In my case i started at the gateway and then repeaters and that did work. I still have some nodes from 1.4 and 1.6 that works with the 2.0gw and repeaters.

      posted in Development
      sundberg84
      sundberg84
    • RE: ST=FAIL?!

      Hi @moskovskiy82!

      st=fail" means the receiving node or gateway has problems sending ack back to the sending node.
      Try adding a capacitor to the receiving radio, change powersource, move reciever/sender closer to eachother or build a repeater.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Are folks here happy with Domoticz?

      @NeverDie I'm happy with Domoticz. Easy to use but after a while I wish it was a bit more flexible.

      posted in Domoticz
      sundberg84
      sundberg84
    • RE: LG TV controller

      Sooo... after some waiting i recieved my RS232 to TTL... but soon found out that my Samsung does not use the RS232... but a 3.5mm stereo as a service port... seems like its the same protocoll so it should be able to do everything from changing channel to volyme, source and other cool stuff...

      Build Plans:
      0_1457642388647_1.jpg

      A great weekend project... 🙂 I will be back!

      posted in My Project
      sundberg84
      sundberg84
    • RE: sleep with timer and level interrupt

      @ebo - have a look at some rain sensors sketches.
      Also check https://www.mysensors.org/download/sensor_api_20#sleeping

      posted in Development
      sundberg84
      sundberg84
    • RE: ST=FAIL?!

      @moskovskiy82
      It has probably nothing with the sketch to do - its hardware (Range/Power issues).
      If you think its a software issue, try clearing the eeprom http://www.mysensors.org/build/debug#clearing-eeprom and reupload your sketch.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Are folks here happy with Domoticz?

      Just to clarify I think Domoticz is very versatile and flexible when it comes to hardware but when it comes to GUI and how to visually show everything it's very nice but not configurable.

      posted in Domoticz
      sundberg84
      sundberg84
    • RE: My First Gateway

      And to continiue on @korttoma thoughts here is some good links about power and PA/LNA radio.

      https://forum.mysensors.org/topic/653/nrf24l01-pa
      https://forum.mysensors.org/topic/1142/nrf24l01-pa-lna
      http://forum.mysensors.org/topic/1877/solved-2-x-nrf24l01-pa-lna-with-rf24_pa_max
      http://forum.mysensors.org/topic/3353/nrf24l01-with-antenna-not-working/2
      http://forum.mysensors.org/topic/3447/nrf24l01-pa-lna

      http://blog.blackoise.de/2016/02/fixing-your-cheap-nrf24l01-palna-module/

      posted in My Project
      sundberg84
      sundberg84
    • RE: help needed for getting started with arduino based sensor and Domoticz

      @peerv - RFXCom is not MySensors. They work similar, you have sensor transmitting data to a gateway.
      RFXCom uses their own librarys and communication and can not communicate with MySensors.
      In Domoticz (the controller) though you can have both a RFXCom gateway and a MySensors gateway, but a MySensors node/sensors can not talk to the RFXCom gatewat/channel.

      As @gohan said - have a look at https://www.mysensors.org/about and go trough everything there and you will understand.

      posted in Development
      sundberg84
      sundberg84
    • RE: Meet in Malmö, Summer 2016?

      Yea - count me in! Ill bring some beer (and food offcourse) 🙂

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Rebuild of my broken 433mhz Cresta/hideki UV-Sensor

      I just wanted to update this post with my code and rebuild to this UV sensor thanks to @core_c!
      I also updated the box 😉

      0_1494874383421_1.jpg
      The Dallas temp sensor was never used in this project so please ignore...

      The node is build with a Slim Node. I could save some power by using a booster with VIn attached to D4. I keep the D4 low between sleeps. In sleep mode it consumes less than 10uA.

      The code:

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24                  //The radio we use!
      #define MY_NODE_ID 19                      //Fixed node ID
      #define MY_BAUD_RATE 9600           //Needs to be defined because standard for MySensors is 115200. This bootloader uses 9600!
      
      #include <SPI.h>
      #include <MySensors.h>
      #include <Vcc.h>
      
      //SketchInfo MySensors
      #define SKETCH_NAME "UV #19"                // Change to a fancy name you like
      #define SKETCH_VERSION "1.4"                // Your version  
      
      //Light
      #define CHILD_ID_LIGHT 1
      #define LIGHT_SENSOR_ANALOG_PIN A0
      #define SENSORS_POWER_PIN 4
      MyMessage light_Msg(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
      
      //===================================================
      // UVM30A ultraviolet detector.
      //
      // Thanks to core_c @ mysensors.org for code and info!
      // The sensor's VCC is connected to +5V
      //
      // At first glance, the datasheet is not entirely making sense:
      //  "输出电压" translates to "Output voltage", with a value of: DC 0—1V.
      //  So the sensor will never output/measure the 2 highest values listed in the graph & table of the datasheet (1079 and 1170+).
      //  The datasheet explains it: "(对应 UV 指数 0-10)" translates to "(corresponding to UV index 0-10)".  Fair enough.
      //
      //  "测试精度" translates to: "Test accuracy", with a value of: ±1 UV INDEX
      //  That is not very accurate on a range 0-10. Example: if the real UV-index is 4, you could measure 3, or 5.
      //  For that reason we take an average of multiple samples, to get a better measurement.
      
      #define UV_PIN A1
      #define CHILD_ID_UV 0
      MyMessage uv_Msg(CHILD_ID_UV, V_UV);
      const int UV_threshold[12] = {50, 227, 318, 408, 503, 606, 696, 795, 881, 976, 1079, 1170}; // // The list of UV index thresholds in units of mV
      
      // The read value is a 10-bit value, ranging from 0 to 2^10-1 (0 to 1023).
      // The reference voltage on the input pin is set to 1.1V.
      // That voltage is spread out over the 1024 possible values of a sample.
      // So our achieved resolution equals (1.1 Volts / 1024) = 0.00107421875 Volt.
      // The UVM30A sensor datasheet lists all UV-index values according to measured milli-Volts.
      const float SAMPLE_TO_MV = (1.1 * 1000) / 1024; // mV per sample-resolution
      
      uint16_t UV_value;
      uint16_t UV_index;        // the UV index
      uint16_t UV_index_f;      // the fractional part of the UV index
      
      // Compiler directives for averiging the UV-sensor readings
      // (Change the values of UV_AVERAGE_T & UV_AVERAGE_N according to your own taste).
      #define UV_AVERAGE_T 4000 // Sample interval duration in milliseconds..  (1 <= T <= 60000)
      #define UV_AVERAGE_N 10   // ..During that interval, N samples are taken, and averaged.    (1 <= N <= 100, must be <>0)
      
      #if UV_AVERAGE_T < 1      // Sanity check. It must be dummy proof
      #define UV_AVERAGE_T 1
      #endif
      #if UV_AVERAGE_N < 1      // Sanity check. It must be dummy proof
      #define UV_AVERAGE_N 1    // This value must be <>0 at all times, because we divide by it
      #endif
      
      // calculate once, use many times in the loop()
      const float UV_AVERAGE_N_RP = 1.0 / UV_AVERAGE_N;
      const uint32_t UV_AVERAGE_D = UV_AVERAGE_T * UV_AVERAGE_N_RP;
      //===================================================
      
      //SleepTime
      unsigned long SLEEP_TIME = 600000; // Sleep time between reads (in milliseconds)
      
      //Battery
      const float VccMin   = 1.9;           // Minimum expected Vcc level, in Volts.
      const float VccMax   = 3.0;           // Maximum expected Vcc level, in Volts.
      const float VccCorrection = 1.0 / 1.0; // Measured Vcc by multimeter divided by reported Vcc
      
      Vcc vcc(VccCorrection);
      
      void presentation()  {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo(SKETCH_NAME, SKETCH_VERSION);
      
        // Register all sensors to gateway (they will be created as child devices)
        present(CHILD_ID_UV, S_UV);
        present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
        
      }
      
      void setup()  {
      
        analogReference(INTERNAL);
      
        pinMode(SENSORS_POWER_PIN, OUTPUT);
        pinMode(UV_PIN, INPUT);
        pinMode(LIGHT_SENSOR_ANALOG_PIN, INPUT);
      
      }
      
      void loop()
      {
      
        digitalWrite(SENSORS_POWER_PIN, HIGH);  //Set power on digital pin for lightsensor.
        wait(500); //Wait 500ms to make sure lightsensor is powered and stable.
      
        processUV();   //Read UV
      
        readLightLevel();   //Read Light
      
        digitalWrite(SENSORS_POWER_PIN, LOW); // Set power for lightsensor off to save power.
      
        BatteryCalculation();
      
        //Sleep!
        sleep(SLEEP_TIME);
      }
      
      void readLightLevel()      {
        int lightLevel = (1023 - analogRead(LIGHT_SENSOR_ANALOG_PIN)) / 10.23; //To get a value ranging from 0 (dark) to 100 (bright).
      
      #ifdef MY_DEBUG
        Serial.print("Light: "); Serial.println(lightLevel);
      #endif
        send(light_Msg.set(lightLevel));
      
      }
      
      //===================================================
      // Process a UV measurement:
      // read an average value from the UV detector.
      // The average consists of N samples taken during a T milliseconds interval.
      //===================================================
      void processUV() {
        // Set the reference voltage for sampling
        // For our ATmega328 Nano: INTERNAL = 1.1V, DEFAULT = 5V
        // After using analogReference(), the first few samples may not be accurate (according to the Arduino language reference),
        // and that is why we read a few dummy samples before starting the actual measurement.
        // NOTE: If you change the next statement, beware to adjust the value of SAMPLE_TO_MV too.
      
        for (int i = 0; i < 10; i++) UV_value = analogRead(UV_PIN); // ignore the possibly inaccurate samplevalues.
      
      #ifdef MY_DEBUG
        Serial.print("UV raw values: [");
      #endif
        uint32_t average = 0;
        for (int i = 0; i < UV_AVERAGE_N; i++) {
      #ifdef MY_DEBUG
          UV_value = analogRead(UV_PIN);
          Serial.print(UV_value);  Serial.print(" ");
          average += UV_value;
      #else
          average += analogRead(UV_PIN);
      #endif
          delay(UV_AVERAGE_D);
        }
        UV_value = average * UV_AVERAGE_N_RP;
      #ifdef MY_DEBUG
        Serial.print("]    avg: ");  Serial.print(UV_value);
      #endif
      
        // We must convert sample-values into mV-values before we look up the UV-index.
        UV_value *= SAMPLE_TO_MV;
      
      #ifdef MY_DEBUG
        Serial.print("     mV: ");  Serial.print(UV_value);
      #endif
      
        // determine the UV index
        if (UV_value < UV_threshold[0]) {
          // too low value  or  invalid value (in case the sensor is wrongly connected it always returns 0)
          UV_index = 0;
          UV_index_f = 0;
        } else {
          for (UV_index = 11; UV_index > 0; UV_index--) {
            if (UV_value >= UV_threshold[UV_index]) break;
          }
          // calculate fractional part of the UV-index
          if (UV_index == 11) {
            // already at the maximum level; Displaying a fraction is meaningless
            UV_index_f = 0;
          } else {
            UV_index_f = map(UV_value, UV_threshold[UV_index], UV_threshold[UV_index + 1], 0, 9); // one decimal, so a number ranging 0 to 9
          }
        }
        float UV_index_float = UV_index + (UV_index_f * 0.1); // that is the same as /10
      
      #ifdef MY_DEBUG
        Serial.print("     UV index: ");  Serial.println(UV_index_float);
      #endif
      
        send(uv_Msg.set(UV_index_float, 1));
      
      }
      
        
      void BatteryCalculation()
      {
        float v = vcc.Read_Volts();
      
      #ifdef MY_DEBUG
        Serial.print("VCC = ");
        Serial.print(v);
        Serial.println(" Volts");
      #endif
        float p = vcc.Read_Perc(VccMin, VccMax);
      
      #ifdef MY_DEBUG
        Serial.print("VCC = ");
        Serial.print(p);
        Serial.println(" %");
      #endif
      
        sendBatteryLevel(p);
      
      }
      

      0_1494927947601_Schematics.jpg
      And offcourse the sensors analog output was connected to analog input of the atmega - forgot that in the schematics. UV=A0 and Light =A1

      posted in My Project
      sundberg84
      sundberg84
    • RE: Debug to a sd-card module?

      Coming along nice... some small bugs to kill but project alive and almost finished!
      0_1506883200108_Image.jpg

      posted in Development
      sundberg84
      sundberg84
    • RE: DHT sensor for Mysensors V2

      @mfalkvidd said:

      @sundberg84 could https://forum.mysensors.org/topic/115/implementing-multiple-sensors/4 be the one?

      YES! Thank you!

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Debug to a sd-card module?

      @NeverDie - What do you mean with Range - for bluetooth?

      My idea is to have one long term function and one short term, which is bluetooth. So for a "quick" look I would use the bluetooth module and for this I have not seen myself in need of alot of range. I wish to debug the node on-site and if there are errors I know why. I dont know the range exacly yet - but im sure its like normal bluetooth.

      With the more long term logging Im going to leave the logger at the node-site and let it be for a while - and evaluate the logs later to understand what im facing.

      posted in Development
      sundberg84
      sundberg84
    • RE: Get something that´s working

      @pettib - it should be possible to get it stable - I find it very reliable with my ethernet gateway (W5100). Are you sure it isnt any of your hardware thats unstable/not working correctly?

      This is what im using since i build my: 2.0 Ethernet GW.
      I have not had to reboot it once and my forum thread says 2 months.

      Arduino IDE: 1.6.6 (Boards version 1.6.10)
      MySensors API: 2.0.1 development
      Other Librarys: None for the GW, and for the sensors i always use whats found on MySenors github.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Door sensor make USB disconnect while reading serial output?

      Sorry, brainfreeze - 5v dataline should be fine... confused with the RFM radio...

      0_1515589653051_90c5e495-d594-4c5f-9263-00deca6c3483-image.png

      posted in Development
      sundberg84
      sundberg84
    • RE: why mysensors is based on nrf24?

      @Reza - I have currently atleast 30+ nodes based on MySensors and Nrf24l01+ and it works fine!

      0_1489165663592_1.JPG

      Its DIY and sometimes I have to debug and change something - but it works so good I have my house alarm motion sensors using Nrf24l01+ radios. I have nodes which I have not touched for 1 year + and still works great. Compared to any commercial system (which I have to pay 10times as much) im so happy about this!

      Sometimes you get bad radios, and you have to debug and try different capacitors - but thats the fun about it! If someoen wants a quick, plug and play sollution - I would not suggest MySensors because thats not what MySensors are about,

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Battery: pro mini @ 1mhz vs booster

      @kiesel i mean exactly what @NeverDie mentioned above (https://forum.mysensors.org/topic/10952/battery-pro-mini-1mhz-vs-booster/12?_=1582011000646). When voltage drops below 2.4v the 8mhz processor is "out of specs". I cant promise it works as it should, but just as neverdie I also have alot of nodes out of specs so unless you do crasy stuff and pulling much current it should work.

      About the noice questions, its very hard to diagnose or find unless you have a oscilloscope. What you might experience is bad reception and alot of :NACK messages.

      In most cases i reprogram the bootloader and use 8mhz internal or 1mhz interlan.

      posted in Development
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      @gohan it's fun to do projects together! We enjoyed it and I tried the water story to explain everything. Also some short instructions to solder the legs and not the solder itself... Now he is playing with it so a good result!

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Handling NACKs

      @evb - yes, that is correct, here is a complete sketch with a GW (Nrf24 - ethernet)

      // Enable debug prints to serial monitor
      #define MY_DEBUG
      
      // Enable and select radio type attached
      #define MY_RADIO_NRF24
      #define MY_RF24_PA_LEVEL RF24_PA_MAX
      
      // Enable gateway ethernet module type
      #define MY_GATEWAY_W5100
      
      // Enable Soft SPI for NRF radio (note different radio wiring is required)
      // The W5100 ethernet module seems to have a hard time co-operate with
      // radio on the same spi bus.
      #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD)
      #define MY_SOFTSPI
      #define MY_SOFT_SPI_SCK_PIN 14
      #define MY_SOFT_SPI_MISO_PIN 16
      #define MY_SOFT_SPI_MOSI_PIN 15
      #endif
      
      // When W5100 is connected we have to move CE/CSN pins for NRF radio
      #ifndef MY_RF24_CE_PIN
      #define MY_RF24_CE_PIN 5
      #endif
      #ifndef MY_RF24_CS_PIN
      #define MY_RF24_CS_PIN 6
      #endif
      
      #define MY_IP_ADDRESS 192,168,1,8   // If this is disabled, DHCP is used to retrieve address
      // Renewal period if using DHCP
      //#define MY_IP_RENEWAL_INTERVAL 60000
      // The port to keep open on node server mode / or port to contact in client mode
      #define MY_PORT 5003
      
      // Controller ip address. Enables client mode (default is "server" mode).
      // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere.
      //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254
      
      // The MAC address can be anything you want but should be unique on your network.
      // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use.
      // Note that most of the Ardunio examples use  "DEAD BEEF FEED" for the MAC address.
      #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0x01, 0x08 //AF-A0-F2-15-3B-1C
      
      // Set blinking period
      #define MY_DEFAULT_LED_BLINK_PERIOD 300
      
      // Enable inclusion mode
      //#define MY_INCLUSION_MODE_FEATURE
      // Enable Inclusion mode button on gateway
      //#define MY_INCLUSION_BUTTON_FEATURE
      // Set inclusion mode duration (in seconds)
      //#define MY_INCLUSION_MODE_DURATION 60
      // Digital pin used for inclusion mode button
      //#define MY_INCLUSION_MODE_BUTTON_PIN  3
      
      // Uncomment to override default HW configurations
      #define MY_DEFAULT_ERR_LED_PIN 7  // Error led pin
      #define MY_DEFAULT_RX_LED_PIN  9  // Receive led pin
      #define MY_DEFAULT_TX_LED_PIN  8  // the PCB, on board LED
      
      
      #define MY_INDICATION_HANDLER
      static uint32_t txOK = 0;
      static uint32_t txERR = 0;
      #define REPORT_INTERVAL 300000 // Report every 5 minutes
      #define CHILD_ID_TX_OK 0
      #define CHILD_ID_TX_ERR 1
      
      #include <SPI.h>
      
      #if defined(MY_USE_UDP)
      #include <EthernetUdp.h>
      #endif
      #include <Ethernet.h>
      #include <MySensors.h>
      
      MyMessage txOKmsg(CHILD_ID_TX_OK, V_CUSTOM);
      MyMessage txERRmsg(CHILD_ID_TX_ERR, V_CUSTOM);
      
      void indication(indication_t ind)
      {
        switch (ind)
        {
          case INDICATION_TX:
            txOK++;
            break;
          case INDICATION_ERR_TX:
            txERR++;
            break;
        }
      }
      
      void presentation()
      {
        //Send the sensor node sketch version information to the gateway
        sendSketchInfo("Gateway #1", "1.0");
        present(CHILD_ID_TX_OK, S_CUSTOM);
        present(CHILD_ID_TX_ERR, S_CUSTOM);
      }
      
      void setup()
      {
      }
      
      void loop() {
      
        static unsigned long last_send = 0;
        if (millis() - last_send > REPORT_INTERVAL) {
          send(txOKmsg.set(txOK));
          send(txERRmsg.set(txERR));
          last_send = millis();
        }
      
      }
      
      

      In Home Assistant you need to create a sensor that breaks down the incrementing number to each intervall you want.
      I use a utility_meter.

      utility_meter:
      hourly_ok_gw:
          source: sensor.gateway_1_0_0
          cycle: hourly
        hourly_err_gw:
          source: sensor.gateway_1_0_1
          cycle: hourly
      

      This sensors will be sent to Grafana each hour just like any other sensor and you can create a graph there:

      2556f0fa-a34b-49da-bac6-e0a8aadbd633-image.png

      posted in Development
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Back to topic! Last night I made some changes to my ATX Power supply because the variable settings was to sensitive:

      0_1511953574080_upload-c7feca62-d22d-435e-9c73-9599ca0c9044

      0_1511953586756_upload-3bb65a38-91b8-4dc8-9dd7-3a0af6fd45f9

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Simple node enclosure

      @rozpruwacz 3dhubs.com

      posted in Enclosures / 3D Printing
      sundberg84
      sundberg84
    • RE: [SOLVED] What open hardware license to use

      @dbemowsk - maybe this can help:

      https://forum.mysensors.org/topic/3096/open-hardware-licensing

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: 110v-230v AC to Mysensors PCB board

      @BSoft I had this idea also and have been working on a pcb for some weeks now.
      Its a 5x5 cm PCB you cut in halv so you get a 2 pcs which are 2.5x5cm - and they are stackable (like a shield).

      1.JPG

      This is how i plan to stack them: (Blue inwall socket behind).
      2.JPG

      On the bottom you have the high power and HK 240->5v converter.
      Then in the middle between the pcbs you have the radio and arduino and on top whatever you wants.
      I have made outputs for LCD screen, buttons and/or motion.

      There are still much work in progress here but so far this is my thoughts... and it fits inside the typical wall hole.
      This will not be ready for atleast some week, and the three weeks or so with order/deliver time.

      I will create my own post to get input on this when im done and If someone else knows and want to improve the design i can send over the files.

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Recieved some PCBs today and one is the HLK-PM01 breakout which I will start working on for a project.

      0_1514392627367_HLKPCB.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: In wall - PCB, (AC to DC 5v)

      I recieved my PCB today - Yea!

      The good news is - its working, and it fits inside my wall socket.
      The bad news is that as always i will need another revision - the hole for the fuses are to close to each other.

      Some pictures:
      1.jpg

      Anyone with any input on this?

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      And want to make a tip about smd component organisation...

      0_1514555049950_15145550389591441077832.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Recommendation: power supply

      Hi @dakky.

      What kind of power supply are you looking for?
      Here is a great discussion: http://forum.mysensors.org/topic/1607/safe-in-wall-ac-to-dc-transformers
      You should also be able to use a phone charger as power supply. You will get 5v and if you use a original phonecharger they have all the safety test/checks (CE for example).

      posted in Hardware
      sundberg84
      sundberg84
    • RE: CNC PCB milling

      Would this be something good to do? https://www.youtube.com/watch?v=7rVmiRgsI1M
      Cut a complete flat peace of wood with the cnc machine?

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Infrared Temp Sensor

      Barbecue temp ?

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      @scalz - this was my first project and I agree with you (because I didnt calculate much before). If you are looking for the best sound its incredible important... for me and this build I wanted a small enclosure in the kitchen but the sound is pretty impressive for such a small thing so Im happy even though I know it could have sounded better.

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: In wall - PCB, (AC to DC 5v)

      Trying to take this to the next level:

      3d design - first try (ever!).
      0_1455462995837_Skärmklipp.JPG

      I guess it wont meet any standard since its not completley sealed up - but I want to be able to reach the MYSX connector. Might be OK if I use a female pin header to MysX connector, then it wont be possible to put your finger inside.

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      Some more testings on my Logger... I want it to work great before moving on so alot of testing is needed. Why not do it on node #1 (note the old rev om EasyPCB).

      0_1516296664777_1516296654046501906847.jpg

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Safe In-Wall AC to DC Transformers??

      So there is another safety issue we should discuss for the HLK.
      Creepage (separation between two solder eyes measured along the surface) and clearance (shortest distance between as measured through the air) on the AC input.

      According to datasheet there is 5mm center-center, but real distance with solder and pads its more like 3, maybe 3.5mm.

      I found this and this which was a great summary of some IEC standards states that if your are going to use 240v and put the HLK into a environment with pollution degree III higher you need more creppage than 3.2mm. What am i saying? If i understand this right its not safe to use the HLK in any environment where moisture condensation may occur (outside, bathroom). My guess when i try to read the contamination groups is that if you put the HLK inside a sealed case you get the contamination level down to 2 and then we are safe above needed 2,5mm.

      To be on the safe side I have in my latest pcb added holes between AC input to increase creepage:

      0_1456695808093_1.JPG

      Am i right? Dont know - its hard to read all these articles and Im new to this so please bring anything to the table... corrections, questions or thoughts.

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      6.3 days or 152hours just inst good enough - this is what my logger managed to do with 2xAA debugging a temp/hum node sending every 15min. Its below 50% to target (14 days) but this included the leds was on all the time... how much can a 2x leds do 😐 ?? Next experiemtn...

      0_1517140948433_Logger6h.png

      posted in General Discussion
      sundberg84
      sundberg84
    • RE: Wireing the Radio?

      Hi @cattoo and welcome!
      If you follow http://www.mysensors.org/build/connect_radio it should be ok.
      9-13 on that site is yours D9-D13
      GND = GND
      VCC = 3V3

      Good luck.

      posted in Hardware
      sundberg84
      sundberg84
    • RE: What did you build today (Pictures) ?

      0_1518791218187_15187911952321497205782.jpg

      Today some maintenance on my GW.

      Added a ground wire for debug and also corrected a buildmisstske and grounded the case.

      And relocated (let's hope for the best) it to my new HA DIY board...

      0_1518792236611_15187922282851484593467.jpg

      posted in General Discussion
      sundberg84
      sundberg84