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.

hanzibal's Content

There have been 386 items by hanzibal (Search limited from 28-September 23)


By content type

See this member's


Sort by                Order  

#50682 Home Automation - Want to know more?

Posted by hanzibal on 21 June 2013 - 12:22 AM in General Discussion

You might want to look at this old post:
http://www.avsforum....for-itach-irule

And perhaps also this one:
http://itachtoolkit.codeplex.com/

And maybe this too:
http://forums.netdui...ased-ir-remote/

All in all you can build your own iTach emulator or HTTP listener on an NP or NP2 to carry out the commands against whatever h/w you want to control.

The thing is that the iRuleAtHome remote control and builder is just awesome, I use it for all kinds of stuff in my house. I even use it to turn the christmas tree on and off during that time of year. In this post there's a video on controlling a Netduino mini over ethernet:
http://forums.netdui...m-a-smartphone/

You can of course also do it with a PC, Raspberry PI or what have you.



#50514 How to read input from sound sensor?

Posted by hanzibal on 16 June 2013 - 12:17 PM in Netduino 2 (and Netduino 1)

Hi and welcome to the forum! It sounds as if you got it wired correctly but beware the Netduiono analague ports are not 5V tolerant. You could try feeding the module 3V3 instead of 5V and see what happens. I'm not saying you have but there's a possibility you might have damaged the ADC of your Netduino. According to the discription, you should get a transition (in either direction doesn't clearly state which) on the digital pin when the sound pressure exceeds a certain threshold depending on the potentiometer position. Could be transition is made from high to low so try wiring to an interrupt port and have it trigger on both edges. Then put a Debug.Print in the event handler and see if you get anything as you clap and dial the pot slowly from one extreme to the other. I assume that if you had a scope, you would have already used it so I guess you either don't have a one or didn't see a signal According to the review, you need to make a pretty loud noise for it to react, like clapping your hands very close to it. Since you probably already tried this, it would seem to me you got a rotten egg :-(



#49399 multi threading problem

Posted by hanzibal on 13 May 2013 - 09:48 PM in Visual Basic Support

I forgot to say earlier; move the if block to inside the do...loop for both threads.



#50791 The latest thing: Oscilloscope Art

Posted by hanzibal on 25 June 2013 - 10:31 AM in General Discussion

I used an MCP41100 digital pot for drawing the signal and here's the code for it:

http://forums.netdui...-potentiometer/




#50859 Led.dispose() turns on led...why?

Posted by hanzibal on 27 June 2013 - 06:49 AM in General Discussion

It so happens that the pin you are claiming is electrically connected to an on-board LED. When disposing the pin, it reverts to its default config and usage. I'm not sure but, could it be the pin (and thus the LED) is used as a power indicator on your board?



#50968 Compiling and downloading

Posted by hanzibal on 30 June 2013 - 08:14 PM in Visual Studio

Pleae note that the free version "Visual Studio Express" will work just fine for working with the Netduino. I recommend getting a Netduino Plus 2 as it is the most versatile with built-in networking and on-board SD card slot. Netduino mini is very small but not as powerful. Good luck!



#52117 Built-in usb serial communication

Posted by hanzibal on 13 August 2013 - 10:50 AM in Netduino Plus 2 (and Netduino Plus 1)

The Netduino would have to implement a CDC class USB device. I'm pretty sure that would have to be done in native code for performance reasons. I beleive the likeliness for that being included in a coming firmware release is pretty slim so you'd have to do it yourself. This has been discussed before:

 

http://forums.netdui...oard#entry50164

 

Another option could be to implement a USB HID device class and use that for communication. This has been done in managed code, try this Google query and you will find some threads about HID:

 

http://www.google.se...etduino.com HID

 

While using HID from PC application is rather easy (there are libraries), it's not generic like serial communication so you would have to write a dedicated PC application.




#49461 New to this, I want to make sure I use the right tools

Posted by hanzibal on 15 May 2013 - 11:12 AM in General Discussion

Hi Dave and welcome to the forum,

I totally agree with Dave  :P

 

Seems like a good kit to start with. As you know the Netduino Plus 2 has networking capabilities and can send emails and such. As for sound, you can use PWM to play a chime on that piezo buzzer.

 

Since you're an experienced developer, I'm sure you'll manage to put the door bell/mailer together.

 

Good luck!




#52468 Low baud rates on serial port

Posted by hanzibal on 30 August 2013 - 07:39 AM in Netduino Plus 2 (and Netduino Plus 1)

If the meter unidirectional and "read only": UART signals are quite simple active low pulses, look it up on wikipedia and you'll see how to interpret the signal. At 300 baud, it should possible to read using an interrupt enabled GPIO. You would then analyze the time difference in between the slopes. Also, It just might be possible to read it at 1200 and then convert the data afterwards (you would typically receive each bit four times). Start och stop bits might present problems though. If the meter is bidirectional, I think you could use one of these: https://www.sparkfun.com/products/9981



#50361 The latest thing: Oscilloscope Art

Posted by hanzibal on 08 June 2013 - 10:04 PM in General Discussion

Can you see what the oscilloscope says?  :ph34r:

 

oscart_text.JPG

 

I'll be uploading some code later so we can compete in drawing the best oscilloscope art  :D

 




#52524 Low baud rates on serial port

Posted by hanzibal on 03 September 2013 - 02:36 PM in Netduino Plus 2 (and Netduino Plus 1)

Yes, a soft UART would work for receiving since interrupts are correctly time stamped but sending is trickier.

 

Still, if the meter doesn't really use full duplex (won't receive and respond in parallel) you might get away with sending too - 300 baud means >1 ms between pin toggles and that is a pretty long time even for an NP2.




