Author Topic: Arduino - The Quick and Dirty Guide  (Read 16948 times)

Offline Prodigy

  • Survivalist Mentor
  • *****
  • Posts: 636
  • Karma: 41
  • Better to die on your feet than live on your knees
Arduino - The Quick and Dirty Guide
« on: February 18, 2015, 10:59:17 AM »
What is Arduino?

Arduino is an open source electronics platform intended for a wide variety of DIY electronics projects.  It is cheap, pretty easy to use, and great for learning electronics and doing cool home projects.

Want to hook up a few LED lights and make them blink?  Want to hook up a servo and create a simple robot?  Want to patch an Arduino board with a wireless receiver in your garage so you can text your garage door open from your cellphone (this was my original project that is on hold due to lack of funds)?  Aduino is for you!

How to get started:

My first bit of advice would be to search for a nearby hackerspace, if one exists.  They will almost certainly have someone on hand who can help get you started, and very likely will have beginner Arduino classes.

Can't find a hackerspace near you?  arduino.cc is full of helpful getting started tips, and arduino in general is a massively popular platform with no lack of information via web searches.  I would start out by ordering a basic arduino uno kit, like:

http://www.allelectronics.com/make-a-store/item/ard-74/starter-kit-for-arduino-flex/1.html?gclid=COG-ov2E7MMCFYQCaQodsZsAzw
(I have no idea if this is a good site to order from, this is just an example of a good starter type kit that includes the board, plus some helpful accessories)

The basic premise is that you get your arduino board (lots of different types, but the Uno is a good basic starter board).  You'll need the free open source software installed on your computer, which will allow you to plug a USB cable from the board to your computer and communicate with the board.  You can upload whatever small program you want (many of them are pre-coded so you don't have to know much about how to program), and the arduino will be configured for whatever your application is. 

The easiest way to think about it, is there are inputs and outputs.  So you'll want to think about what sorts of information is will take in, and what it will then output. 

Inputs:
Arduinos have a huge range of sensors and inputs available, from a simple button, to a temperature sensor, to motion sensors, microphones, and a million others.

Outputs:
Tons of these as well, including LED lights, LED text displays, speakers, servos and other random motors, and even network-based output (like mini web servers), and a million others.

Combine any input with any output, and you have an Arduino project.  Example:  I press a button, and an LED light goes on.  Or a speaker beeps loudly when the temperature gets over 80 degrees F.  My boss did a project with his kid that was a door opener for his dog:  when the dog barked, the door would open for it.  That way the cat couldn't get out, but the dog could (unless the cat learned to somehow make a loud barking-level noise).

It is fun, and can be a great learning experience for kids especially.  I am not an Arduino expert, I've just dabbled here and there, but any questions are welcome.

Offline Cedar

  • ...just aDD water...
  • TSP Supreme Galactic Ant
  • ************
  • Posts: 28429
  • Karma: 1396
  • Dont wait for the storm to pass, dance in the rain
Re: Arduino - The Quick and Dirty Guide
« Reply #1 on: February 18, 2015, 11:01:24 AM »
.

Offline David in MN

  • Dedicated Contributor
  • ******
  • Posts: 1970
  • Karma: 151
Re: Arduino - The Quick and Dirty Guide
« Reply #2 on: February 18, 2015, 11:28:10 AM »
Make magazine is always on our coffee table. I tend to be more focused on physical manufacturing but I'm getting more into electronics. I love the idea of a lamp with an LED "boot up" light and a big, meaty toggle switch. I guess I have a little steampunk inside me. The Mrs. (electrical engineer) laughs at my goofy projects which have yet to net $1.

Great post, I'm definitely looking into Arduino for some fun projects to develop skills and products.

Offline Smurf Hunter

  • Survival Veteran
  • ********
  • Posts: 7171
  • Karma: 333
Re: Arduino - The Quick and Dirty Guide
« Reply #3 on: February 18, 2015, 11:52:50 AM »
Warning - amateur radio segue:

DIY APRS for your android smart phone.  Step by step using a breadboard:  http://www.mobilinkd.com/2014/09/11/arduino-kiss-tnc/
Here's a non-arduino competitor, though it's less feature rich IMHO.  Both Raspberry PI and BeagleBone versions: http://tnc-x.com/



