Navigation

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

    Topics created by Cliff Karlsson

    • Cliff Karlsson

      People counter using VL53L1X help "decoding" existing code to arduino
      General Discussion • • Cliff Karlsson  

      1
      1
      Votes
      1
      Posts
      816
      Views

      No one has replied

    • Cliff Karlsson

      Help understanding why websockets does not work in arduino sketch
      Troubleshooting • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      356
      Views

      No one has replied

    • Cliff Karlsson

      Is this scenario possible using domoticz?
      Domoticz • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      3504
      Views

      pjr

      @Cliff-Karlsson said in Is this scenario possible using domoticz?: I have a sensor whish can output four different values depending on how the sensor is triggered, how do I send four different values to domoticz and what sensor type do I chose? I want in this example be able to light up four different lightbulbs in domoticz depending on the sensoroutput. I have done this with my heat pump controller. I'm using dimmer and "linking" that to dummy selector what contains the states(0=off, 10=heat by water, 20=heat by room, 30=freeze protection...). Linking is done with LUA: -- -- Heat pump mode selector<>dimmer mapping event -- commandArray = {} selectorName = 'Pumppu_Mode' selectorId = '332' dimmerName = 'Pumppu_ModeSW2' -- selector -> native if(devicechanged[selectorName]) then iDimLevel = tonumber(otherdevices_svalues[selectorName]) commandArray[dimmerName]='Set Level '..iDimLevel end -- native -> selector. (not triggering events this way of calling with UpdateDevice) if (devicechanged[dimmerName]) then if (devicechanged[dimmerName] == 'Off') then commandArray['UpdateDevice'] = selectorId..'|0|0' else iCurrentDimLevel = 0 if(otherdevices[dimmerName] == 'On') then -- can be "On" or something else iCurrentDimLevel = tonumber(otherdevices_svalues[dimmerName]) else iCurrentDimLevel = tonumber(string.match(otherdevices[dimmerName], "Set Level: (%d+) %%")) end commandArray['UpdateDevice'] = selectorId..'|'..iCurrentDimLevel..'|'..iCurrentDimLevel end end return commandArray I would also want to be able to use a local variable and a global variable. Can I somehow "push" a variable from domoticz to the sensor everytime it changes? Create a device to your sketch and use that to handle the "variable". The rest is just scripting in domoticz after that.
    • Cliff Karlsson

      Ninja spheres for sale (Sweden)
      General Discussion • • Cliff Karlsson  

      1
      1
      Votes
      1
      Posts
      692
      Views

      No one has replied

    • Cliff Karlsson

      Connecting external power and FTDI adapter?
      Troubleshooting • • Cliff Karlsson  

      3
      0
      Votes
      3
      Posts
      1911
      Views

      NeverDie

      Or use a level shifter.
    • Cliff Karlsson

      Help with sketch (motion/distance)
      Troubleshooting • • Cliff Karlsson  

      9
      0
      Votes
      9
      Posts
      1930
      Views

      Cliff Karlsson

      I never understod how the millis() -part worked so I just changed it to a simple countdown instead.
    • Cliff Karlsson

      How to update counter using json
      Domoticz • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      752
      Views

      No one has replied

    • Cliff Karlsson

      Connecting grid-eye sensor
      Troubleshooting • • Cliff Karlsson  

      3
      1
      Votes
      3
      Posts
      2338
      Views

      Yveaux

      @Cliff-Karlsson Very interested to see what you'll be building with this sensor! (http://www.pureengineering.com/projects/grid-eye-breakout) Maybe this sketch can help? https://github.com/kriswiner/AMG8833
    • Cliff Karlsson

      Help with sketch...
      Troubleshooting • • Cliff Karlsson  

      6
      0
      Votes
      6
      Posts
      1455
      Views

      core_c

      I did not know about the newPing.h library. (i can not find it when searching for it in the Arduino IDE).. so i googled it. The example (for 15 sensors) confuses me Can't you just do something like this? unsigned long pingTimer[SONAR_NUM]; unsigned int cm[SONAR_NUM]; boolean bigChange[SONAR_NUM]; void setup() { pingTimer[0] = millis() + 75; pingTimer[1] = pingTimer[0] + PING_INTERVAL; } void loop() { // your rest code here.. for (uint8_t i = 0; i < SONAR_NUM; i++) if (millis() >= pingTimer[i]) { pingTimer[i] += PING_INTERVAL; cm[i] = sonar.ping_cm(); bigChange[i] = ((doorDistance-(int)cm[i]) > 10)?true:false; } oneSensorCycle; And adjust oneSensorCycle() to use bigChange[0] & bigChange[1] instead of bigChange_0 & bigChange_1
    • Cliff Karlsson

      Troubleshooting sketch
      Troubleshooting • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1044
      Views

      mfalkvidd

      @gohan which one?
    • Cliff Karlsson

      Easy arduino with 5v sensors and 3.3v radio?
      General Discussion • • Cliff Karlsson  

      3
      0
      Votes
      3
      Posts
      1228
      Views

      dbemowsk

      I use the Easy Newbie boards for most of my projects. It is designed for the nRF24L01+, and it has space for the needed 3.3v regulator if you are running it at 5V. I don't know if he has a way of using it with the RFM69 radios, but you could check. Plus it has a small proto-board area for wiring your sensors. Kudos to @sundberg84 for the design.
    • Cliff Karlsson

      What sensortype to chose to present a number to domoticz?
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      803
      Views

      gohan

      I'd say you present 2 switches, one triggers when someone enters the room, the other when someone exits, but without something else like a pir sensor that actually checks if someone is in the room or not, it will eventually leads to errors in the counter. All the counting will have to be made in the controller and maybe reset people count in a room if no movement is detected for like 30 minutes. How to do it in domoticz, I don't know
    • Cliff Karlsson

      Anyone got a few 47uf 0805 capacitors to sell (in Sweden)?
      General Discussion • • Cliff Karlsson  

      8
      0
      Votes
      8
      Posts
      1767
      Views

      Cliff Karlsson

      @Alpoy Of cource I know that I can buy them at elfa to. But 5 pcs will cost me 199 SEK with shipping witch is pretty much for a few components in my world.
    • Cliff Karlsson

      Are there any RFM69 shields for Arduino pro mini?
      Hardware • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      2004
      Views

      FotoFieber

      I love this one: https://www.openhardware.io/view/268/RFM69HW-interstitial-board-for-Pro-Mini-Temp-Humidity-sensor
    • Cliff Karlsson

      What options are there for wireless wifi power-plugs with energy-monitoring?
      Hardware • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1057
      Views

      Cliff Karlsson

      @MikeF Great, I just found the same unit right before your post. Seams to be the best option right now.
    • Cliff Karlsson

      How do I change a variable in domoticz from a sensor-reading?
      Troubleshooting • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      4044
      Views

      AWI

      @Cliff-Karlsson domoticz allows you to create a virtual / dummy counter sensor. You can increment / decrement it from several other sensor events in a LUA script as mentioned by @sundberg84
    • Cliff Karlsson

      Texas Instruments Sensortag CC2650?
      Hardware • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      923
      Views

      scalz

      For advanced users. Not an out of the box thing, nor usable with mysensors. for writing your firmware, you may need to look if cc2650 is Arduino compatible (Energia). but i'm not sure..then you would need TI's compilers and tools. For use, when you have your firmware ready, it depends on the controller which protocols it supports. perhaps nodered too. you'll need a receiver (GW). for bluetooth or others protocols
    • Cliff Karlsson

      Question about step-down-module.
      General Discussion • • Cliff Karlsson  

      7
      0
      Votes
      7
      Posts
      1873
      Views

      NeverDie

      @Cliff-Karlsson Assuming your PSU is only driving your buck converter, then, if the device data can be believed (a big IF by the way), then yes, I would expect it could deliver 12a at 5v. That said, you're buying a cat in a bag, and from a no-name Chinese manufacturer no less. So, for instance, who knows whether the parts are actually rated for what they proclaim themselves to be. Those are electrolytic caps. Usually, they don't do well when exposed to heat, and in that design they look to be quite close to the heat sinks. Are the caps really rated for whatever heat you might encounter? That's a big unknown with these types of cheap boards. On the other hand, it's only $4, so maybe that's a trade-off you're willing to live with.
    • Cliff Karlsson

      Possible to change LED effects from controller/domoticz?
      General Discussion • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      3086
      Views

      Tore André Rosander

      @AWI has a nice piece of code that is exactly what you are looking for, try searching for mood light here on the forum.
    • Cliff Karlsson

      Using gyros with mysensors?
      Hardware • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      1395
      Views

      tbowmo

      @Cliff-Karlsson said: @tbowmo Like a "flex" sensor? Or loadcell? Like a flex sensor..
    • Cliff Karlsson

      Dim lights to match sunlight from windows?
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      754
      Views

      sundberg84

      @Cliff-Karlsson - from my point of view (Domoticz) it wouldnt be hard at all. You need one lux sensor and a dimmer. The code could be written in Lua for example and executed every time the lux sensor gets a new reading.
    • Cliff Karlsson

      Error: Serial Port closed!... Error: End of file..
      Troubleshooting • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      2108
      Views

      flopp

      I tried to reprogram the Arduino Nano but that didn't helped. Changed com port on computer and that seems to solve my problem
    • Cliff Karlsson

      Is it possible to send s_weight to domoticz?
      Domoticz • • Cliff Karlsson  

      9
      0
      Votes
      9
      Posts
      2326
      Views

      Boots33

      @Cliff-Karlsson An interesting project. As you don't need to know the weight that will make the sketch much simpler. You can just use the raw ADC values to work out the best threshold for when the bed is occupied. Try the sketch below and see if you get meaningful results . Depending on your voltage divider you should get a value between 0 and 1023 sent every 2 seconds. /** * weightTester */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 #include <SPI.h> #include <MySensors.h> #define CHILD_ID_WEIGHT 0 int inPin = 3 ; // change this to the analog pin you are using int forceReading = 0; //placeholder for the analog readings unsigned long waitTime = 2000; // time between message sends (in milliseconds) MyMessage msg(CHILD_ID_WEIGHT, V_WEIGHT); void setup(){ } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Weight Test", "1.0"); // Register all sensors to gateway (they will be created as child devices) present(CHILD_ID_WEIGHT, S_WEIGHT); } void loop() { forceReading = analogRead(inPin); send(msg.set(forceReading)); #ifdef MY_DEBUG Serial.println(forceReading); #endif wait(waitTime); }
    • Cliff Karlsson

      How to use force/preassure sensor to send data to domoticz?
      Troubleshooting • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      549
      Views

      No one has replied

    • Cliff Karlsson

      Create fire-effect using ws2812 leds?
      General Discussion • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      1285
      Views

      No one has replied

    • Cliff Karlsson

      Possible to focus PIR "beam" ?
      General Discussion • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1651
      Views

      m26872

      I have a CVD ZnSe (Chemical Vapor Deposited Zinc Selenide) lens I'm planning to experiment with in this kind of use case. It should work in theory. It bought it for my IR camera, but I've understood it's commonly used in laser cutters.
    • Cliff Karlsson

      Guide for connecting several small RGB 5050 ledstrips?
      General Discussion • • Cliff Karlsson  

      7
      0
      Votes
      7
      Posts
      1802
      Views

      LastSamurai

      I am using my RGBW controller like that. I have some of these nodes controlling multiple strips. Although if you want to controll them individually you need a controller for each one. (or build one that has more mosfets, then you are only limited by the number of pwm pins on the arduino you are using).
    • Cliff Karlsson

      Xiaomi Mi Flora [Temp/Light/Moisture] BLE Sensor
      General Discussion • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      1468
      Views

      No one has replied

    • Cliff Karlsson

      How do I turn a Pin to HIGH from controller?
      Troubleshooting • • Cliff Karlsson  

      3
      0
      Votes
      3
      Posts
      856
      Views

      nielsokker

      There is an example that exactly gives you what you need. The Relay example is the structure of what you need to use.
    • Cliff Karlsson

      What is wrong with this sketch?
      Troubleshooting • • Cliff Karlsson  

      20
      0
      Votes
      20
      Posts
      3625
      Views

      Cliff Karlsson

      ahh!!!, you where right. I powered the node using a mobile charger but had not connected the PIR to the same GND as the charger. Now it works.
    • Cliff Karlsson

      Help with sketch, update on motion OR pressure
      Troubleshooting • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      434
      Views

      No one has replied

    • Cliff Karlsson

      Help with bed occupancy-sketch using preassure sensor
      Troubleshooting • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      604
      Views

      Cliff Karlsson

      This is a regular basic sketch that uses the sensor. int FSR_Pin = A0; //analog pin 0 void setup(){ Serial.begin(9600); } void loop(){ int FSRReading = analogRead(FSR_Pin); Serial.println(FSRReading); delay(250); //just here to slow down the output for easier reading }
    • Cliff Karlsson

      Why is the the DIY PCBs on openhardware.io so expensive?
      General Discussion • • Cliff Karlsson  

      9
      0
      Votes
      9
      Posts
      1772
      Views

      hek

      Not at the moment. There is still only a few boards where the author has activated sales function. When this number grows, I'll add some more filters. https://www.openhardware.io/explore#view=forSale
    • Cliff Karlsson

      Witch temp/hum sensor is best to use for battery powered sensors?
      General Discussion • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      4649
      Views

      chrille

      @AWI I fully agree! The AM2302 (aka DHT-22) does not work, when the supply drops slightly below 3.3V, while the AM2321works at much lower voltage. I have used the AM2321 for more than 6 months to monitor my greenhouse
    • Cliff Karlsson

      Witch "variables" are supported by domoticz?
      Domoticz • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      1175
      Views

      sundberg84

      Check this out: https://github.com/domoticz/domoticz/blob/master/hardware/MySensorsBase.cpp#L24
    • Cliff Karlsson

      Has anyone got Mi-lights to work in domoticz without controller?
      Domoticz • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      665
      Views

      No one has replied

    • Cliff Karlsson

      Triple Axis Compass Sensor for mailbox?
      General Discussion • • Cliff Karlsson  

      12
      0
      Votes
      12
      Posts
      2784
      Views

      Cliff Karlsson

      I used the BinarySwitchSleepSensor sketch and tried adding the battery measuring info. Does this look ok If I only want the sensor to sleep until the magnetswitch attached to PIN 2 is opened and every 6h it reports battery? // Enable debug prints to serial monitor #define MY_DEBUG #define SLEEP_TIME 21600000 // Sleep time between reads (in milliseconds) // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #include <SPI.h> #include <MySensor.h> #define SKETCH_NAME "Mailbox +Battery" #define SKETCH_MAJOR_VER "1" #define SKETCH_MINOR_VER "0" #define PRIMARY_CHILD_ID 3 #define CHILD_ID_BATTERY 1 #define BATTERY_FULL 3143 // 2xAA usually give 3.143V when full #define BATTERY_ZERO 2340 #define PRIMARY_BUTTON_PIN 2 // Arduino Digital I/O pin for button/reed switch // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED); MyMessage voltage_msg(CHILD_ID_BATTERY, V_VOLTAGE); long oldvoltage = 0; void setup() { // Setup the buttons pinMode(PRIMARY_BUTTON_PIN, INPUT); // Activate internal pull-ups digitalWrite(PRIMARY_BUTTON_PIN, HIGH); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER "." SKETCH_MINOR_VER); // Register binary input sensor to sensor_node (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. present(PRIMARY_CHILD_ID, S_DOOR); delay(250); present(CHILD_ID_BATTERY, S_CUSTOM); } // Loop will iterate on changes on the BUTTON_PINs void loop() { uint8_t value; static uint8_t sentValue=2; // Short delay to allow buttons to properly settle sleep(5); value = digitalRead(PRIMARY_BUTTON_PIN); if (value != sentValue) { // Value has changed from last transmission, send the updated value send(msg.set(value==HIGH ? 1 : 0)); sentValue = value; } long voltage = readVcc(); if (oldvoltage != voltage) { // Only send battery information if voltage has changed, to conserve battery. send(voltage_msg.set(voltage / 1000.0, 3)); // redVcc returns millivolts. Set wants volts and how many decimals (3 in our case) sendBatteryLevel(round((voltage - BATTERY_ZERO) * 100.0 / (BATTERY_FULL - BATTERY_ZERO))); oldvoltage = voltage; } // Sleep until something happens with the sensor sleep(PRIMARY_BUTTON_PIN-2, CHANGE, SLEEP_TIME); } long readVcc() { // From http://provideyourown.com/2012/secret-arduino-voltmeter-measure-battery-voltage/ // Read 1.1V reference against AVcc // set the reference to Vcc and the measurement to the internal 1.1V reference #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) ADMUX = _BV(MUX5) | _BV(MUX0); #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) ADMUX = _BV(MUX3) | _BV(MUX2); #else ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); #endif delay(2); // Wait for Vref to settle ADCSRA |= _BV(ADSC); // Start conversion while (bit_is_set(ADCSRA, ADSC)); // measuring uint8_t low = ADCL; // must read ADCL first - it then locks ADCH uint8_t high = ADCH; // unlocks both long result = (high << 8) | low; result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000 return result; // Vcc in millivolts }
    • Cliff Karlsson

      How do I connect/code to use a flex sensor?
      Troubleshooting • • Cliff Karlsson  

      7
      0
      Votes
      7
      Posts
      2889
      Views

      Dwalt

      @Cliff-Karlsson No sure on the button force sensors, I have not used them. To test the force sensors under a mattress, I would wire them up to an Arduino with a sketch that simple reads the analog pin and serial prints the result. Place the sensor under the mattress and see what the serial monitor readings are when the bed is unoccupied and occupied. This would give you the unique range for you particular need. Might be tricky if your computer and bed are in different rooms. After you have the range, you could write a sketch with S_BINARY to trigger V_STATUS whenever the reading approached the high end of your tested range. If you cannot reach you bed while connected to serial, you could write a sample mySensors sketch to send the analog reading every few seconds to your controller as V_LEVEL. This video helps explain how to wire up the sensor and select the static resistor for the voltage divider. video
    • Cliff Karlsson

      Help troubleshooting code
      Troubleshooting • • Cliff Karlsson  

      13
      0
      Votes
      13
      Posts
      2344
      Views

      martinhjelmare

      You have to add a timer, and an if statement. Start the timer after motion is tripped. If time is less than 30 s, ping. Else reset timer and sleep with motion interrupt. I can post some example code later perhaps.
    • Cliff Karlsson

      Add a second distance sensor to the same arduino?
      Troubleshooting • • Cliff Karlsson  

      18
      0
      Votes
      18
      Posts
      3619
      Views

      TheoL

      @Cliff-Karlsson I'm sorry would love help you further. But it's getting late over here and my better half wants me to turn off the laptop.
    • Cliff Karlsson

      Simple detector that detects "breaking of a line"
      General Discussion • • Cliff Karlsson  

      8
      0
      Votes
      8
      Posts
      3423
      Views

      niccodemi

      @Cliff-Karlsson I use active beam detector. Power is needed on both sides though but if that is an issue you can always use mirror on the other side. In my experience these things are very sensitive in short ranges (below 5m). More expensive models let you adjust trigger time too.
    • Cliff Karlsson

      Can I connect two PIR sensors to a mini pro/328p and use interrupt on both?
      General Discussion • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      901
      Views

      mfalkvidd

      You just don't connect it. That's all The MySensors nrf code does not use the interrupt so there is no code to remove.
    • Cliff Karlsson

      Human presence detection?
      General Discussion • • Cliff Karlsson  

      6
      0
      Votes
      6
      Posts
      5176
      Views

      Cliff Karlsson

      Simply because I am not good at all in "coding" or writing sketches. I would have to hope someone else creates the exact sketch that I need. I saw some video where someone showed of the sensor and some "simple" code. There where alot of arrays involved and you had to write some half complicated "algoritms" to translate the different arrays of temperatures into "persons" to detect.
    • Cliff Karlsson

      Help troubleshoting sketch
      Troubleshooting • • Cliff Karlsson  

      19
      0
      Votes
      19
      Posts
      3600
      Views

      Cliff Karlsson

      Hmm I tried the sketch. It works when using NRF radio, when I change to RFM69 radio it does not work. I tried connection the same RFM69 radio to a 3.3v mini pro and then it works. I am using this RFM69breakout on all my boards with only the RFM69 radio and pin headers soldered. Is there something funky about the breakoutboard? I con't understand why if that is as all other boards work using the same breakout, This is the result when trying the sketch with RFM69 Starting sensor (RRNNA-, 2.0.0-beta) Radio init successful. send: 99-99-0-0 s=255,c=3,t=15,pt=0,l=2,sg=0,st=fail: send: 99-99-0-0 s=255,c=0,t=17,pt=0,l=10,sg=0,st=fail:2.0.0-beta send: 99-99-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,st=fail:0 send: 99-99-0-0 s=255,c=3,t=11,pt=0,l=13,sg=0,st=fail:Binary Sensor send: 99-99-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,st=fail:1.0 send: 99-99-0-0 s=3,c=0,t=0,pt=0,l=0,sg=0,st=fail: find parent send: 99-99-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: send: 99-99-0-0 s=4,c=0,t=0,pt=0,l=0,sg=0,st=fail: Init complete, id=99, parent=0, distance=255 send: 99-99-0-0 s=3,c=1,t=16,pt=2,l=2,sg=0,st=fail:1 send: 99-99-0-0 s=4,c=1,t=16,pt=2,l=2,sg=0,st=fail:1```
    • Cliff Karlsson

      Help with script for controlling Wemo bulbs.
      General Discussion • • Cliff Karlsson  

      8
      0
      Votes
      8
      Posts
      3534
      Views

      drock1985

      @Cliff-Karlsson I'm not too sure you will get that reaction time from anything but the Wemo app itself, or the mechanical switch on the Wemo. The problem I found out with the Wemo is, it will randomize what port it connects to in a certain range. I can't remember the exact range (maybe 49152-49156?), but I think it's stated in the .sh script. Therefore, the script or whatever program that is doing the switching needs to first find the proper IP/Port, then actually run the command. The one option you may have is setting a static IP to each Wemo switch, then sending it more direct. To be all honest, this is why I switched from Wemo over to MySensors and the Relay sketch. Works much better than the Wemo's do, and haven't had a chance to buy and test any Zigbee wall switches yet.
    • Cliff Karlsson

      Plant automation, Soil moisture and watering with pump?
      General Discussion • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      837
      Views

      No one has replied

    • Cliff Karlsson

      Problems getting a RFM69HW gateway to work in domoticz
      Domoticz • • Cliff Karlsson  

      16
      0
      Votes
      16
      Posts
      4410
      Views

      John Tol

      Hi Cliff, could you be so kind to share the full sketch with us? I'm also having trouble getting this RFM69HW to work.
    • Cliff Karlsson

      Arduino nano + logic level shifter + 3.3v PSU+RFM69HW?
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      1452
      Views

      carlierd

      Hello, As mentioned on the MySensors page, NSS, MOSI and SCK are not 5v tolerant so you need to connect them to a level converter. Don't connect MISO to the level converter, it's not necessary and not working for me ! Hope it helps ! David.
    • Cliff Karlsson

      Step by step instructions of how to troubleshoot RFM69 gateway/sensor ?
      Troubleshooting • • Cliff Karlsson  

      8
      0
      Votes
      8
      Posts
      3316
      Views

      Cliff Karlsson

      I tried both gateway and node sketch and it worked. I then uploaded the mysensors.org gateway sketch version 1.5,1.6 and 2.0. None worked. Formatted and reinstalled domoticz. Tried both stable and beta. No change. I am giving up on this for tonight.
    • Cliff Karlsson

      How do I burn a bootloader to an 328p with UNO bootloader preinstalled?
      Troubleshooting • • Cliff Karlsson  

      15
      0
      Votes
      15
      Posts
      9028
      Views

      Cliff Karlsson

      I tried and failed almost every procedure. But in my last atempt I plugged in an USBtinyISP to my new(old) arduino with 328p socket. After clicking burn bootloader it took like 2 sec then it said that the burning was colmplete. The only visual clue that anything has changed is that the default blink-sketch that blinks the built in led have stoped blinking on the UNO and is solid now. How can I test if everything is ok? I tried uploading the blink sketch again to the UNO and the upload took alot longer and I got this error: Board arduino:avr:apm96 doesn't define a 'build.board' preference. Auto-set to: AVR_APM96 But it all complied and uploaded correctly in the end and it started blinking again.
    • Cliff Karlsson

      Identify ESP8266 module
      Troubleshooting • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      1314
      Views

      No one has replied

    • Cliff Karlsson

      How do I play audio?
      Hardware • • Cliff Karlsson  

      6
      0
      Votes
      6
      Posts
      2851
      Views

      hek

      dog.mp3
    • Cliff Karlsson

      Hardware debounce?
      Hardware • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      2053
      Views

      lafleur

      For something that slow, try a MAX6816... cheap, sot-4 case
    • Cliff Karlsson

      5v on input to act like a button
      Troubleshooting • • Cliff Karlsson  

      11
      0
      Votes
      11
      Posts
      3504
      Views

      AWI

      @Cliff-Karlsson if you have an AC waveform it will probably be a lot of noise and/or a "sine like" wave of a certain frequency. . Connected to an optocoupler this will trigger very frequently. What I suggest you do is rectify the signal so that you get a "DC" signal to use as a trigger. thnx wiki Connect the +Vo and GND to your optocoupler (in series with a resistor of around 470 Ohm). C1 = 100uF & R1 = 1kOhm will do to get a reasonable clean signal. You can attach the optocoupler to the interrupt (D2 or D3) and do whatever you want with it using gw.sleep(...)
    • Cliff Karlsson

      Relay_Actuator add second relay?
      Troubleshooting • • Cliff Karlsson  

      9
      0
      Votes
      9
      Posts
      2893
      Views

      Michel - It

      solution vera http://forum.mysensors.org/topic/799/my-relay-module
    • Cliff Karlsson

      mySensors Node PCB components ?
      Troubleshooting • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      598
      Views

      No one has replied

    • Cliff Karlsson

      Change power output?
      General Discussion • • Cliff Karlsson  

      9
      0
      Votes
      9
      Posts
      2580
      Views

      Oitzu

      @Cliff-Karlsson said: thanks for the answer, I don't really know what a fly-back diode is or have any non-light diodes at home right now. I have a couple of optocouplers, mosfets and transistors lying around. Can I use any combination of those components to control the pump? At this small pump a mosfet will probably also work yes. To the fly-back diode: As you may already know a diode only conducts in one direction. And you may also know that a electric motor can also be used as an generator. When powering off the motor the motor will be act for a short time as "generator" due to the momentum and the stored energy in the magnetic field. The diode will be connected between the mosfet and the motor to prevent flow of current back to the mosfet in this event.
    • Cliff Karlsson

      Omron D6T Thermal sensor for detecting human presence
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      5471
      Views

      gregl

      Looks good.. I found some code here for it: http://forum.arduino.cc/index.php?topic=212749.15 I've not looked any further as to what people may have done with respect to counting people etc..but im sure there is some out there! Not too cheap though.. $80AUD here!
    • Cliff Karlsson

      Led dimmer sketch, voltage drop?
      Troubleshooting • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1811
      Views

      Yveaux

      @Cliff-Karlsson said: Ok, how much voltage/current is needed to open the gate? I changed to a Nano and now I get ~10v First, I'm a software guy, but I'll try to answer your question. Please correct me if I'm wrong! I started to type an answer to your question, but it has already been answered many times on the web, e.g. http://electronics.stackexchange.com/questions/144607/do-mosfets-have-voltage-drop-across-source-and-drain-when-turned-on And for the full background http://www.microsemi.com/document-portal/doc_view/14692-mosfet-tutorial For your IRFZ44N look up the Vgs chart in the datasheet (http://www.irf.com/product-info/datasheets/data/irfz44n.pdf, page 3, figure 3). You can see that 4.5 Volts is roughly the bare minimum to get the Mosfet to open its gate, but the maximum current is only about 10Amps there. At 7 Volts it can switch 100Amps -- should be sufficient for your LED strip Either use e.g. a transistor to switch it using a higher voltage, or use a logic-level mosfet, as @Drcashman suggested.
    • Cliff Karlsson

      Controlling 433Mhz products like nexa and others?
      General Discussion • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      2857
      Views

      TheoL

      @Cliff-Karlsson The RFXtrs433E is a bit expensive but works really well. I received mine last weekend to control my Somfy Blinds. Also I'm now able to hijack my neighbours light controls Can't wait till the next time I'll visit them, and see the look upon their face when I switch on and off their ligths without them knowing that's me doing it.
    • Cliff Karlsson

      RFM69 breakoutboard, what components to use?
      General Discussion • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      1482
      Views

      TD22057

      You could combine the two ideas and create a PCB board with level shifters and the 4x2 connector.
    • Cliff Karlsson

      Attempt to combine three sketches failed.
      Troubleshooting • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1297
      Views

      mfalkvidd

      Pro tip1: the error is often a line before the line that the compiler complains about. So don't always focus on the highlighted line Pro tip2: Use Tools->Auto Format in the Arduino IDE to make the code more readable. In this case, auto format would probably have made the error more visible because the could would have looked like this after auto-format: /** * 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 * * Interrupt driven binary switch example with dual interrupts * Author: Patrick 'Anticimex' Fallberg * Connect one button or door/window reed switch between * digitial I/O pin 3 (BUTTON_PIN below) and GND and the other * one in similar fashion on digital I/O pin 2. * This example is designed to fit Arduino Nano/Pro Mini * */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #include <DallasTemperature.h> #include <OneWire.h> #include <SPI.h> #include <MySensor.h> #define SKETCH_NAME "Binary Sensor+temp" #define SKETCH_MAJOR_VER "1" #define SKETCH_MINOR_VER "0" #define PRIMARY_CHILD_ID 3 #define SECONDARY_CHILD_ID 4 #define COMPARE_TEMP 1 // Send temperature only if changed? 1 = Yes 0 = No #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected #define MAX_ATTACHED_DS18B20 16 #define PRIMARY_BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch //#define SECONDARY_BUTTON_PIN 7 // Arduino Digital I/O pin for button/reed switch OneWire oneWire(ONE_WIRE_BUS); // Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs) DallasTemperature sensors(&oneWire); // Pass the oneWire reference to Dallas Temperature. float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors = 0; boolean receivedConfig = false; boolean metric = true; #if (PRIMARY_BUTTON_PIN < 2 || PRIMARY_BUTTON_PIN > 3) #error PRIMARY_BUTTON_PIN must be either 2 or 3 for interrupts to work #endif //#if (SECONDARY_BUTTON_PIN < 2 || SECONDARY_BUTTON_PIN > 3) //#error SECONDARY_BUTTON_PIN must be either 2 or 3 for interrupts to work //#endif #if (PRIMARY_BUTTON_PIN == SECONDARY_BUTTON_PIN) #error PRIMARY_BUTTON_PIN and BUTTON_PIN2 cannot be the same #endif #if (PRIMARY_CHILD_ID == SECONDARY_CHILD_ID) #error PRIMARY_CHILD_ID and SECONDARY_CHILD_ID cannot be the same #endif // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(PRIMARY_CHILD_ID, V_LIGHT); MyMessage msg2(SECONDARY_CHILD_ID, V_TEMP); int BATTERY_SENSE_PIN = A0; // select the input pin for the battery sense point unsigned long SLEEP_TIME = 600000; // sleep time between reads (seconds * 1000 milliseconds) int oldBatteryPcnt = 0; void setup() { // Startup up the OneWire library sensors.begin(); // requestTemperatures() will not block current thread sensors.setWaitForConversion(false); #if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endif // Setup the buttons pinMode(PRIMARY_BUTTON_PIN, INPUT); // pinMode(SECONDARY_BUTTON_PIN, INPUT); // Activate internal pull-ups digitalWrite(PRIMARY_BUTTON_PIN, HIGH); // digitalWrite(SECONDARY_BUTTON_PIN, HIGH); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR_VER "." SKETCH_MINOR_VER); // Register binary input sensor to sensor_node (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. //numSensors = sensors.getDeviceCount(); // Present all sensors to controller //for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { } present(PRIMARY_CHILD_ID, S_LIGHT); present(SECONDARY_CHILD_ID, S_TEMP); } // Loop will iterate on changes on the BUTTON_PINs void loop() { uint8_t value; static uint8_t sentValue = 2; static uint8_t sentValue2 = 2; // Short delay to allow buttons to properly settle sleep(5); value = digitalRead(PRIMARY_BUTTON_PIN); if (value != sentValue) { // Value has changed from last transmission, send the updated value send(msg.set(value == HIGH ? 1 : 0)); sentValue = value; } // value = digitalRead(SECONDARY_BUTTON_PIN); // // if (value != sentValue2) { // // Value has changed from last transmission, send the updated value // send(msg2.set(value==HIGH ? 1 : 0)); // sentValue2 = value; // } // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); // query conversion time and sleep until conversion completed int16_t conversionTime = sensors.millisToWaitForConversion(sensors.getResolution()); // sleep() call can be replaced by wait() call if node need to process incoming messages (or if node is repeater) sleep(conversionTime); // Read temperatures and send them to controller for (int i = 0; i < numSensors && i < MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((getConfig().isMetric ? sensors.getTempCByIndex(i) : sensors.getTempFByIndex(i)) * 10.)) / 10.; // Only send data if temperature has changed and no error #if COMPARE_TEMP == 1 if (lastTemperature[i] != temperature && temperature != -127.00 && temperature != 85.00) { #else if (temperature != -127.00 && temperature != 85.00) { #endif // Send in the new temperature send(msg.setSensor(i).set(temperature, 1)); // Save new temperatures for next compare lastTemperature[i] = temperature; } // get the battery Voltage int sensorValue = analogRead(BATTERY_SENSE_PIN); #ifdef DEBUG Serial.println(sensorValue); #endif // 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 int batteryPcnt = sensorValue / 10; #ifdef DEBUG float batteryV = sensorValue * 0.003363075; Serial.print("Battery Voltage: "); Serial.print(batteryV); Serial.println(" V"); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); #endif if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep sendBatteryLevel(batteryPcnt); oldBatteryPcnt = batteryPcnt; } } // Sleep until something happens with the sensor sleep(PRIMARY_BUTTON_PIN - 2, CHANGE, SLEEP_TIME); }
    • Cliff Karlsson

      Question about premade pcb
      General Discussion • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      933
      Views

      No one has replied

    • Cliff Karlsson

      Troubleshooting step one, Arduino install.
      Troubleshooting • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      1053
      Views

      No one has replied

    • Cliff Karlsson

      Help understanding the serial monitor.
      Troubleshooting • • Cliff Karlsson  

      6
      0
      Votes
      6
      Posts
      1438
      Views

      Cliff Karlsson

      Ok, will try to resolder the radio to see if it helps
    • Cliff Karlsson

      RFM69 problems
      Troubleshooting • • Cliff Karlsson  

      34
      0
      Votes
      34
      Posts
      14221
      Views

      GertSanders

      why not connect the NRF24 directly to your Raspi2 and run PiSerialGateway on Raspi itself ?
    • Cliff Karlsson

      Is it better to use RFM69HW/Nrf24L01 long-range on gateway?
      General Discussion • • Cliff Karlsson  

      2
      1
      Votes
      2
      Posts
      1357
      Views

      Sparkman

      @Cliff-Karlsson In the long range variants, the LNA is for the receive side (does a better job amplifying the received signal) and the PA is to produce higher power output on the transmit side. I use a module with a LNA/PA for my gateway and also for nodes that are far away or behind a few walls. Cheers Al
    • Cliff Karlsson

      Can't get relay to work
      Troubleshooting • • Cliff Karlsson  

      9
      0
      Votes
      9
      Posts
      3289
      Views

      malarcy

      @Cliff-Karlsson - I may be way off base here and I am new to this myself - but, does that sketch you quoted actually compile? - I ask because it looks like you have used the relay sample on the mysensors site - but cut out some of the loop. The bit that sets the output pin that the relay is connected to pinMode (pin, OUTPUT) ..... From what you have posted, you haven't got pin defined anywhere - in the original example it gets declared in the line for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) In your sketch i can't see pin or sensor defined - so I can't see how it's compiling....... but I may have missed something If I have general advice would be check what pin the relay is connected to, and make sure thats that one you set as output and the one that you do the digitalWrite to. Hope this helps - but if not - sorry if I am way off base.
    • Cliff Karlsson

      Gateway with both RFM69 and nRF24l01+ ?
      General Discussion • • Cliff Karlsson  

      10
      0
      Votes
      10
      Posts
      4344
      Views

      Anticimex

      I think that will be my strategy. That is, I keep my current rf24 gateway and larer on add a "69" gateway when the rf24 does not really cut it abd i have to use 69 nodes (typically the ones far away). I am not too fond of deploying wired repeaters unless I have to.
    • Cliff Karlsson

      Stupid question about powering leds
      Troubleshooting • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      1642
      Views

      Dwalt

      @Cliff-Karlsson Skip the Arduino and just go with red LEDs taped to coincell batteries. Should last thru Halloween. See this...
    • Cliff Karlsson

      Sketch for powerconsumption
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      892
      Views

      Sparkman

      @Cliff-Karlsson Here's a good example as to how to use them: http://openenergymonitor.org/emon/node/58. You'd have to combine their sketch with a MS sketch, but that shouldn't be too difficult. Note that a clamp on current transformer can produce high voltages without a burden resistor and should never be used without being connected. See the Safety section on this page for more info: http://openenergymonitor.org/emon/buildingblocks/ct-sensors-introduction. Cheers Al
    • Cliff Karlsson

      Connecting arduino to the display of a washing machine?
      General Discussion • • Cliff Karlsson  

      6
      0
      Votes
      6
      Posts
      2672
      Views

      flopp

      Maybe you can use LDR, one for each LED but make good isolation when you put the LDR close to the LED. With LDRs you will not use same power and "almost" no chance that you get any shortcut between Arduino stuff and washing machine
    • Cliff Karlsson

      What wire to use when soldering semi-permanent sensors?
      General Discussion • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1456
      Views

      ahhk

      Hi, why dont you design your own pcbs? Its quite easy... Greetings Andreas
    • Cliff Karlsson

      Pulse power meter flooding gateway
      Troubleshooting • • Cliff Karlsson  

      9
      0
      Votes
      9
      Posts
      2402
      Views

      Yveaux

      @Cliff-Karlsson said: I am using the same sensor as in the build example, the biggest sensor. And by 'biggest sensor' you mean the 'LM393 Light Sensor' ? I use a comparable sensor (same pcb) with a LDR and had to debounce its readings or multiple pulses were detected on each blink. Anyway, from the sketch I see sensor values should only be sent every 30 seconds, so that can't cause you gateway-spamming issue. The sketch will try to receive the old absolute counter value on startup, so it can continue counting where it left off: // Fetch last known pulse count value from gw gw.request(CHILD_ID, V_VAR1); IKf it doesn't get an answer, it will retry forever: } else if (sendTime && !pcReceived) { // No count received. Try requesting it again gw.request(CHILD_ID, V_VAR1); lastSend=now; } Could it be that that mechanism is bugging you? You could also connect to the sensor's serial port an see what it has to tell you.
    • Cliff Karlsson

      What kind of relay for in-wall application?
      Hardware • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1817
      Views

      Cliff Karlsson

      Ok, the heat issue was new to me regarding the ssr's. I already have one SSR-40DA and its quite big as it is without a heatsink. I think I wil go with the standar relays instead. But What kind of fuses should I get to make it as sefe as possible. A Thermal fuse Do I need some more fuse? if so a ebay/aliexpress link would be great.
    • Cliff Karlsson

      Possible for novice to create PCB?
      KiCad • • Cliff Karlsson  

      16
      0
      Votes
      16
      Posts
      7733
      Views

      Anticimex

      @Cliff-Karlsson can you be more specific on what information you lack? There are detailed instructions in the repos for how to set it up: https://github.com/mysensors-kicad/part_management
    • Cliff Karlsson

      Mosfet for RGB control
      General Discussion • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      2494
      Views

      kalle

      "Is this the same component? and could I use those in the same way as the regular mosfets?" If you are use a 5 meter strip (300 LED and each LED can consume 60mA in "bright white"), you need a MOSFET with ~18A in theory. The IRLL014 has 2.7A which looks like it is not enough. SOT223 is a small size and if you are a beginner it is hard to solder it on a PCB
    • Cliff Karlsson

      Pulse Powermeter, set to the same value as real power meter?
      Domoticz • • Cliff Karlsson  

      16
      0
      Votes
      16
      Posts
      8078
      Views

      Slorf

      @sundberg84 I cleared the Eeprom from both gateway and sensor, then set the V_VAR2 on the sensor on a start value for example 5555 I changed the sketch not to request any values from the gateway When the sensor gets it's first reading it's registered in Domoticz with the value of 5556 ( 5555 + first reading of 1 ) Now I have to questions: After the first reading ( 5556 ) is send to Domoticz I can change the sketch back to where it requests the reading form the gateway ? But if the sensor for example quits working for a week, then I have to change the V_VAR2 on the sensor again, which is not very handy ? Thanks for the help !! Alex
    • Cliff Karlsson

      PCB for Mini Pro, RFM69 and HLK-PM01 / Battery
      Hardware • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      1048
      Views

      No one has replied

    • Cliff Karlsson

      Energy Monitoring
      Troubleshooting • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      2573
      Views

      Cliff Karlsson

      Sorry for spamming but I solved the problem. The Original sketch was fine. I removed the radio and resoldered it (RFM69W) And then everything was Ok. There must have been some bad connecton as the sketch sent 3x greeting message.
    • Cliff Karlsson

      Identifying Pro Mini 5v and 3.3v, Is this correct/safe ?
      Hardware • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1500
      Views

      novicit

      On my 5V minis, the 16mhz crystal is much larger (long silver oval component stamped 16.00) than on 3.3v. At least on mine.
    • Cliff Karlsson

      Mailbox detector, what is the most battery efficient sensor?
      General Discussion • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1924
      Views

      bjornhallberg

      Magnetic switch or tilt switch (ball or mercury) would be a safe bet. Other possibilities would be a mechanical switch either at the top or bottom (that reacts to the weight of the mail). A light sensor / resistor (which obviously wouldn't work at night) or perhaps some sort of IR beam (not very battery friendly I imagine). Personally I have been using tilt switches for a couple of years. Very jumpy though when it comes to debouncing. Never tried with a capacitor as a simple hardware debouncer but rather just run the tripped message every loop and then sleep at the end of the loop, first for 10min and then until the next interrupt. Domoticz sets the sensor as "off" automatically after a time. A bit hacky but it works it seems. Reading the tilt switch state and getting it right every time became too frustrating. Speaking of debouncers, I was almost desperate enough to look into debouncer ICs like the Maxim MAX6816/MAX6817. Almost. A bigger concern is perhaps radio range. Despite earlier trials that seemed to indicate that the range was ok (and activating ACK), I had to set up a repeater node (with a pa+lna no less, the normal module wouldn't work!) and manually make sure the mailbox node always sends through the repeater. I was planning to set the repeater up eventually anyway, this just forced my hand.
    • Cliff Karlsson

      Help adding battery level to switch sketch
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      1692
      Views

      hek

      @Cliff-Karlsson said: mys.sleep(BUTTON_PIN-2, CHANGE, 0); Change to wakeUpReason = mys.sleep(BUTTON_PIN-2, CHANGE, SLEEP_TIME); See documentation on wakeUpReason if you only want to send battery value at wakeup.
    • Cliff Karlsson

      Please add a guide for how to connect use the RFM69(H)W
      Feature Requests • • Cliff Karlsson  

      16
      0
      Votes
      16
      Posts
      8291
      Views

      alexsh1

      @hek I can confirm that Moteino Mega USB (and I think Moteino Mega as well) works out of the box: Starting sensor (RRNNA-, 2.0.0-beta) Radio init successful. find parent send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: find parent send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc: Init complete, id=255, parent=255, distance=255 find parent send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,st=bc:
    • Cliff Karlsson

      Error: MySensors: Error opening serial port!
      Domoticz • • Cliff Karlsson  

      3
      0
      Votes
      3
      Posts
      2486
      Views

      Cliff Karlsson

      @Cliff-Karlsson said: one sensor to try out with that is a mini pro 3.3v +RFM69W and a light sensor. But this is all I get from the log. What can be the problem? No, the strange thing is that I had RFM69 radios working on both controller and sensors before, then I did something to screw it all up and after that I cant get anything to work. I have tried building/resoldering three different gateways using RFM69HW radios and I can add the to domoticz without problem. But as soon as I start a RFM69 sensor I get the same problems as in the log. I have even changed my raspberry pi to a new one and bought a pwered USB-hub, but I get the same problem. NRF radios/gateway works fine tho.
    • Cliff Karlsson

      Power Pro mini 3.3v from usb ?
      General Discussion • • Cliff Karlsson  

      5
      0
      Votes
      5
      Posts
      1970
      Views

      gloob

      Why not connect the arduino directly to the IO pins of the raspberry? I have a similar setup running with a sensebender micro as a gateway.
    • Cliff Karlsson

      What radio to use? NRF24L01+, RFM69, RFM73 ?
      Hardware • • Cliff Karlsson  

      52
      0
      Votes
      52
      Posts
      49153
      Views

      mfalkvidd

      @mahesh2000 please don't post the same question in multiple places. It wastes people's time when some details are available in one thread and some details in another thread. To anyone responding to @mahesh2000's question, please reply in https://forum.mysensors.org/post/85838 instead.
    • Cliff Karlsson

      "Smart" LCD module? 2.4" HMI Intelligent Smart USART Serial TFT LCD Module Display w/ Touch Panel
      Hardware • • Cliff Karlsson  

      12
      0
      Votes
      12
      Posts
      7787
      Views

      Sparkman

      @Cliff-Karlsson Hi Cliff, I ordered one a few days ago and as far as I understand, the only other thing you need is an sd card to transfer the design from the editor/pc to the display. You can connect with an ftdi adapter, but it's much faster using the sd card. The cable to connect it to an arduino is included. Cheers Al
    • Cliff Karlsson

      How do I add the soil-moisture sensor to domoticz?
      Domoticz • • Cliff Karlsson  

      22
      0
      Votes
      22
      Posts
      20034
      Views

      mfalkvidd

      Not quite. There are no diodes and no resistors in the solution I use.
    • Cliff Karlsson

      Best way to combine two sketches using interrupt and sleep time?
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      1014
      Views

      LastSamurai

      You can actually combine both I think. Search for sleep. There is a sleep function bool sleep(int interrupt, int mode, unsigned long ms=0); that both listenes to an interrupt and wakes up after a certain time. The return boolean value indicates which one.
    • Cliff Karlsson

      Basics of powering multiple sensors from one arduino
      General Discussion • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      1808
      Views

      Sparkman

      @Cliff-Karlsson Yes, you can power them from the same pins. You do have to make sure that the Arduino can source enough current for all of the sensors that you have. The amount they can source will depend on which Arduino you have. Cheers Al
    • Cliff Karlsson

      Help make button-sketch sleep.
      General Discussion • • Cliff Karlsson  

      6
      0
      Votes
      6
      Posts
      3022
      Views

      m26872

      @Cliff-Karlsson There's a good example in the MySensors lib with sleep and two switches. https://github.com/mysensors/Arduino/blob/master/libraries/MySensors/examples/BinarySwitchSleepSensor/BinarySwitchSleepSensor.ino My adaption of that one to my own need and with one swtich looked like this #include <MySensor.h> #include <SPI.h> #define SKETCH_NAME "BinSwSleepBat" #define SKETCH_VERSION "1-2" #define CHILD_ID 0 #define BUTTON_PIN 3 // Arduino Digital I/O pin for button/reed switch. On Atmega328p (nano and pro mini) D2 and/or D3 are interrupt pins. MySensor mys; MyMessage msg(CHILD_ID, V_TRIPPED); // Change to V_LIGHT if you use S_LIGHT in presentation below int sentValue=2; void setup() { mys.begin(); pinMode(BUTTON_PIN, INPUT); // Setup the buttons digitalWrite(BUTTON_PIN, HIGH); // Activate internal pull-ups mys.sendSketchInfo(SKETCH_NAME, SKETCH_VERSION); mys.present(CHILD_ID, S_DOOR); } void loop() // Loop will iterate on changes on the BUTTON_PINs { mys.sleep(50); // Short delay to allow buttons to properly settle uint8_t val = digitalRead(BUTTON_PIN); if (val != sentValue) { // If value has changed from last transmission, send the updated value mys.send(msg.set(val==HIGH ? 1 : 0)); sentValue = val; } mys.sleep(BUTTON_PIN-2, CHANGE, 0); // Sleep until something happens with the sensor }
    • Cliff Karlsson

      Trying to combine Temp + Battery level-sketch, What is wrong?
      Troubleshooting • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      1925
      Views

      Cliff Karlsson

      I am definitly no expert but I guess that is only a setup value. This part I think sets the proper value of sensors: // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); // Present all sensors to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { gw.present(i, S_TEMP); }```
    • Cliff Karlsson

      What batteries is best to use for a sensor that sleeps most of the time?
      Hardware • • Cliff Karlsson  

      8
      0
      Votes
      8
      Posts
      3432
      Views

      Andy Pep

      i use 2cell 7.4 volt recycled laptop battery packs for my projects thay have a natural discharge of 5% a month but do some reading and research on how to handle and charge them...and you should be fine..plus recycleing lappy batterys is good for the enviroment..and you also learn about the new breed of batterys and cells
    • Cliff Karlsson

      How do I send a REST command?
      Domoticz • • Cliff Karlsson  

      4
      0
      Votes
      4
      Posts
      4000
      Views

      pjr

      What are you trying to archieve with this? What is the receiving end? I think you can send your "ajax call" from lua script with os.execute method using curl if you are in linux enviroment. commandArray = {} if (devicechanged['NameOfYourSwitch'] == 'On') then os.execute('/usr/bin/curl -X PUT -d STATE=true 192.168.0.22:4455/devices/{udn}') else if(devicechanged['NameOfYourSwitch'] == 'Off') then os.execute('/usr/bin/curl -X PUT -d STATE=false 192.168.0.22:4455/devices/{udn}') end return commandArray And give it a name with prefix: script_device_xxxxxxx.lua where xxxxxxx is name for your script. Then domoticz will launch it everytime some device state changes. Location for it is script/lua under your domoticz folder.
    • Cliff Karlsson

      Cheapest way to build wireless buttons?
      Hardware • • Cliff Karlsson  

      13
      0
      Votes
      13
      Posts
      8200
      Views

      Cliff Karlsson

      Ok I think I will try the original idea with the nrf24l01 and arduino pro mini. But I am still waiting for my pro minis to arrive and only have a old one with a ATmega168. I read something about disabling the debug in mysensors.h. Will I still be able to fit an button sketch with wireless using the smaller ATmega168?
    • Cliff Karlsson

      Updating to 1.5 and question about RFM69HW
      General Discussion • • Cliff Karlsson  

      7
      0
      Votes
      7
      Posts
      3221
      Views

      Francois

      @riteshpatel I upgrade to version 1.6 beta as this have an must better integration with the RFM69 radios. Now you only have to configure your device in the MyConfig.h file. Also if you look at the sketch you will see you only have to #define MY_REPEATER_FEATURE to have the repeater. // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached /m#define MY_RADIO_NRF24 #define MY_RADIO_RFM69 // Enable repeater functionality for this node #define MY_REPEATER_FEATURE
    • Cliff Karlsson

      Can I use a Pro mini ATmega128 5V/16M for anything?
      General Discussion • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      782
      Views

      No one has replied

    • Cliff Karlsson

      Help beginner with first project
      General Discussion • • Cliff Karlsson  

      3
      0
      Votes
      3
      Posts
      1061
      Views

      hek

      Try the ones you have. Not exactly an exact science this...
    • Cliff Karlsson

      Send intent?
      Controllers • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      1213
      Views

      Moshe Livne

      @Cliff-Karlsson see this thread http://forum.mysensors.org/topic/1607/safe-in-wall-ac-to-dc-transformers regarding inwall 220->5v. Its not trivial and it is dangerous. If you are not sure what you are doing you better get zwave or x10 inwall switches. BTW, will the switches do anything other than sending the intents? you can maybe make the switches "fake" on battery power. just sending signals a few times a day a battery should last over a year.
    • Cliff Karlsson

      Wemo/Hue Bulbs?
      PiDome • • Cliff Karlsson  

      2
      0
      Votes
      2
      Posts
      1442
      Views

      John

      Currently not, zigbee is on our list, when we start to implement it it will be done per protocol, there is no estimate or decision made when to implement zll to control lighting. I'm also not sure yet if the ZLL will work on all/recent zigbee dongles because as far as i have understand it is a network not included in default zigbee mesh networks.
    • Cliff Karlsson

      Possible to control Wemo-bulbs or Hue-bulbs without bridge?
      Domoticz • • Cliff Karlsson  

      1
      0
      Votes
      1
      Posts
      1105
      Views

      No one has replied

    • Cliff Karlsson

      First project controling light-sensor and "smart" lightbulbs
      General Discussion • • Cliff Karlsson  

      7
      0
      Votes
      7
      Posts
      3565
      Views

      AWI

      @Cliff-Karlsson I is getting a little off-topic but the Ninja Spheres are open-source and should be able to act as a controller (i.e. gateway between Wifi/LAN and ZigBee. If you look for something out of the box than MySensors is probably not the way to go..