Skip to content

Hardware

Talk about fun sensor hardware, MCUs, PCBs and how to power your sensors here.
1.8k Topics 18.3k Posts
  • dht11 CR2032 longevity

    21
    0 Votes
    21 Posts
    6k Views
    Nca78N
    @fhenryco I agree with you, I find it more simple to just remove the led. Cutting trace can lead to mistake (like you did on your first board) and there are a bunch of different promini clones, some might have traces using different paths than on the example.
  • Knock sensor keeps knocking. Alternative?

    4
    0 Votes
    4 Posts
    1k Views
    sundberg84S
    @edsteve - thanks for reporting back - it might help someone else in the future :) Great you solved it.
  • MH-Z14A CO2 sensor

    25
    0 Votes
    25 Posts
    17k Views
    korttomaK
    I finally found some time to really look in to this 562 issue. I looked at the raw data in DataMine2 and I noticed that the 562 value appeared every 10 minutes on the minute. [image: 1480571212918-dm_co2.jpg] Then I knew that this value cannot possibly come from the sensor. I search around in my Vera device for a bit and I found some lua code that copied the "Variable1" value from the sensor to the "CurrentLevel" every 10 minutes. Then I remembered that in the previous version of this sensor the value was reported via V_VAR1 and I had to copy it to another variable in Vera to be able to draw any graph. The current version of the sensor reports the value directly to the "CurrentLevel" variable and the value 562 that was still in the old variable was copied over the "real" value every 10 minutes. I also previously had some really low values from time to time from the sensor mostly when responseHigh = 1 and responseLow = negative value so I forced the responseLow to always be a positive value like this: int responseLow = abs((int) response[3]); I will keep an eye on the behavior of the sensor now that I have finally removed the confusing 562 value.
  • Battery Sensor with stepup and on/off transistor

    33
    1 Votes
    33 Posts
    21k Views
    abmantisA
    @n3ro Couldn't you power the step-up from one of the arduino's digital pins? Then set the pin to HIGH/LOW to power the sensor on/off? Maybe it draws too much power?
  • esp8266 to dht22

    7
    0 Votes
    7 Posts
    3k Views
    Jim DanforthJ
    @kimot Tried that. Ca't get domoticz to see the sensor.
  • Using gyros with mysensors?

    5
    0 Votes
    5 Posts
    1k Views
    tbowmoT
    @Cliff-Karlsson said: @tbowmo Like a "flex" sensor? Or loadcell? Like a flex sensor..
  • Arduino Micro suitable for use as MySensors node ?

    2
    0 Votes
    2 Posts
    1k Views
    hekH
    I think people are running MySensors on ATmega32U4 without any problems... I.e. @fleinze https://github.com/mysensors/MySensors/pull/378
  • Transmission issues, looking for ideas

    13
    0 Votes
    13 Posts
    3k Views
    M
    Juts to leave a record about the issue. I changed the GW radio module with a NRF24L01 + PA + LNA one, powered by the AMS1117 and the ugly fix. Everything seems to working fine now. Thank you to every one.
  • Serial gateway with NRF wireless + RS485 ??

    2
    0 Votes
    2 Posts
    984 Views
    hekH
    You'll have to use separate gateways.
  • Mysensors 2.0 + Relay, DHT, and PIR - No Relay

    6
    0 Votes
    6 Posts
    3k Views
    dbemowskD
    I did a similar project that is working well. Mine was powered all the time, so I didn't use the sleep code. The main reason I didn't was so that I could manually control the relay/light when there was no motion detected. It also allowed me to get continuous readings from the LDR so I could use that light level for other things if I ever wanted to. Here is a link to my project. https://forum.mysensors.org/topic/5243/driveway-motion-light . Maybe you can get some ideas from my code.
  • Ultra small ESP8266 node with 2 channel relay&temperature&dimmer Project

    1
    0 Votes
    1 Posts
    2k Views
    No one has replied
  • Help with hacking a wireless outdoor weather station

    24
    0 Votes
    24 Posts
    15k Views
    breimannB
    @Boots33 thanks that's really helpful info much appreciated. Now i need to decommission my Mega as my GW ready for RFlink and setup a new gateway.
  • How to mysensorise a new sensor via microUSB?

    9
    0 Votes
    9 Posts
    2k Views
    FotoFieberF
    There is an USB host shield: https://www.circuitsathome.com/arduino_usb_host_shield_projects/ This could be a solution.
  • Sample: ESP gateway with sensor

    2
    0 Votes
    2 Posts
    1k Views
    AWIA
    @gloob I only commented out my network id/ passw/ and ip config A counter is included ;-) /** * 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 1.0 - Henrik EKblad * Contribution by a-lurker and Anticimex, * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de> * Contribution by Ivo Pullens (ESP8266 support) * * DESCRIPTION * The EthernetGateway sends data received from sensors to the WiFi link. * The gateway also accepts input on ethernet interface, which is then sent out to the radio network. * * VERA CONFIGURATION: * Enter "ip-number:port" in the ip-field of the Arduino GW device. This will temporarily override any serial configuration for the Vera plugin. * E.g. If you want to use the defualt values in this sketch enter: 192.168.178.66:5003 * * LED purposes: * - To use the feature, uncomment any of the MY_DEFAULT_xx_LED_PINs in your sketch, only the LEDs that is defined is used. * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or recieve crc error * * See http://www.mysensors.org/build/esp8266_gateway for wiring instructions. * nRF24L01+ ESP8266 * VCC VCC * CE GPIO4 * CSN/CS GPIO15 * SCK GPIO14 * MISO GPIO12 * MOSI GPIO13 * GND GND * * Not all ESP8266 modules have all pins available on their external interface. * This code has been tested on an ESP-12 module. * The ESP8266 requires a certain pin configuration to download code, and another one to run code: * - Connect REST (reset) via 10K pullup resistor to VCC, and via switch to GND ('reset switch') * - Connect GPIO15 via 10K pulldown resistor to GND * - Connect CH_PD via 10K resistor to VCC * - Connect GPIO2 via 10K resistor to VCC * - Connect GPIO0 via 10K resistor to VCC, and via switch to GND ('bootload switch') * * Inclusion mode button: * - Connect GPIO5 via switch to GND ('inclusion switch') * * Hardware SHA204 signing is currently not supported! * * Make sure to fill in your ssid and WiFi password below for ssid & pass. */ // Enable debug prints to serial monitor #define MY_DEBUG // Use a bit lower baudrate for serial prints on ESP8266 than default in MyConfig.h #define MY_BAUD_RATE 9600 // Enables and select radio type (if attached) #define MY_RADIO_NRF24 #define MY_RF24_CHANNEL 83 // radio channel, default = 76 //#define MY_RADIO_RFM69 #define MY_GATEWAY_ESP8266 #define MY_ESP8266_SSID "<your SSID" #define MY_ESP8266_PASSWORD "<your passw>" // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) #define MY_IP_ADDRESS 192,168,2,120 // If using static ip you need to define Gateway and Subnet address as well #define MY_IP_GATEWAY_ADDRESS 192,168,2,254 #define MY_IP_SUBNET_ADDRESS 255,255,255,0 // The port to keep open on node server mode #define MY_PORT 5003 // How many clients should be able to connect to this gateway (default 1) #define MY_GATEWAY_MAX_CLIENTS 2 // Controller ip address. Enables client mode (default is "server" mode). // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 68 // Enable inclusion mode #define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway // #define MY_INCLUSION_BUTTON_FEATURE // Set inclusion mode duration (in seconds) #define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button #define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period // #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Flash leds on rx/tx/err // Led pins used if blinking feature is enabled above //#define MY_DEFAULT_ERR_LED_PIN 16 // Error led pin //#define MY_DEFAULT_RX_LED_PIN 16 // Receive led pin //#define MY_DEFAULT_TX_LED_PIN 16 // the PCB, on board LED #if defined(MY_USE_UDP) #include <WiFiUdp.h> #endif #define NODE_TXT "AWI_ESP 120" // Text to add to sensor name #include <ESP8266WiFi.h> #include <MySensors.h> unsigned long SLEEP_TIME = 10000; // Sleep time between reports (in milliseconds) #define CHILD_ID 1 // Id of the sensor child #define CHILD_ID2 2 // Id of the sensor child //#define LED_GREEN 12 //#define LED_BLUE 13 #define LED_RED 16 //#define ADC A0 // Initialize message MyMessage msg(CHILD_ID, V_PERCENTAGE); MyMessage msg2(CHILD_ID2, V_TEXT); int messageCounter = 0 ; // Count the outgoing messages for validation (0..99) void setup() { delay(1); } void presentation() { // Present locally attached sensors here // Send the sketch version information to the gateway and Controller sendSketchInfo(NODE_TXT, "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID, S_DIMMER, NODE_TXT " dimmer"); present(CHILD_ID2, S_INFO, NODE_TXT " text"); } void loop() { // Send locally attached sensors data here send(msg.set(messageCounter)); // Send message to gw messageCounter = ++messageCounter % 100 ; // wrap send(msg2.set("Hallo")); // Send message to gw // Send update every SLEEP_TIME wait(SLEEP_TIME) ; } void receive(const MyMessage &message) { // messages from node or controller //char printBuf[40] ; //Serial.print(message.getInt()); //sprintf(printBuf, "Message node: %d %d OK\n", message.sender, message.getInt()); } //Serial.print(printBuf) ; //sprintf(printBuf, "Messages: %d Errors: %d\n", messageCounter, messageErrorCounter); //Serial.print(printBuf) ;
  • Help hacking a LED outdoor security light motion sensor

    8
    0 Votes
    8 Posts
    2k Views
    breimannB
    @AWI i've since done some more work on this and discovered the switched 3.95v didn't share a common ground with the rest of the circuit. So i ended up hooking up a DIL reed relay PRMA 0105 (5v) onto it, and used the relay contacts to connect to pin D3 on my nano. So i've got it operating that whenever the motion sensor is tripped it toggles my 1 channel relay board, but what isn't working is being able to manually switch it from in domoticz. Would someone be able to take a look at my code which i've taken from this thread My code is: /* DESCRIPTION Sketch for 1x relay with buttons bistable. After back power all relays set OFF and send correct status OFF to controller. */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 // Enabled repeater feature for this node #define MY_REPEATER_FEATURE #include <SPI.h> #include <MySensors.h> #include <Bounce2.h> // Define Relays #define RELAY_ON 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay // Define Sensor ID's #define SSR_A_ID 1 // Id of the sensor child // Define buttons and relays const int buttonPinA = 3; const int relayPinA = 4; // Define Variables int oldValueA = 0; bool stateA = false; int trigger = 0; Bounce debouncerA = Bounce(); MyMessage msgA(SSR_A_ID, V_STATUS); void setup() { pinMode(buttonPinA, INPUT_PULLUP); // Setup the button Activate internal pull-up // After setting up the buttons, setup debouncer debouncerA.attach(buttonPinA); debouncerA.interval(5); // Make sure relays are off when starting up digitalWrite(relayPinA, RELAY_OFF); // Then set relay pins in output mode pinMode(relayPinA, OUTPUT); /*--------------------- Added these lines for toggle switch-------------------------*/ oldValueA = digitalRead(buttonPinA); // set oldValueA to the current status of the toggle switch // send(msgA.set(false)); // Send off state for relayA to ensure controller knows the switch is off // send(msgB.set(false)); // Send off state for relayB to ensure controller knows the switch is off } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relay with Bistable", "1.1"); // Register all sensors to gw (they will be created as child devices) present(SSR_A_ID, S_LIGHT); } /* Example on how to asynchronously check for new messages from gw */ void loop() { if (trigger == 0){ send(msgA.set(false)); // Send off state for relayA to ensure controller knows the switch is off trigger = 1; } debouncerA.update(); // Get the update value int valueA = debouncerA.read(); if (valueA != oldValueA) { // send(msgA.set(stateA ? false : true), true); // Send new state and request ack back send(msgA.set(stateA ? false : true), false); // Send new state with no request for ack stateA = stateA ? false : true; // invert the state digitalWrite(relayPinA, stateA ? RELAY_ON : RELAY_OFF); // toggle the relay oldValueA = valueA; } } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type == V_STATUS) { switch (message.sensor) { case 1: stateA = message.getBool(); digitalWrite(message.sensor + 4, stateA ? RELAY_ON : RELAY_OFF); break; case 2: break; } // Write some debug info Serial.print("Incoming change for sensor:"); Serial.println(message.sensor); Serial.print("from node:"); Serial.println(message.sender); Serial.print(", New status: "); Serial.println(message.getBool()); } }
  • RFM69CW Continuous Mode

    2
    0 Votes
    2 Posts
    1k Views
    scalzS
    Hello For answering to pins connection in continuous mode i think you can connect it to the pins you want, and poll or irq. But, RFM69 driver for Mysensors uses Packet Mode. not Continuous mode.
  • AC dimmer

    1
    0 Votes
    1 Posts
    571 Views
    No one has replied
  • 230V power supply to Arduino

    67
    3 Votes
    67 Posts
    69k Views
    crocC
    @axillent thanks and what is the smd coil that you use?
  • conecting the radio module on a MEGA 2560 ?? !!

    15
    0 Votes
    15 Posts
    4k Views
    hekH
    @samdel said: how do you measur the noisyness Empirically, I just couldn't get it working.
  • AC dimmer for 230v with smd relays

    2
    0 Votes
    2 Posts
    1k Views
    J
    Hello, Theese relays is already with triacs. You could look at themes in here: https://forum.mysensors.org/topic/4020/controlling-an-inductive-ac-load/2 ...and here: https://forum.mysensors.org/topic/3238/ac-light-dimmer-with-2x-triac There is discusion about it, and also shematics. Check it :)

26

Online

11.7k

Users

11.2k

Topics

113.1k

Posts