Skip to content

My Project

Show off and share your great projects here! We love pictures!
961 Topics 13.4k Posts
  • Curent sensor/power with 2xcts013-30 + light + temperature

    1
    0 Votes
    1 Posts
    857 Views
    No one has replied
  • How To: 2 Door Chime Automation Hack (Thanks @petewill)

    9
    3 Votes
    9 Posts
    10k Views
    D
    Update 17-July-2016 Sensor v2.2 MySensors 2.0 Update I have updated the code in the latest post for the release of MySensors 2.0! Not much has changed, just the calls. All of the same functionality is kept. Since MySensors 2.0 does not include any external libraries, you will need to manually add the debounce 2 library to your Arduino IDE/MySensors2 setup. The official GitHub repo is located here. Install it the same as any Arduino Library. Any comments or questions please ask. V2.2 Sketch: /* * 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. * ******************************* * * REVISION HISTORY * Version 2.2 - Removed MySensors 1.5 code and replaced with MySensors 2.0 * Version 2.1 - Derrick Rockwell (Drock1985) * - Complete Re-write of code to provide better flow/structure. * Version 2.0 - ResentedPoet * * Based on original concept/code by @petewill for 1 Door bell chime. See original thread * http://forum.mysensors.org/topic/2064/how-to-doorbell-automation-hack * This sketch is used to control a front and back doorbell ring with relays as well as send an * alert when the buttons are pressed. For front door, Connect the button to ground and digital * pin 3. The relay controlling the doorbell is conntected to pin 4. For rear door bell * connect second button to ground and digital pin 5. The relay controlling that pin goes * to pin 6. */ // Enable debug prints // #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #define MY_NODE_ID 2 //or use AUTO to have your home controller assign it for you. #define MY_REPEATER_FEATURE // Enabled repeater feature for this node. Comment out if you do not want repeater function #include <MySensors.h> #include <SPI.h> #include <Bounce2.h> #define FRONT_DOOR_BUTTON 3 // Arduino Digital I/O pin number for the front doorbell button #define FRONT_CHIME_RELAY 4 // Aduino Digital I/O pin number for the front door chime relay #define CHILD_ID_FRONT 0 // Child ID for the front doorbell sensor #define BACK_DOOR_BUTTON 5 // Arduino Digital I/O pin number for the back doorbell button #define BACK_CHIME_RELAY 6 // Aduino Digital I/O pin number for the back door chime relay #define CHILD_ID_BACK 1 // Child ID for the back doorbell sensor #define CHILD_ID_MUTE 2 // Child ID for the mute option #define CHIME_MUTE_STATE // Used to hold value of door chime mute funtion. #define CHIME_OFF 0 // Variable to define ring the chime #define CHIME_ON 1 #define FRONT_CHIME_RELAY_ON LOW // Variable for front chime. Reverse low/high if relay pin set different #define FRONT_CHIME_RELAY_OFF HIGH // Variable for front chime. Reverse low/high if relay pin set different #define BACK_CHIME_RELAY_ON LOW // Variable for front chime. Reverse low/high if relay pin set different #define BACK_CHIME_RELAY_OFF HIGH // Variable for front chime. Reverse low/high if relay pin set different Bounce debouncerF = Bounce(); Bounce debouncerB = Bounce(); boolean CHIME_MUTE = 1; MyMessage msg(CHILD_ID_MUTE, CHIME_MUTE); MyMessage frontDoorbell(CHILD_ID_FRONT, V_TRIPPED); MyMessage backDoorbell(CHILD_ID_BACK, V_TRIPPED); MyMessage chimeMute(CHILD_ID_MUTE, V_LIGHT); int pestTimeout = 4000; // Delay between registered button presses. Stops button mashers ;) Set to whatever delay you want. unsigned long previousMillis=0; // Tracks time since last door chime button press void setup() { // Setup the button and activate internal pull-up pinMode(FRONT_DOOR_BUTTON, INPUT); pinMode(BACK_DOOR_BUTTON, INPUT); digitalWrite(FRONT_DOOR_BUTTON, HIGH); digitalWrite(BACK_DOOR_BUTTON, HIGH); // After setting up the button, setup debouncer debouncerF.attach(FRONT_DOOR_BUTTON); debouncerB.attach(BACK_DOOR_BUTTON); debouncerF.interval(5); debouncerB.interval(5); // Make sure relays are off when starting up digitalWrite(FRONT_CHIME_RELAY, FRONT_CHIME_RELAY_OFF); digitalWrite(BACK_CHIME_RELAY, BACK_CHIME_RELAY_OFF); // Then set relay pins in output mode pinMode(FRONT_CHIME_RELAY, OUTPUT); pinMode(BACK_CHIME_RELAY, OUTPUT); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("2 Door Chime Sensor", "2.2"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_FRONT, S_MOTION); present(CHILD_ID_BACK, S_MOTION); present(CHILD_ID_MUTE, S_LIGHT); send(chimeMute.set(1)); } void loop() { unsigned long currentMillis = millis(); debouncerF.update(); debouncerB.update(); int valueF = debouncerF.read(); int valueB = debouncerB.read(); //Front Doorbell if ( ((unsigned long)(currentMillis - previousMillis) >= pestTimeout) && valueF != HIGH && CHIME_MUTE == 1) { digitalWrite(FRONT_CHIME_RELAY, FRONT_CHIME_RELAY_ON); send(frontDoorbell.set(1)); wait(50); digitalWrite(FRONT_CHIME_RELAY, FRONT_CHIME_RELAY_OFF); send(frontDoorbell.set(0)); previousMillis = currentMillis; } if ( ((unsigned long)(currentMillis - previousMillis) >= pestTimeout) && valueF != HIGH && CHIME_MUTE == 0) { send(frontDoorbell.set(1)); wait(50);; send(frontDoorbell.set(0)); previousMillis = currentMillis; } //Back Doorbell if ( ((unsigned long)(currentMillis - previousMillis) >= pestTimeout) && valueB != HIGH && CHIME_MUTE == 1) { digitalWrite(BACK_CHIME_RELAY, BACK_CHIME_RELAY_ON); send(backDoorbell.set(1)); wait(450); digitalWrite(BACK_CHIME_RELAY, BACK_CHIME_RELAY_OFF); send(backDoorbell.set(0)); previousMillis = currentMillis; } if ( ((unsigned long)(currentMillis - previousMillis) >= pestTimeout) && valueB != HIGH && CHIME_MUTE == 0) { send(backDoorbell.set(1)); wait(50); send(backDoorbell.set(0)); previousMillis = currentMillis; } } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.isAck()) { Serial.println("This is an ack from gateway"); } if (message.type == V_LIGHT) { // Change relay state CHIME_MUTE = message.getBool(); send(msg.set(CHILD_ID_MUTE, CHIME_MUTE?CHIME_ON:CHIME_OFF)); // Store state in eeprom saveState(CHILD_ID_MUTE, CHIME_MUTE); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
  • Battery operated Lux Sensor

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • 2xAA powered PIR

    2
    4 Votes
    2 Posts
    1k Views
    alexsh1A
    [image: 1467975977974-2016-07-08-11.51.06.jpg]
  • My 1AA battery sensor

    prototype powered battery low
    23
    4 Votes
    23 Posts
    21k Views
    jsiddallJ
    Looks like it has been a year or two now. Is it still going on the original battery?
  • Li-Ion current clamp sensor

    2
    0 Votes
    2 Posts
    1k Views
    thazlett144T
    Did you get anywhere with this in the end? This is something I would like to do also!
  • Energy pulse meter + outside temperature

    temp energy pulse me
    13
    5 Votes
    13 Posts
    11k Views
    M
    @NickBuilder I now have looked at the code and (of course) you are right, the interrupt is used for the pulse count which I think is the best way of programming this function. My sensor is based on an old version of this code but modified for use with Openhab (which does not give any start value back, this function has to be own programmed). Another modification is that same unit monitors a number of temperature sensors. The "thing" has been in operation since my first post above and works well but I guess I should make an effort to modernize the code. Maybe a task for the long and dull autumn/winter days here.
  • Watermeter Elster V200 PR6P:1

    16
    1 Votes
    16 Posts
    7k Views
    YveauxY
    @hek said: parts of the power meter example seems to have ended up in it. Especially the header :laughing:
  • MySensors nodes with Ethernet interface only

    6
    0 Votes
    6 Posts
    2k Views
    E
    Will this include nodes with ESP8266 modules too?
  • CC128 Node

    1
    1 Votes
    1 Posts
    697 Views
    No one has replied
  • Mini motion detector based on Biltema PIR LED

    3
    6 Votes
    3 Posts
    2k Views
    D
    And now everything is connected together. I had to change some values on the resistors. R6 = 10k and C4 = 10 nF gives 2.5 seconds ON time. I also changed the sensitivity from 4 s to 0.05 Seconds, I am considering changing this a bit to some greater value to increase the time some. [image: 1467401532879-20160701_211141_resized.jpg] I also need to do some changes to the Arduino board as the on led is always on and i think i should remove the regulator to save some more power. [image: 1467401646837-20160701_211414_resized.jpg]
  • Got another problem

    2
    0 Votes
    2 Posts
    603 Views
    L
    seems I have a problem with Domoticz and my ESP8266 Gateway. ![alt text]([image: 1467318176393-upload-a531d3d9-8450-411e-8e7f-7d9c73eb9449] image url)
  • Home Automation and monitoring

    mysensors arduino home automation
    1
    1 Votes
    1 Posts
    2k Views
    No one has replied
  • Coal or water level sensor

    2
    0 Votes
    2 Posts
    2k Views
    malukoM
    thanks romeak01 i have update with my sample, i think that will run ok. #include <MySensor.h> #include <SPI.h> //import MySensors library #define trigPin 6 #define echoPin 5 int max = 91; //distance (cm) from min water level to sensor int min = 6; // distance (cm) from max water level to sensor int procent; //distance percentage int ilosc; //amount of the tank as a percentage #define child_id_ilosc 1 //setting to identify the amount of water in the tank MySensor gw; MyMessage msgilosc(child_id_ilosc, V_IMPEDANCE); void setup() { pinMode(trigPin, OUTPUT); //Pin, that its connet to trig pinMode(echoPin, INPUT); //a echo, input gw.begin(); //launch MySensors library gw.sendSketchInfo("Water tank meter", "1.0"); gw.present(child_id_ilosc, S_WEIGHT); //present data to controller } void loop() { long czas, dystans, diferenca; digitalWrite(trigPin, LOW); delayMicroseconds(2); digitalWrite(trigPin, HIGH); delayMicroseconds(10); digitalWrite(trigPin, LOW); czas = pulseIn(echoPin, HIGH); dystans = czas / 58; diferenca = max -min; procent = (((dystans - min) * 100) / diferenca); ilosc = 100 - procent; gw.send(msgilosc.set(ilosc)); // send to controller delay(1000); // delay }```
  • Chinese Solar Lipo powered PIR led lamp.

    42
    1 Votes
    42 Posts
    27k Views
    ranseyerR
    @gyro Thanks for the Answer. Mine was produced in China too... Her the picture of the backside: [image: lamp4daul3.jpg] No connections, but a board name: YYGF-601L. I would be happy for any hints...
  • PIR faceplate

    5
    0 Votes
    5 Posts
    2k Views
    Mark JeffordM
    https://www.openhardware.io/view/4/EasyNewbie-PCB-for-MySensors Made up in China for about £10 Inc shipping I think Dirtypcbs is an awesome website :)
  • Soil Tensiometer Sensor Network

    arduino mysensor 1.4 nrf24l01+pa+lna
    39
    0 Votes
    39 Posts
    23k Views
    nervusvagusN
    following this thread loosely. I have the following sensors and they seem to be accurate to some degree: http://www.aliexpress.com/item/DFRobot-Capacitive-Analog-Soil-Moisture-Sensor-3-3-5-5V-Corrosion-Resistant-with-Gravity-3-Pin/32574020064.html?spm=2114.01010208.3.2.P99ddH&ws_ab_test=searchweb201556_0,searchweb201602_1_10037_10017_507_10033_10032_10040,searchweb201603_1&btsid=8d3b5e46-a069-441a-a1f7-491ae7e317e1 and they are much easier to work with Arduino compared to Watermark stuff. Anyone agree?
  • Slim Node 5V-Mod

    17
    2 Votes
    17 Posts
    6k Views
    badmannenB
    @Soloam Hello looks like a great board. Any progress on the Switch board? //Henrik
  • My First Gateway

    6
    4 Votes
    6 Posts
    3k Views
    masterkenobiM
    @korttoma, thanks for the advice. Now I understand better. I guess I will need to come up with version 2 for my gateway. I did go through the articles shared by @sundberg84 but it is too much reading for me. I find it hard for me to understand them base on my level of knowledge. Your summary helps me a lot.
  • This topic is deleted!

    3
    1 Votes
    3 Posts
    125 Views

19

Online

11.7k

Users

11.2k

Topics

113.1k

Posts