---

Showing posts with label .net gadgeteer. Show all posts
Showing posts with label .net gadgeteer. Show all posts

Monday, May 28, 2012

Getting Started with .NET Gadgeteer

My book 'Getting Started with .NET Gadgeteer' has just started shipping - at least at Amazon.com.


Its a short book, designed to get you started and then lead you into a few projects, to explore some of the features of this interesting platform.

Here are some details of the projects. More information as well as downloads can be found at the books official website.



Spy Camera
This project uses the camera module to capture images peri- odically and save them to the SD card. The LCD touchscreen is used to set the recording interval of between 5 and 60 seconds.

Snowflakes Game
This is a simple game in which you guide a tongue back and forth across the screen in order to catch snowflakes that are falling from the sky.
The project uses the display and joystick modules included in the Fez Starter Kit.

Web Messenger
The Gadgeteer with an Ethernet module can be put to work as a small web server. In this project, the web server constantly serves the contents of the Gadgeteer screen. You can draw sketches on the screen with your finger or a stylus and leave messages for the world to see.
Camera Backup Gadget
This project  is intended for the digital camera user who, while travelling, might feel insecure about having all his or her precious photo- graphs on just one SD card that could become damaged or lost. Instead of copying the files to a laptop, this gadget will copy everything on an SD card to a USB flash drive.

Monday, March 12, 2012

.Net Gadgeteer Heart Monitor

I have been playing with a .NET Gadgeteer pulse oximeter module from Seeed.



This is a high quality device that you clip over your finger to measure the frequency of your pulse. It detects slight variations in the amount of light passing through your finger as the blood pulses through the blood vessels.

The board has all the necessary filtering, and appears to do it all with analog electronics rather than DSP.  I haven't checked, but from the number of small chips, I suspect there are opamps and instrumentation amps on the board. It requires a U type socket.

As with all Gadgeteer modules, it is simplicity itself to use. Using a Fez Spider, I connected it up as shown below. The lead from socket 1 goes to the USB DP module and then your computer.



I also added an LCD display and another Seeed product, the LED-7R. This has a ring of LEDs which will animate by lighting in turn when a pulse is detected.

The display is just used to display the pulse rate.

The program is listed below. You essentially get an event every time a pulse is detected.


using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;

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

namespace PulseMeter
{
    public partial class Program
    {
        // This method is run when the mainboard is powered up or reset.   
        void ProgramStarted()
        {
            pulseOximeter.Heartbeat += new PulseOximeter.HeartbeatHandler(pulseOximeter_Heartbeat);
            DisplayPulseRate(0);
        }

        void pulseOximeter_Heartbeat(PulseOximeter sender, PulseOximeter.Reading reading)
        {
            lED7R.Animate(50, true, true, false);
            DisplayPulseRate(reading.PulseRate);
        }

        private void DisplayPulseRate(int p)
        {
            display.SimpleGraphics.Clear();
            display.SimpleGraphics.DisplayText("Pluse: " + p,
                Resources.GetFont(Resources.FontResources.NinaB), Colors.Green, 20, 100);
        }
    }
}

Conclusion.

This is a good quality module and this is reflected in the price. 

If you fancy a DIY attempt, then you could try the Arduino-based pulse meter from my book '30 Arduino Projects for the Evil Genius'. Its much simpler, and I admit much more difficult to get to work than this module - unlike the Seeed module, my module requires calibration and is frankly pretty ugly.

About the Author
These are my books. Click on the image below to find out more about them.


Tuesday, December 13, 2011

.NET Gadgeteer - First Impressions

It shows just how far Arduino and the other open source hardware platforms have come, when Microsoft wants to get in on the act.


The question often posed is 'is .NET Gadgeteer an Arduino Killer?'



        




                  vs.








The answer is an emphatic NO, it isn't. In the same way that a Rolls-Royce isn't a pedal cycle killer. They are both vehicles and some people will own one of each, but they are very different beasts.

It is rare that you get very far with an Arduino without a bit of soldering. It has a laughably feeble processor, tiny amounts of RAM and program storage. However, thats often all you need. Its 'lightness' is part of its charm.

The .NET Gadgeteer is a quite different beast. The kit I have is the 'Fez Spider Starter Kit' from GHI electronics. And it comes with a fantastic range of things to connect to your Controller board.


Yup, thats right, there is a camera, a large LCD touch screen, a joystick, multicolor LED, USB host, SD card and even a little push button. And they all have little DIL connectors, so you assemble your project by plugging things together. Nearly all the components actually have their own microcontroller, and I suspect there are more transistors in one of these kits than a thousand Arduinos.

So whereas an Arduino project will often involve a shield, that has a few components on, say a screen and a joystick,  in the Gadgeteer world, you plug in separate components using lengths of ribbon cable. So the front of a Gadgeteer controller board is covered in sockets into which things can be plugged.



There are rules about what can be plugged into what, but we will come to that in a moment.

You can see the separate programmer, which yes, you guessed it uses one of those little sockets to connect it to your computer via USB. When I say your computer, obviously I mean your Windows computer. You program the Gadgeteer using the Visual Studio integrated development environment, and this is only available for Windows. However, Mac and Linux users do not despair. I had no problems running the development environment on Virtual Box and Windows on my Mac.

I have to say that programming the Gadgeteer was a very pleasant surprise. The libraries are very well though out and easy to use and backed up by a really excellent hardware designer. Let me show you.


In this mini project I am connecting a joystick and a RGB LED. So, as I change the position of the joystick, it will use the X position of the joystick to control the brightness of the blue channel of the LED.

So, before I actually plug together the physical hardware, I plug together virtual hardware on the designer. This does nice things like tell me which of the sockets are compatible with the peripheral I am plugging in.

Then, when I am done designing the hardware, I hit save, and a load of boilerplate code is generated for me. All I need to do then is add in a Timer and a single line that reads the X position, scales it and assigns it to the blue channel of the LED and I am done.


Installing it in the actual hardware is a button press and what's more I can use a proper debugger and set break-points in my code and everything.

Very cool.

Conclusion.

I can see .NET Gadgeteer working really well in educational settings. Its a great way of getting kids to understand that their gadgets don't just fall ready formed from the sky, but they get designed by people like them. The ability to make things without soldering is sadly another win in our safety conscious society.

It is a very well thought out and consistent system that provides another approach to hardware development for the masses.

About the Author
These are my books. Click on the image below to find out more about them.