Netduino home hardware projects downloads community

Jump to content


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

Stefan

Member Since 28 Feb 2011
Offline Last Active Jul 16 2014 01:22 PM
*****

#15535 LCD Help needed, 16x2s are boring

Posted by Stefan on 15 July 2011 - 04:11 PM

Stefan you were much faster than I could wish, :o

http://wiki.netduino...hx?NoRedirect=1


#15481 Digital GPIO Pins Voltage

Posted by Stefan on 14 July 2011 - 04:11 PM

For the digital I/O's, it just doesn't matter. For analog I/O's it does. They are 3.3V, not 5V tolerant. An important one to keep in mind :)


#15260 Multiplexing with servos on the Netduino

Posted by Stefan on 09 July 2011 - 12:56 PM

Hi :)

Earlier I broke the limitation of generic input and output ports.
The next step would be PWM ports, or actually servo ports, since PWM can drive much more then only servos.

I tried a few types of hardware but found one in particular quite simple to use, and it can be daisychained (and I love that!)

http://www.youtube.com/watch?v=Tj-9ZvSNaig

As you can see in the movie I have 5 servos working. Why not more? Simple: servos cost money and I only have 5 :D
The most left isn't quite visible from the top, but it's a robotic claw. See this movie for more.

To get this result, I used the Pololu Micro Serial Servo Controller which looks like it's actually just a pre-programmed PIC processor (PIC16F628A) which drives the servo and gets it's input from the serial interface.

To use it, you need to connect it to your Netduino like this:
GND -> Netduino GND
VIN -> Netduino +5V
SIN -> Netduino pin 1
OUT -> Netduino pin 0
Also, above the servo connectors there is a Vcc and Gnd-connector, which should be connected to Netduino Vin and Gnd.

Ps. small warning: in my movie the maximum of simultaneously controlled servos is two. This is because when I tried five, my power supply said: "oh just turn those darn things yourself, I give up!". Servos pull quite some power.

Download Micro Serial Servo Controller.zip


#14354 Power Netduino (Linksys WRT-54Gl)

Posted by Stefan on 15 June 2011 - 06:06 PM

Hi Sebastiaan, First, welcome to the Netduino community :) It all depends on the needs of both devices. I know most routers don't use the maximum of their adapter. You can know for sure if you measure the amperes used by both devices while connected seperatlely. If it doesn't exceed 1A, it would do fine. The netduino board itself doesn't consume much power, it's what you connect to it that consumes the most power. I see an LCD, those are known for high power consumption. Now for powering it, You could use the adapter socket on the netduino or the Vin pin. Those are virtually the same since they're connected to each other.


#14318 Basic questions

Posted by Stefan on 14 June 2011 - 01:25 PM

Hi Beer,

Welcome to the Netduino community!

To respond to your questions:

- Is there a .NETMF library support for SD card I/O.
Yes, there is. It's actually built in the firmware.

- Is there a .NETMF library support for USB devices
As far as I know, no. But it's not impossible to write it I suppose. You need a USB Host port to start with.

- Is there a .NETMF library support for ETHERNET (I saw some samples and there was Sockets namespace).
Yes, there is. It's actually built in the firmware.

- Is 64KB enough for all those libraries mentioned above at the same time?
Yes. As stated, SD and Ethernet are already in the firmware so they won't consume any of the code RAM. You could also try this beta firmware to gain even more RAM: http://forums.netdui...te-50-more-ram/

- Is there any color graphic display available for netduino.
Several, check this out: http://www.google.co...ms.netduino.com

- What about SPI/I2C --> is there .NETMF support or do I have to manage signals on my own.
Both are available via managed classes in the firmware.



Another question that came up in my mind reading your project is that you probably need a real time clock for data logging? The Netduino doesn't have a real time clock onboard, but there are breakouts for that purpose. See http://wiki.netduino...k-Breakout.ashx for example.


#14122 Event handlers sample

Posted by Stefan on 09 June 2011 - 04:49 AM

Second sample, a bit more complex, using events:

Imports Microsoft.SPOT
Imports Microsoft.SPOT.Hardware
Imports SecretLabs.NETMF.Hardware
Imports SecretLabs.NETMF.Hardware.Netduino

