Skip to content

My Project

968 Topics 13.5k Posts

Show off and share your great projects here! We love pictures!

  • RELAY 433MHZ + KEYPAD 4x4 COMANDER (vera-domoticz)

    3
    0 Votes
    3 Posts
    6k Views
    Michel - ItM
    I have one better, but how to implement it in code mysensor?[image: Schematic-Keypad.png] . New Code > sketch + Library > https://codebender.cc/sketch:183503 Original Code #include <MyTransportNRF24.h> #include <MyHwATMega328.h> #include <MySensor.h> #include <SPI.h> #include <Wire.h> #include <RCSwitch.h> RCSwitch mySwitch = RCSwitch(); #define NODE_ID 165 #define NODE_VERSION "1.1" #define NODE_DESCRIPTION "MikRelay" #define NUMFLAKES 10 #define XPOS 0 #define YPOS 1 #define DELTAY 2 #define RADIO_TX_PIN 2 #define NUMBER_OF_RELAYS 11 // Total number of attached relays typedef struct { unsigned long address; unsigned char unit; bool dimmer; } MikParams; MikParams Mik_PARAMS[NUMBER_OF_RELAYS] = { {87311, 24, false}, {87500, 24, false}, {87491, 24, false}, {87359, 24, false}, {87539, 24, false}, {87548, 24, false}, {87536, 24, false}, {87356, 24, false}, {87503, 24, false}, {4011779, 24, false}, {4011968, 24, false} }; // NRFRF24L01 radio driver (set low transmit power by default) MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW); //MyTransportRFM69 radio; // Message signing driver (none default) //MySigningNone signer; // Select AtMega328 hardware profile MyHwATMega328 hw; // Construct MySensors library MySensor gw(radio, hw); void setup() { mySwitch.enableTransmit(RADIO_TX_PIN); // init done // Show image buffer on the display hardware. // Since the buffer is intialized with an Adafruit splashscreen // internally, this will display the splashscreen. // Initialize library and add callback for incoming messages gw.begin(incomingMessage, NODE_ID, false); delay(2000); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo(NODE_DESCRIPTION, NODE_VERSION); // Fetch relay status for (int sensor = 1; sensor <= NUMBER_OF_RELAYS; sensor++) { // Register all sensors to gw (they will be created as child devices) gw.present(sensor, S_LIGHT); } } void loop() { // Alway process incoming messages whenever possible gw.process(); } void incomingMessage(const MyMessage &message) { if ((message.sensor < 1) && (message.sensor >= NUMBER_OF_RELAYS)) { return; } if (message.type == V_LIGHT) { mySwitch.send(Mik_PARAMS[message.sensor - 1].address, Mik_PARAMS[message.sensor - 1].unit); // 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(", Miks: "); Serial.print(Mik_PARAMS[message.sensor - 1].address); Serial.print(", Miks: "); Serial.print(Mik_PARAMS[message.sensor - 1].unit); Serial.print(", New status: "); Serial.println(message.getBool()); } else if (message.type == V_DIMMER) { mySwitch.send(Mik_PARAMS[message.sensor - 1].address, Mik_PARAMS[message.sensor - 1].unit); } }``` I know that not everyone. but there is some kind soul can help me? I see you do not laugh!
  • 433Mhz Garage opener projects

    2
    0 Votes
    2 Posts
    2k Views
    HeinzH
    Hi, as a start you could modify the following sketch: remove the flamingo.h include and all flamingo related stuff. https://github.com/windkh/flamingoswitch/blob/master/examples/mysensors/FlamingoSwitchSensor.ino Have a look at the function incommingMessage line 196. Here the message from the gateway is received. Replace 230 with your own code.
  • MySensors Network at a High School Farm

    11
    8 Votes
    11 Posts
    8k Views
    bpairB
    And I just noticed the internet has been down at the greenhouse since early Saturday! More reason to have a local install.
  • Reinventing the motion controlled outside lamp

    3
    3 Votes
    3 Posts
    4k Views
    TheoLT
    I've recently modified the code a bit. Will post an update soon. The way a PIR motion sensor works, is that you can setup the duration of a detected movement by tweaking a potentionometer. That will determine the amount of time the PIR sensor will report back as a motion detection. In reality you know only one thing. There was at least one motion detected that triggered the motion pin of the PIR sensor. Between that period and that and the interval you've setup, there might have been a lot of movement but the PIR doesn't report that back. How I solved that is as follows. I turned the potentionometer to the lowest must interval duration. Whenever the first movement has been detected, it will report that to my Home Automation controller and it will start a timer that is 30 seconds after the detected motion. As my current motion detection interval of the PIR sensor is around 3 seconds, it will give me another 27 seconds to detect a follow up motion. If a follow up motion has been detected, it will reset the 30 second timer. So that has another 27 seconds the time to detect another motion. If however no motion has been detected when the 30 seconds timer times out, it will tell my home automation controller that there's no longer any motion. As most PIR sensors are quiet sensitive, they detect my presence by each small movement a wake. In most cases the movement caused by breathing is enough for the PIR sensor to detect my presence. Hope's this explains is. I've tried it in my best English ;-)
  • Solar (H2O) Shop Heater

    flow sensor solar heater pressure sensor
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Monitor a irrigation status

    2
    0 Votes
    2 Posts
    2k Views
    TD22057T
    Yes - but you have to protect the arduino from that high voltage. Best way is with a small optocoupler chip (I use EL817 chips which you can get for practically nothing). There is an excellent explanation in the first answer on this post on stackExchange. You may have to adjust the resistors because of the higher voltage. I've included the schematic below (it's a good idea to read the answer though).[image: lp5m2.png]
  • 'MySensoring' a Kidde Smoke Detector. (Completed)

    smoke detector
    30
    0 Votes
    30 Posts
    27k Views
    macieiksM
    Hello, If I want to use this code on Arduino Mega2560 with support of 4 smoke sensors only thing I need to do is to create "arrays" ? Regards, Maciek
  • Slim CR123A (2AA) battery node..

    motion sensor
    11
    4 Votes
    11 Posts
    11k Views
    ahmedadelhosniA
    @m26872 The link is helpful and I understand now. Thanks
  • 2 Votes
    9 Posts
    9k Views
    sundberg84S
    --- New question on this old post This node has started to behave strange. There is three sensors and lux is working 100% but DHT and LM393 stops working from time to time. It can suddenly stop sending these two values for 24 hours, and then they are back online again. Lux sensor works all the time. Havent bothered to do a serial log yet since its outside and working most of the time - but any thoughs anyone?
  • LED On & OFF Problem

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • 1 Votes
    56 Posts
    34k Views
    S
    @korttoma The only difference I see is that you put the entire url with parameters in the first argument of the http.request call and "run=run" as the second (don't know why you have that?). I use the base url as the first argument and the field list as the second r, s = http.request(baseUrl, "field1=XX&field2=XX") Hope that fixes the issue. Also You have to setup the "Channel" and "Plugin" in the website accordingly and name the fields there.
  • bluetooth instead of wifi

    7
    0 Votes
    7 Posts
    3k Views
    TmasterT
    This is a interesting discussion, despite there are no proves that wi-fi its not safe... wifi routers uses so low power that in 20 m and a wall,signal is gone. Myself already serched about problems on wifi ,before have wi-fi and use wireless arduinos(nrf24..) ,but know i think its senseless. before of all you shoud read how this "world" works. because compare nrf24l01 card with wifi is like compare a bicycle with a car... on temperature sensor for example ,each command activate the card for milisenconds and sleep again during 10 minutes (in my case). i guess put your head in to the sun makes more dammage and get more radiation thant this.... :)
  • 0 Votes
    5 Posts
    3k Views
    mfalkviddM
    Link to the PR in case someone wants to find it later: https://github.com/mysensors/Arduino/pull/261
  • mq-135 sensor Arduino code

    3
    0 Votes
    3 Posts
    11k Views
    epierreE
    tsss.... have a look here: http://forum.mysensors.org/topic/147/air-quality-sensor/ and here: https://github.com/empierre/arduino/blob/master/AirQuality-MQ135.ino
  • [contest] My Gateway

    18
    4 Votes
    18 Posts
    26k Views
    O
    @Newzwaver All hardware except 433MHz antenna is from MySensors "Store". I found the antenna on ebay and the box for everything is bought here in Sweden (http://www.kjell.com/se/sortiment/el/elektronik/elektroniklador/ventilerad-inbyggnadslada-95x135-mm-p89012)
  • My Shiny Gateway and Irrigation system sHiNyBoX! :P

    2
    7 Votes
    2 Posts
    2k Views
    blaceyB
    Great works - looks awesome! :+1: That said, you shouldn't need the extra coupling capacitor on the NRF24L01+ regulator because the coupling capacitor(s) are built in.
  • Controlling central heating, TV, lights and boiler over the internet

    5
    0 Votes
    5 Posts
    4k Views
    E
    @alexsh1 Many thanks Alexsh1 , I'm using ESP8266 chip with Arduino
  • Experimenting with cheap 433mhz gadgets

    10
    6 Votes
    10 Posts
    15k Views
    B
    Hello Dwalt ! thanks for your quick answer ! My remote is an old style Chacon with 8 buttons[image: Chacon-Télécommande-face.jpg] [This remote has a 4 positions dip switch on the back (group 1 2 3 4) so i plan to put my 4 wall plugs on group 1 and my remote on group 2; with that, the plugs will be commuted by the mysensors rf433 emitter and the remote will send codes to my receiver mysensors without communicating directly with plugs] And my receiver is a "cheap" one but i will have a sperheterodyne in a few days (according yours tests) To receive my codes i use RCswitch library and this code: #include <RCSwitch.h> * RCSwitch mySwitch = RCSwitch(); void setup() { Serial.begin(9600); mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2 } void loop() { if (mySwitch.available()) { output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol()); mySwitch.resetAvailable(); } } With this i can read rf433 codes on serial but it don't send in mysensors.. thanks for your help, i wil try to understand how to modify your code
  • Raspberry data to > Mysensoors/Vera

    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • Mapping your Personal Network

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied

15

Online

12.4k

Users

11.2k

Topics

113.4k

Posts