Offline kckndrgn

  • Survivalist Mentor
  • *****
  • Posts: 615
  • Karma: 23
    • Ryans Turnings
Re: Arduino - The Quick and Dirty Guide
« Reply #4 on: February 18, 2015, 03:45:23 PM »
I started playing with Arduino just before Christmas this year.

Made a the projects that came with the kit for learning.  Now I took one of my sons toys and incorporated the arduino, a motor sheild and some sensors and made a little autonomous tank.  When it senses an obstruction in front of it, it will stop, reverse and turn about 45* then try going forward again.

 A fun little project.

Next I'm working on a moisture sensor for my plants.  It will have a red, yellow & green LED to alert me when to water the plants.  My goal here is to set it up so that on our off grid hunting property I can have a food plot setup and let it water as needed instead of just on a timer.

There are so many neat things that can be made, I just don't have enough of an imagination to build them all :)

Offline TexasGirl

  • Survival Demonstrator
  • *******
  • Posts: 2820
  • Karma: 173
  • Simple country farm girl. Prepper? What's that?
Re: Arduino - The Quick and Dirty Guide
« Reply #5 on: February 18, 2015, 11:17:46 PM »
I'm working on using a small Arduino processor to control my hot water system.  I have 100 gal storage, two solar collectors, a waterside loop on the woodstove, one electric element, and three circulation pumps.  Two are heat gathering, one transfers heat to the Tilapia tank in the greenhouse.

The two 50-gal tanks were electronic water heaters that were removed from service after lightning fried their controllers, so they already had imbedded thermocouples.  I put DS18's in the solar collectors, waterside output, and Tilapia tank to measure temps.  When the collectors are 20 degrees hotter than the lowest tank temp, the appropriate DC pump will run @ 1 GPM, until collector falls to 5 degrees above lowest tank temp (same with woodstove).  Pump also runs if collector falls to 34 degrees to prevent freezing.  Tilapia tank Tako pump is dependent on multiple factors.  The electric element is on a manual countdown timer as a backup (only used when off-grid solar has a surplus and weather forecast is good).

Its a fun project.  In fact, I'm going to go reap the benefits of it and take a hot shower before bed.

~TG

Off-grid high tech.

Offline fritz_monroe

  • The Defenestrator
  • Administrator
  • Survival Veteran
  • *******
  • Posts: 8288
  • Karma: 147
    • The Homestead Fritz
Re: Arduino - The Quick and Dirty Guide
« Reply #6 on: February 20, 2015, 05:57:18 PM »
Thanks for starting the thread.

Offline TiredOldGrunt

  • Senior Survivalist
  • ****
  • Posts: 298
  • Karma: 15
  • Tabbed: "Regular Guy"
Re: Arduino - The Quick and Dirty Guide
« Reply #7 on: February 20, 2015, 09:55:52 PM »
I got started on the Picaxe, once I outgrew that I progressed to the Pic and Proton BASIC.

TOG

Offline theBINKYhunter

  • Does not fall well with plastic guns...
  • Moderator On Leave
  • Survival Veteran
  • *
  • Posts: 5847
  • Karma: 181
  • Not a tactical baddass
Re: Arduino - The Quick and Dirty Guide
« Reply #8 on: February 27, 2015, 11:24:38 AM »
:popcorn:

I've heard a lot about this and want to follow up. Probably similar but different is the RasberryPi. That's been peaking my interest as well.

Offline Smurf Hunter

  • Survival Veteran
  • ********
  • Posts: 7171
  • Karma: 333
Re: Arduino - The Quick and Dirty Guide
« Reply #9 on: February 27, 2015, 11:56:39 AM »
:popcorn:

I've heard a lot about this and want to follow up. Probably similar but different is the RasberryPi. That's been peaking my interest as well.

I think the material difference is you can generally install and run PC level software on the raspberry.
e.g. linux, or windows 10, etc. 

That's convenient because you can develop and test on a desktop machine, and permitting enough system resources of the R-pi you just copy the same software over.

Whereas arduino is it's own system and considerably simpler in that you don't run a full fledged operating system like you'd have on a laptop.