#56471 Lcd 16x4 initialization

Posted by hanzibal on 26 February 2014 - 10:33 PM in General Discussion

Faith, what controller is it, got a datasheet you can point to?



#51251 Webserver and locking

Posted by hanzibal on 09 July 2013 - 12:58 PM in Netduino Plus 2 (and Netduino Plus 1)

You should use an interlocked exchange to change the value of the _serverReady varible. The Interlocked.Exchange method will replace the value and return the previous value in a single atomic (unbreakable) operation.
int _serverReady = 1;if(Interlocked.Exchange(ref _serverReady, 0) == 1){            // process request       .      .      .      // done, open unlock the door      _serverReady = 1;}else{      // server busy}
As indicated above, I think you have to declare _serverReady as an integer for this work. You might want to use the volatile modifier on your variable declaration but I don't know if that feally matters in .NETMF. There might also be a way to configure the listener as synchronous so that the server will never attempt to process requests in parallel. Could be this feature is not available in .NETMF, I'm not sure.



#56349 bitwise comparison & IF condition

Posted by hanzibal on 24 February 2014 - 09:45 PM in General Discussion

That makes it compile but it's not quite the same thing, I'd say it translates into this:
if ((this_led_color & mask) != 0)       SDI.Write(true);else       SDI.Write(false);
Checking for equality to mask is no longer the same when mask has other than a single bit set.



#51705 Anyone tried XMarine?

Posted by hanzibal on 26 July 2013 - 10:35 AM in General Discussion

This is not directly related but looks an interesting way to build smartphone apps for interfacing with your Netduino, for example via sockets over a network.

 

As I understand, XMarine would enable you to use Visual Studio for writing apps for both Android and iOS devices.

 

http://xamarin.com/

 

To me it sounds very cool. Has anyone of you guys tried it?




#51320 Thinking Of Begining To Use Netduino

Posted by hanzibal on 10 July 2013 - 11:29 PM in General Discussion

I agree, a Netduino is not a good choise for those things and I don't even think the PI could cope. Any of those would probably be a really big detour from achieving what you want. As all of the bullets are pretty high level stuff, I'd recommend using a PC. Later, you could move to a micro or nano ATX if size is important. Of course, a Netduino could perhaps handle some of it but what's the point if you got s PC on the side. To be quite honest, I think the stuff you've mentioned taken together could take years to develop no matter what hardware you got.



#50732 Netduino + Video Experimenter shield

Posted by hanzibal on 23 June 2013 - 08:26 AM in Netduino Plus 2 (and Netduino Plus 1)

The shield is probably based around the Maxim MAX7456 chip. Sparkfun has a similar board based on the MAX7456: https://www.sparkfun.com/products/9168 That one has been discussed in these threads: http://forums.netdui...58-netduino-tv/ http://forums.netdui...-video-overlay/ I'm pretty sure I've seen it in other posts as well but I can't find that info right now. Hope that helps a little anyway.



#50369 Driver for the MCP41100 digital potentiometer

Posted by hanzibal on 09 June 2013 - 01:20 PM in Project Showcase

Hi all!

 

The MCP41100 is a programmable digital potentiometer with SPI interface and comes in a breadboard friendly DIP-8 package. You can set it to any value between 0 (zero) and 100 kOhm in 256 steps. You can of course tweak it into doing other ranges by wiring in series or in parallel with other (fixed) resistors.

 

For another project, I needed to produce a variable voltage between 0 (zero) and 5V so I made a simple driver class for it and thought I'll share it with you. Attached you'll find the driver and demo app. It is written for my beloved mini but works with others too requiring only small modifications.

Attached File  miniMCP41100.zip   4.51KB   7 downloads

 

You simply use it like this:

var r = new MCP41100(new SPI.Configuration(Pins.GPIO_PIN_17, false, 0, 0, false, true, 10000, SPI.SPI_module.SPI1));// set half resistance (i.e. ~50k)r.Level = 128;// set zero resistancer.Level = 0;// ...or you can use the Resistance property to set ~50k like sor.Resistance = 50000;// set ~100kr.Resistance = 100000;

The demo app assumes the IC has been wired as a voltage divider like in this schematic (Pw = output):

mcp41100.PNG

When connected that way, you can use it as an a very slow "arbitrary signal generator" meaning you can pretty much draw any signal over time like I did in this post or a nice sine wave if you prefer that:

MCP41100_sine.JPG

 

I guess you could think of the MCP41100 like a "poor man's DAC" :) but since the mini does not have a DAC, it can actually very useful at times as it's also much simpler than to use PWM.

 

