Navigation

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

    FotoFieber

    @FotoFieber

    Hardware Contributor

    75
    Reputation
    240
    Posts
    3010
    Profile views
    2
    Followers
    1
    Following
    Joined Last Online
    Website www.fotofieber.ch

    FotoFieber Follow
    Hardware Contributor

    Best posts made by FotoFieber

    • Why IOYT matters...

      My current home automation setup uses sensors with different technologies:

      • MySensors (with node-red and serial gateway)
      • zWave (with fhem)
      • Homematic (with homegear)
      • Netatmo
      • Buderus (oil-fired heating, with fhem)
      • Sonoff Dual (hacked, with MQTT)

      I have adapters for all of them to/from MQTT. With node-red I have written an abstraction layer for all of them, which is heavily inspired by the mysensors API.

      The most complex thing I have implemented, is a regulation for the floor heating. The regulation algorithm takes in account:

      • open windows
      • room temperature
      • time
      • lead temperature

      Every room has it's own regulation. But it is dependent mostly on the room temperature sensor. I have written some fuzzy logic but if to many of them fail, it will get cold inside.

      Tomorrow the old api of netatmo will not work anymore. It is the third time, I have written an adapter for my home automation setup. The new api doesn't really bring new functionality but I have to use it.

      So I made a decision to replace all this netatmo stuff with MySensors (https://forum.mysensors.org/topic/4355/mh-z14a-co2-sensor/5).

      It will be

      • cheaper
      • not dependent of the internet or the cloud
      • up to me to decide, when or if I want to change the api
      • fully open sourced
      • not only IOT, bur IOYT

      IOYT... what else?

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

      Building a (xenon) flash to notify alarms. Flashes every 5 seconds if activated.
      0_1551620885559_IMG_3712.JPG

      posted in General Discussion
      FotoFieber
      FotoFieber
    • Geiger Counter

      As I live near a nuclear power plant, I thought it would be a good idea to have a radioactivity sensor:
      geiger.jpg
      Components used:

      Geiger Counter Kit:
      http://www.ebay.com/itm/321499888801?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

      An SBM-20 tube:
      http://www.ebay.com/itm/280865770387?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT

      And MySensors with this sketch:

      #include <SPI.h>
      #include <MySensor.h>
      
      #define DIGITAL_INPUT_SENSOR 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
      #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
      #define CHILD_ID 1   // Id of the sensor child
      
      #define LOG_PERIOD 60000     //Logging period in milliseconds, recommended value 15000-60000.
      
      #define MAX_PERIOD 60000    //Maximum logging period
      
      unsigned long counts;             //variable for GM Tube events
      
      unsigned long cpm;                 //variable for CPM
      
      unsigned int multiplier;             //variable for calculation CPM in this sketch
      
      unsigned long previousMillis;      //variable for time measurement
      
      unsigned long timeReceived = 0;
      unsigned long timeRequested = 0;
      
      MySensor gw;
      // Initialize motion message
      MyMessage msg(CHILD_ID, V_VAR1);
      
      void setup()
      {
        wdt_enable(WDTO_8S);
        gw.begin();
      
        // Send the sketch version information to the gateway and Controller
        gw.sendSketchInfo("Geiger Sensor", "1.1");
      
        wdt_reset();
        // Register all sensors to gw (they will be created as child devices)
        gw.present(CHILD_ID, S_ARDUINO_NODE);
        
        // Geiger initialise
        counts = 0;
      
        cpm = 0;
      
        multiplier = MAX_PERIOD / LOG_PERIOD;      //calculating multiplier, depend on your log period
      
        pinMode(DIGITAL_INPUT_SENSOR, INPUT);      // sets the geiger sensor digital pin as input
      
        digitalWrite(DIGITAL_INPUT_SENSOR, HIGH);                                 // turn on internal pullup resistors, solder C-INT on the PCB
      
        attachInterrupt(1, tube_impulse, FALLING);  //define external interrupts
      
      }
      
      void loop()
      { 
        wdt_reset();
        unsigned long currentMillis = millis();
      
        if (currentMillis - previousMillis >= LOG_PERIOD) {
      
          cpm = counts * multiplier;
      
          gw.send(msg.set(cpm));
      
          counts = 0;
          previousMillis = currentMillis;
      
        }
      }
      
      
      void tube_impulse() {              //procedure for capturing events from Geiger Kit
      
        counts++;
      
      }
      
      
      
      
      

      I get cpm and in Node-Red I calculate microsievert/per hour:

      [{"id":"ba386057.845d3","type":"mqtt-broker","broker":"192.168.92.4","port":"1883","clientid":"NodeRed"},{"id":"75acf1fb.8a531","type":"mqtt in","name":"Geiger CPM","topic":"MyMQTT/48/1/V_VAR1","broker":"ba386057.845d3","x":146,"y":52,"z":"d1478aa9.2eb878","wires":[["d17bbe2a.2e844"]]},{"id":"d17bbe2a.2e844","type":"function","name":"Nach uSievert umrechnen","func":"cpm = msg.payload;\n\n// für SBM 20 Röhre\n// http://cs.stanford.edu/people/nick/geiger/\nusv = cpm * 0.0057;\n\nmsg.topic = 'NodeRed/Geiger/usv';\nmsg.payload = usv;\n\nreturn msg;","outputs":1,"valid":true,"x":377,"y":52,"z":"d1478aa9.2eb878","wires":[["c53927ba.3ac6d8"]]},{"id":"c53927ba.3ac6d8","type":"mqtt out","name":"","topic":"","qos":"","retain":"","broker":"ba386057.845d3","x":647,"y":52,"z":"d1478aa9.2eb878","wires":[]}]```
      posted in My Project
      FotoFieber
      FotoFieber
    • RE: What did you build today (Pictures) ?

      Prototyping my netatmo replacement device. It has an led strip that can simulate a lighouse, a rainbow or a fireplace...
      (If not used only for fun, it should warn you, if there is too much CO2 in the air.)
      0_1558731422060_IMG_3858.JPG

      posted in General Discussion
      FotoFieber
      FotoFieber
    • RE: MH-Z14A CO2 sensor

      The sensor is really simple to use, when attached via serial-ttl (3.3V) and powered with 5 volt.

      MH-Z14 co2 readings - PWM & UART with raspberry pi in C++ – 16:20
      — Gary Travell

      You get the values directly from the sensor and don't need to make calculations. Here is what I use:

      /*
         The MySensors Arduino library handles the wireless radio link and protocol
         between your home built sensors/actuators and HA controller of choice.
         The sensors forms a self healing radio network with optional repeaters. Each
         repeater and gateway builds a routing tables in EEPROM which keeps track of the
         network topology allowing messages to be routed to nodes.
      
         Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
         Copyright (C) 2013-2015 Sensnology AB
         Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
      
         Documentation: http://www.mysensors.org
         Support Forum: http://forum.mysensors.org
      
         This program is free software; you can redistribute it and/or
         modify it under the terms of the GNU General Public License
         version 2 as published by the Free Software Foundation.
      
       *******************************
      
         DESCRIPTION
      
          MH-Z14 CO2 sensor via rx/tx serial
      
          */
      
      // Enable debug prints to serial monitor
      //#define MY_DEBUG
      
      // Enable and select radio type attached
      //#define MY_RADIO_NRF24
      
      #define MY_RADIO_RFM69
      #define MY_RFM69_FREQUENCY RF69_868MHZ
      #define MY_RFM69_NETWORKID 13
      #define MY_RFM69_ENABLE_ENCRYPTION
      #define MY_IS_RFM69HW
      
      #include <MySensors.h>
      #include <SoftwareSerial.h>
      #include <Wire.h>
      #include "Adafruit_HTU21DF.h"
      
      SoftwareSerial mySerial(A0, A1); // RX, TX соответственно
      
      Adafruit_HTU21DF htu = Adafruit_HTU21DF();
      
      byte cmd[9] = {0xFF, 0x01, 0x86, 0x00, 0x00, 0x00, 0x00, 0x00, 0x79};
      char response[9];
      
      #define CHILD_ID_AIQ 0
      #define CHILD_ID_TEMP  1
      #define CHILD_ID_HUM   2
      
      unsigned long SLEEP_TIME = 30 * 1000; // Sleep time between reads (in milliseconds)
      unsigned int TEMP_HUM_ROUNDS = 5; // wait 5 rounds for sending TEMP_HUM
      unsigned int loop_round = 0;
      boolean preheat = true;  // wait TEMP_HUM_ROUNDS for preheat
      
      int lastppm = 0;
      
      MyMessage msg(CHILD_ID_AIQ, V_LEVEL);
      MyMessage msg2(CHILD_ID_AIQ, V_UNIT_PREFIX);
      MyMessage msgHum(CHILD_ID_HUM, V_HUM);
      MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
      
      boolean isMetric = true;
      
      void setup()
      {
        mySerial.begin(9600);
        isMetric = getConfig().isMetric;
      
        if (!htu.begin()) {
          Serial.println("Couldn't find sensor htu21!");
        }
      }
      
      void presentation() {
        // Send the sketch version information to the gateway and Controller
        sendSketchInfo("AIQ Sensor CO2 MH-Z14 Serial, HTU21 Temp Hum", "1.0");
      
        // Register all sensors to gateway (they will be created as child devices)
        present(CHILD_ID_AIQ, S_AIR_QUALITY);
        send(msg2.set("ppm"));
      
        present(CHILD_ID_TEMP, S_TEMP);
        present(CHILD_ID_HUM, S_HUM);
      }
      
      void loop() {
      
        mySerial.write(cmd, 9);
        mySerial.readBytes(response, 9);
        int responseHigh = (int) response[2];
        int responseLow = (int) response[3];
        int ppm = (256 * responseHigh) + responseLow;
      
        if ((loop_round == 0) || (abs(ppm - lastppm) >= 10)) {
          if (!preheat) {
            send(msg.set(ppm));
            lastppm = ppm;
          }
        }
      
      
      
        if (loop_round == 0) {
          float temp = htu.readTemperature();
          if (!isMetric) {
            temp = temp * 9 / 5 + 32; // convert to farenheit
          }
          send(msgTemp.set(temp, 1));
      
          float hum = htu.readHumidity();
          send(msgHum.set(hum, 1));
        }
      
        loop_round++;
        if (loop_round >= TEMP_HUM_ROUNDS) {
          loop_round = 0;
          preheat = false;
        }
      
        // Power down the radio.  Note that the radio will get powered back up
        // on the next write() call.
        sleep(SLEEP_TIME); //sleep for: sleepTime
      }
      
      posted in Hardware
      FotoFieber
      FotoFieber
    • RE: What did you build today (Pictures) ?

      Testing a CCS811 CO2 sensor. It seems to use less power then the MH-Z14A I am using now. The CCS811 may even run on battery. I will compare measurements of these two sensors with a Netatmo sensor. The sensors have to burn in for two days bevore I start the comparison.
      0_1554572353955_IMG_3788.JPG
      The CCS811 breakout board I use hast temp, hum and barometer sensors (and the CO2).

      posted in General Discussion
      FotoFieber
      FotoFieber
    • RE: 💬 Node RED

      Here is my solution with support for generating node-ids, multiple controllers and a generic mapping to/from mqtt.

      0_1473669025539_nodered-mys.txt

      posted in Announcements
      FotoFieber
      FotoFieber
    • RE: PCB Boards for MySensors

      Not keen on soldering SMD, I designed my own PCB.

      The PCB has a flexible design (use jumpers):

      • use with battery
      • use with 5 volt (and LE33 for NRF24L01+)
      • use with voltage stabilazitaion to 3.3V (LE33) for ATMEGA328P and NRF24l01+

      mysduino2.fzz

      OSH Park Link

      I am programming it with an ISP.

      Use a 8 MHz setup: select Lilypad/328p in the Arduino IDE and first burn the bootloader.

      Then I set fuses with mit usbtinyisp to not reset the eeprom with the upload of a sketch (no new node id)

      ./avrdude -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -c usbtiny -p m328p -U hfuse:w:0xD2:m
      

      an enable low voltage usage with battery:

      ./avrdude -C /Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -c usbtiny -p m328p -U efuse:w:0x07:m
      
      posted in Hardware
      FotoFieber
      FotoFieber
    • RE: German users

      https://forum.mysensors.org/topic/2258/german-speaking-members/15

      posted in General Discussion
      FotoFieber
      FotoFieber
    • RE: 💬 MySensors Contest 2017

      Hmm, I have so many ideas and not much time.

      • a push mysensors notification for amazon echo (alexa)
      • maybe could be the same hardware as above: notify via voice about: window state, air quality, doorbell from mysensors...
      • nice nextion display showing information about my home and the weather forecast
      • doorbell sensor without additional power supply
      • ac detection without additional power supply
      • a mysensors serial mqtt controller for up to 3 gateways based on arduino due

      Or should I first finish my heating circuit regulation which does work for more than two months now without any problem but isn't mysensorized...

      Or should I invest in a blog explaining all the things I did and could help others? (i.e. how do I distinguish an arduino pro mini 16 MHz from a 8 MHz model or how do I connect different protocols ie zWave, mysensors, homematic, netatmo.....)

      Or should I invest more time in my job? 😆

      What about photography? I really like to take pictures with old cameras on film but have done this last time 2 years ago... 😢

      Or should I paint my garage? It is really time to....

      What about tidy up my garage and all my electronic items I purchased with that many ideas in my mind?

      We don't talk about my family. I swear, they don't get to short.

      Maybe a 3d printing project with my 8 year old daughter?

      Sigh, life is to short...

      posted in Announcements
      FotoFieber
      FotoFieber

    Latest posts made by FotoFieber

    • RE: What did you build today (Pictures) ?

      @tbowmo said in What did you build today (Pictures) ?:

      Not hardware though, but I'm working on my dashboard solution for a wallmounted tablet.

      Sigh, this is on my todo list for a long time. I have a working solution with imperihome (gateway to imperihome implemented in node-red) but never get to mount the tablet. 😞

      I kind of already have this working in angular, but lately I have switched to react

      Second sigh.... popularity of angular seems to decrease. Do I have to learn another framework?

      (joined a new project at work where they use react for frontend development), so wanted to see how "easy" it would be to create a something similar to my angular dashboard, but in react instead.

      ...

      All data, except weather forecast and channel lists, is from my mqtt broker, where I use mqtt over websockets.

      Third sigh 🙂 I like your chosen architecture except for the decision using websockets. (It is neither nice from a security standpoint nor is it proxy friendly, but who cares in a closed home enviroment.)

      I have a bunch of python scripts, and a node-red instance, to wrap things up for the display, and also do a lot of magical stuff, like turning on TV and amplifiers automatically when casting youtube, and then turn the TV etc. off again, when I haven't streamed anything for a couple of minutes. (So the kids doesn't forget to turn off the TV when they're finished watching cartoons)

      I really like your project. Maybe you can publish some react code? (Then I can try t understand another ui framework...)

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

      Modified a laser filament sensor (pat9125, used with Prusa mk3) to be used with an ESP32.

      Maybe I will use it as a filament stuck sensor with octoprint. Or a filament meter?

      0_1571850670675_IMG_4393.jpg

      posted in General Discussion
      FotoFieber
      FotoFieber
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @jaredwolff
      My experiments with VOC sensors were all not satisfactory.

      The NDIR-sensors reported more or less the same as the netatmo devices and I will therefore stick with them. Apart from that, using the NDIR-sensors in arduino is much easier and you don't have to store baselines or link precompiled code.

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

      Prototyping my netatmo replacement device. It has an led strip that can simulate a lighouse, a rainbow or a fireplace...
      (If not used only for fun, it should warn you, if there is too much CO2 in the air.)
      0_1558731422060_IMG_3858.JPG

      posted in General Discussion
      FotoFieber
      FotoFieber
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @jaredwolff
      I downloaded the binaries from the Bosch site and the source library from the github repo.

      In the binaries archive is an arduino library with an example with the error, you found.... The github repo has no binaries and I couldn't get it up with the binary.

      The binary distribution of essential code makes it more complicated than it could be...

      The integration in platformio is not to complicated in my code. I only had to add (after investigating for some hours)

      build_flags =   -Llib/BSEC/src/esp32/
                      -lalgobsec
      
      posted in My Project
      FotoFieber
      FotoFieber
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @jaredwolff said in Particle Powered Air Quality Sensor Logging to Google Docs:

      ...
      inputs[nInputs].signal = _data.humidity/1000.0f; // Need to divide by 1000 for fp;
      ...

      WTF, they have a known bug in the library and we all have to discover it by ourselves?....

      How cool is that, you seem to have solved the problem I had.... 🙂

      BSEC library version 1.4.7.3
      Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent
      End setup()
      279, 21.37, 94698.00, 57.66, 80982.00, 25.00, 0, 21.37, 57.66, 25.00, 500.00, 0.50
      3278, 21.21, 94700.00, 57.42, 111997.00, 25.00, 0, 21.15, 58.10, 25.00, 500.00, 0.50
      6278, 21.22, 94700.00, 57.25, 127972.00, 25.00, 0, 21.16, 57.80, 25.00, 500.00, 0.50
      9278, 21.22, 94702.00, 57.10, 135341.00, 25.00, 0, 21.16, 57.58, 25.00, 500.00, 0.50
      

      I hope I will have a graph in two days and I can compare the Bosch sensor to the NIDIR-Sensors...

      posted in My Project
      FotoFieber
      FotoFieber
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @jaredwolff
      The data is read correctly:

      temp 1883
      hum 54739
      press 94317
      gas resistance 118267
      call bsec_do_steps(..
      return of bsec_do_steps -2
      

      And -2 means:

       BSEC_E_DOSTEPS_VALUELIMITS = -2,                /*!< Value of input (physical) sensor signal passed to bsec_do_steps() is not in the valid range */
      

      I wish I had the source code of the lib....

      posted in My Project
      FotoFieber
      FotoFieber
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @jaredwolff
      ESP32 is the platform I use.

      Linking is no problem (after trial and error of two hours 🙂 ).

      I seem to have made a call to the lib:

      BSEC library version 1.4.7.3
      

      Now adding DEBUG-Messages to the BSEC arduino library.

      posted in My Project
      FotoFieber
      FotoFieber
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @jaredwolff
      Managed to compile Bosch arduino demo code on ESP32 on platformio after 3 hours. 😎

      But then....

      BSEC library version 1.4.7.3
      Timestamp [ms], raw temperature [°C], pressure [hPa], raw relative humidity [%], gas [Ohm], IAQ, IAQ accuracy, temperature [°C], relative humidity [%], Static IAQ, CO2 equivalent, breath VOC equivalent
      BSEC error code : -2
      

      Maybe I give up here, as I really don't like to use binary code in my sensors....

      posted in My Project
      FotoFieber
      FotoFieber
    • RE: Particle Powered Air Quality Sensor Logging to Google Docs

      @jaredwolff
      Seems like I only get an IAQ value for the BME680 and no (e)CO2. Is this correct?

      posted in My Project
      FotoFieber
      FotoFieber