Create your own Web of Things using the Netduino Plus and ThingSpeak

Getting Started with the Netduino Plus

The Netduino Plus is an Atmel 32-bit microcontroller development board that includes on-board Ethernet and USB. You create firmware using the Microsoft .NET Micro Framework, Visual C#, and Microsoft Visual Studio IDE. The board also has the same header foot print as the Arduino, so the board makes use of the many Arduino Shields available.

Netduino Plus

Setting up the Programming Environment

Visit netduino.com for the most current downloads and support options

Setting the IP Address of the Netduino Plus

  • Connect the Netduino Plus with a micro-USB cable
  • Open the .NET Micro Framework Tools folder under Program Files: C:\Program Files\Microsoft .NET Micro Framework\v4.1\Tools
  • Double-click on the file “MFDeploy.exe”
  • Under Device, select USB and NetduinoPlus_NetduinoPlus
  • Click Ping - if you recieve “TinyCLR”, then the Netduino Plus is connected properly to the PC
  • From the navigation menu, select TargetConfiguration, and Network to open the network settings page
  • Enter a unique Static IP address, Subnet Mask, and Default Gateway that are valid for your network
  • Enter a DNS Address (4.4.4.4 is a public DNS server)
  • Connect an Ethernet cable to the Netduino Plus

Creating a New Netduino Plus Project

  • Start Visual Studio
  • Select New Project
  • Select Micro Framework under the Visual C# section
  • Select Netduino Plus Application
  • Click OK

Setting up the Netduino Plus in Visual Studio

  • Connect the Netduino Plus with a micro-USB cable
  • Under your project, right-click on Properties and select Open
  • Select the .NET Micro Framework panel
  • Under Transport, select USB
  • Under Device, select NetduinoPlus_NetduinoPlus

Notes

  • Your program will be contained in the “Program.cs” project file
  • To build your program, press F6 (or select Debug, Build Solution)
  • To deploy your program to the Netduino Plus, press F5 (or select Debug, Start Debugging)

Connecting to ThingSpeak

The interface with the ThingSpeak API is either HTTP GET or HTTP POST. When the Netduino Plus is getting data from the API, use HTTP GET. When the Netduino Plus is sending data to the API, use HTTP POST. Download the ThingSpeakClient application for reference code on how to connect the Netduino Plus to ThingSpeak. The ThingSpeak API documentation can be found here.

The ThingSpeakClient application highlights the following features:

  • Reading analog inputs with a Netduino Plus
  • Blinking the on-board LED
  • Sending HTTP POST requests
  • Updating a ThingSpeak Channel with sensor data
  • Sending ThingSpeak status updates

Connecting a Light Sensor to the Web

Here’s a project demonstrating how to connect a light sensor to the web using the Netduino Plus and the ThingSpeak web service.

Parts:

  • Netduino Plus
  • Photo Resistor
  • 1k Ohm Resistor
  • Hookup Wire
  • Breadboard

Circuit Diagram for Light Sensor (Photo Resistor):

Light Sensor Circuit Diagram

Project Photo:

Light Sensor Connected to Netduino Plus

ThingSpeak Chart of Light Levels:

Light Sensor Chart by ThingSpeak

Netduino Plus Project File:

Click here to download the “ThingSpeakClient” application for the Netduino Plus.

Web Front-end

Here’s how you can take this project further with a design from shadowlord. You can create a web front-end using HTML, CSS, and jQuery to visualize your status updates from the Netduino.

  • Twitter
  • Facebook
  • Google Bookmarks
  • del.icio.us
  • StumbleUpon
  • Reddit
  • Digg
  • Add to favorites

One comment

  1. Thanks for this sample. This works for me out of the box when it’s running on my Netduino but it seems to get stuck when I try to run it using the debugger in Visual Studio.

    It appears that it in the method ConnectSocket the call to socket.Connect(…) never returns.

    Has anyone else seen this problem? or can you point me towards a solution?

    Thanks,
    Josh

Leave a comment