Module Module1

    Public led As OutputPort = New OutputPort(Pins.ONBOARD_LED, False)

    Sub Main()
        Dim button As InterruptPort = New InterruptPort(Pins.ONBOARD_SW1, False, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth)
        AddHandler button.OnInterrupt, AddressOf ButtonChange
        button.EnableInterrupt()

        Thread.Sleep(Timeout.Infinite)

    End Sub

    Sub ButtonChange(ByVal data1 As UInteger, ByVal data2 As UInteger, ByVal time As Date)
        If data2 = 0 Then led.Write(False) Else led.Write(True)
    End Sub

End Module

When pushing the onboard button, the onboard led is emitting.

Attached Files




#13572 communicate between boards

Posted by Stefan on 24 May 2011 - 06:31 AM

Hi Scotty,

Welcome to the Netduino community!

Which boards do you want to stack? Shields can stack on top of the Netduino, and they can work together if the pins don't interfear. But multiple Netduinos can't stack.

It is possible though, to link multiple netduinos, for example by using a serial port. You need to link pin 0 and pin 1 to the other netduino pin 1 and pin 0 (crossed). Then you can use the SerialPort class to do the rest.


#12554 Happy Birthday boobytrap

Posted by Stefan on 28 April 2011 - 06:16 AM

Yesterday I made a small 10-minutes project. A Netduino in a box with a speaker and simple switch:

Posted Image

It's on the door of my brother's office right now, since he has got his 30th birthday. As soon as he opens the door it'll play Happy Birthday with my speaker class :D

Just a small project, but worth sharing I suppose ;)


#12464 Speaker class and Netduino Keyboard

Posted by Stefan on 24 April 2011 - 02:29 PM

Hi :)

While toying with PWM I connected a speaker to my Netduino. I got some noise from it in no-time, but regulated sounds was a challenge. I got some help from a good friend of me and with his help I crafted the attached class. Driving it is very simple if you are familiar with ancient BASIC-dialects.

For my example I connected an old PC-speaker to pin 9 and ground.

First we need to initialize the speaker:
Speaker PCSpeaker = new Speaker(Pins.GPIO_PIN_D9);
Then we have three methods, as mentioned before I took the syntax from BASIC.

For a simple beep:
PCSpeaker.Beep();

To produce a 440 hertz tone for 5 ticks:
PCSpeaker.Sound(440, 5);

To play a simple melody:
PCSpeaker.Play("cdec cdec");     // Are you sleeping? Are you sleeping?
PCSpeaker.Play("efg efg");       // Brother John, Brother John,
PCSpeaker.Play("gagfec gagfec"); // Morning bells are ringing! Morning bells are ringing!
PCSpeaker.Play("c<g>c c<g>c");   // Ding, dang, dong. Ding, dang, dong.

The syntax of the Play-method is the same as in BASIC and according to the Music Macro Language. Here's a summary:
// Octave and tone commands:
//   Ooctave    Sets the current octave (0 - 6).
//   < or >     Moves up or down one octave.
//   A - G      Plays the specified note in the current octave.
//   Nnote      Plays a specified note (0 - 84) in the seven octave
//              range (0 is a rest).
// 
// Duration and tempo commands:
//   Llength    Sets the length of each note (1 - 64). L1 is whole note,
//              L2 is half note, etc.
//   ML         Sets music legato.
//   MN         Sets music normal.
//   MS         Sets music staccato.
//   Ppause     Specifies a pause (1 - 64). P1 is a whole-note pause,
//              P2 is a half-note pause, etc.
//   Ttempo     Sets the tempo in quarter notes per minute (32 - 255).
// 
// Suffix commands:
//   # or +     Turns preceding note into a sharp.
//   -          Turns preceding note into a flat.
//   .          Plays the preceding note 3/2 as long as specified.

After this class was done I made a simple keyboard, see this video for more details:

http://www.youtube.com/watch?v=m0FUJ579bp0

:D

In QBasic there were a lot of people who liked to put up some (part of) songs, I found these quite nice:
- http://www.madhouseb...iew&view=qbasic
- http://www.network54...asic Play Music
- http://www.scribd.co...irit-Qbasic-txt

You can just use these strings for the Speaker.Play()-method to get the same result!

Downloads:
- Speaker.zip (Just the driver and a very simple sample project)
- NetduinoKeyboard.zip (The keyboard-project from the movie)


#12040 Easy multiplexing with the Netduino

Posted by Stefan on 12 April 2011 - 09:39 PM

If you want to skip the blah blah blah and only want to see something or download the schematic and source, scroll to the bottom of this article :)

