JerseyTechGuy - Viewing Profile: Likes - Netduino Forums - Page 2
   
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.

JerseyTechGuy

Member Since 29 Dec 2011
Offline Last Active May 03 2017 02:30 AM
*****

#46678 [Concept] Library for logging, debugging, and simple data analysis

Posted by JerseyTechGuy on 05 March 2013 - 01:07 PM

Well, I'll be coming at this from a different perspective.  I am one of the "Minority" who started as an Electronic Engineer, Learned Web Design and Application Design and has been doing both for 20+ years.  I am old school in the fact that while I have a degree in CEET, I don't believe whole-heartedly in in Certifications and Degrees without the Skills to back it.  I have hired many a person over the years who could spew terms like a dictionary with a spigot but you barely program or design themselves into keeping the job.

 

I learned the hard way... by doing, by tinkering and also by reading, researching and studying... basically putting in the effort and realizing the end result is worth the time spent and there are no shortcuts to be had that bring personal value and satisfaction.

 

I know there are people that discover these Microcontrollers like the Netduino and say, I wish I could have a device that could turn on my lamp when it gets dark outside.  Well, with the Netduino you can build that if you are willing to spend the time to learn about the Netduino, C# and how simple electronics works.  There is knowledge and value to be gained by building it along with personal satisfaction.  If people simply want to shortcut it and get it running ASAP taking all the shortcuts, why not simply by an X10 remote and an X10 Lamp controller.  You will be able to still control that lamp, it's ready to go and will probably be cheaper than making it yourself.

 

Now I'm not saying to build everything from the ground up and force the users to code everything.  I have made and sold many modules for DotNetNuke, Custom .NET controls, breakout boards for sensors all of these which are meant to save time.  This is the idea behind the libraries.  If you are going to design a set of libraries it should be done with a methodical approach.  Research what libraries are out there for the Netduino already.  Stefan, Mario, Fabien and many others have libraries already out there with quite a few great features and drivers.  Look at the gaps that need to be filled. Design the libraries in a way where they are usable and extensible to allow the user to implement it as well as expand it. Then provide clear documentation for the classes for the end users providing examples and instructions.  While this shows how to make it work, it still puts the work back on the user to plumb it all together.

 

So, I few ideas... I've read about frustration on a few forums. Things users have asked for as far as "has anyone written this yet" and here are a few suggestions based on that.  These are classes I had to write for myself on my own .NET Netduino projects.

  • Simple Data Logging - Ability to easily log data to an SD card.  Could be Fixed Text, Could be XML, Could Provide Both.  Make it simple enough to handle basic logging needs but robust enough for advanced users to do something like pass a collection of objects and have it automatically deserialize the collection to the log files.
  • Error handling - A global error handling class which not only is able to handle errors properly but can also take advantage of the Simple Data Logging class and log the errors to a log file.  Keep it extensible so a user could add in functionality to email or tweet an error using a 3rd party class like Stefan's SMTP or Fabien's Twitter classes.
  • Menu System - This could be a tricky one because you need to take into account the different types of display mechanisms, or simply design it to work with Character LCDs but design it in a way where users could enhance it to work with their displays.  I had to design a Menu System for my project that had a Parent/Child relation menu system.  Allowed me to use a simple setup of an Up/Down/Enter button or in a more complex case Up/Down/Left/Right/Enter from a 5 way joystick or tactile button.  The menu system should be configurable to the Screen to allow the user to specify things like; Show on 1 line, 2 line, etc basically how you will see the list of menu items. Easily allow a user to specify what an item click does (ie: Execute a method vs going to a child item).  Have the ability to drive the Menu through code like an array or even from an XML file on the SD Card.

So these are a few of my thoughts, opinions, ideas.  I hope my 2 cents is worth 2 cents.  Good luck with the project and welcome to the Netduino Forums!




#46345 Character LCD On N+2

Posted by JerseyTechGuy on 27 February 2013 - 04:57 PM

I think I have a fix for the garbled characters when using it in SPI mode with the Adafruit LCD Backpack.  I also have many I2C setups running the same backpack that don't glitch.  Myself and another member are currently testing our changes for the SPI glitching issue.

 

Just to be clear about one thing you mentioned.  The LCD issues are not Firmware issues.  There may have been some issues with the Firmware for the ND+2 early on that prevented I2C and SPI from working correctly but these are not related to the LCD.  It also depends greatly on the Hardware Setup you are planning to use to drive the LCD.




