8 Replies - 6364 Views - Last Post: 31 May 2011 - 02:46 PM

#1 dyno  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-May 11

developing software to work with sensors and actuators?

Posted 28 May 2011 - 07:46 AM

Hi,

I'm new here and not a computer expert so i hope this is the right place.
I'd like to know how hard it would be to make a software program or control unit that can:

Read a sensor input > follow a predetermined reaction map > activated a actuator.
Preferably something small and stand alone like a micro chip on a small circuit board.

Can any one give me more info on how this could be done and what would be needed?

Is This A Good Question/Topic? 0
  • +

Replies To: developing software to work with sensors and actuators?

#2 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: developing software to work with sensors and actuators?

Posted 28 May 2011 - 08:13 AM

"Hard" is a relative term.
If you are already experienced with programming, then the board is just matter of adding some serial IO to existing knowledge.

So how much programming experience do you have?

A buddy of mine did up a control board that had a dozen inputs and outputs. I've emailed him for some details. When he gets back to me I'll update it here.
Was This Post Helpful? 0
  • +
  • -

#3 dyno  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 28-May 11

Re: developing software to work with sensors and actuators?

Posted 28 May 2011 - 08:29 AM

zero programing skills lol.
So i'd ether be interested in learning how to do this or know how easy it would be for some one with a "certain" level of skill to do this.
Was This Post Helpful? 0
  • +
  • -

#4 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: developing software to work with sensors and actuators?

Posted 28 May 2011 - 08:37 AM

Then you really need to learn to code just within windows and within your PC before you start trying to code for external devices.

First work through the resources below.
Then you can start working on serial IO.
Serial port communication

But for some with experience it really isn't all that difficult. We do it in some of our products where we check the temperature of a sensor and turn on cooling systems, when a water sensor goes high we turn on pumps and wipers and blowers etc.



Standard resources, references and suggestions for new programmers.


I would recommend you start with "Hello World" just like the other million+ coders out there. Then work your way up to the more advanced tasks like this.

The problem with taking on large, complex tasks like this when you are new to coding is that
  • it will frustrate you to the point of quitting,
  • you don't know enough about coding to know where to start or in what direction to design your program
  • You risk learning via the 'Swiss cheese' method where you only learn certain bits and pieces for the one project but have huge holes in your education.


I am going to guess that you are trying to teach yourself C# without much guidance, a decent book or without knowing where to look. Sometimes just knowing where to look can make all the difference. Google is your friend.
Search with either "C#" or "MSDN" as the first word: "MSDN Picturebox", "C# Custom Events", "MSDN timer" etc.

But honestly, just typing away and seeing what pops up in Intellisense is going to make your self-education take 20 years. You can learn by trying to reverse engineer the language through banging on the keyboard experimentation - or you can learn by doing the tutorials and following a good "How to learn C#" book.

Free editions of Visual Studio 2010

May I suggest picking up a basic C# introductory book? There are so many great "How do I build my first application" tutorials on the web... There are dozens of "Learn C# in 21 days", "My first C# program" type books at your local book seller or even public library.

D.I.C. C# Resource page Start here
Intro to C# online tutorial then here...
C# control structures then here.
MSDN Beginner Developer video series
MSDN video on OOP principals, making classes, constructors, accessors and method overloading
MSDN Top guideline violations, know what to avoid before you do it.

The tutorials below walk through making an application including inheritance, custom events and custom controls.
Bulding an application - Part 1
Building an application - Part 2
Quick and easy custom events
Passing values between forms/classes

Working with environmental variables
'Why do we use delegates?' thread

Debugging tutorial
Debugging tips
Great debugging tips
It still doesn't work, article

Build a Program Now! in Visual C# by Microsoft Press, ISBN 0-7356-2542-5
is a terrific book that has you build a Windows Forms application, a WPF app, a database application, your own web browser.

C# Cookbooks
Are a great place to get good code, broken down by need, written by coding professionals. You can use the code as-is, but take the time to actually study it. These professionals write in a certain style for a reason developed by years of experience and heartache.

Microsoft Visual Studio Tips, 251 ways to improve your productivity, Microsoft press, ISBN 0-7356-2640-5
Has many, many great, real-world tips that I use all the time.

Writing a text file is always one of the first things people want to do, in order to store data like high-scores, preferences and so on
Writing a text file tutorial.
Reading a text file tutorial.

And everyone always wants to connect to a database, right out of the gate so
Database tutorials right here on DIC

These are just good every-day references to put in your bookmarks.
MSDN C# Developers Center with tutorials
Welcome to Visual Studio

Have you seen the 500+ MSDN Code Samples? They spent a lot of time creating samples and demos. It seems a shame to not use them.