Offline UFOBryan

  • Fledgling Prepper
  • *
  • Posts: 4
  • Karma: 2
  • New TSP Forum member
Re: Arduino - The Quick and Dirty Guide
« Reply #10 on: February 27, 2015, 02:00:53 PM »
I am extremely interested in arduino!!  I would like to use it with a soil moisture meter and a water flood sensor to control my 12 volt pumps and inverter for 110 in my greenhouse, eventually adding sensors and irrigation outside the greenhouse for my raised beds. It should not be as difficult as I have found it to be. Any help is appreciated

Offline fritz_monroe

  • The Defenestrator
  • Administrator
  • Survival Veteran
  • *******
  • Posts: 8288
  • Karma: 147
    • The Homestead Fritz
Re: Arduino - The Quick and Dirty Guide
« Reply #11 on: April 13, 2015, 07:34:45 PM »
I got an Arduino clone and starter kit in the mail the other day.  This weekend I went about doing a lot of the examples on the official site.  I'll have to figure out what I want to do with this.

Like many, I can't really learn from just looking at the examples.  I'll have to set some time aside to just sit down and write some sketches to do stuff.  Maybe I'll make up the circuits and try to write the sketches myself.  An issue I have is an LED or speaker isn't the kind of feedback that I'm used to when coding.  The syntax is slightly different than I'm used to also.


Offline mxitman

  • Dedicated Contributor
  • ******
  • Posts: 1733
  • Karma: 125
  • Entrepreneur/HVAC Mechanic/Electrician
    • Heezy
Re: Arduino - The Quick and Dirty Guide
« Reply #12 on: April 13, 2015, 09:47:42 PM »
I'm familiar with using Picaxe but looking to learn and use arduino.. is their main website the best source for learning? anyone have any good resources for this.

Thanks

Offline Smurf Hunter

  • Survival Veteran
  • ********
  • Posts: 7171
  • Karma: 333
Re: Arduino - The Quick and Dirty Guide
« Reply #13 on: April 13, 2015, 10:34:06 PM »
I'm familiar with using Picaxe but looking to learn and use arduino.. is their main website the best source for learning? anyone have any good resources for this.

Thanks

In my mind there are a couple ways to go about this.

The language is c/c++, so understanding the language basics are helpful.  Honestly you don't need to have great coding skills for most projects I've looked at.

Then there's the arduino specific function library that has the abstractions for the various IO like LED HIGH and LOW.
See: http://arduino.cc/en/Reference/HomePage

Offline John Doe

  • Survivor
  • ***
  • Posts: 199
  • Karma: 13
  • Central Virginian Prepper
    • My personal prepper blog
Re: Arduino - The Quick and Dirty Guide
« Reply #14 on: April 14, 2015, 03:30:58 AM »
 :popcorn:

Offline kckndrgn

  • Survivalist Mentor
  • *****
  • Posts: 615
  • Karma: 23
    • Ryans Turnings
Re: Arduino - The Quick and Dirty Guide
« Reply #15 on: April 14, 2015, 05:31:28 AM »
I am extremely interested in arduino!!  I would like to use it with a soil moisture meter and a water flood sensor to control my 12 volt pumps and inverter for 110 in my greenhouse, eventually adding sensors and irrigation outside the greenhouse for my raised beds. It should not be as difficult as I have found it to be. Any help is appreciated
The moisture meter is no big deal.  I've built one and there are many available to purchase pre-made.  Running the pumps and inverter is where it will get a bit trickier.  You will need a motor shield and an external power source for the pumps.  The inverter, depending on the make, may or may not be easy.  On some inverters for cars people have just moved the power switch to a convenient location so you "might" be able to get away with just a relay to turn the inverter on.

I've taken one of my son's remote controlled (the kind with a wire running to the control box, not a radio remote) toys and converted it to an autonomus rover.  It just goes forward until an obsticle is reached the it backs up and turns then forward again.  This required a motor shield and range sensor.  I also have the bluetooth module and played with that on a separate arduino as I plan to put it all together and let him control the rover from his kindle.

I got an Arduino clone and starter kit in the mail the other day.  This weekend I went about doing a lot of the examples on the official site.  I'll have to figure out what I want to do with this.

