Skip to content

Hardware

Talk about fun sensor hardware, MCUs, PCBs and how to power your sensors here.
1.8k Topics 18.3k Posts
  • Window / motion sensor: noob help on sketc

    3
    0 Votes
    3 Posts
    1k Views
    AWIA
    @tenaciousmetal I think something went wrong in combining the two sketches. You are instantiating (defining) two nodes in one sketch. What you should do is have one node, "gw" for example and define two children/sensors. I tried to make some changes in your sketch that should lead you in the right direction. (marked with "AWI", not tested there can be a few syntax errors) #include <MySensor.h> #include <SPI.h> unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds) #define SKETCH_NAME "Binary / Motion Sensor" #define SKETCH_MAJOR_VER "2" #define SKETCH_MINOR_VER "0" #define PRIMARY_CHILD_ID 4 #define PRIMARY_BUTTON_PIN 2 // Arduino Digital I/O pin for button/reed switch #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) #define INTERRUPT DIGITAL_INPUT_SENSOR-2 // Usually the interrupt = pin -2 (on uno/nano anyway) // initialize motion sensor MySensor gw; // Initialize motion message MyMessage msg(CHILD_ID, V_TRIPPED); //initialize window sensor (AWI: don't define the node twice) //MySensor sensor_node; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msg(PRIMARY_CHILD_ID, V_TRIPPED); void setup() { //sensor_node.begin(); (AWI: define the "gw" node here) gw.begin() ; // Setup the Window & Activate internal pull-ups pinMode(PRIMARY_BUTTON_PIN, INPUT_PULLUP); // Activate internal pull-ups (AWI: combined in previous definition) // digitalWrite(PRIMARY_BUTTON_PIN, HIGH); // Send the sketch version information to the gateway and Controller gw.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. gw.present(PRIMARY_CHILD_ID, S_DOOR); // gw.begin(); (AWI: no need for another begin) pinMode(DIGITAL_INPUT_SENSOR, INPUT); // sets the motion sensor digital pin as input // Register all sensors to gw (they will be created as child devices) gw.present(CHILD_ID, S_MOTION); } // 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 gw.sleep(5); value = digitalRead(PRIMARY_BUTTON_PIN); if (value != sentValue) { // Value has changed from last transmission, send the updated value gw.send(msg.set(value==HIGH ? 1 : 0)); sentValue = value; } // Read digital motion value boolean tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; Serial.println(tripped); gw.send(msg.set(tripped?"1":"0")); // Send tripped value to gw // Sleep until something happens with the window sensor (AWI: combine with other sleep) //sensor_node.sleep(PRIMARY_BUTTON_PIN-2, CHANGE, 0); // Sleep until motion interrupt comes in on motion sensor. Send update every two minute. gw.sleep(INTERRUPT, CHANGE, PRIMARY_BUTTON_PIN-2, CHANGE, SLEEP_TIME); }
  • 0 Votes
    3 Posts
    3k Views
    F
    @Oitzu Thanks. I have order an NRF with external antenna and will see if that helps
  • Arduino with built-in RF running on a single AA

    rfm69 arduino battery low-power
    5
    0 Votes
    5 Posts
    3k Views
    Michael MoebiusM
    Thanks again, learned a lot... I decide to give a try there, I also had a look on some components' datasheet and seems to be what I need... Let's see, if end up getting the boards I'll publish a review here later.
  • Why continue to use NRF24L01?

    17
    0 Votes
    17 Posts
    9k Views
    tbowmoT
    Another option, would be to go with rfm69.. It's sub gHz, so it would have longer range (Even compared to esp8266). Power consumption is equal to nrf24 (as far as I know).
  • How to solder FTDI Platinum so out voltage is 3.3

    3
    0 Votes
    3 Posts
    1k Views
    keldandorinK
    @tbowmo Thx, not easy :P
  • BOM for Sensenender Micro?

    2
    0 Votes
    2 Posts
    736 Views
    tbowmoT
    @tcontrada Must have forgotten all about it back then :) I've just added it to github, so please have a look again..
  • My look at a cheap 12V power supply

    9
    11 Votes
    9 Posts
    13k Views
    KoreshK
    Nice work. :+1: But I'm sure, it's too risky to use this power supply instead of HLK-PM01 (or other more or less "correct module"). Power supply without creepage barrier is scary. It's industrial standard, even for the cheapest solutions. But omitted suppresion XY capacitor - disaster. It could be the cause of many indeterminate bugs, becouse your device will be helpless before common-mode interference. Also I can recommend using X capacitor (X has less protection requirements than Y) in input of power supply if it doesn't contain it. To put it another way, it's not only the problem with EMI compatibility, it's the problem for your device stability.
  • Glass break sensor?

    18
    0 Votes
    18 Posts
    8k Views
    Rod MacPhersonR
    Yes, regardless of the source, always check the spec sheet and even take some measurements your self when you get it to be sure. You can use resistors as voltage dividers, or use optocouplers/relays, or even burn it off with a step down voltage regulator like an LM7805. You will need to supply ~12V to the sensor too, as that is what it is designed for in a burglar alarm system, so take that into account. This one says it will operate off 9V, but don't count on powering it long off a 9V square battery. :)
  • New nrf24l01+ smd

    39
    0 Votes
    39 Posts
    17k Views
    SweebeeS
    @Maciej-Kulawik removed the pull-up and they are all working fine :) Don't know why i have added it, in one of my oldest sketches i havent enabled it.
  • Long range barrier sensor

    2
    0 Votes
    2 Posts
    682 Views
    mfalkviddM
    The solutions discussed in http://forum.mysensors.org/topic/3257/simple-detector-that-detects-breaking-of-a-line/ might be something you can use?
  • How to connect 5V sensor to battery powered device?

    3
    0 Votes
    3 Posts
    1k Views
    A
    Thanks @AWI! A level converter is exactely what is needed.
  • Machanical lock sensor

    13
    0 Votes
    13 Posts
    3k Views
    bjacobseB
    I found those "authorized" and they are damn expensive http://hansenlellinge.dk/produkter/11-el-laase-og-tilbehoer/10423-effeff-slutblikskontakt-877/ http://hansenlellinge.dk/produkter/11-el-laase-og-tilbehoer/10408-assa-slutblikskontakt-82/
  • openHAB MQTT Ethernet Gateway & ESP-01?

    12
    0 Votes
    12 Posts
    4k Views
    AndyRooA
    Ok so I have an update: OpenHAB and MQTT are both up and running perfectly along with the Ethernet Gateway. :D Everything is talking to each other. Now, I want a ESP-01 on the Ethernet shield to send commands to other Arduinos with an ESP-1. I am able to send/receive data from MQTT and the Ethernet but I am not sure how to write the Gateway sketch to receive a command via Ethernet from MQTT and then to send it via WiFi ESP-01 to another Arduino with a WiFi ESP-01. Suggestions? I know it is possible somehow, but I just can't find anyone else who has done this. The ESP-01 is the cheapest and most accessible module, I really dont want to use anything else.
  • I know what I want but I don't know the hardware to get there.

    6
    0 Votes
    6 Posts
    1k Views
    hekH
    Yes, it is possible and has been done. Use the ESP-gateway example sketch in the development branch on github.
  • Another battery monitoring thread...

    9
    0 Votes
    9 Posts
    3k Views
    S
    @mfalkvidd, I'm glad it seems that I'm doing everything in theory and method correctly. Shows to myself that i have understood the principles properly. I think I'm correct in assuming/thinking the limitations are as I said in the previous post (post 4), however I would like a discussion regarding those to just confirm them so i know where and what i can do with this method of applying readVcc() to analogRead() to measure a voltage externally from the VCC line of the uC.
  • TCP service for Raspberry Pi NRF24l01 direct connection

    raspberry pi nrf24l01
    3
    2 Votes
    3 Posts
    2k Views
    jbjallingJ
    Firmware upload doesn't seem to work :-/ BR Jonas
  • 1 Votes
    41 Posts
    22k Views
    C
    @epierre I normally use a reflow oven and in your case I had to use a heat gun.
  • Housing for BH1750

    6
    0 Votes
    6 Posts
    3k Views
    27maximilian2
    Hey @dakky how did you progress in building the housing? I would be happy to hear (of course also see) about your experiences since I am planing something very similar.
  • Very narrow and minimal switch node - low power consumption experiment

    5
    5 Votes
    5 Posts
    2k Views
    AWIA
    -- revisited --- I changed the bootloader to a 8mHz version. As the processor runs 8 times as fast the active period pulse width is now < 0.5 ms (earlier 3.8 ms) The sleep and active consumption have not changed. This would reduce the 'pulse' burden on the coin cell as attentively mentioned by @scalz. [image: 1457896553952-upload-49f13d13-d4ed-46aa-8576-a47e5f271d2e] Something comparable to 'internal resistance' increases as the charge reduces. This will impact the available voltage for the node. I used a conservative figure for battery capacity (50mAh) and a load current of 0.8uA which will be less if battery voltage goes down. [image: 1457897897595-upload-dae13a0d-52ee-46c3-b470-425dd5a225a0] [image: 1457898169118-upload-60cbec3f-4bb1-480a-a7a8-d5077d6b3f92] Have three nodes ready for real life test with constant battery measurement. I hope to report just within five years from now :zzz:
  • Understanding Current Requirements

    1
    0 Votes
    1 Posts
    580 Views
    No one has replied

17

Online

11.7k

Users

11.2k

Topics

113.1k

Posts