#46328 how do measure temperature(with a temperature sensor) via netduino...Please h...

Posted by JerseyTechGuy on 27 February 2013 - 12:48 PM

Hello(Dave)--sorry to disturb you again...but I couldnt find the attached project

 

Hmm, this is the second post in 2 days that the Attachment got lost.  I reattached it to the previous post.




#46121 My Paranormal Investigation Tool(s) Project

Posted by JerseyTechGuy on 23 February 2013 - 03:13 AM

Sorry for delay. Upload issues. It's close to 20 minutes. Enjoy!




#46060 How to power netduino without USB?

Posted by JerseyTechGuy on 22 February 2013 - 12:39 PM

I thought about the car battery because it delivers 12V, so I can do both, power other things AND the N+.

What do you mean with "Booster"?

 

Opto-Isolating sounds good, I have to look into it, I have nothing at home for this =)

 

Greets

 

LiPoly Batteries are only 3.7v so they are not enough to power a ND.  The booster takes the 3.7 and turns it into 5v for the ND.  https://www.sparkfun.com/products/8290




#46055 Is there a Watchdog breakout out there?

Posted by JerseyTechGuy on 22 February 2013 - 11:39 AM

By the way, my goal is still to have the Netduino Plus 4.2 firmware compiled with both 1-wire and hardware watchdog features enabled. For now this 4.1.0.6 with CW2's 1-wire has served me well enough.

 

Also, I have access to RDVS compiler versions 3.1 and 4.0.

 

I still think there is something to be gained from a Hardware watchdog over a software watchdog when there is only one choice available.  Yes it adds more components but it can be ready easily.  Chris Walker mentioned about 3-4 weeks for the software watchdog and in reality we know 3-4 weeks is optimistic as things come up as higher priority.  In the end the option to use both a Hardware and Software watchdog together will give the best of both worlds and a solid foundation for a fault tolerant system design.




#46004 Fridge Wiring Help - how to bypass Defrost Timer

Posted by JerseyTechGuy on 21 February 2013 - 10:12 PM

This sounds more like a basic electronics question (not netduino related) and would be better asked on either a refrigerator repair board like http://www.appliance...com/mainforums/ or even on an electronics forum http://http://forum....outcircuits.com




#45894 Question about SDA/SCL pins

Posted by JerseyTechGuy on 20 February 2013 - 11:39 AM

I can verify that it works. I am running five I2C devices on one board.  All have pullups and all have separate addresses and they work great together.  I have run dual LCD displays with I2C Backpacks with Stefan's scenario of changing addresses.  They also worked well together.




#45739 Netduino 2 Firmware v4.2.2 (update 2)

Posted by JerseyTechGuy on 18 February 2013 - 03:56 PM

Hi,

With current release( [color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]4.2.2 Update 2), does Netduino 2 support I2C?[/color]

Yes.  The I2C bugs were fixed a few versions ago.




#45680 RGB LED Color Cycle

Posted by JerseyTechGuy on 17 February 2013 - 10:25 PM

