Skip to content

Status monitor using TM4C1294 Connected LaunchPad and K350QVG-S1 320x240 LCD BoosterPack. Can be used as example code for ArduinoJson, ThingSpeak IoT REST API, Arduino Time Library, NTP.

License

Notifications You must be signed in to change notification settings

Andy4495/ConnectedStatusMonitor

Repository files navigation

Connected IoT Status Monitor

Arduino Compile Sketches Check Markdown Links

Status display sketch and hardware to display various sensor data readings that are queried from the ThingSpeak IoT Platform.

The sketch is specifically designed for use with the Texas Instruments TM4C1294 Connected LaunchPad, Kentec Touch Display BoosterPack (SPI version), Futaba 162SD03 Vacuum Fluorescent Display, and SparkFun Micro OLED Breakout.

While the sketch is written for a specific hardware configuration, it can be used as an example for the following:

  • TCP and UDP connections using Ethernet
  • ArduinoJson library for parsing JSON strings
  • Reading data using REST API for ThingsSpeak IoT platform
  • Arduino Time Library
  • Retrieving NTP time
  • Calculate Standard Time or Daylight Saving Time based on current day/time.
  • Using a simple photo resistor circuit to detect when a room light is turned on
  • Character Displays
  • Bit-Mapped Displays

Parts of the code are messy and could be improved. However, the sketch does what I want, so they will probably stay as they are. In particular:

  • I tried to come up with a creative solution for defining x/y coordinates for the display items. My solution ended up being cumbersome and difficult to maintain if the screen layout needs to change significantly.
  • The DST conversion algorithm is optimized for U.S. time zones. It is not generalized for all time zone/DST cases.

Light Detector Circuit

This display is located in a windowless workshop, and I only want the board querying the sensors database when I am in the workshop -- which is essentially any time the room light is on. In addition, the LCD backlight and VFD draw about 400 mA (out of a total 540 mA for the full setup), so I want to minimize power usage when I'm not in the workshop.

I constructed a simple light detection circuit using a 10K resistor and a cheap photo resistor (which probably came from an Arduino starter kit). The 10K and photo resistors are wired in series, with the 10K pulled to Vcc and the photo resistor connected to ground. Analog Pin A19 reads the voltage at the 10K/photo resistor connection (a simple voltage divider). Since it is just checking for a dark room vs. a lighted room, a threshold of half the ADC range is used.

Vacuum Fluorescent Display

The Futaba VFD is enabled by a power control circuit with a logic-level MOSFET along with a CD40109 tri-state buffer for the control signals to the VFD. The CLK, DATA, and RESET signals to the VFD are only active when the VFD is powered.

SparkFun Micro OLED Display

The SparkFun Micro OLED is used to display the atmospheric pressure history. The past 64 readings are displayed graphically to show the pressure trend to predict the weather.

A modified version of the SparkFun Micro OLED library is required to work with the Tiva controllers.

The OLED is controlled using parallel-8080 mode. While the OLED also supports SPI and I2C serial control, the Energia Tiva SPI implementation is incompatible with the SparkFun library. I was also unable to get I2C mode to work on the TM4c129 LaunchPad and decided to use parallel mode since I had enough I/O available.

Ethernet Status LEDs

The Connected LaunchPad supports Ethernet Link (LED4) and Activity (LED3) status indicators. However, I find these LEDs are bright and distracting. They are disabled by default. The code to enable them is in the sketch, but is commented out.

External Libraries

  • ArduinoJson
    • Sketch has been updated to suport the version 7 API. Earlier versions of the library are not supported
    • Version 7 increased flash usage by about 1200 bytes, but this is still a small portion of the overall flash size (1 MB)
  • Arduino Time Library
    • The code currently requires version 1.5 of the Time library. Version 1.6 and later use pgm_read_ptr instead of pgm_read_word, which causes a compile error with the Tiva board package
  • FutabaUsVfd162S Library
  • Modified SparkFun Micro OLED Library
    • This modified version is required in order to support compilation with the Tiva board
  • Kentec_35_SPI
    • Version v2.0.0, modified from the library included with Tiva board package to support TM4C129 and this project configuration

References

License

The software and other files in this repository are released under what is commonly called the MIT License. See the file LICENSE in this repository.

About

Status monitor using TM4C1294 Connected LaunchPad and K350QVG-S1 320x240 LCD BoosterPack. Can be used as example code for ArduinoJson, ThingSpeak IoT REST API, Arduino Time Library, NTP.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published