Arduino project to measure the temperature and send the data using the RN2483.
The hardware is as follows:
- Ardiono UNO
- DHT11 temperature sensor connected to pin 2 of the arduino. The power line should be connected to pin 3.
- A photocell should be connected to A0 with power connected to pin 4. (using 10K resistor pulldown to GND)
- RN2483 connected using serial to the Arduino (pin 0 and 1)
Depenencies:
- DHT sensor library by Adafruit Version 1.2.3
- Low-Power by Rocket Scream Electronics Version 1.6.0
- PinChangeInterrupt by NicoHood Version 1.2.4
The sketch doesn't configure the RN2483. This should be done manually:
- DevEUI should be set:
mac set deveui 0000000000000000 - AppEUI should be set:
mac set appeui 0000000000000000 - AppKey should be set:
mac set appkey 00000000000000000000000000000000 - The config should be saved:
mac save
Led indicator:
- Led is on - trying to join network
- Led is off - joined the network
- Blinking 300ms - waiting for data from RN2483
Startup:
- blinking 1s for 5 seconds - startup
- blinking 300ms - waiting for otaa join
- if led goes off means joined, if led goes on means not joined.
- wait 60 seconds
- If not joined go to step 2.
- measuring sensor data and sending it using the RN2483
- blinking 300ms - waiting for confirmation.
- wait 5 minutes
- goto step 6
Fuse settings for internal clock 8Mhz use:
avrdude -U lfuse:w:0xe2:m -U hfuse:w:0xd9:m -U efuse:w:0xfe:m -p m328p -c usbasp