Code Monkey home page Code Monkey logo

connectedstatusmonitor's Introduction

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.

connectedstatusmonitor's People

Contributors

andy4495 avatar

Watchers

 avatar  avatar

connectedstatusmonitor's Issues

README updates

First paragraph: add a reference link to "ThingSpeak IoT Platform".

Change references to the Futaba VFD library to my updated name of the library.

In the references section, remove Arduino Playground Futaba VFD, since it is already referenced in the external libraries section (and it isn't the specific library used for this project).

In the hardware README:

  • spelling "contaians"

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.