Like many, I can't really learn from just looking at the examples.  I'll have to set some time aside to just sit down and write some sketches to do stuff.  Maybe I'll make up the circuits and try to write the sketches myself.  An issue I have is an LED or speaker isn't the kind of feedback that I'm used to when coding.  The syntax is slightly different than I'm used to also.
When testing your sketches and the arduino is hooked up to a PC, you can use the serial output from the arduio to show text/data as well.  That's how I've been testing a moisture meter.  When I put into use on a phase one type thing, the output will be to 3 colored LEDS.  Eventually I wan the arduino to control a water valve to auto water the plants and I will have 3 or more moisture meters that will be monitored

So many other projects going on right now not sure when I'll finish this thing up.

Offline outoforder2day

  • Survivalist Mentor
  • *****
  • Posts: 399
  • Karma: 37
  • Semper Ubi Sub Ubi
    • The End Of The Tunnel
Re: Arduino - The Quick and Dirty Guide
« Reply #16 on: April 14, 2015, 08:40:44 AM »
How is everyone communicating with their Arduinos?
I'm thinking of building a bit more of a robust/pluggable system which I could get started with now, and expand later. I'd like to start with integrating the thermostat, water heater, and a few sensors in the utility room. However, these devices are pretty spread out.
So, how are people networking their devices together? It seems that XBEE/ZigBee is the way to go, expecially considering they can be hooked directly up to sensors without the need for an arduino, in many cases. However, I wanted to see what other folks were doing.

nkawtg

  • Guest
Re: Arduino - The Quick and Dirty Guide
« Reply #17 on: April 14, 2015, 09:08:05 AM »
Here's a great one for controlling your shops dust control system.
https://www.youtube.com/watch?v=HAMYaCIXXYU

Offline artephius

  • Survivor
  • ***
  • Posts: 149
  • Karma: 6
  • Recovering forum lurker..
Re: Arduino - The Quick and Dirty Guide
« Reply #18 on: May 10, 2015, 10:31:37 AM »
How is everyone communicating with their Arduinos?
...

I'm building a sensor network using RFM69HW modules for wireless (RF) communications. They are fairly low power (meaning battery powered nodes are doable which is really convenient) and they only cost about $5 each.

Here is a really cool instructable about this with many examples that someone else came up with: http://www.instructables.com/id/Uber-Home-Automation-w-Arduino-Pi/?ALLSTEPS

I left out the raspberry pi and the arduino with the ethernet shield and opted for a single arduino with an rfm69hw as my "base station". It communicates to my computer using the usb serial connection and from there I can do anything with the sensor data and/or send commands to the various nodes such as turn on the garden sprinklers or close the garage door.

Eventually I'll write up a web interface and maybe an android app to have complete control remotely!

Fun stuff!

Edit: The best part about the RFM69HW modules that I forgot to mention is they have very good range for home/homestead use. I've tested a pair out to about an acre (including a wall or two in between) and they communicated flawlessly. Some people report up to around a kilometer line of sight range.


Offline Chemsoldier

  • Pot Stirrer
  • Global Moderator
  • Survival Veteran
  • ******
  • Posts: 5722
  • Karma: 544
Re: Arduino - The Quick and Dirty Guide
« Reply #19 on: May 10, 2015, 10:55:16 AM »
 :popcorn:

endurance

  • Guest
Re: Arduino - The Quick and Dirty Guide
« Reply #20 on: May 10, 2015, 12:44:27 PM »
I used the boards to figure out some problems when creating my own bike lights in 2006-2008. I was working with LEDs and buck pucks that could dim with either a rheostat or resisters. Since I couldn't find waterproof rheostats, I wanted to use resisters on a waterproof three way switch. It let me figure out to get a low, medium and high setting, all sealed up and waterproof once I'd figured out what resistance I needed to get the right brightness.

Seeing some of the other toys you can add, I need to get my boards out and get some new tools to start playing with. In my dreams I want to have a set up where I can call my home or get on the interweb and activate my rooftop sprinkler without ever going home if I know there's a wildland fire in my neighborhood.

Offline mxitman

  • Dedicated Contributor
  • ******
  • Posts: 1733
  • Karma: 125
  • Entrepreneur/HVAC Mechanic/Electrician
    • Heezy