Enjoy!

 

EDIT: Note that the MCP41100 is not suited for signal generation in general.




#50151 Analog.ReadRaw unhandled exception in SecretLabs.NETFM

Posted by hanzibal on 31 May 2013 - 07:56 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, That "first chance" is from an exception being caught in a try...catch and the second is an exception (the same?) not being caught. I suppose the error is what it is said to be, e.g. an object that unexpectedly has a value of null. Since the code has run for quite a while and the exception looks not to originate from your own code, my guess would be that it is due to unsufficient memory available or something else that builds up over time. I would think its hard for anyone to say much more about it having not seen your code.



#49420 Old school ft. New school: Snake with a Lumia 920 controlling a 5110 LCD usin...

Posted by hanzibal on 14 May 2013 - 11:42 AM in Project Showcase

Very nice, at first I didn't see the Lumia but only an old 5110 but then I noticed the animated "fly by" arrows and reallzed the 5110 was never capable of that. Thanks for sharing! Edit: also, congrats on becoming a Nokia Developer Champion!



#50385 Driver for the MCP41100 digital potentiometer

Posted by hanzibal on 09 June 2013 - 07:19 PM in Project Showcase

Yes, I even mentioned PWM in the end of my post. Naturally, the MCP41100 is not at all intended for signal generation (for many reasons), it just seemed like a "fun thing" as opposed to being something of practical value. 



For debugging, that simple type of signal can be good. You just hook up a voltmeter, or a lead to a multi-channel voltage data-logger, and you can get valuable information.  :)  It's also much easier than a serial output.  And, a handheld voltmeter is small and easy to use, and to look at signals/test-points.

That's a good tip!

 

Speaking of PWM, below is a sine(-ish) wave form that I generated using a UART and an LP-filter. It was done using a regular USB to TTL UART converter cable with code running on the PC in an attempt to produce audio - see how beautifully smooth it is?  :lol: 

UART_sine.JPG

 

Also, I was actually thinking of doing PWM audio on an MSP430 but someone beat me to it:

 




#50462 Netduino Plus 2, SPI interferes with Networking?

Posted by hanzibal on 13 June 2013 - 10:55 AM in Netduino Plus 2 (and Netduino Plus 1)

I would have thought it be unusual for an SPI slave device to ignore chip select but could be it only looks at the raising edge of the clock as long as !cs is asserted, i.e. performing and AND operation on the two. Maybe that is defacto standard procedure. The parameters you set do matter and controls how the Netduino SPI module manages the cs and clock pins respectively but I guess you knew that already.



#50681 Mocking Inputs?

Posted by hanzibal on 20 June 2013 - 11:58 PM in General Discussion

Instead of Unit-testing, you might consider "black boxing" by writing a corresponding set of interfaces through which data Is introduced. You would then make your fake implementations always returning fixed or random dummy data as needed. Later of course, you would make real (non-fake) implementations.



#50660 Vin

Posted by hanzibal on 20 June 2013 - 12:18 PM in Netduino Plus 2 (and Netduino Plus 1)

If you mean what the pin is used for, I believe it is for supply voltage 7.5 - 9V.




#50734 Turnkey RTC?

Posted by hanzibal on 23 June 2013 - 10:49 AM in General Discussion

Hi! While looking for adjacent info, forum member emg mentioned this module: http://www.ebay.co.u...e-/270762577188 That and other alternatives was discussed in this thread: http://forums.netdui...for-rtc-backup/




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.