Skip to content

Hardware

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

    6
    0 Votes
    6 Posts
    5k Views
    T
    I am not sure, I bought some relays from Ebay. If I use the MySensors 433RF Sketch, the receiver recognises the remotes. /* * This sketch demonstrates how to use InterruptChain to receive and * decode remote switches (old and new) and remote sensors. * * Basically, this sketch combines the features of the ShowReceivedCode * and ShowReceivedCodeNewKaku examples of RemoteSwitch and the * ThermoHygroReceiver of RemoteSensor all at the same time! * * After uploading, enable the serial monitor at 115200 baud. * When you press buttons on a 433MHz remote control, as supported by * RemoteSwitch or NewRemoteSwitch, the code will be echoed. * At the same time, if data of a remote thermo/hygro-sensor is * received, as supported by RemoteSensor, it will be echoed as well. * * Setup: * - connect a 433MHz receiver on digital pin 2. * * * MySensor note: This example has not yet been adopted but can be used as an example * of receiving 433Mhz stuff. * * One idea could be to echo received 433 codes back to gateway to be able to pick up and * handle data over there. * */ #include <RemoteReceiver.h> #include <NewRemoteReceiver.h> #include <SensorReceiver.h> #include <InterruptChain.h> void setup() { Serial.begin(115200); // Interrupt -1 to indicate you will call the interrupt handler with InterruptChain RemoteReceiver::init(-1, 2, showOldCode); // Again, interrupt -1 to indicate you will call the interrupt handler with InterruptChain NewRemoteReceiver::init(-1, 2, showNewCode); // And once more, interrupt -1 to indicate you will call the interrupt handler with InterruptChain SensorReceiver::init(-1, showTempHumi); // On interrupt, call the interrupt handlers of remote and sensor receivers InterruptChain::addInterruptCallback(0, RemoteReceiver::interruptHandler); InterruptChain::addInterruptCallback(0, NewRemoteReceiver::interruptHandler); InterruptChain::addInterruptCallback(0, SensorReceiver::interruptHandler); } void loop() { // You can do other stuff here! } // shows the received code sent from an old-style remote switch void showOldCode(unsigned long receivedCode, unsigned int period) { // Print the received code. Serial.print("Code: "); Serial.print(receivedCode); Serial.print(", period: "); Serial.print(period); Serial.println("us."); } // Shows the received code sent from an new-style remote switch void showNewCode(NewRemoteCode receivedCode) { // Print the received code. Serial.print("Addr "); Serial.print(receivedCode.address); if (receivedCode.groupBit) { Serial.print(" group"); } else { Serial.print(" unit "); Serial.print(receivedCode.unit); } switch (receivedCode.switchType) { case NewRemoteCode::off: Serial.print(" off"); break; case NewRemoteCode::on: Serial.print(" on"); break; case NewRemoteCode::dim: Serial.print(" dim level "); Serial.print(receivedCode.dimLevel); break; case NewRemoteCode::on_with_dim: Serial.print(" on with dim level "); Serial.print(receivedCode.dimLevel); break; } Serial.print(", period: "); Serial.print(receivedCode.period); Serial.println("us."); } // Shows the received sensor data void showTempHumi(byte *data) { // is data a ThermoHygro-device? if ((data[3] & 0x1f) == 0x1e) { // Yes! byte channel, randomId; int temp; byte humidity; // Decode the data SensorReceiver::decodeThermoHygro(data, channel, randomId, temp, humidity); // Print temperature. Note: temp is 10x the actual temperature! Serial.print("Temperature: "); Serial.print(temp / 10); // units Serial.print('.'); Serial.println(temp % 10); // decimal } }
  • nRF24LE1 full controller to control devices and sensors reading!!

    18
    0 Votes
    18 Posts
    12k Views
    AnticimexA
    They also make a slightly fatter module with USB: http://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24LU1P This puppy does come in 32Kb flash variant.
  • 0 Votes
    18 Posts
    5k Views
    C
    @PotatoBattery You have probably already found the solution for your issue, but for the sake of variety, here is my take on the matter. [image: upload-41343723-da07-492a-ad92-a2c3f45a7bfa.jpg] The battery is a generic lithium phone battery, 2300mAh in this case. The solar cell is a 5,5V, 30mAh one. It is enclosed in resin. The battery charger is a 1A lithium charger with battery protection. I've replaced the programming resistor with a 10k, to better suit the solar cell output current capabilities. The battery gets 15mA, on a sunny day. All the components are from eBay. And you can buy the Arudino board here, on mysensors.org. [image: upload-0709f7e6-73c0-4276-bde9-64bc76a97947.jpg] Everything fit perfectly. [image: upload-87599f77-07ab-4173-9a25-8463fd73875a.jpg]
  • Video - "Getting Started with the nRF24L01 Transceiver"

    nrf24l01
    1
    0 Votes
    1 Posts
    1k Views
    No one has replied
  • TX RX ERR - LED for Sensors

    9
    0 Votes
    9 Posts
    5k Views
    AWIA
    I use something similar mainly to show if messages are received. For this purpose I created a small class/ library to blink and time LED's. The class uses a similar syntax as Bounce2 for assigning and handling LED's attached to output pins. LedFlash. A code example: https://codebender.cc/sketch:85200
  • Small Mosfet transistor to high power Mosfet driver

    1
    1 Votes
    1 Posts
    1k Views
    No one has replied
  • Amazon place to buy parts

    store
    4
    0 Votes
    4 Posts
    2k Views
    hekH
    @Trixcomp said: 10-Best-Electronics-Suppliers What's best... for who? US residents? ;) Naa. we've cannot just focus on US when it comes to parts. And I'm from Sweden actually. Last month visits: [image: upload-e3df2c90-e430-4c86-897b-4daa18971642.png] [image: upload-81fb3c4e-030c-4857-a573-55ff4bc0711a.png]
  • External power supply to radio

    14
    0 Votes
    14 Posts
    9k Views
    gigiG
    @ServiceXp said: I just can't believe that the display, rfm12b and NRF24 on the same 3.3v rail is under 50ma,... not too mention the other stuff on it.. You could try disconnecting everything except the NRF24 and see what happens? I can't even get my NRF24's to work with the shop's listed boost with the Pro Mini attached without a 'massive' capacitor. I tried to put a separate power supply. General supply 5V 2 Amps. I do not have the controller and I put two arduino nano for 3.3 volts [image: upload-b4d19d21-af78-4ed4-b9fd-952020dc766d.jpg] after 2 hours the system crashes. if I put only one of the two radio system is fine. I tried it with a standalone with two radio but without a monitor and the system works perfectly!!! I have to put other capacitors? Thank
  • PCB Prototype Machine

    8
    0 Votes
    8 Posts
    3k Views
    greglG
    @blacey said: So many toys, so little time ;) ...and money....
  • Leapmotion

    10
    0 Votes
    10 Posts
    3k Views
    hekH
    @Johnny-B-Good We have to wait for the standalone version. :)
  • Hardware debugging

    1
    1 Votes
    1 Posts
    745 Views
    No one has replied
  • MQTT Gateway and Relay Status

    6
    0 Votes
    6 Posts
    3k Views
    X
    @hek It works to have a feedback from the sensor, but this doesn't give a status if someone acts on the relay manually. BTW I've tested a similar approach. I send from the sensor a custom variable with the status of the relay. @gadu This is the best approach. This could handle the status of the relay even if manual activated. The return of the signal always give us the relay position. But it needs a different dual stepper relay. I'll try this as well soon. Thanks a lot to all! Simon
  • One way on how to reuse 433MHZ alarming sensors for Mysensors

    5
    1 Votes
    5 Posts
    4k Views
    axillentA
    i see a bug, been without a motion events for a while it is stop working at the same time it can work for a while in case of motion events hmm... fix needed but it is just a prototype. I plan to support 4-6 types of sensors (at least types I have with my security system). Currently only motion sensors are supportde (actually any alert sensor can be treated as a motion sensor but it will be better to differentiate) double radio transmittion is also not good, will be better to have an ethernet gateway directly working with RF433 This way I'm connecting very simple RF433 sensors one way (alert is comming from sensor to home controller). Same idea but different hardware and different sketch are needed to soport RF433 relays and wall switches. #include <avr/eeprom.h> #include <SPI.h> #include <MySensor.h> #include <DHT.h> #include <RCSwitch.h> #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 #define HUMIDITY_SENSOR_DIGITAL_PIN 3 unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds) MySensor gw; DHT dht; float lastTemp; float lastHum; boolean metric = true; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); RCSwitch mySwitch = RCSwitch(); #define RF433_CHILDS_MAX 20 typedef struct { unsigned long key; uint8_t child_id; } rf433_child_type; uint8_t *eeprom_last_id = (uint8_t*)EEPROM_LOCAL_CONFIG_ADDRESS; rf433_child_type *eeprom_rf433_array = (rf433_child_type*)EEPROM_LOCAL_CONFIG_ADDRESS+1; unsigned long dht_period; void setup() { gw.begin(); dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN); mySwitch.enableReceive(0); // Receiver on inerrupt 0 => that is pin #2 digitalWrite(5, HIGH); // Send the Sketch Version Information to the Gateway gw.sendSketchInfo("Humidity", "1.0"); // Register all sensors to gw (they will be created as child devices) gw.present(CHILD_ID_HUM, S_HUM); gw.present(CHILD_ID_TEMP, S_TEMP); metric = gw.getConfig().isMetric; } void loop() { if(digitalRead(5)) { Serial.println("-- enetered RF433 init mode"); unsigned long t = millis(); while(millis() - t < 60000) { if (mySwitch.available()) { unsigned long key = mySwitch.getReceivedValue(); mySwitch.resetAvailable(); uint8_t child_id = rf_find_child(key); Serial.print("--- child_id - "); if(child_id == 255) { // key is not presented in EEPROM uint8_t last_id = rf_get_last_id(); if(last_id < RF433_CHILDS_MAX) { // a new id should be created rf433_child_type child; // prepare data to be stored in eeprom child.key = key; child.child_id = last_id + 2; eeprom_write_block(&child, &eeprom_rf433_array[last_id], sizeof(child)); // store new last_id last_id++; rf_set_last_id(last_id); Serial.print("new "); Serial.println(last_id); gw.present(child.child_id, S_MOTION); } else { // no more space in EEPROM Serial.println("no space"); } } else { // existing key Serial.println(child_id); gw.present(child_id, S_MOTION); } break; } } Serial.println("-- left RF433 init mode"); } if (mySwitch.available()) { // motion event unsigned long key = mySwitch.getReceivedValue(); mySwitch.resetAvailable(); uint8_t child_id = rf_find_child(key); Serial.print("-- rf key "); Serial.print(key); Serial.print(" child_id "); Serial.println(child_id); if(child_id != 255) { MyMessage msg(child_id, V_TRIPPED); gw.send(msg.set("1")); // Send tripped value to gw delay(2000); gw.send(msg.set("0")); } } if(dht_period < millis()) { //delay(dht.getMinimumSamplingPeriod()); float temperature = dht.getTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT"); } else if (temperature != lastTemp) { lastTemp = temperature; if (!metric) { temperature = dht.toFahrenheit(temperature); } gw.send(msgTemp.set(temperature, 1)); Serial.print("T: "); Serial.println(temperature); } float humidity = dht.getHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum) { lastHum = humidity; gw.send(msgHum.set(humidity, 1)); Serial.print("H: "); Serial.println(humidity); } //gw.sleep(SLEEP_TIME); //sleep a bit dht_period = millis() + SLEEP_TIME; } } uint8_t rf_get_last_id() { uint8_t x = eeprom_read_byte(eeprom_last_id); if(x == 255) x = 0; return x; } void rf_set_last_id(uint8_t last_id) { eeprom_write_byte(eeprom_last_id, last_id); } uint8_t rf_find_child(unsigned long key) { uint8_t last_id = rf_get_last_id(); uint8_t id = 0; while(id != last_id) { rf433_child_type child; eeprom_read_block(&child, &eeprom_rf433_array[id], sizeof(child)); if(child.key == key) return child.child_id; } return 255; }
  • Keypads

    6
    0 Votes
    6 Posts
    4k Views
    klimK
    I'm actually working on a mySensor KeyPad node, but currently i'm struggling with a generic solution to read/write eeprom configurations controlled by the gateway. Maybe i'll ask for help in this forum in near future for future.
  • PIN 12 broken .... Could I use another pin instead?

    3
    0 Votes
    3 Posts
    1k Views
    M
    Worked! Many Thanks
  • 5V arduino pro mini battery powered - help needed

    3
    0 Votes
    3 Posts
    3k Views
    D
    I'd use a DCDC Step up converter (there is a 1-5V to V mentioned in the MySensors shop). For a 5V device I'd not connect directly to the batteries, because the voltage might drop below 5V although the batteries are still far away from beeing empty. You don't want your approach with the diodes (or any other linear voltage regulator) because it wastes expensive energy to produce heat (In order to get the higher voltage down). With 3.3V Device I'd (and will in the near future :) ) try to just use two batteries (without regulator). They'll have 3V max. Voltage and Adrduino Pro mini / nrf24l01 work down to 1.9V - so most if not all of the charge from the battery can be used. (rechargeable batteries shouldn't go below 0.8V so this fits quiet nicely (2*0.85 = 1.9). Additionally I think it might be easier to use the 3.3 V Arduino over the 5V, because more lowpower people use it and because the power consumption typically drops if you use less voltage as long as we are talking about some mA. E.g. Modern CPUs are working <1V to keep down the (thermal) losses. As a last sentence: Designing real low power and battery applications is hard work. It is dependet on sofware but also -maybe somewhat more- on hardware. You must design/find a power supply that matches the application very well and have to think of the parts of your sensor/circuit you can / must switch off. Maybe some of them must be switched off in hardware (cut power supply). Then it is part of the software to re-enable them in the correct sequence and with proper startup times to have everything work. However for a start I'd recommend to try the mentioned ste up converter. But I fear it has a relative large quiescent current because it is able to deliver 500mA which is much. Maybe someone else knows some modules that suit better and have a defined quiescent current. Best regards DirkH
  • more types of actuators

    linear actuator automatic gate pop up tv
    3
    0 Votes
    3 Posts
    1k Views
    brettzky84B
    Thanks I'll keep that in mind. But You can never have enough toys and are as common as stepper motors are around an everyday home but open up new possibilities. Sure you could build it though, but having a community working as one is progress [image: upload-e686a1bb-bee7-40ab-9001-265fb0b8b34c.jpg] [image: upload-d223980b-d4f3-4d36-80de-6f64eebe0624.jpg]
  • A kickstarter project maybe helpfull to make nodes...

    4
    0 Votes
    4 Posts
    2k Views
    D
    @epierre as a battery operated solution I use li-fe battery's they have a lower voltage per cell then lion and lipo so there is no need for any type of voltage regulation witch makes it simple. I just need to watch out not to over discharge the battery, but with 3Ah on a temp/hum sensor that will not be much of a problem ;) OT: seems like a very interesting board with lots of function and usefull stuff. But for $25 I would mutch rather throw my own hardware on a breadboard or protoboard or something.
  • Handy Serial Gateway for testing.

    serial gatewayc raspberry
    1
    2 Votes
    1 Posts
    1k Views
    No one has replied
  • Is the arduino nano capable of

    10
    0 Votes
    10 Posts
    5k Views
    tbowmoT
    @diamantmatch It was just the optocoupler approach to control 12V dc from arduino that caught my attention. It's enough with a simple transistor driver to control it. And yes, always have a diode in reverse across the relay coil. If it's 12V relays, you probably already use the same 12V supply to power both relays, and the arduino (maybe with a voltage regulator for providing 5V to the arduino from the 12V rail), and then the optocoupler approach is defeated, as they have a common ground.

24

Online

11.7k

Users

11.2k

Topics

113.0k

Posts