Re: Arduino - The Quick and Dirty Guide
« Reply #21 on: May 10, 2015, 09:47:36 PM »
Quote
In my dreams I want to have a set up where I can call my home or get on the interweb and activate my rooftop sprinkler without ever going home if I know there's a wildland fire in my neighborhood.

that would be handy, is there a commercial model for something like that? if not I bet you could make a few $$ creating a basic system ready to go, plug n play!

I just got in the mail a few Uno boards and some sensors stuff to play with, waiting for a rainy day to get started, weather has been crazy warm so far and I've been slammed doing outdoor projects and getting my garden beds in and planted.

Offline IKN

  • Senior Survivalist
  • ****
  • Posts: 202
  • Karma: 13
  • New TSP Forum member
Re: Arduino - The Quick and Dirty Guide
« Reply #22 on: May 11, 2015, 10:03:40 AM »
I opted for using Arduino for building my Yuriy's Toys DRO for my lathe and mill http://www.yuriystoys.com/.
I've often thought that Arduino, Rasberry Pi, and the like would be great platforms for automating many prepper items/tasks.
For those of us less programming literate, learning to write the programs is a bit of a learning curve.
Has anyone on the forum considered getting a folder posted on the forum for projects they've done along with the code ?
Would save those like me from re-inventing the wheel.

Offline artephius

  • Survivor
  • ***
  • Posts: 149
  • Karma: 6
  • Recovering forum lurker..
Re: Arduino - The Quick and Dirty Guide
« Reply #23 on: May 11, 2015, 08:38:22 PM »
Has anyone on the forum considered getting a folder posted on the forum for projects they've done along with the code ?
Would save those like me from re-inventing the wheel.

I'm planning to do just that once I've actually got something worth posting up and running... I'm still working on (re)inventing the wheel ;) There are a few open source projects out there for the software end like openhab but I haven't found one I like.

I've found that arduinos are perfect for getting your feet wet with microcontrollers because there are tons of people that are NOT electrical engineers playing with these things and they've managed to ask every "stupid question" I could ever want to know the answer to already... so with a little searching you can figure out pretty much anything... Sometimes you just have to dig into the datasheet for whatever crazy part you want to use and it can be really intimidating, but where there's a will there's a way!

In my dreams I want to have a set up where I can call my home or get on the interweb and activate my rooftop sprinkler without ever going home if I know there's a wildland fire in my neighborhood.

That just happens to be exactly the sort of thing I'm working on for my first (serious) arduino project. I have my base station and a remote node communicating with each other through the RFM69HW. The remote node sits out in my garden bed and has 2 temperature sensors (one for the ambient air, and one stuck in the soil), a cheap soil humidity sensor, and a relay connected to a regular sprinkler solenoid so I can automate my lettuce watering... Since the "base station" (arduino) talks directly to my computer I can easily ssh or whatever from the internet and tell it what to do.

My ultimate goal is a complete modular (software) system that can handle any number of RF or directly connected nodes that either gather data or automate things that can easily be controlled from the net/phone. Really its just a matter of coming up with a good efficient user interface. I haven't had the time to get cracking on that yet though, I've been spending all my time playing with the electronics that do the dirty work...


Addendum: What we REALLY need around here is a thread for brainstorming ideas for things that could/should be automated with arduinos and similar things... That could really get interesting...
« Last Edit: May 11, 2015, 08:43:56 PM by artephius »

Offline scoob

  • Senior Survivalist
  • ****
  • Posts: 286
  • Karma: 24
  • Chicken-farming knuckle-dragger
    • Marksmanship, History, Civic Engagement
Re: Arduino - The Quick and Dirty Guide
« Reply #24 on: May 12, 2015, 02:58:20 PM »
I think a cross-link to this episode belongs in this thread:
Episode-1551- Eric Escobar on Automation

There are some good links in the show notes too.

Quote
Has anyone on the forum considered getting a folder posted on the forum for projects they've done along with the code ?
Would save those like me from re-inventing the wheel.

Eric Escobar suggested starting an article in the TSP Wiki, and he'd post his links.  I'd start it, but I don't have the time to figure out how to do it right.

Maybe a dedicated thread or two here to start the juices flowing... hmmmm.  I got an idea.



