New project - experienced developer, new to Go - Netduino Go - Netduino Forums
   
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.
Photo

New project - experienced developer, new to Go


  • Please log in to reply
7 replies to this topic

#1 digitaldias

digitaldias

    New Member

  • Members
  • Pip
  • 2 posts

Posted 14 April 2013 - 07:46 AM

Hi all! 

I was looking for a fun project to work with and came up with the idea of making an in-door irrigation system for my more expensive plants. The idea is: 

 

1) Create a device that can measure humidity from the soil

2) Report the humidity once per hour to a web API that I'll be writing.

3) From the web service, provide instructions for opening/closing a valve that releases water into the plant

 

Additionally, I will be looking into weather forecasts to recommend misting the leaves of the plants is the day was hot and warm (so, a third device reporting temperature). Further down the timeline, something to trigger the window blinds to shield the plants from too much direct sun would be easy to make I hope.

 

But I am oooooooojust beginning!

So far, I've obtained the SDK for .Net Micro, as well as downloaded the Go SDK, both in versions 4.3. I can create a project, and when it's run, a device emulator with 5 buttons and a display show on up screen, accompanied with the message "Found Debugger" in the VS2012 console window.

 

I have not obtained the hardware yet. My idea is that I want to see a functional emulation of my plan before I invest in the hardware bits. I see it isn't cheap, the wifi module alone appears to cost around $89. 

 

The big question is: How to I proceed to work with this code in emulator, so that I can test out my logic while I wait for the stuff to arrive? (Also, if you're in Norway and know a good place to buy the netduino GO, please let me know)

 

Here's what I'm trying to do: 

public class Program	{		private const int FIVE_SECONDS = 5000;		public static void Main()		{			DateTime _lastUpdate = DateTime.Now;			// write your code here			while (true)			{				var elapsed = DateTime.Now - _lastUpdate;				if (elapsed.Hours >= 1)				{					ReportHumidityToWebService();					_lastUpdate = DateTime.Now;					Thread.Sleep(FIVE_SECONDS);				}			}					}		private static void ReportHumidityToWebService()		{			throw new NotImplementedException();		}	}

 

 

 

 

 

 

 

 

 

 



#2 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 15 April 2013 - 10:40 AM

Hello and welcome to the forum!

 

What happens when you run the application by pressing the green "play" button?

 

I see an exception is thrown in your ReportHumidityToWebService subroutine. If you run the code, you will immediately get an exception and the application will not continue from there. 

 

AFIK, the emulator should work just like a real device but the "hardware" periphals are of course different than those on an actual Netduino. Apart from the exception being thrown I don't see anything wrong with your code.

 

I would postpone the networking stuff and do a proof of concept first. Why do you need networking in the first place, why not let the Netduino do both the humidity detection and the water valve control in-place?

 

I'm in Sweden and prefer shopping for hardware on eBay. I have never had to pay additional VAT and import fees, probably because the Chinese sellers usually mark the parcel's as "gift" or state a significantly lower order value. Maybe rules are tougher in Norway.



#3 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 15 April 2013 - 04:40 PM

The big question is: How to I proceed to work with this code in emulator, so that I can test out my logic while I wait for the stuff to arrive? (Also, if you're in Norway and know a good place to buy the netduino GO, please let me know)

 

I'd probably look at getting the Netduino Plus 2.  There are not a lot of modules available for the Netduino GO! at the moment.

 

Regards,

Mark


To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#4 digitaldias

digitaldias

    New Member

  • Members
  • Pip
  • 2 posts

Posted 16 April 2013 - 06:02 AM

Thank you for your replies. 

Regarding the exception: Yes, I put it there :-)

Writing software is not a problem (I am a professional developer) what I need help with is: 

 

1) Is there a way to configure the emulator so that it is "connected" to the same modules that I plan to use?

2) I need a board, a moisturizing sensor, and a wifi-module - what else? Do these things run on batteries or do I need a power supply?

2.1) Can I feed them output from a "blind" usb AC/DC connector?

 

