Skip to content
  • Infrared Emitters/LEDs and Receivers

    Hardware infrared led irled infrared
    3
    0 Votes
    3 Posts
    915 Views
    S
    @hek, thank you for that. I have had a quick look on his topics page and i will read through in more depth later on. I see he was the guy that created the IR Blaster than i was reading about a few months back. Looks a nice little module for universal controlling with IR. But again, by the looks of things i don't see any sort of PWM control going on with timers and what not. So unless this is handled through PWM pins (which i doubt because its all running through MOSFETS to power the IR LEDs equally) then it is just straight power to the LEDs when needed. I'm pretty sure that as long as the wavelength matches we're good to go without pulsing.
  • 2 Votes
    7 Posts
    3k Views
    E
    I recently build successfully a mysensor node based on an Arduino Uno, a Robolink IR sensor and a Robolink DHT11 sensor. The last two from an Elektor sensor kit ever bought for my son when he was still interested by electronics :wink: . My controller is Home Assistant, so I did a merge of the given MySensors example sketch and the Home Assistant example sketch together with the DHT11 sketch. The airco is a Samsung one, so in the sketch you will find these defines uncommented. Replace by your airco manufacturer. People interested in building one, can find my sketch on https://github.com/ericvb/MySensorsArduinoSketches @ToniA a big thanks for the work to decode all these IR sequences!
  • IR distance sensor usage?

    Hardware proximity infrared distance
    4
    0 Votes
    4 Posts
    3k Views
    hetbeestH
    I did some quick coding, combining it with a temperature sensor. It did work for a couple of hours, after that my 9V battery was drained so far that I didn't get any data send from the sensors anymore. Quite likely the IR sensor uses a lot of power while it keeps transmitting IR. Anyhow, my quick and dirty code is: // Example sketch showing how to send in OneWire temperature readings #include <MySensor.h> #include <SPI.h> #include <DallasTemperature.h> #include <OneWire.h> #include <DistanceGP2Y0A21YK.h> #define ONE_WIRE_BUS 3 // Pin where dallase sensor is connected #define MAX_ATTACHED_DS18B20 16 #define CHILD_ID_DISTANCE 25 DistanceGP2Y0A21YK Dist; unsigned long SLEEP_TIME = 500; // Sleep time between reads (in milliseconds) OneWire oneWire(ONE_WIRE_BUS); DallasTemperature sensors(&oneWire); MySensor gw; float lastTemperature[MAX_ATTACHED_DS18B20]; int numSensors=0; boolean receivedConfig = false; boolean metric = true; int distance; int lastDistance=0; int loopCounter=0; int loopsBetweenTemp = 60; // Initialize temperature message MyMessage msg(0,V_TEMP); MyMessage msgdist(CHILD_ID_DISTANCE,V_DISTANCE); void setup() { // Startup OneWire sensors.begin(); Dist.begin(0); // Startup and initialize MySensors library. Set callback for incoming messages. gw.begin(); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Temperature and Distance Sensor", "1.0"); gw.present(CHILD_ID_DISTANCE,S_DISTANCE); // Fetch the number of attached temperature sensors numSensors = sensors.getDeviceCount(); // Present all sensors to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { gw.present(i, S_TEMP); } } void loop() { // Process incoming messages (like config from server) gw.process(); distance = Dist.getDistanceCentimeter(); if (distance != lastDistance) { lastDistance = distance; gw.send(msgdist.set(distance)); } if (loopCounter == 0) { // Fetch temperatures from Dallas sensors sensors.requestTemperatures(); // Read temperatures and send them to controller for (int i=0; i<numSensors && i<MAX_ATTACHED_DS18B20; i++) { // Fetch and round temperature to one decimal float temperature = static_cast<float>(static_cast<int>((gw.getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.; // Only send data if temperature has changed and no error if (lastTemperature[i] != temperature && temperature != -127.00) { // Send in the new temperature gw.send(msg.setSensor(i).set(temperature,1)); lastTemperature[i]=temperature; } } } if (++loopCounter >= loopsBetweenTemp) loopCounter = 0; gw.sleep(SLEEP_TIME); }
  • Battery powered IR sender

    Development slight gw.sleep infrared blaster
    6
    0 Votes
    6 Posts
    3k Views
    KytrixK
    Ok, I was thinking that I could ask the state of the message S_LIGHT at every wake up, and if it changes, do my IR sending ... But it seems to not work. I guess for this, the problem is on the controller side, after send the command, without acknowledge , it give up and let the state of the button unchanged. Always on means power supply, This sensor must also get temperature, so I don't want to put it anywhere ... anyway thanks for you help :)

14

Online

11.7k

Users

11.2k

Topics

113.1k

Posts