Sending Data to TTN when sensor value changes

Hi , Im new here :slight_smile:

I tried to find something here and in the web for this but I wasnt able to.

I would like to monitor a door with a Dragino shield on an Arduino Uno and and a binary sensor that is High when the door is closed and low when the door is open. I also would like to send a data package when the sensor value changes to TTN. And exactly here lies the problem:

In the example sketches everything depends on the set time interval (TX)

Is there a way to change “send data dependent on time” to value change?

for example in the Hello World sketch:

I would be very happy if someone could share some wisdom with me :slight_smile:

Thank you!

when the door is closed nothing happens, when the door opens an interrupt is generated, the nodes wakes up and transmits a byte to your application.
then the node waits until the door closes and go back to sleep.
this is how your code could work (not the code you’ve posted)

depending on the distance to your gateway and the interval (how many times per minute the door opens/closes), and NO, you must not change these LMIC parameters.


1 Like

Thanks for your reply :slight_smile:
Ill try it again tomorrow and read through you attached threat