If you are using Visual Studio for the code, details like the parameters show up in intellisence or even in the object browser built into visual studio.  Basically... as you type the code... when you add the first ( after SetDutyCycle it should show in intellisence what the parameters are.  If not, simply hover over SetDutyCycle and this will often show the objects parameters.




#45666 RGB LED Color Cycle

Posted by JerseyTechGuy on 17 February 2013 - 02:43 PM

Hi again Paul,
 
Apparently, it wants a number inside the parenthesis.

This is because SetDutyCycle takes an unsigned integer (unit) and you are passing an integer (int).  It can't directly cast.
 
if you use redled.SetDutyCycle((unit)red); it should work because this casts it to an unsigned integer.
 
I've used this code below to rotate through red, green and blue.  You can change the loops in many ways.  If you embed the loops you can rotate through every RGB color.  The nice thing about using a 0-255 instead of 0-100 and having it do the math is that you can use standard RBG colors.  Say you want a medium purple, this would be 128,0,128 on a PC so instead of passing 50,0,50, you can use 128,0,128 which is much clearer if you've done any color work in photoshop or with websites, etc.

        static PWM redled = new PWM(Pins.GPIO_PIN_D9);        static PWM greenled = new PWM(Pins.GPIO_PIN_D6);        static PWM blueled = new PWM(Pins.GPIO_PIN_D5);        public static void Main()        {            redled.SetDutyCycle(50);    //50% red intensity                     greenled.SetDutyCycle(50);  //50% green intensity            blueled.SetDutyCycle(50);   //50% blue intesity            // Fade to red            for (byte Red = 0; Red < 255; ++Red)            {                // Values are sent from 0 to 255, but we actually want 0 to 100.                // This makes it RGB color standard compatible.                uint uRed = (uint)(Red * 100 / 255);                redled.SetDutyCycle(uRed);                Thread.Sleep(10);            }            // Fade to green            for (byte Green = 0; Green < 255; ++Green)            {                // Values are sent from 0 to 255, but we actually want 0 to 100.                // This makes it RGB color standard compatible.                uint uGreen = (uint)(Green * 100 / 255);                greenled.SetDutyCycle(uGreen);                Thread.Sleep(10);            }            // Fade to blue            for (byte Blue = 0; Blue < 255; ++Blue)            {                // Values are sent from 0 to 255, but we actually want 0 to 100.                // This makes it RGB color standard compatible.                uint uBlue = (uint)(Blue * 100 / 255);                blueled.SetDutyCycle(uBlue);                Thread.Sleep(10);            }        }

Oh and one additional tip. I've used this with different RGB LEDs and Backlights and if you are using a Common Anode as apposed to common Cathode style you should add [color=#ff0000;]uRed = 100 - uRed;[/color] for each one before you set the duty cycle.  For a Common Anode 0 (zero) is all the way bright and 100 is all the way off.




#45573 how do measure temperature(with a temperature sensor) via netduino...Please h...

Posted by JerseyTechGuy on 15 February 2013 - 03:58 PM

[color=#ff0000;]EDIT: I made a correction to the code and the description.  I mixed up the LM34 and L35.  Let me explain.  The LM34 measures in Fahrenheit whereas the LM35 measures in Celsius. When using the LM34 you would need to subtract the 10mv * 25c (which is zero Fahrenheit) from the millivolt reading to show the reading correctly.  With the LM35 this is not necessary.  You may however still want to subtract some amount of mv from the reading if you decide to calibrate it as it may vary +-1.0c at room temperature.[/color]

 

On the off chance you don't have the documentation, I have attached it.  First you need to look at the documentation.  As Stefan pointed out all sensors are different.  There are many temperature sensors out there and all of them work differently.  The LM35 using a basic Analog Input on the Netduino.  So what you need to know is that the LM35 provides a 250mV output at 25°C. This give you a scale to work with.
 
Using the Scale you determined you can create a class with the following code.  You definite an analog input and set the range from 0v to 3.3v (max range of the analog input) in millivolts thus the 3300.  Next you create a method to read the temp in centigrade.  Performing the sensor.Read returns a reading of 0 - 3300 milli-volts.  Since we know 250mv is 25c, we subtract the 250 to zero it out.  Finally you take the milli-volts and divide by 10 since we know we get a 10mV change per degree Centigrade going by the specs.

public class LM35{    protected AnalogInput sensor;     public LM35(Cpu.Pin pin)    {        sensor = new AnalogInput(pin);         sensor.SetRange(0, 3300);     }    public float GetTemperatureInC()    {        // gain = 10 mV/Deg C         int mv = sensor.Read() - 250; // 250 = 0c        int mv = sensor.Read();         return mv / 10f;     }}

To get the reading you'll need to instantiate the class and call the GetTemperatureInC method.  You can use this type of code in your main loop.

public static void Main(){    LM35 sensor = new LM35((Cpu.Pin)AnalogIn.Pin.A0);    while (true)    {        Debug.Print("Temperature: " + sensor.GetTemperatureInC() + "c");        Thread.Sleep(1000);    }}

If you want your reading in Farenheit also you can easily at a new method to the class called GetTemperatureInF and have it call the GetTemperatureInC method and do the math to convert from C to F.

Attached Files




#45508 Hello! Just getting started!

Posted by JerseyTechGuy on 14 February 2013 - 03:30 PM

I'm a somewhat long-time lurker who's just getting started with Netduino. I've been scouring the internet and trying to get an idea of what is compatible with the Netduino.

 

I'm dying to get started, but I'm not entirely sure of the scale of Netduino's capabilities. I've seen all manner of awesome projects, from SMS controlled sprinkler systems to garage door openers. My first Netduino project was a servo that changed positions every 12 hours to switch my floodlights on and off, but it was just physically actuating the switch.

 

And now for the obligatory noob questions...

 

1) Would it be possible to build something large? A robotic arm that could pick up things based on their color perhaps?

 

2) What would be required to make something like this happen?

 

3) How do you run power to a large motor, but control the logic with Netduino?

 

4) How would I interface with a sensor purchased from parallax such as the Ping?

 

5) If I were to purchase a sensor, how would I create a way to interface with it if no documentation for it is available?

 

