element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Members
    Members
    • Benefits of Membership
    • Achievement Levels
    • Members Area
    • Personal Blogs
    • Feedback and Support
    • What's New on element14
  • Learn
    Learn
    • Learning Center
    • eBooks
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Dev Tools
    • Manufacturers
    • Raspberry Pi
    • RoadTests & Reviews
    • Avnet Boards Community
    • Product Groups
  • Store
    Store
    • Visit Your Store
    • Choose Another Store
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
Personal Blogs
  • Members
  • More
Personal Blogs
Legacy Personal Blogs Google Visualisations displays data over Ethernet from Arduino
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Blog Post Actions
  • Subscribe by email
  • More
  • Cancel
  • Share
  • Subscribe by email
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: neilk
  • Date Created: 15 Dec 2013 5:40 PM Date Created
  • Views 305 views
  • Likes 0 likes
  • Comments 0 comments
  • arduino_projects
  • arduino_ethernet_shield
Related
Recommended

Google Visualisations displays data over Ethernet from Arduino

neilk
neilk
15 Dec 2013

I came across this article by chance:


  http://fermentationriot.com/arduinopid.php


The article describes a very sophisticated Arduino data collection and display system for a home brewing setup.


The data display, in a browser window, interested me because it exploits  free to use  javascript modules, developed and hosted by Google.


This post concentrates on one particular module which draws analog meter displays, or gauges:


https://developers.google.com/chart/interactive/docs/gallery/gauge 


I copied the HTML code from the example and pasted it into a text file on my PC, named the file gauge.html and saved it to disk.  When I double clicked on the file, a browser window opened and the the 3 gauges, Memory, CPU and Network  were displayed exactly as in the display on the Google website, as shown below:

image


The example HTML was then implemented inside a simple Arduino sketch, based on the Web Server example given in the standard Ethernet Library.


Because of the large number of string constants to be printed out, I used the F() syntax, as in


          client.print(F(“Any constant string data”));


to store the string constants in flash or program memory, at compile time:


http://playground.arduino.cc/Learning/Memory


It’s fairly easy to change the example HTML code to use variables instead of constants and the options section can be used to set a variety of extra features - see the description of the available options on the Google link, above. A lot of the changes can be tested inside a simple standalone HTML file, before trying to code a Sketch.


My next development was to use variables, to which I could assign changing values, instead of constants, for the values displayed on the gauges.


I modified the first sketch to read 3 floating analog inputs and used the values to set the gauge display. The reading are updated at 5 second intervals( the refresh time defined to the browser in the initial HTTP connection response). Because the analog inputs are floating, the readings change every 5 seconds, thus simulating changing data on the gauge displays.


A zip file containing the original html from the example on the Google website and my 2 simple Arduino demonstration sketches is attached.


Please let me know what you think of this free, hosted, code.




Attachments:
Gauge.zip
  • Sign in to reply
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2023 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • Facebook
  • Twitter
  • linkedin
  • YouTube