Skip to content

My Project

Show off and share your great projects here! We love pictures!
961 Topics 13.4k Posts
  • Count car-starts

    47
    0 Votes
    47 Posts
    13k Views
    F
    Version 1.13 changed to fixed NODE_ID // Made by Daniel Nilsson // Tested with Domoticz 3.5721 // 2016-12-10 #include <SPI.h> #include <MySensor.h> #define CHILD_ID 0 // Id of the sensor child #define NODE_ID 7 // a number or AUTO to let controller assign #define SKETCH_NAME "Car start counter" // Change to a fancy name you like #define SKETCH_VERSION "1.13" // Your version int Controller; // Current start counts from Controller, like Domoticz boolean pcReceived = false; // If we have recieved the start counts from Controller or not int starts; // summary of all starts to be sent to Controller int eeprom; // start counts read from/to be stored in EEPROM MySensor gw; MyMessage volumeMsg(CHILD_ID,V_RAIN); MyMessage lastCounterMsg(CHILD_ID,V_VAR1); void setup() { pinMode(3,OUTPUT); delay(2*45000); // Allow time if USB/cigarette plug is powered before you turned the key digitalWrite(3,HIGH); delay(300); digitalWrite(3,LOW); delay(300); digitalWrite(3,HIGH); delay(300); digitalWrite(3,LOW); //Begin gw.begin(incomingMessage, NODE_ID, false); // Send the Sketch Version Information to the Gateway gw.sendSketchInfo(SKETCH_NAME, SKETCH_VERSION); // Register this device as Rain sensor (will not show in Domoticz until first value arrives) gw.present(CHILD_ID, S_RAIN); Serial.println(""); eeprom = gw.loadState(0); // read EEPROM Serial.print(eeprom); // print EEPROM Serial.println(" starts have not been sent"); Serial.println("add 1 start"); Serial.print(eeprom); Serial.print("+1="); eeprom = eeprom + 1; Serial.println(eeprom); gw.saveState(0,eeprom); // store to EEPROM at position 0 Serial.println(""); Serial.println("Startup completed"); } void loop() { //See if we have the start counts from Controller - and ask for it if we dont. if (!pcReceived) { Serial.println("Request start counts"); gw.request(CHILD_ID, V_VAR1); gw.wait(1000); return; } Serial.println(""); eeprom = gw.loadState(0); // read EEPROM Serial.print(eeprom); Serial.println(" starts have not been sent"); Serial.print(Controller); Serial.println(" starts from Controller"); starts = Controller + eeprom; // total starts Serial.print(eeprom); Serial.print("+"); Serial.print(Controller); Serial.print("="); Serial.println(starts); Serial.print("Send "); Serial.print(starts); Serial.println(" to Controller"); Serial.println(""); if (!resend((volumeMsg.set(starts)), 6))return; if (!resend((lastCounterMsg.set(starts)), 6)) return; Serial.println(""); Serial.println("store 0 to EEPROM"); gw.saveState(0,0); // set 0 start to EEPROM, all have been sent Serial.println("sleep"); // mission accomplished digitalWrite(3,HIGH); delay(900); digitalWrite(3,LOW); while(1){} } // check if "st:fail" during gw.send, thanks n3ro bool resend(MyMessage &msg, int repeats) { int repeat = 1; boolean sendOK = false; int repeatdelay = 2000; while ((sendOK == false) and (repeat < repeats)) { if (gw.send(msg)) { sendOK = true; } else { sendOK = false; Serial.print("Error "); Serial.println(repeat); } repeat++; delay(repeatdelay); } if (sendOK == false && repeat == repeats){ return false; } return true; } //Read if we have a incoming message. void incomingMessage(const MyMessage &message) { if (message.type==V_VAR1) { Controller = message.getULong(); pcReceived = true; Serial.print("Received start counts from Controller: "); Serial.println(Controller); } }
  • Home ventilation filter status - Pressure sensor MPX2010DP

    2
    0 Votes
    2 Posts
    2k Views
    m26872M
    @mikee You would want the MPX5010DP instead to get a 5V analog output for Arduino ADC, but still - to detect increased filter pressure drop I'd say you'll need 10Pa resolution. With MPX5010DP you'll get 10kPa/1024=9.75, i.e. OK. I guess you'd be able to detect something despite the noise, but not an early warning or trending. (You would want a 0..1kPa range sensor or something instead to do that. I don't now which one.) Give it a try and please report back! If you search the internet for "arduino MPX2010DP" you'll find a few projects measuring water level.
  • Understanding combined sketch

    3
    0 Votes
    3 Posts
    1k Views
    fernando alvarez buyllaF
    @mfalkvidd thanks mate that's exactly what I need
  • My best nRF24L01+PA+LNa node (gateway/ repeater) so far

    14
    3 Votes
    14 Posts
    9k Views
    F
    Now it is working extremely much better, I have 8 days in a row without any errors. I think this is how it should be.
  • humidity sensor value

    hardware
    1
    0 Votes
    1 Posts
    761 Views
    No one has replied
  • gw.sleep on battery powered magnet door switch

    42
    0 Votes
    42 Posts
    13k Views
    slingS
    @siod new observation: I have two temp nodes with red Htu21d in them. One keeps locking up randomly. Have to go outside and reset the arduino. I'll try another sensor today and see if it fixes things. Have completely rebuild the node twice now with new parts except the sensor.
  • Selecting a motor

    8
    1 Votes
    8 Posts
    3k Views
    breimannB
    @stefaanv Hi there, how is your coup going now? I've just pulled down an old kids cubby house at a friend who is moving, and put it back up on our farm. So I'm getting ready to build my auto doors etc.
  • [contest] My 4-in1 LED-dimmer/motion/temp-hum sensor

    contest
    9
    5 Votes
    9 Posts
    17k Views
    Fat FlyF
    Small question. I want to try this but some errors. Library is installed with library manager. Ubuntu 16.04 and last Arduino ide. First try IDE not find library and i change in line 29 #include <MySensor.h> to #include <MySensors.h> add only s and then this error. motion_dht22_led_dimmer:44: error: 'MySensor' does not name a type MySensor gw(9,10);
  • How to use a scrolling display board

    11
    0 Votes
    11 Posts
    4k Views
    dbemowskD
    @Sparkman said: I think they likely accomplish by mixing 3 colors That is how most if not all RGB LEDs work. Using PWM on the red, green and blue LEDs is how you achieve the different colors. I could probably have more than just the 2 colors if I can find a way to mix the 2 colors using PWM, but that might be a bit much for a nano to handle with all of the display multiplexing going on.
  • Weather station (the easy way)

    1
    4 Votes
    1 Posts
    2k Views
    No one has replied
  • LG TV controller

    25
    15 Votes
    25 Posts
    21k Views
    tbowmoT
    @dbemowsk Just an idea, use a dimmer in domoticz for the volume, when you receive a value from the controller, then send VOLM and the value.. There is no need for the controller to know how to set the volume (the VOLM command) For IR commands, that's probably another story, Haven't looked that much into it (yet).. Right now I have a logitech harmony elite, integrated with domoticz, so that I (from domoticz) can turn on different scenes.. But I can not send an individual command to the tv, or the radio..
  • Mysensor-ing a Roomba vacuum cleaner.

    15
    0 Votes
    15 Posts
    6k Views
    M
    Take a look to this.
  • No ID assigned by gateway.

    dimmer domoticz ac 220v
    7
    0 Votes
    7 Posts
    3k Views
    Suresh MaliS
    After filding around a lot with the MySensor2.0 lib and spending my whole weekend, when I could not get things going I finally switched back to MySensors1.5.4. After that I made quick progress and my node was on network. Here is the link below of a working Dimmer node. https://www.youtube.com/embed/N_Zx1xARwtM
  • RFM69HW temp-humidity node

    64
    7 Votes
    64 Posts
    21k Views
    NeverDieN
    With the BME280 voltage regulator removed, I powered it stand-alone using a 3.3V bench power supply. Using Dave Jones's uCurrent in conjunction with a Fluke 87V multimeter, I measure the standby current at a mere 155 nanoamps. I had planned to power it from pins on the atmega328p and then powering it down between measurements, but at 155na I'm not sure it even matters, provided it's being powered from a battery. :smile: On the other hand, if the entire mote is being powered from a capacitor that's charged from solar energy that's harvested from only weak ambient indoor light.... I guess in that scenario it might depend on the relative leakage rate of the capacitor that's used for the mote's energy storage as to whether or not it's worth fussing about.
  • Cheap Asda USB charger + Sensor node

    4
    1 Votes
    4 Posts
    2k Views
    thazlettT
    So I got another one of these and made a motion sensor version :-) [image: USMjwcCX3i0XJU8L-DnNu8CshXpRLDpMfxlDSmUgNvA-xoONFXf79MQ0T28SlvlSCZ2H6WfKGb_K2QsHSoPBSuBnJPhhQelgf2-DNrJb_0FN8j6sYv7vbI2oZ792D_pZZ-IdOT0kv1oDVzT2pZ3qTQ7c7U7Qm9YX3ZyDyBx6vLWsxnxBGpeUP2t_NyZ6NOErF8jcLWr3CeofpnExoH6a6bEGz7sfbKIkMIlk6Kype1mq862fSUe_3eieFaiEnbrW-SnD-WMaoK_sQxpgfgKP9dFKZBxjEiL56Csr7fzEH_MK0_lykDX7-aBljVoD_sNk07Pqe8Q8yvc8ZPL7ARgOR-u3-G6mnPdvLyJhzPb36ipHd3rxlsXWIgGxXqRIKjiDVnfj4MnLKe7JZg-zs0hJmb9ufsg59RTb5LxcYn_BvGI_cHevevzj0Ooc4zzKUv9fQbW0NsUMfYTfKQXdylhrINVyKMQm7VCOUygL4mxB1rZ9UMI9pIBKjkfzfHTh7PPPnbyPV5EbRfKNbE3Fl99-ktLzpzbWURduohh-tnZ1MmhDNck81jawKQ5LYU1CTIxxxdSkzeMLhNpjIzi74y3chv9CYzuYaM3ldEqcEVUsc5seUhVnVQ=w785-h589-no] I was thinking about making a multi sensor version of this. I have the sketches for many combinations of multi sensor sketches I have mashed together.
  • RFID v2

    12
    0 Votes
    12 Posts
    4k Views
    J
    @fleshfear: ok got it also working. Thanks. mine works with 3.3V and 5V
  • Window Blinds

    3
    0 Votes
    3 Posts
    2k Views
    ramoncarranzaR
    @hek Thank you
  • How can I get Arduino working even it can not connect with Gate Way?

    4
    1 Votes
    4 Posts
    1k Views
    LukasppL
    Dear friend, Thanks Nca78. I will wait or the new release. Best regards
  • Multisensor PIR and Lux

    2
    3 Votes
    2 Posts
    3k Views
    T
    Hey Kcest Nice work! Can you help me if I would like two PIR sensors in the same sketches. thank you in advance, Tom
  • Analog power meter reading TCRT 5000

    7
    0 Votes
    7 Posts
    3k Views
    karlheinz2000K
    I use digital output. The R&C modification works only with digital output.

19

Online

11.7k

Users

11.2k

Topics

113.1k

Posts