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.

monewwq1's Content

There have been 104 items by monewwq1 (Search limited from 21-June 23)


By content type

See this member's


Sort by                Order  

#16676 Lithium batteries

Posted by monewwq1 on 13 August 2011 - 12:21 AM in General Discussion

Looks like you can.


Chris- yes, this setup works great.



#16130 Lithium batteries

Posted by monewwq1 on 01 August 2011 - 01:00 AM in General Discussion

I actually bought this the other day: http://www.sparkfun.com/products/10300, along with this cell: http://www.sparkfun.com/products/339. Do you know if the Power Cell - LiPo Charger/Booster will allow me to keep my project plugged in while also charging the lithium battery? I couldn't find a clear answer on that. I don't want to have to remove the battery and unplug my Netduino in order to charge it.



#16279 LiPo batteries

Posted by monewwq1 on 03 August 2011 - 10:23 PM in General Discussion

Thanks CW2!!



#16219 LiPo batteries

Posted by monewwq1 on 03 August 2011 - 03:03 AM in General Discussion

Hi! I bought a 3.7v 1000mAh single cell LiPo battery and a LiPo charger/boost converter (http://www.sparkfun.com/products/10300), but I don't understand how I can wire the LiPo battery to my Netduino Plus. Can I connect the LiPo battery to VIN and GND? Since I am only getting 5V from the battery, I don't think VIN and GND will work. Where do I plug in the battery to power my Netduino? Thanks! Nick



#29409 Is there a 3.3V pin on Mini?

Posted by monewwq1 on 19 May 2012 - 06:01 PM in Netduino Mini

I am converting a project from Netduino to Netduino Mini, and I have a device that requires 3.3V power. Is there a 3.3V pin on Netduino Mini so I can power this device with the Mini? Thank you



#17367 Input Debounce

Posted by monewwq1 on 01 September 2011 - 01:39 AM in Netduino Plus 2 (and Netduino Plus 1)

I set up my software debounce like this:

	static long lastDebounceTime = DateTime.Now.Ticks;  
        static long debounceDelay = 100000;   //adjust as necessary

	public static void Main() {
		InterruptPort input = new InterruptPort(Pins.GPIO_PIN_D4, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeBoth);
        	input.OnInterrupt += new NativeEventHandler(input_OnInterrupt);
	}	 

	static void input_OnInterrupt(uint data1, uint data2, DateTime time)
        {
            if ((System.DateTime.Now.Ticks - lastDebounceTime) > debounceDelay)
            {           
                lastDebounceTime = DateTime.Now.Ticks;
		// do stuff
            }
        }


Thanks everyone for the help.



#17357 Input Debounce

Posted by monewwq1 on 31 August 2011 - 06:43 PM in Netduino Plus 2 (and Netduino Plus 1)

Stefan, you are right about the current peak, but it is very very short in time.
Supposing the switch equivalent resistance around 1 Ohm (it is surely lower), the capacitor will be discharged in less than one microsecond.
Within this short time an overheat is not possible, so nor any switch damage.

It is also valuable your tip about the software debounce filter, but I think it should be already present. Either it has been implemented and it works, or it has *NOT* been implemented and we must create our own.
Anyway, post the code of your solution: it may be useful sometime.
Cheers


I wrote a simple software de-bouncer today and it works great. I am a little surprised that we would have to do this since the glitch filter should provide this capability. I will post my code here tonight.



#17277 Input Debounce

Posted by monewwq1 on 30 August 2011 - 03:34 PM in Netduino Plus 2 (and Netduino Plus 1)

Hi, I have a wall switch connected to D4 and Ground on my Netduino Plus. I am using the internal pull-up resistor and I set the glitch filter to true. The input still bounces a lot. I also tried just using jumper wires as the switch and it is still very bouncy. My code is simple. I set an Interrupt to listen for EdgeDetectBoth and in the interrupt I am just printing the status to the debug window. Any thoughts as to why it would be so bouncy? I tried putting a .1uF capacitor across the connection and that helped, but is a cap connected across D4 to Ground an Ok method to use or will this cause problems with the Netduino? Is it better to set up a software debounce?



#19986 Inexpensive WIFI device

Posted by monewwq1 on 30 October 2011 - 12:05 AM in General Discussion

Thanks Nick F. for the quick response. I will take a look at the breakout board version as soldering is not my specialty.

In general how was your experience working with this device? Are there any other components that you used for your implementation? thanks again.


mattnet,

I've had great success with it. My Gainspan post should help. There is example C# code which has helped others get up and running quickly and I also put up a video example of ad-hoc Wi-Fi communications between two Netduino's with Gainspan modules.

Just a word of caution: if you want to update the firmware to the current version, you will need to sign a non-disclosure agreement with Gainspan in order to get the current firmware files. However, the device works fine out of the box without a firmware update. I updated my firmware to take advantage of the ad-hoc DHCP server functionality.

Besides wires, there are no other components required, unless you want to update the firmware, which requires a USB-to-UART 3.3V adapter. Check out my post for all the details.

You'll still need to do some soldering to get wires connected to the breakout board holes, but it is not difficult.

Nick



#19981 Inexpensive WIFI device

Posted by monewwq1 on 29 October 2011 - 10:43 PM in General Discussion

The Gainspan GS1011MIP is $69.99, for the breakout board. I use this module with the Netduino.

If you're good at soldering and figuring out schematics, you can get the GS1011MIP module itself for $33.95.



#20433 IBM's "internet of things" protocol - PAHO

Posted by monewwq1 on 09 November 2011 - 11:06 PM in General Discussion

.



#18171 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 01:38 AM in General Discussion

Can an Atmel AT91SAM7X512 microcontroller support the functions of the Taos TSL235R?

I am still not convinced that I need to throw more components at this problem. Netduino has an ARM7 48MHz processor- why should we deny that there is plenty of speed right on this development board? If I were to remove the processor from the Netduino and program it directly, or remove the .Net firmware and run C/C++ on it, I am sure that this sensor would run fine. I've read in these forums that version 4.1.2 of the Netduino firmware is supposed to offer run-time native code interop. I've also read about someone's project called "Fluent", which runs code something like 20 to 30 times faster than the managed code. I've also read that you can run FreeRTOS on the Netduino platform. Can't you run a quadrocopter with FreeRTOS? Isn't that real-time?

Does version Netduino 4.1.2 have runtime native code interop? If not, when will it have this functionality? Where can I get this "Fluent" project? Where can I find resources on how to run my own C/C++ on this board?

I understand the opinion that more tools will help me solve this problem, but I would rather use what I have instead of having to then deal with connecting, learning, and powering these other pieces.



#18164 High resolution light measurement

Posted by monewwq1 on 18 September 2011 - 09:50 PM in General Discussion

I just set up that FEZ code to run with the Netduino and the TLS235R, and Netduino still chokes on it after three reads. I also had to cover up the sensor with black cloth or else the Netduino failed immediately. Here are the readings I'm getting with the sensor completely covered:

Using an Interrupt
Reading 0
20400 Hz
221739.13043478262 uW/cm2
2650.3369113867698 lux (single)
163.81671308080081 lux (gauss)

Reading 1
20500 Hz
222826.08695652176 uW/cm2
2663.3287589916072 lux (single)
164.61973618413808 lux (gauss)

Reading 2
20400 Hz
221739.13043478262 uW/cm2
2650.3369113867698 lux (single)
163.81671308080081 lux (gauss)

Reading 3
3500 Hz
38043.478260869568 uW/cm2
454.71466616929877 lux (single)
28.105808616804058 lux (gauss)

Invalid frequency 0
Invalid frequency 0
Invalid frequency 0

I guess I am going to have to learn how to program another bare MCU and use that for my readings. It is really cool to watch the frequency change on my oscilloscope as the light levels change. The readings look nice and stable. And yes, I shined a really bright light on the sensor and watched the scope and it did go to one pulse every 2µs.



#18119 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 04:37 PM in General Discussion

I am under the impression that I can use an InterruptPort on the Netduino without the need for additional components. Perhaps code like this would work with the TSL235R? I will give it a try and let you know the results.



#18129 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 11:29 PM in General Discussion

Ok, this code works, using the wiring method I mentioned in my other reply above:

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

namespace TSL235R
{
    public class Program
    {
        // Constants
        const ulong period = 10000;			   // Number of light frequency measurements
        const float area = 0.0092F;			 // Sensing area of TSL235R device (cm2)
        // Variables
        static ulong pulses = 0;		  // Counter of measurements of the TSL235R
        static ulong frequency;		   // Read the frequency from the digital pin (pulses/second)
        static float irradiance;			    // Calculated irradiance (uW/cm2)

        private static InputPort TSL235R_Pin = new InputPort(Pins.GPIO_PIN_D7, false, Port.ResistorMode.Disabled);

        static int readCount = 0;
        static bool result = false;
        static bool prev_result = false;
        public static void Main()
        {
            while (true)
            {
                while (readCount < 10000)
                {
                    result = TSL235R_Pin.Read();
                    if (result == true && prev_result == false) // Rising
                        pulses++;
                    if (result == false)
                        prev_result = false;
                    if (result == true)
                        prev_result = true;          
                    readCount++;
                }
                getfrequency();			    
                Debug.Print("Frequency:  ");
                Debug.Print(frequency.ToString() + " pulses/second");		 
                getirradiance();			  
                Debug.Print("Irradiance: " + irradiance.ToString() + " uW/cm2");		
                readCount = 0; 
                pulses = 0;		
               Thread.Sleep(1000);        
            }
        }

        static ulong getfrequency () {
            frequency = pulses/(period/10000);    // Calculate the frequency (pulses/second)
            return (frequency);
        }

        static float getirradiance()
        {
            irradiance = frequency / area;	// Calculate Irradiance (uW/cm2)
            return (irradiance);
        } 
    }
}

Example results from debug console:

Frequency:  
1786 pulses/second
Irradiance: 194130.438 uW/cm2
Frequency:  
1790 pulses/second
Irradiance: 194565.219 uW/cm2
Frequency:  
1932 pulses/second
Irradiance: 210000 uW/cm2
Frequency:  
2375 pulses/second
Irradiance: 258152.172 uW/cm2
Frequency:  
2478 pulses/second
Irradiance: 269347.812 uW/cm2
Frequency:  
2640 pulses/second
Irradiance: 286956.5 uW/cm2
Frequency:  
2435 pulses/second
Irradiance: 264673.906 uW/cm2
Frequency:  
3001 pulses/second
Irradiance: 326195.656 uW/cm2
Frequency:  
2720 pulses/second
Irradiance: 295652.156 uW/cm2
Frequency:  
2540 pulses/second
Irradiance: 276086.938 uW/cm2
Frequency:  
2104 pulses/second
Irradiance: 228695.641 uW/cm2
Frequency:  
2742 pulses/second
Irradiance: 298043.469 uW/cm2

There are two problems here though:
  • I am not using an InterruptPort, because it did not work properly for me.
  • I do not know if the readings I am getting are really accurate irradiance measurements.

Regarding Point 1, if anyone knows how to modify this code to use an InterruptPort, please reply and let me know. I tried to add InterruptPort code, but it causes my Netduino to lock up and become non-responsive to my C# IDE.

Regarding Point 2, I put a black piece of felt cloth over the sensor, and the reading went way down. I then shined a bright light onto the sensor and the reading went way up, so I know I am getting semi-valuable readings. However, the readings fluctuate by about 20 to 50 values while I am at a particular light level, and I am uncertain why. The readings do go up and down as expected, but they also "jump" while they are within that range. How can I fix this? Perhaps there is nothing wrong. I wonder if shadows are causing the "jumps".



#18204 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 05:48 PM in General Discussion

Chris, et. al, Here is the simple version of my code: [



#18166 High resolution light measurement

Posted by monewwq1 on 18 September 2011 - 10:10 PM in General Discussion

Can someone please speed up my Netduino? Does anyone have a Netduino Ultra I could borrow? :D



#18126 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 07:52 PM in General Discussion

Yes, if an Arduino can interface with this sensor, I find it hard to believe that a Netduino cannot.

This is the wiring I am using right now:

TSL235R ------ Netduino
======= ---- ========
GND(1) ---- GND
Vcc(2) ------ +5V
Out(3) ------ Digital I/O pin 2

I also have a 0.1uF cap wired from Vcc to GND, as mentioned in the TSL235R datasheet.

This does not work, and when I try to load my C# via USB, it says: "An error occurred: Please check your hardware." Edit: If I remove the TSL235R from the Netduino, I do not get the hardware error. I have no other devices plugged in to the Netduino.

I also tried wiring it to 3.3V on the Netduino and that does not work either.

Does anyone know what is wrong with my wiring?



#18195 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 02:30 PM in General Discussion

Hi NickDuino,

I'm just picking up on this thread now, but are you using InputPort to meeasure the time in managed code instead of using InterruptPort (which passes a fairly precise timestamp of the original event)?


Hi Chris,

I am using InterruptPort:

                // the pin is expected to interrupt on rising edges
                InterruptPort _dataOutInterruptPort = 
                    new InterruptPort(Pins.GPIO_PIN_D2, false,
                                       Port.ResistorMode.Disabled,
                                       Port.InterruptMode.InterruptEdgeHigh);

                // add an interrupt handler to the pin
                _dataOutInterruptPort.OnInterrupt += 
                    new NativeEventHandler(_dataOutInterruptPort_OnInterrupt);

And in the event handler _dataOutInterruptPort_OnInterrupt, I am simply counting the pulses with a long variable:

            private void _dataOutInterruptPort_OnInterrupt(uint port, uint state, DateTime time)
            {
                _pulseCount++;
            }

I'm then using the _pulsecount to determine the frequency and then using some additional math to get the irradiance. If I cover the TSL sensor with a black cloth, I do get a few readings from the Netduino, but after that, my Interrupt stops firing. If I shine a bright light on the TSL sensor, I never get any readings and the Netduino becomes "busy" and unresponsive to the IDE.

Perhaps there is too much code in my interrupt routine. I am going to write a real simple version that does not do any irradiance calculations and only prints a very limited amount to the Debug console. I will post the code to this thread later today.



#18116 High resolution light measurement

Posted by monewwq1 on 17 September 2011 - 02:50 PM in General Discussion

I am trying to find a suitable component that would allow me to measure the brightness of an image appearing on a computer monitor. Specifically, the computer is set up to flash different colored images and I want my Netduino to read and interpret the brightness values of those images. I bought this light-to-frequency converter: http://www.sparkfun.com/products/9768, which looks promising. Does anyone have any other suggestions for suitable components? I suppose I could use a standard photodiode, but I am looking for a large resolution, and I need a fast response time because the colors on the monitor will flash on and off quickly. I am thinking that having a large resolution will allow me to set up a larger range of commands that could occur depending on the light frequency that the Netduino reads. The end goal is to be able to allow a user to program certain aspects of my Netduino using the variances of light frequencies coming from images on a web page. In effect, a "'dark" frequency might represent a "1", and a "light" frequency might represent a "0". A company called Aniomagic has an e-textile product called "Sparkle" that allows you to program it by holding it up to your computer monitor, but I have much bigger plans for this basic idea. You can see "Sparkle's" program page here: http://www.aniomagic...program/?hl=en. Do you think the light-to-frequency converter would work for a Netduino project like this?



#18207 High resolution light measurement

Posted by monewwq1 on 19 September 2011 - 06:23 PM in General Discussion

P.S. A quick way to help determine if the Netduino's memory is getting filled with events is printing out the avaiable memory using Debug.Print(Debug.GC(true)); in your loop (not the event -- Debug.Print will slow down your event).



Here's the Debug.GC(true) output, and I ran this from the main loop, not the event:

27888
27000
27912
31056
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32796
32532
20472

After the 20472, I lose connection with the IDE. I am using a Netduino Plus by the way. If I turn off networking, would that help? I see that with networking turned off, I should have 60k of RAM. If so, how do I turn off networking? If that won't help, what else can I do?



#18154 High resolution light measurement

Posted by monewwq1 on 18 September 2011 - 07:24 PM in General Discussion

I am still confused as to why I cannot directly interface it with a Netduino. Does it somehow make a difference if it is outputting a 50% duty cycle and not a pulse train? How are they doing this with a .Net Micro Framework board? Here is an example of directly interfacing a TSL230R with a .Net FEZ board, using .Net Micro Framework C# code. Am I missing something? Are they scaling the result or something?



#18152 High resolution light measurement

Posted by monewwq1 on 18 September 2011 - 06:51 PM in General Discussion

No, the ADC was for an hypothetical analog sensor. If you're hooking your sensor to an arduino, you can directly count the pulses with it and then send that number to your netduino. However, using an arduino is overkill for that, you could just use a "naked" microcontroller (e.g. an atmega168 or similar - also overkill for this, but a lot cheaper than a "full" arduino :) - that is, if you already have a programmer/are planning to buy one anyway).




#18139 High resolution light measurement

Posted by monewwq1 on 18 September 2011 - 09:20 AM in General Discussion

Page 3 of this document indicates that the TSL235R can be used for photographic applications. Instead of the project I mentioned above, let's say I want to build an accurate light meter for a camera. How could I make the TSL235R work with the Netduino from 1Hz all the way to the full 1MHz output frequency so that I have full resolution? If I programmed this in native code, would that work? Or is there another component I could use to obtain the frequency from the TSL235R and then somehow send the results to the Netduino? If so, how can I do this?



#18150 High resolution light measurement

Posted by monewwq1 on 18 September 2011 - 06:28 PM in General Discussion

The sensor looks great, but there is a problem that makes any conversion hard. You may notice that the sensor has a dynamic of 10E6, i.e. from 1 to 1MHz. In other words, if this sensor was a voltage generator and you were using an ADC, you should consider at least a 20-bit ADC.
So, I guess the Arduino would be the easiest way to monitor the frequency produced by the sensor, just because you may code the best algorithm without great efforts.
Hope it helps.
Cheers




Pardon my ignorance, but does this mean I could connect a 20-bit ADC to an Arduino and use it to measure the TSL235R output and then connect an Arduino to my Netduino via SPI? This way, the Arduino could report the measurements to the Netduino at a certain reasonable time interval. Is that correct?

I found this ADC chip that looks like it interfaces with an Arduino nicely. Although it is a 24-bit ADC, they were getting 18-to-19-bit precision in testing. Would this chip work for me?




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.