Let me also throw in a couple tips:
  • You have to program as if everything breaks, nothing works, the cyberworld is not perfect, the attached hardware is flakey, the network is slow and unreliable, the harddrive is about to fail, every method will return an error and every user will do their best to break your software. Confirm everything. Range check every value. Make no assumptions or presumptions.
  • Take the extra 3 seconds to rename your controls each time you drag them onto a form. The default names of button1, button2... button54 aren't very helpful. If you rename them right away to something like btnOk, btnCancel, btnSend etc. it helps tremendously when you make the methods for them because they are named after the button by the designer.
    btnSend_Click(object sender, eventargs e) is a lot easier to maintain than button1_click(object sender, eventargs e)
  • You aren't paying for variable names by the byte. So instead of variables names of a, b, c go ahead and use meaningful names like Index, TimeOut, Row, Column and so on. You should avoid 'T' for the timer. Amongst other things 'T' is commonly used throughout C# for Type and this will lead to problems. There are naming guidelines you should follow so your code confirms to industry standards. It makes life much easier on everyone around you, including those of us here to help. If you start using the standards from the beginning you don't have to retrain yourself later.

Was This Post Helpful? 2
  • +
  • -

#5 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: developing software to work with sensors and actuators?

Posted 29 May 2011 - 09:43 AM

There is nothing really that I can add to this thread. But I just wanted to say.. wow. tlhIn`toq, that post needs splitting into a thread and stickying!
Was This Post Helpful? 0
  • +
  • -

#6 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: developing software to work with sensors and actuators?

Posted 29 May 2011 - 10:11 AM

View PostShane Hudson, on 29 May 2011 - 10:43 AM, said:

There is nothing really that I can add to this thread. But I just wanted to say.. wow. tlhIn`toq, that post needs splitting into a thread and stickying!


Much of the C# Resources sticky comes from that post of mine.
Newbies don't read stickies, or look through tutorials, or do a search in the forum for similar questions, or do a Google search. They just assume they're the first person to ever ask that question and post it.

I have a text document with a number of standard responses and copy/paste from that document to a thread as needed. Including the 'newbie suggestions' above. I've tried to polish it over time to avoid pissing people off with phrases that make it sound like I'm calling them monkeys beating on a keyboard. Oddly they don't like that.

But sticky-ing it is pointless because newbies don't look *for* anything before posting. So I just repeat it as needed.

I have a block of tutorial links for common things:

Password handling tutorial
Calculator tutorial
Serial port communication
(de)Compression tutorial
Adding sound to your C# application
[...]
Writing a text file tutorial.
Reading a text file tutorial.
Simulate mouse and keystroke (even to another application)

Debugging links,
Form A talks to Form B, links

etc.

Though I think I might try re-arranging it to more of a F.A.Q. style

Q: I got an error message, how do I fix it?
A: Debugging links

Q: How do I make form a talk to form b?
A: Tutorial links

Q: How does inheritance work and why do I care?
A: Tutorial links
Was This Post Helpful? 0
  • +
  • -

#7 Shane Hudson  Icon User is offline

  • D.I.C Technophile
  • member icon

Reputation: 343
  • View blog
  • Posts: 1,286
  • Joined: 06-December 09

Re: developing software to work with sensors and actuators?

Posted 30 May 2011 - 06:33 AM

View PosttlhIn`toq, on 29 May 2011 - 06:11 PM, said:

Much of the C# Resources sticky comes from that post of mine.
Newbies don't read stickies, or look through tutorials, or do a search in the forum for similar questions, or do a Google search. They just assume they're the first person to ever ask that question and post it.


Ah I see, well definitely a useful file to have! Very similar to what I was thinking of when I wrote the thread in DIC++ about needing a wiki. I search before I post anything (maybe that is why my thread count is so low) but it seems so many people do not!
Was This Post Helpful? 0
  • +
  • -

#8 tlhIn`toq  Icon User is offline

  • Please show what you have already tried when asking a question.
  • member icon

Reputation: 5481
  • View blog
  • Posts: 11,762
  • Joined: 02-June 10

Re: developing software to work with sensors and actuators?

Posted 31 May 2011 - 08:50 AM

This is the board that a buddy of mine uses for reading inputs and triggering devices. Hope it helps.
http://www.sparkfun....w&what=products
Was This Post Helpful? 0
  • +
  • -

#9 Curtis Rutland  Icon User is online

  • (╯□)╯︵ (~ .o.)~
  • member icon


Reputation: 4469
  • View blog
  • Posts: 7,780
  • Joined: 08-June 10

Re: developing software to work with sensors and actuators?

Posted 31 May 2011 - 02:46 PM

View PostShane Hudson, on 29 May 2011 - 11:43 AM, said:

tlhIn`toq, that post needs splitting into a thread and stickying!


I see that tlhIn`toq has already mentioned this, but I did use a large portion of his links there in the C# Resources stickied in the C# forum, along with some others from various sources. I think he's added a few since; I might have to go back through and update the list.

He's right though, most people don't bother to look at stuck threads. That thread was created in January, and it only has 2.5k views. That's not very many when you consider the C# traffic we get. Hell, most newbies don't even take the time to google anything other than "c# help" or "c# forum" to find us to ask the questions.

Btw, if you do arrange one QnA style, post it as a reply to the resources thread, or in it's own thread, and I'll stick that too. Then you can just link to it instead of pasting it over again.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1