IoT Industrial Scale

Pages
Contributors: jenfoxbot
Favorited Favorite 9

Program the Photon

Write a program for the Photon that will read in the serial output data from the OpenScale and push it to the IoT platform of your choice.

Or you can use/modify my code :) Here's the GitHub repository for the IoT scale, or just copy and paste the code from here:


This program reads data from the OpenScale and pushes it to ThingSpeak (also prints it to the Photon serial monitor). ThingSpeak is super easy (and free!) to set up, the only downside is that it only allows data to be posted every 15s.

What you need to do to make the program work for your setup:

variables to change

Click for a closer look.

  1. Include your WiFi SSID (network name) and your WiFi password in lines 53 & 54, and lines 69 & 70.

  2. Set up a ThingSpeak channel!.

    thingspeak channel setup

    1. Name the channel and write a brief description.
    2. Include at least one field name. If you want to push more data, like temperature or a timestamp, include those corresponding fields.
    3. Save the channel!
  3. Copy the "Channel ID" number and the "Write API Key" and input them into lines 84 & 85.

    API keys

Read through the comments in the program code for more information on how the program works.