Skip to content

Hardware

Talk about fun sensor hardware, MCUs, PCBs and how to power your sensors here.
1.8k Topics 18.4k Posts
  • Help hacking a LED outdoor security light motion sensor

    8
    0 Votes
    8 Posts
    3k 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
    619 Views
    No one has replied
  • 230V power supply to Arduino

    67
    3 Votes
    67 Posts
    72k 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
    2k 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 :)
  • RF433 transistor/fet wanted

    7
    0 Votes
    7 Posts
    2k Views
    Boots33B
    @ericvdb said: The problem is that when powered with 12V, the transmitter does not see the 5V on the data pin as high. Then maybe you can try on 9v as @TimO has suggested, this may be close enough to register the highs and still give you the range boost needed. Otherwise it would seem you will need some form of line level shift circuit as @dbemowsk has shown. The only other option would be a 5v transmitter like the Dorji or similar
  • PCBs for battery based sensor

    5
    2 Votes
    5 Posts
    3k Views
    ileneken3I
    @jumping Consider this: https://www.aliexpress.com/item/1PCS-TP5000-4-2V-3-6V-1A-Lithium-Battery-Charging-Board-Charger-Module/32756803176.html?ws_ab_test=searchweb0_0,searchweb201602_2_10065_10068_10084_10083_10080_10082_10081_10060_10061_10062_10056_10055_10037_10054_10033_10059_10032_10078_10079_10077_10073_10096_10070_10052_423_10050_424_10051,searchweb201603_2&btsid=e6d6960b-1c4d-48ce-b291-cde58e005c58 It's not as cheap as a TP4056, but it allows you to choose between battery technologies.
  • HC-SR501 motion sensor

    31
    0 Votes
    31 Posts
    36k Views
    abmantisA
    @mrwomble Yeah, the issue was probably due to the battery getting discharged during the OTA update, since that keeps the radio awake for a long time. So, should we use a 3.3V step up converter for this sensor?
  • Need lower voltage from powersupply

    2
    0 Votes
    2 Posts
    849 Views
    Boots33B
    @Tore-André-Rosander depending on how many leds you are running you could just put a diode in series with the supply, that will drop the voltage by about .5v which should still be ok. The diode will need to be able to handle the load of your leds though
  • In wall - PCB, (AC to DC 5v)

    pcb inwall
    89
    9 Votes
    89 Posts
    71k Views
    sundberg84S
    @Ddawme - Hi! I suggest you read all the links in the project for example: http://forum.mysensors.org/topic/1607/safe-in-wall-ac-to-dc-transformers https://forum.mysensors.org/topic/4175/clearance-creepage-and-other-safety-aspects-in-mysensors-pcbs
  • Orange Pi Zero H2

    18
    0 Votes
    18 Posts
    8k Views
    dbemowskD
    Here are 2 pics of my setup. The first pic is just of the Orange Pi and my gateway. The gateway is connected through one of the serial ports on the Orange Pi's GPIO pins. It can't be seen in the pic, but the top USB plug is for the external hard drive that has the OS on it. [image: controller_gateway_1.jpg] This pic includes my USB hub. The thing in slot 3 of the hub is my 1-Wire interface. The breadboard was from some things I had set up on my old R-Pi setup. May still hook up that RTC module, not sure yet. [image: controller_gateway_2.jpg]
  • Battery powered sensor last 1 week

    29
    0 Votes
    29 Posts
    9k Views
    bjacobseB
    @sundberg84 Can I assume that you are using power to DHT22 via a FET or directly from Arduino pin, so you are controlling when the DHT22 is getting power/voltage? I personally think using a DHT22 that requires min 3.3 V is not a good option for battery device - but I understand it can be managed ;-) http://www.datasheetcafe.com/dht22-datasheet-pdf/ DHT22: [image: 1478973631527-dht22.png] My opinion is is use HTU21D instead since it can operate on a much lower battery voltage. Watch out, some breakout boards have a 3,3V voltage regulator, that is just using battery consumption and isn't needed when using Arduino 3.3V 1Mhz battery operated [image: 1478974582712-htu21d.png]
  • 9+A 5V power supply?

    9
    0 Votes
    9 Posts
    3k Views
    K
    Here are also some similar power supply and they ship really fast https://kutop.com/catalogsearch/result/?q=power+supply
  • RSSI and TX power of RFM69HW

    6
    0 Votes
    6 Posts
    4k Views
    fricklerF
    @scalz Thanks for the reply, that sounds great!
  • What is the best low frequency antenna I can get?

    6
    0 Votes
    6 Posts
    2k Views
    mfalkviddM
    @mk55 I have not seen any. https://www.adafruit.com/products/3077 has the radio module soldered on the same board as the mcu, but no sma.
  • 0 Votes
    2 Posts
    868 Views
    loiphinL
    No one have this problem?? Bueller... Bueller .... Bueller.... anyone?
  • What kind of sensor for my mailbox?

    7
    0 Votes
    7 Posts
    2k Views
    loiphinL
    http://www.ebay.com/itm/161806126324 I am going to use these magnetic switches on my postbox lid. Haven't got them yet, so cant say if they are any good or not.
  • Do I have to wire all grounds?

    2
    0 Votes
    2 Posts
    771 Views
    mfalkviddM
    @Chester one is enough. They are connected to each other on the pcb. You can verify this by putting a multimeter in continuity mode or resistance mode and measure the resistance between the two ground pads. The resistance should be zero.
  • Pro mini

    9
    0 Votes
    9 Posts
    3k Views
    petewillP
    @micah I have had this happen to a couple of mine too. It only takes a few times before I learned never to apply 12v to the raw pin :grimacing: I have been able to revive all of my pro minis by soldering on a new capacitor here: [image: 1478302518407-upload-0e34ea93-e569-4bda-a128-01f155ebb85e]

5

Online

11.8k

Users

11.2k

Topics

113.2k

Posts