Last: 

I do use visual studio 2012 - does anyone have a tutorial on how to set up a working emulator environment while I wait for the hardware to arrive? (I am planning to purchase as soon as I know all the components that I'll be needing - Netduino plus 2 is already on the list)

 

Why I want the wifi module: 

I will be making a set of WebApi's that this duino can speak to in order to report measurements taken every hour. This way, I can create a statistical database and make graphs. Everything looks cooler with graphs :) Besides, I will be hosting this online, so that I can try out a few push mechanisms to alert me on the mobile phone whenever stuff happens - the key here is overengineering :)



#5 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 16 April 2013 - 06:46 AM

1. I actually don't think so since the emulator cannot not emulate whatever hardware you plan to use and probably not even the periphals needed to talk it (i.e. SPI, I2C, etc)

2. As I understand you also need an electro-mechanical water valve, probably one with variable flow and not only on/off. You probably want a valve that is normally closed so that it will close on a power failure. I suppose there are hoses with tiny holes for the purpose of watering.

It is of course possible to run the system on batteries but it depends on the total power draw and you would probably need a step up converter depending on what output voltage the batteries have. A single LiPo cell has ~3.7V and so you would need to boost that to 5V but if you connect several cells in series you would need a 5V regulator or step down converter to bring it down to 5V. Driving the power valve could consume considerate amounts of power so I suggest using a regular AC/DC adapter as power supply.

2.1. A blind USB adapter could suffice since it can normally supply some 500mA but again, it depends on the power needed to periodically drive the power valve.

In my opinion, a Netdiuno Plus 2 would be a good choice since it has Ethernet on-board letting you create a wired prototype.

EDIT: Just to make sure I understand what you want to do:
You will have the Netduino report humidity data wirelessly to a PC. Besides publishing info on the web as diagrams, etc., the PC will feed the humidity data to a software regulator and/or filter and then send commands to the Netduino to adjust the water flow accordingly by driving a power valve.

EDIT: I mean a valve that looks like this one:
Posted Image
http://www.ebay.com/...=item43b73282f8

That one requires very little power maintain its position because it's latched which also means it will remain in it its current position upon a power drop which might be a bad thing.

#6 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 16 April 2013 - 05:19 PM

I'm in Sweden and prefer shopping for hardware on eBay. I have never had to pay additional VAT and import fees, probably because the Chinese sellers usually mark the parcel's as "gift" or state a significantly lower order value. Maybe rules are tougher in Norway.

Same in Norway,I have newer paid fee for ebayshopping from chinese sellers, but Netduinos are not easily available.

proto-advantage.com is good to use, they ship fairly fast, and have almost all products, except the new Netduino2 (they have the Netduino 2 plus), but you have to pay taxes then, but since they are not expensive on shipping, it's not that bad.

http://www.proto-adv....php?cPath=2100

There is also an Norwegian shop that have some parts: http://www.robonor.n...ult/?q=netduino

--
Asbjørn


#7 hanzibal

hanzibal

    Advanced Member

  • Members
  • PipPipPip
  • 1287 posts
  • LocationSweden

Posted 17 April 2013 - 08:25 AM

That proto-advanced shop was great news for me!

I've been looking for a good source of PCB adapters for misc connectors and they seem to have it all at reasonable prices.

Thanks!



#8 neslekkim

neslekkim

    Advanced Member

  • Members
  • PipPipPip
  • 350 posts
  • LocationOslo, Norway

Posted 17 April 2013 - 08:28 AM

Typically I pay $9 for shipping, have bought some pcb adapters there, and also used their service to mount an smt8s mcu on an adapter for breadboarding, fantastic service, they order the chip and solder it for you.

For people in US, it's maybe not that fantastic, but for me, as I had to pay $30 in shipping for one ship from mouser/digikey etc, it's a lot cheaper and better.


--
Asbjørn





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.