Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add simple function for measuring temperature #389

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ladislavkrivy
Copy link

No description provided.

@IoTThinks
Copy link
Collaborator

@ladislavkrivy How good is the builtin temperature?
I thought the temperature measure can only be done in FSK mode?

@ladislavkrivy
Copy link
Author

ladislavkrivy commented Aug 13, 2020

It's quite terrible but good enough for compensating crystal's temperature drift (on small crystals tends to be linear-ish). In my case just with linear compensation by LoRa.setFrequency(F_UPLINK + 150 * LoRa.temperature()); before sending a packet I can easily get away with 20.8k bandwidth.
Screenshot_20200813_180257

Yes, to measure the temperature it switches to FSK mode momentarily and restores the mode afterwards.
It could be improved if there's a way to check wether the module is currently receiving a packet (trough I'd rather leave user to to this check in the sketch)

@IoTThinks
Copy link
Collaborator

Thanks a lot for your code.
Let me try next week.

It should be good for LoRa node in outdoor environment?

@ladislavkrivy
Copy link
Author

Cool, It'll be interesting to know whether the temperature characteristic is somewhat similar for those 32M crystals (was for mine but they are probably same batch) or actually it has wilder variance.

Keep in mind the reading is not calibrated so you'll probably need to use frequencyError for initial calibration. I have 3 outdoor nodes at different places and with temperature compensation the system works even when sun hits one of the nodes.

@ned-kelly
Copy link

Any chance we can merge this one in?

@IoTThinks
Copy link
Collaborator

Should be a good feature to merge in the main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants