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.

Thomas's Content

There have been 15 items by Thomas (Search limited from 09-April 19)

By content type

See this member's

Sort by                Order  

#10705 Exploring the Netduino

Posted by Thomas on 09 March 2011 - 07:53 AM in General Discussion

Hi Mister Matt, Nice writeup! One thing though: The analog inputs on the Arduinos can also be used as general I/O similar to the Netduino. On the UNO for instance, I2C is specifically on two of the analog pins. /Thomas

#10703 "No results found for 'labview'."?

Posted by Thomas on 09 March 2011 - 07:39 AM in General Discussion

It is possible to do this with a Netduino, though at the moment, the Netduino part will be a bit more complicated than the Arduino example that was linked to. This is because the USB connection on the Netduino is usually used for Visual Studio programming and debugging, but it can be programmed to act as a virtual serial port (USB CDC). A future release of the Netduino firmware should make this easier and have a sample to work out from, as far as I have understood. There are a few more detail in this thread under Netduino Beta (http://forums.netdui...e-v412-alpha-0/) The LabView part should be the same, though I haven't tried it (don't have LabView) /Thomas

#9578 2x16 LCD Menu Class ?

Posted by Thomas on 15 February 2011 - 01:31 PM in General Discussion

Hi Steve, One option to emulate or get inspiration from could be the menu system used in the older HP laser printers... I'm going to do something similar on a little Arduino based board (, but with only up, down and select ( /Thomas

#7740 Replace analog pot with Netduino using PWM

Posted by Thomas on 16 January 2011 - 01:04 AM in Netduino 2 (and Netduino 1)

Hi, You could also use a digital potentiometer like http://www.maxim-ic....vp/id/4205/t/al /Thomas

#7487 MagStripe Reader with Netduino

Posted by Thomas on 12 January 2011 - 01:35 AM in General Discussion

Today I tried using interrupts for all the signals from the Mag Stripe reader, and saving the timestamps for later comparison, and that seems to work, even for really fast swiping. I'll try to wrap it all up in a nice library with error correction and all, and post it for all of you to try out and comment on. /Thomas

#7333 Notifications from Netduino

Posted by Thomas on 09 January 2011 - 12:28 PM in General Discussion

You could also go directly to SMS using one of these shields:

- Sparkfun: Cellular Shield with SM5100B

I got the Cooking Hacks one, but up until now, only tried it with an Arduino, but I'm planning on giving it a go with the Netduino too. If I remember correctly, some custom wiring is necessary since it uses the ICSP connector on the Arduino, but nothing complicated, just power (the regular power pins are not used since the gsm module is placed in that spot).


#7329 MagStripe Reader with Netduino

Posted by Thomas on 09 January 2011 - 12:07 PM in General Discussion

Yes, that's right. If you want to get the state of other pins, you may check out sweetlilmre's post - he has built a custom firmware with extended InterruptPort, which passes an array of [watched] pin states to the interrupt handler.

That looks very interesting!

Do you know if that firmware is available to test? I don't have access to the Keil Compiler so a binary FW would be what I needed.



#7299 MagStripe Reader with Netduino

Posted by Thomas on 09 January 2011 - 12:12 AM in General Discussion

In addition to what Chris said, you can also use the second parameter of the interrupt handler (udata2), it contains the pin state at the time the interrupt has occurred, contrary to pin.Read() method call that retrieves the pin state while the interrupt handler routine is being executed.

Cool, thanks!

I guess that udata2 only holds the state of the pin triggering the interrupt, and not the other pins, but even then, this is what I need when constructing the two arrays.


#7295 MagStripe Reader with Netduino

Posted by Thomas on 08 January 2011 - 11:13 PM in General Discussion

Thanks for the suggestions, both of you! I'll try the caching of both clock and data with timestamps, and and see if I can get good captures that way. /Thomas

#7279 MagStripe Reader with Netduino

Posted by Thomas on 08 January 2011 - 04:50 PM in General Discussion


I have been playing around with a Mag Stripe reader (the one I use only reads track 2), but at the moment it only works when I swipe the card very slowly through the reader.

The outputs from the reader is:

- Card Present
- Clock
- Data

When a card is swiped, the Card Present will first go low, and the clock wil start switching high and low, and when the clock goes from high to low, you are suppose to sample the data line, which becomes stable a short while before and keeps stable as long as the clock is low.

The clock is not constant, but depends on how fast you swipe the card. Swiping the card slowly results in something like 500 Hz, going about normal speed you will get a clock speed of roughly 1 to 1.5 kHz and swiping it fast will probably be 2-4 kHz.

I wrote some code (included below) which seemd to work when swiping the card slowly, but when the speeds get to what most people would do, it won't read the values correctly.

Am I using the InterruptPort correctly?

How long does the InputPort.Read() method take to read the pin state?

In the code below, I just put a breakpoint at the end of cp_OnInterrupt and look at the temp variable to see what was read.

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.Netduino;

namespace MagStripeReader
    public class Program
        public static byte[] data = new byte[1024];

        public static int count = 0;

        public static InputPort dataPin = new InputPort(Pins.GPIO_PIN_D6,

        public static void Main()
            // write your code here
            InterruptPort clk = new InterruptPort(Pins.GPIO_PIN_D10,
            clk.OnInterrupt += new NativeEventHandler(clk_OnInterrupt);

            InterruptPort cp = new InterruptPort(Pins.GPIO_PIN_D5,
            cp.OnInterrupt += new NativeEventHandler(cp_OnInterrupt);


        static void cp_OnInterrupt(uint data1, uint data2, DateTime time)
            bool inStartZone = true;
            bool inEndZone = false;

            byte[] temp = new byte[1024];
            int charCounter = 0;
            int bitCounter = 0;

            for (int i = 0; i < count; i++)
                if (inStartZone && data[i] == 1)

                else if (inStartZone == false)
                    bitCounter = 0;
                    if (data[i+0] == 0)
                        temp[charCounter] |= (byte)(1 << bitCounter);
                    if (data[i + 1] == 0)
                        temp[charCounter] |= (byte)(1 << bitCounter);
                    if (data[i + 2] == 0)
                        temp[charCounter] |= (byte)(1 << bitCounter);
                    if (data[i + 3] == 0)
                        temp[charCounter] |= (byte)(1 << bitCounter);

                    i += 4;
                    inStartZone = false;
            count = 0;

        static void clk_OnInterrupt(uint data1, uint data2, DateTime time)
            data[count] = 0;
            if (dataPin.Read())
                data[count] = 1;


#6942 RFID Reader Opinions

Posted by Thomas on 04 January 2011 - 12:03 AM in General Discussion

I just tried Googling a bit, and it seems I'm not the only one with that observation: http://forum.sparkfu...hp?f=14&t=25360 I think it's just minor changes or feature upgrades but they kept backwards compatibility. EM4001 seems to have been replaced by EM4100 and EM4102 and those have now been replaced by EM4200, but again with backwards compatibility. (http://www.emmicroel...p?IdProduct=282) /Thomas

#6857 RFID Reader Opinions

Posted by Thomas on 02 January 2011 - 10:02 PM in General Discussion

OK, I have now made a few tests with both the Parallax reader and the ID-20. I have made a post (including a little video) about it on my blog http://www.hackmeist...-with-netduino/ where you will find all the details and the source code I used with the Netduino. There is very little difference between the two readers when it comes to reading distance. The variation between different readings on the same reader is way bigger. Also, I found that both readers read the same EM4100 tags just fine. I have tried with 4 different tags (two different CC sized tags, and two different keychain tags) I also made a little blog post about how I solved the 2mm pin spacing problem on the ID.20: /Thomas

#6664 RFID Reader Opinions

Posted by Thomas on 29 December 2010 - 07:58 PM in General Discussion

I actually have both the Parallax Serial reader and the ID-20, but have only played with the Parallax one up until now. As I remember, the reading distance is relatively short, something like 1-2 inches for a regular CC card type tag. I can try to make a comparison between the two, but I will likely not have time before this weekend. Generally, my experience with the 125kHz system is that the reading distance is pretty short... and often almost need "contact" if the reader is housed in an enclosure. /Thomas

#6617 Iphone interface to Netduino via audio jack

Posted by Thomas on 28 December 2010 - 11:56 PM in Visual Studio

Have you seen this interface made for Arduino? http://arms22.blog91...-entry-350.html The blog-post is in Japanese, but using Google Translate you should be able to get an idea about how it's done. /Thomas

#160 Reversing the pushbutton state -- feedback?

Posted by Thomas on 09 August 2010 - 05:03 PM in Netduino 2 (and Netduino 1)

Shouldn't the SW1 button act like all the other GPIO's? If you start out by using the SW1 for input, but later on decides to use another pin for the button, it wouldn't be good to require further code changes. The way the button is wired (Pull-Up scenario) is pretty common, and having all GPIO's "inverted" wouldn't be fun is you ask me. I'd say that a LOW signal on a pin should be FALSE, and a HIGH signal should be TRUE - Including the SW1 input. Just my 5 cents... /Thomas

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.