So many questions!

 

Welcome to the Netduino world where nearly everything is possible.  I've numbered your questions in the quote above to match answers below.  I'll try to give you my perspective and I am sure others will chime in with theirs.

 

1)  You can certainly build something large.  Really depends on the processing power needed and how many GPIO pins are needed to control devices however the limit of 13 GPIO pins can be overcome with multiplexing or going with a GO Bus style architecture.  So really you are bound by the storage space for your program and the processing power needed to execute the program. I consider my project (Pandora's Box) small to medium (just to give you an idea).  It has sensors for temperature, humidity, barometric pressure, accelerometer, magnetometer, gyroscope, xband, and PIR motion as well as Ping (ultrasonic) and laser distance measurement.  It has a 4x20 LCD screen, 5 way joystick, real time clock, LiPoly Charging and monitoring capabilities as well as an on board web server for access to the logged data (which is taken from the sensors 3-6 times a second as well as the ability to control the board via the web interface.  I am just about maxed out on storage space for the application.

 

2) So, at a high level to make your "robotic Arm happen"... if you were starting from complete scratch... you would likely be building a 5 or 6 degree of freedom arm so you would need all of the parts to build the arm, the 5-6 servos and motors to control it and a gripper with it's servo.  You would then need a motor controller and there are so many.  They are externally powered but controlled by the microcontroller. They make them in Serial, I2C as well as you can control the servos directly with the PWM pins but you are limited to 4 on the Netduino I believe.  You would also need the vision system.  With the Netduino you cannot handle live streaming video for recognition so it would have to be done by single camera shots or using the means of other sensors to monitor the environment then determine the color of the object(s).  There are devices like the PING you mentioned that can be used to detect distance and sensors that detect color.  These would likely need to be on a rotating mechanism to scan the surroundings or even at the end of the arm near the gripper (kinda like Doc Octopus from Spiderman had eyes in his tentacles).  Again this is just a high level overview not specifics.

 

3) As mentioned above, most motor controllers are external powered for the motors then have an interface either PWM, I2C, Serial to control them.

 

4) There are already many classes written for various sensors out there.  Best way is to ask on the forums or search the forums.  I have one I am using for the ping that returns the distance in CM.  Basically the ping has 5V and GND to power it and a Signal (SIG) line.  When you are ready to PING, you send a 10us pulse to the Sig pin using a tristate port on the Netduino, this tells the PING to send a 40khz sound wave out then you turn the the tristate port to read and wait for the return signal.  This is the amount of time it took to bounce back and is used to calculate the distance.

 

5) I have come across very very few sensors with no documentation.  The few I have purchased from China that had to docs usually were copied or designed using the same chipset that other sensors use so you can use their documentation.  If you absolutely have no docs you can still try to find the chipset documentation and figure out how it works from that doc and using an oscilloscope and other meters.

 

I hope this gives you some starting perspective.  Feel free to keep asking away.




#45453 Change the NP2 IP from code

Posted by JerseyTechGuy on 13 February 2013 - 06:36 PM

I agree... yes it does.  In my project I still set it each time from the SD card from a config file, but if I don't do that the settings do stay.




#45427 Change the NP2 IP from code

Posted by JerseyTechGuy on 13 February 2013 - 11:57 AM

Yes, quite easy:

 

var interf = NetworkInterface.GetAllNetworkInterfaces()[0];interf.EnableStaticIP(<settings.staticIPAddress>, <settings.subnetMask>, <settings.defaultGateway>);interf.EnableStaticDns(new string[] { <settings.primaryDNSAddress>, <settings.secondaryDNSAddress> });





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.