From the moment I got my Netduino microprocessor board I was thinking, what are it's limitations, and how can I work around them? One of the most obvious limitations is the amount of Input/Output (I/O) ports. This image shows what the board is capable of.

Posted Image

I wanted to look a way around this limitation with quite some success. By adding multiple bitshift IC's it's possible to get virtually unlimited I/O-ports. The only limitation in this is the clock speed, but I haven't reached this limitation yet.

I've used two kinds of IC's, a serial-in/parallel-out, called 74HC595, and a parallel-in/serial-out, called 74HC165. They can be used in chains, so by adding more IC's, you won't need to use more I/O ports on the Netduino board. In my example below I got 32 I/O ports by only occupying 5 I/O's on the netduino.

The schematic is quite simple, I used buttons with pull-up resistor to represent of inputs and leds to represent outputs. The basic idea is that every added IC adds 8 Input or Output ports.
You can see it working at Youtube.

Posted Image

Then we get at the code part. Connecting stuff is one thing, making it work is another. The Netduino is filled with code compiled from C# and uses the .NET MicroFramework.
This framework has a couple of built-in classes, for example, OutputPort, InputPort and InterruptPort. I made copies of those built-in classes to work with the bitshift IC's, so usage would be a simple as the rest of the framework.

The only difference is that we need to define the IC setup first. So we got two input IC's and two output IC's. We define the connected chains first:
Ic74HC165Chain ChainIn = new Ic74HC165Chain(SPI_Devices.SPI1, Pins.GPIO_PIN_D10, 2);
Ic74HC595Chain ChainOut = new Ic74HC595Chain(SPI_Devices.SPI1, Pins.GPIO_PIN_D9, 2);
Both IC chains are connected to the Netduino's SPI bus (Pins 11 to 13) and use a different Chip Select-pin, in this example pins 9 and 10. Both chains contain 2 IC's.

When the chains are defined, we have to make interfaces for the IC's. This is done by this:
Ic74HC165 IcIn1 = new Ic74HC165(ChainIn, 0);
Ic74HC165 IcIn2 = new Ic74HC165(ChainIn, 1);
Ic74HC595 IcOut1 = new Ic74HC595(ChainOut, 0);
Ic74HC595 IcOut2 = new Ic74HC595(ChainOut, 1);
The enumeration starts at 0 as you can see. 0 is the first IC in the chain, 1 the second, 2 the third, etcetera.

Now we can define our Input/Output/InterruptPort classes. They have the same parameters as the regular classes except for the first one, which defines the IC it's connected to:
InterruptPortShift Button0 = new InterruptPortShift(IcIn1, Ic74HC165.Pins.GPI_PIN_D0, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);            
OutputPortShift Led0 = new OutputPortShift(IcOut1, Ic74HC595.Pins.GPO_PIN_D0, false);
Here we defined an InterruptPort and OutputPort using bitshift registers. From this part, the code which follows is exactly the same as it would be using the onboard I/O ports.

Credits
I wouldn't have done this without the help of two very nice guys in the Netduino Community: Mario Vernari and CW2. Thanks again :)
The schematics are made with the free tool Fritzing. Should also be mentioned since the tool is a great help!

Download source at http://netmftoolbox.codeplex.com/


#12015 Threads VS Timers

Posted by Stefan on 12 April 2011 - 02:06 PM

Thanks for all the quick feedback. :)
@Stefan - I like that InterruptPort, it would make life a lot easier. All the input plugins so far are passive however. I'm planning on just reading a pin on a set interval to gather data. (i.e. Read temp once an hour) so can I still use the InterruptPort? I could add the interrupt and use that to trigger my output plugins, but I still need to poll the input plugins.

The interruptport just triggers an event when the inputport changes value, nothing more, nothing less.
If you want to read a temperature once an hour it's perhaps not the best solution.

You could use a timer, see http://msdn.microsof...ercallback.aspx for more about that, but as stated earlier, timers aren't 100% precise I've read somewere else. If it's not life depended that it's a couple of seconds wrong, the timer classes can be useful.


#12005 Threads VS Timers

Posted by Stefan on 12 April 2011 - 01:03 PM

If I understand you correctly you want to use a timer/thread to poll an inputport for data? You can also use a InterruptPort for that, which works event-based. See this tutorial for details: http://www.netduino....edbuttonapp.zip


#10874 Keypad driver and scheme

Posted by Stefan on 13 March 2011 - 03:09 PM

True, think this version would be better? http://nederland.lig...313_keypad2.zip




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.