What does the LED blinking (pin 13) mean?



  • I've managed to put together a couple of mysensors with arduino pro mini. I notice that when they startup, they do some blinking with the built-in LED (the one connected to pin 13).

    I tried to find where in the code this happens, but failed. Is there an explanation to this blinking, i.e. any patterns that indicate success or failure connecting to network, etc?


  • Mod

    The radio is connected to pin 13 (see http://www.mysensors.org/build/connect_radio)
    According to the Arduino SPI page:
    SCK (Serial Clock) - The clock pulses which synchronize data transmission generated by the master.

    So the led is lit whenever the Arduino is talking to the radio.



  • I've built 2 sensors so far, one a relay actuator using an arduino pro mini and the other with temperature and humidity sensor using an Arduino Nano. On the nano the Pin13 LED just flickers occasionally (I guess when the radio transmits) but on the Pro Mini the LED is permanently on, with just an odd visible flicker occasionally.
    Both nodes work fine, so I'm intrigued as to why the LEDs should behave differently?


  • Mod

    The only reason I can think of is if you enabled MY_WITH_LEDS_BLINKING_INVERSE when you compiled the sketch for the pro mini. But that's probably not something you'd do by mistake 🙂
    https://github.com/mysensors/Arduino/blob/development/libraries/MySensors/MyConfig.h#L136


  • Hero Member

    I'd guess that the radio on the relay node is activated all the time, the radio is not brought to sleep.

    I suppose the temp / humidity node on the other side sleeps most of the time so the radio is in sleep mode and needs no clock.



  • @mfalkvidd These are not extra LEDs added to monitor tx/rx/err (which is what I believe that the MY_WITH_LEDS... compiler directive controls), this is the inbuilt pin13 LED on the arduino board. I do wonder why the library has been written to use this pin as in a battery powered configuration any extra LED current will impact on battery life.
    @TimO I agree - the actuator has to listen all the time for incoming messages, whereas the sensor can (and does) sleep for most of the time.



  • @TimO To confirm this I just 'rebuilt' my actuator node as the example humidity sensor (swapped a few links on my breadboard) and now the Pin13 LED behaves just like the other sensor node, mostly off with just a tiny flicker on each transmit.


Log in to reply
 

Suggested Topics

  • 4
  • 14
  • 2
  • 9
  • 274
  • 5

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts