Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.


Member Since 24 Jan 2012
Offline Last Active Feb 02 2014 10:37 PM

Topics I've Started

Electrit Microphone Sensor

27 May 2013 - 06:03 PM



Is there anyone who has already worked with Electret Micrphone Sensor? I need to detect the noise in my room, so I wired the sensor simply to my Netduino Plus (5v, GND, Analog Pin 0), and I am getting random values (70 to 130) which are independent to the existing noise.


-My code:

    public class Program    {        public static void Main()        {            SecretLabs.NETMF.Hardware.AnalogInput inp = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);                        while(true)            {                Debug.Print(inp.Read().ToString());                Thread.Sleep(100);            }            }    }

Software Reboot for Netduino Plus

21 May 2013 - 11:58 PM



I had a problem for 1 month to use a Watchdog mechanism in Netduino Plus. FYI, the "Watchdog" acts as a software reboot with a predefined timer.

The watchdog functions have been already developed in C# Micro Framework, but they never work. Based on the comment I got from Chris: "No watchdog implemented in the gen1 hardware.  We're currently designing a software update for gen2 hardware which would enable it."

Finally, I created my own watchdog function which works well to reboot the Netduino after a fixed time (e.g., 5h).

public class MainFrame{        const Int32 wdDelay = 1000 * 60 * 60 * 5;   // 5h        static Timer wdtimer = new Timer(watchdog, null, wdDelay, 0);                public static void Main()        {            // Write your codes here        }        public static void watchdog(object state)        {            PowerState.RebootDevice(false);     //Watchdog.Enabled = true;        }}

I hope it helps you in your project :)

AnalogInput: Sometimes works, sometimes doesn't

08 May 2013 - 09:54 PM

Hi All,   I developed a code to get the temperature readings from TMP36 sensor. My Netduino was working properly. After 5 hours, I started debugging again, but it throwed exceptions (on the line voltagePort = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A1)):

A first chance exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dllAn unhandled exception of type 'System.ArgumentException' occurred in Microsoft.SPOT.Hardware.dll

The code of mine is here:

using System;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace TMPSensor{    public class Sensor:Constants    {        //Microsoft.SPOT.Hardware.AnalogInput voltagePort;        SecretLabs.NETMF.Hardware.AnalogInput voltagePort;        OutputPort lowPort, highPort;        public Sensor()        {            //Temperature sensor           //voltagePort = new AnalogInput(AnalogChannels.ANALOG_PIN_A1);           voltagePort = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A1);           lowPort = new OutputPort(Pins.GPIO_PIN_A0, false);           highPort = new OutputPort(Pins.GPIO_PIN_A2, true);        }        public double read()        {            double rawValue = voltagePort.Read();            double value = (rawValue * maxVoltage) / maxAdcValue;            double result = (((value - 0.5) * 1000) / 10) - 4;            return result;        }    }}

The firmware of my Netduino Plus is (RC5), and the SDK is MicroFrameworkSDK_NETMF42_QFE2. Any help or comment is highly appreciated.   Mohammad

Netduino Plus stops running after a while

16 April 2013 - 08:10 PM

Hi there,


My Netduino Plus has been programmed in a way that it sends heart beat requests (every minute) frequently to a data service. Unfortunately, after 1 (or sometimes 2) day(s) it stops running with no error or no reason. Is there any limitations on the Netduino Plus hardware structure?

I tested the data service with my PC as a client (instead of Netduino Plus) to send heart beat requests, so I was convinced there is no problem on the data service.


FYI. It has no power limitation. I mean its power is provided by a USB cable connected to my computer.


Any comments, advice and solutions are more than welcome.


Thanks for your time and attention,


Analog Input in Firmware

14 March 2013 - 05:11 PM

Hi everyone,


I have a Netduino Plus and a TMP36 temperature sensor.

My code already worked perfect with firmware 4.1:

using System;using System.Net;using System.Net.Sockets;using System.Threading;using Microsoft.SPOT;using Microsoft.SPOT.Hardware;using SecretLabs.NETMF.Hardware;using SecretLabs.NETMF.Hardware.NetduinoPlus;namespace TemperatureSensorTest{    public class Program    {        public static void Main()        {            //Temperature sensor                       var voltagePort = new AnalogInput(Pins.GPIO_PIN_A1);            var lowPort = new OutputPort(Pins.GPIO_PIN_A0, false);            var highPort = new OutputPort(Pins.GPIO_PIN_A2, true);                       double rawValue = voltagePort.Read();            double result = ((rawValue - 0.5) * 1000) / 10;            Debug.Print("Result: " + result);        }    }}

Now, it doesn't work with my new firmware. Would you please let me find a solution for this problem?


Thanks in advance,


home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.