Seeed Temperature Humidity Sensor with OLED Display

The modules available for .NET Gadgeteer now include some interesting modules by Seeed Studio.  This example uses two of them:

The application code is very simple, as shown in the following block.

using Microsoft.SPOT;

using GT = Gadgeteer;
using Gadgeteer.Modules.GHIElectronics;
using Gadgeteer.Modules.Seeed;

namespace TempHumidity
    public partial class Program

        void ProgramStarted()
            temperatureHumidity.MeasurementComplete +=
               new TemperatureHumidity.MeasurementCompleteEventHandler(temperatureHumidity_MeasurementComplete);
            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            Debug.Print("Program Started");

        void button_ButtonPressed(Button sender, Button.ButtonState state)
            if (button.IsLedOn)

        void temperatureHumidity_MeasurementComplete(TemperatureHumidity sender, double temperature, double relativeHumidity)
            double fahrenheit = (temperature * 1.8) + 32;

            oledDisplay.SimpleGraphics.DisplayText("Temperature: " + fahrenheit,
                Resources.GetFont(Resources.FontResources.NinaB), GT.Color.Yellow, 5, 40);

            oledDisplay.SimpleGraphics.DisplayText("Rel Humidity: " + relativeHumidity.ToString(),
                Resources.GetFont(Resources.FontResources.NinaB), GT.Color.Yellow, 5, 80);

            if (fahrenheit < 63 || fahrenheit > 75)

Note: Don’t use higher voltage than needed to drive components.  Excess power is dissipated as heat.  After running this example for a few minutes on this 9 volt battery, the power module was hot.  See this discussion on the GHI Electronics forum:


, ,

  1. Leave a comment

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: