views:

431

answers:

10

For those who deal with microcontroller programming...

I want to take a momentary contact switch (let's say a Staples Easy Button, since that's the most fun momentary contact switch around), and when it is pressed, send a broadcast UDP packet across a network (to be received by a .NET application and do all sorts of fun things from there).

The closest thing I've found so far is industrial data acquisition hardware interfaces, but I'm looking for more of a programmable single microcontroller with a couple input pins and ethernet output. Is there a special term for this or any particular recommendations?

A: 

SInce you wish to use .NET (and presumably Windows) I suggest you take a look at Coding4Fun.

Here are some of their hardware projects.

JonnyBoats
A: 

A $5 PIC chip can do that with a small amount of logic/power, see www.microchip.com, depending on QTY, you can build a board or buy one.

kenny
A: 

Easier and cheaper way would be to use something like Phidgets without learning a new language.

Allows you to connect a button to the phidgets board and then connect it a usb port. Use C# to write your communications layer. Phidget comes with a set of .net libraries to enable communications to and from the phidget board.

Check out the phidget forums on their site for answers and examples.

Nirav
A: 

I think that the cleanest approach would be with a couple of XBee modules. Hide one of them inside the Easy Button, attach the other to a computer. When the button is pressed the computer will receive a signal and you can do whatever you like.

Dave
A: 

If you're dead set on Ethernet, modules such as the XPort and WizNet modules make it much simpler to add Ethernet to microcontroller-based systems.

Nick Veys
A: 

I'd recommend the PIC also. You might get samples of the micro from Microchip. They come with a TCP/IP Stack, student level C compiler (no optimizations). You just need to add power and an Ethernet jack.

The .NET app will need to listen for any broadcast packets on a certain port.

Sounds like a neat little project.

Robert
A: 

Recommend an XPort: very easy things to use if you need ethernet.

For information

Take a look at TCP-Lean by Jeremy Bentham. He was a company at IOSoft hardwareHere

He gets a full TCP/IP stack and web server running on a PIC. Source code is included. It applies equally well to any other hardware. MANY people have stuck PIC's onto old ISA 8-bit network cards. works pretty well.

If you could tolerate starting with serial networking, it's really easy to do Windows "direct-computer-to-computer connection" using a serial port and SLIP.

To send a packet, all you need to do is sent the right sequence of bytes.

The most involved bit is the Microsoft client-server handshake to set up the SLIP link. (Normal SLIP has no call initaition at all) MS protocol ( from memory) Client sends "CLIENT" in response, the server sends "CLIENTSERVER"

After that, a simple application can send a single canned SLIP-framed UDP packet any time it wants. (you don't really need a different sequence number forr a button sender.)

Tim Williscroft
+1  A: 

In my experience, any microcontroller with an on-board Ethernet peripheral will probably suit your needs - some manufacturers do better deals on dev boards and limited compilers than others, so that may influence you. Check out Microchip, TI, Freescale and Keil (third party - but good tools).

Depending on how much work you want to do (in reverse order of time-to-burn!):

  • Buy a development board from anybody that has Ethernet already on board and working code samples.
  • Buy a development board that has a MCU with an Ethernet peripheral, but no code samples.
  • Design your own Ethernet hardware around a MCU with an Ethernet peripheral and write/debug your own code and hardware.

Just my 2c! Have fun.

p.s. And don't forget to test out the IDEs before you buy a dev board. There is a huge difference in quality around MCU development environments and it will directly affect your experience...

Byron Ross
A: 

You want an evaluation board for a processor that comes with cheap/free development tools and has onboard ethernet hardware. A couple that spring to mind are from Atmel (AVR32A) and from Rabbit.

Atmel provide a free development system which comes with a FreeRTOS port and ethernet demo software.

The Rabbit comes with a free development environment which is based on a variant of the C language. The language extensions provide some built in multi tasking capability within the C implementation.

Ian
A: 

I looked into this in 2008. I found one ready button from Germany, it was some $90 plus probably expensive shipping. I did not bookmark it and I have not been able to find ever since. Most likely it was discontinued. I did find this:

http://www.plasma2002.com/epb/#details

radim