Skip to content

thingspeak

Reads value on analog input A0 and calculates the the percent level of a lipo battery and uploads the value to ThingSpeak.

Sketch

The sketch can be found here.

Hypothesis

The Adafruit Feather Huzzah can be used to upload data to ThingSpeak.

Assumptions

WIP

Procedure

Circuit

Code

Create a channel on ThingSpeak.

Enter ThingSpeak and WiFi credentials in secrets.h.

Change the ThingSpeak update interval by changing the DELAY_LOOP variable in the sketch.

Note: The update interval should not be less than 15 seconds (15000) for free accounts. See the ThingSpeak FAQ for details.

Install the ThingSpeak library

arduino-cli lib install ThingSpeak

Compile and upload the code.

Output

Battery level: 80%
Attempting to connect to SSID: MySSID
.......
       Connected.
Channel update successful.
Battery level: 80%
Channel update successful.
Battery level: 80%
Channel update successful.
...

The Feather should read the battery level, connect to WiFi, and upload the battery level to ThingSpeak.

Analysis

WIP

Conclusion

WIP

Troubleshooting

WIP

References

Back to top