Skip to content

My Project

Show off and share your great projects here! We love pictures!
961 Topics 13.4k Posts
  • Air Conditioning state monitoring sensor

    16
    5 Votes
    16 Posts
    6k Views
    Ivan ZI
    Good idea. Append IR control
  • Combine Relay Actuator (with button) and BinarySwitch examples?

    7
    0 Votes
    7 Posts
    5k Views
    Sander StolkS
    Well well well... I've got it working with 2 relays and 2 door sensors. See my sketch below! The problem is the relays which are configured by counting and adding up numbers and the child_id's for 1 button and the debouncer missing config in the skecth. With this sketch you can monitor 2 doors and 2 relays // Example sketch showing how to control physical relays. // This example will remember relay state even after power failure. #include <MySensor.h> #include <SPI.h> #include <Bounce2.h> #define RELAY_1 4 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 2 // Total number of attached relays #define RELAY_ON 0 // GPIO value to write to turn on attached relay #define RELAY_OFF 1 // GPIO value to write to turn off attached relay #define BUTTON_PIN_1 3 // Arduino Digital I/O pin for button/reed switch #define BUTTON_PIN_2 8 // Arduino Digital I/O pin for button/reed switch MySensor gw; Bounce debouncer_1 = Bounce(); Bounce debouncer_2 = Bounce(); int oldValue_1=-1; int oldValue_2=-1; MyMessage msgGK(BUTTON_PIN_1,V_TRIPPED); MyMessage msgGD(BUTTON_PIN_2,V_TRIPPED); void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Garagebox", "1.0"); // Fetch relay status for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) gw.present(sensor, S_LIGHT); // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF); } // Setup the doorsensor //pinMode(BUTTON_PIN,INPUT); // Activate internal pull-up //digitalWrite(BUTTON_PIN,HIGH); pinMode(BUTTON_PIN_1,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN_1,HIGH); pinMode(BUTTON_PIN_2,INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN_2,HIGH); // After setting up the button, setup debouncer //debouncer.attach(BUTTON_PIN); //debouncer.interval(5); debouncer_1.attach(BUTTON_PIN_1); debouncer_1.interval(5); debouncer_2.attach(BUTTON_PIN_2); debouncer_2.interval(5); // Register binary input sensor to gw (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. gw.present(BUTTON_PIN_1, S_DOOR); gw.present(BUTTON_PIN_2, S_DOOR); } // Check if digital input has changed and send in new value void loop() { // Alway process incoming messages whenever possible gw.process(); debouncer_1.update(); // Get the update value int value_1 = debouncer_1.read(); if (value_1 != oldValue_1) { // Send in the new value gw.send(msgGK.set(value_1==HIGH ? 1 : 0)); oldValue_1 = value_1; } debouncer_2.update(); // Get the update value int value_2 = debouncer_2.read(); if (value_2 != oldValue_2) { // Send in the new value gw.send(msgGD.set(value_2==HIGH ? 1 : 0)); oldValue_2 = value_2; } } void incomingMessage(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom gw.saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
  • Is this enough to get me started?

    12
    0 Votes
    12 Posts
    4k Views
    Moshe LivneM
    @Daniel-Lindberg go wire wrap! Its the future! :smile:
  • PhoneyTV for Vera is Here!

    34
    1 Votes
    34 Posts
    27k Views
    BulldogLowellB
    @5546dug said: Just a question, when in your code 3.1.1 you have a few scattered lines through out the declaration code with only // on these lines does it mean anything in particular ? Adding the "//" is only a personal preference of mine to use the comment marks rather than leaving a blank line. for me, with a certain text editor that I use, it is easier to edit and not inadvertently delete some curly brace and screw up my code! @5546dug said: your code worked 100% THANKS. happy to hear you are going now, sorry about the mixup.
  • Door, Motion and Temperature Sensor

    63
    0 Votes
    63 Posts
    42k Views
    CaptainZapC
    @ThomasDecock No I wasn't, I was able to get the standard dallas temperature working(because I thought the sensors no longer work), but unfortunately my time on this is pretty limited. I hoped I got it working until I go on vacation, but probably will look into it after. I would appreciate if someone could help with it, I think everyone would.
  • Two button light and fan switch

    2
    0 Votes
    2 Posts
    2k Views
    J
    here which power adapter you used?
  • Air conditioning/HVAC control - work in progress

    2
    2 Votes
    2 Posts
    2k Views
    hekH
    Nice hack. Incredible to get a LCD remote for $3 .
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    1 Views
    No one has replied
  • newby start his project

    4
    0 Votes
    4 Posts
    1k Views
    sundberg84S
    I made that some weeks aga. :) this is my sensor and maybe it can give you some inspiration. Good Lucy @csnij
  • Power strip with 4 sockets

    10
    2 Votes
    10 Posts
    5k Views
    Mohsin HassanM
    Hey Man! any progress on the buttons? Really looking forward to that so that i can start making one for myself as well. Cheers.
  • Voice controlled IR/RF blaster MySensors node

    2
    1 Votes
    2 Posts
    1k Views
    D
    We updated the code and now it possible not only to save learned raw codes on the sd card, but also to read and send Pronto codes that are stored on the sd card. :)
  • Battery Powered Emergency Sump

    3
    3 Votes
    3 Posts
    3k Views
    sowardS
    @ServiceXp I'm not sure. I looked around for similar devices almost a year ago, and didn't find any consumer grade chargers or monitors which had such, though there were a few commercial devices for the larger flooded cells which appeared to monitor the fluid level somehow. Some even monitored the specific gravity of the electrolyte, but I'm sure those cost more than several 'basement watchdogs. I suppose I could try to decode the simpler-looking circuit on the 'emergency' model and try to figure out what it was doing, but I think I've forgotten what little I actually learned in Circuits class back in college.
  • My generic room-senser (Sensebender with Motion and Light)

    16
    5 Votes
    16 Posts
    16k Views
    Moshe LivneM
    @mvader These are perfect for 2aa powered sensors although slightly ominous http://www.aliexpress.com/item/Dummy-Security-Camera-CCTV-Home-Dome-Camera-With-Red-Flashing-Light-Woshida/32317143038.html?spm=2114.32010308.4.11.8z1AAX they are basically empty. for 2.5$ you get a case, a battery holder and a clear dome.... Even a switch!!!! Best deal in the world.
  • Mysensored Garageport

    23
    2 Votes
    23 Posts
    13k Views
    tbowmoT
    Hmm.. firmware updates in the field are not that easy, when you have to stand on a ladder to do the update. Luckily I can place my laptop on the top of the wall, just under the roof in the barn. Maybe I should do something about OTA firmware updates.. On the other hand, then I wouldn't see that the controller went haywire, and tried to close an already closed port, which almost broke the chain drive for the port.. http://youtu.be/BSewn_sLYP8
  • Sprinkler Controller

    5
    4 Votes
    5 Posts
    6k Views
    SparkmanS
    @ServiceXp said: @Sparkman Well Done!! Thanks!
  • Door Bell usage detection / AirFlow usage detection/cutting

    9
    0 Votes
    9 Posts
    7k Views
    bjornhallbergB
    @epierre I'm afraid I haven't gotten around to it yet. Partly because I have my CCTV that automatically feeds me images of whoever has the misfortune of stepping on the porch and triggering the motion detection so I haven't been in any great hurry exactly. I have all the components around here somewhere though. Don't know if the ACS712 + logic level conversion is still the easiest approach or if we're over-complicating things here.
  • PC Power Switch

    14
    1 Votes
    14 Posts
    9k Views
    S
    pictures of the real thing [image: 1435509276281-img_20150628_172334.jpg] [image: 1435509281967-img_20150628_172512.jpg]
  • Home ventilation control

    5
    1 Votes
    5 Posts
    3k Views
    AWIA
    @Jan-Gatzke Make sure you order the snubberless version, I think it was with a W in the type number. I have now used the BTA24 (without W).
  • Serial Gateway Board

    7
    4 Votes
    7 Posts
    4k Views
    S
    Mk 2 box in white ABS, the lights don't look like the picture they are more distinct. [image: 1434747773387-img_20150619_215949.jpg]
  • Trying to do a 3 dimmer Led controller with motion

    6
    0 Votes
    6 Posts
    3k Views
    rvendrameR
    @DrJeff , I plan to document everything and post at the forum later, probably once I incorporate the IR emitter in my project. ;-) [image: 1434716611518-fqznyv7h8cvg9tk.medium.jpg] I forgot to mention the zero-cross detection (on pin2), you will need it if you dimm regular AC bulbs (doesn't matter how many dimmer channels you have, only one zero-cross is enough). The picture above show the zero-cross on top and one dimmer channel on bottom.

22

Online

11.7k

Users

11.2k

Topics

113.1k

Posts