Offline artephius

  • Survivor
  • ***
  • Posts: 149
  • Karma: 6
  • Recovering forum lurker..
Re: Arduino - The Quick and Dirty Guide
« Reply #25 on: May 12, 2015, 07:14:35 PM »
I thought I'd add a little observation about this whole subject that some may not have considered...

Its mind boggling how much perfectly functional electronic "junk" people throw away... I yanked all the electronic guts out of an old air conditioner my boss was throwing away today and got 8 relays (110-240vac w/12v coils), some uln2004's, three strong motors, a really cool led display with icons for temperature, humidity, a fan, a moon, a sun and more (that sucker is going above my desk to show the status of my greenhouse!) and a bunch of other cool stuff I haven't really checked out yet.

For those like me that love to take things apart and re-purpose them (and never have enough money to buy what you want) its amazing what you can get for free when it comes to parts for projects like these. The supply of electronic trash is practically limitless and when something is "broken" its usually just one minor part that you don't care about anyway...

I think those motors and relays might just be extending and retracting a shade-cloth over my greenhouse automatically by next fall... :D




Offline scoob

  • Senior Survivalist
  • ****
  • Posts: 286
  • Karma: 24
  • Chicken-farming knuckle-dragger
    • Marksmanship, History, Civic Engagement
Re: Arduino - The Quick and Dirty Guide
« Reply #26 on: May 20, 2015, 12:25:39 PM »
Good point artephius! 

My job has me interacting with HVAC equipment suppliers on a regular basis.  I've contacted one about rummaging thru their 'bone pile' for dampers, actuators, PLCs, etc.  They were more than happy to oblige.  I'll post back with what I come up with. 

I'd like to find a broken mini-split system like this:  (at least the indoor unit)



There's got to be a ton of useful pieces in there.




Offline scoob

  • Senior Survivalist
  • ****
  • Posts: 286
  • Karma: 24
  • Chicken-farming knuckle-dragger
    • Marksmanship, History, Civic Engagement
Re: Arduino - The Quick and Dirty Guide
« Reply #27 on: May 20, 2015, 01:29:19 PM »
Oh, and closer to the OP:

I'm learning to program Arduinos myself, so I'm finding all kinds of resources, from quick-n-dirty, to the beyond. 
Here are a couple of examples:

Sheepdogsoftware
1st, of course I dig the name.  Can't imagine why  ;)
This site has been keeping me busy lately and is showing no signs of making me bored any time soon.  I like the way he writes, and his tutorials go into a bit more detail than some of the others.  Down-sides: no pretty pictures, and there seems to be an assumption that you either 1. went thru his electronics tutorials, or 2.  have a basic understanding of electronics components.  I am a visual learner, but I'm picking up what he's putting down fairly well.

  On the same site, if you're interested in a simple way to monitor your premises, from any computer anywhere, check out Farwatch

A couple of Arduino tutorial sites:
Lady Ada Adafruit - very visual, lot's of pictures, some videos. 

Sparkfun (there's a broken link on this page to Arduino curriculum, I'm emailing them about it)

Arduino Playground  Probably should start here.

Tronixstuff  Haven't dug into this one yet.

More later...
   

Offline Smurf Hunter

  • Survival Veteran
  • ********
  • Posts: 7171
  • Karma: 333
Re: Arduino - The Quick and Dirty Guide
« Reply #28 on: January 14, 2016, 04:40:38 PM »
Surfing Amazon I see different makes of controllers, at very different prices.

Any tips or feedback regarding some of the cheaper clone models?  If I wasted even 15 minutes debugging a manufacturing flaw, it wouldn't be worth the $9 saved.


http://smile.amazon.com/dp/B016D5KOOC?psc=1


http://smile.amazon.com/LANMU%C2%AE-Atmega328p-Atmega16u2-Version-Arduino/dp/B00SF28U7A

They "real" one is only $21 at the time of this posting.

Offline fritz_monroe

  • The Defenestrator
  • Administrator
  • Survival Veteran
  • *******
  • Posts: 8288
  • Karma: 147
    • The Homestead Fritz
Re: Arduino - The Quick and Dirty Guide
« Reply #29 on: January 14, 2016, 04:57:43 PM »
I felt the same way.  So I just got the "real" one.