My midlife crisis involves learning Arduino

Let me begin by introducing myself. My name is Geoff and I turn 40 next month. I don't want to go buy a Corvette or go hit the bar scene. I want more knowledge!

I am a mechanical engineer by education, but I really enjoy the electrical and programming side of my job. I have done PLC work and simple controls utilizing relays, switches, and timers. I am a decent mathematician and understand creating logics.

I think somewhere deep in me I have always had a desire to understand how things work. But once I discovered the Arduino that desire has come front and center. It's gotten so bad that I'm considering going back to school for computer programming.

My question I pose to the Arduino community is..how would you go about learning?

It seems that I must crawl before I walk before I run. Where do I start?

Srart with the Learning tab, and play with the examples in the IDE.

This seems a little overwhelming at first. Would you prioritize certain subjects?

First of all, this conversation is probably in the wrong "topic area." "Arduino 101" is a particular (and not overly popular) hardware board supported by the arduino environment, not a "beginning Arduino" topic like you might expect in a college class with the same name. I've flagged it for the moderators to move somewhere where it will get more responses.

On to the actual question:
There are probably two main ways of thinking about computer programming. Most college classes with teach a sort of "bottom up" methodology. You'd start with learning some basic principals: variables, syntax, programming concepts like conditionals and looping. gradually you'd build up to algorithms and full programs, and by the time you finish a full semester, you can write little academic ditties and you should be ready for ... the next class. In something like 4 years, you might know what you're doing, enough to get an entry level job. It's sort of like starting mechanical engineering starting with a basic Physics class. At the end, you'll know a lot of (important) theory and concepts, but it's not much good for fixing your car in the meantime.

Arduino and similar systems, along with many of the online classes in programming, is more "top down." The emphasis is on being able to do something useful right away. So you start with a bunch of examples, or projects provided by other people, and learn how to fiddle with them to make them behave closer to what you had in mind. You can get quite good at it without ever really learning the basic principles you are using. Sort of like getting into mechanical engineering by needing to fix your junker of a car and gradually learning more and more about how cars work. You can become a really good mechanic without ever getting to the basic calculus used in that first Physics class.

In general, I think a combined approach is useful. You should learn the basics, but looking at a working example of a THING you are interested in is a lot more motivating than dry lessons in theory. Sadly, I haven't found a free online class for "intro theory" that I like. But there are a lot of them, and just because I don't like one very much doesn't mean you won't find it useful. Note that for learning the basic principles, the "language" that you learn is relatively unimportant - the principles remain the same whether you're programming "Arduino", or Java, or Python, or Lua. (In fact, looking at a program in one language, and trying to figure out just how it needs to be changed to work in a different language, in a different place, can be very educational.)

1 Like

Thread moved.

Lordy Lordy look who's 40!

Congratulations, you are one of the youngest here :wink:

I think you can easily pick up the Arduino hobby by yourself.

Some things to read:

https://learn.adafruit.com/category/learn-arduino

https://learn.sparkfun.com/tutorials/tags/arduino?page=all

https://learn.sparkfun.com/tutorials/what-is-an-arduino

http://playground.arduino.cc/Code/AvoidDelay

https://forum.arduino.cc/index.php?topic=384198.0

.

well... with one led, one push button, a few resistors, a breadboard, and an uno you can learn a lot about coding in the arduino invironment

keystone76:
This seems a little overwhelming at first. Would you prioritize certain subjects?

Get an Arduino Uno
Download and install the Aduino IDE on your PC
Connect your PC to your Arduino with the USB cable
Upload the BLINK example program
Enjoy that level of success

Make a copy of the BLINK example program
Edit the copy to change the blink rate
Upload the revised program
Enjoy that

Then explore the other example programs.

...R
Planning and Implementing a Program

keystone76:
Let me begin by introducing myself. My name is Geoff and I turn 40 next month. I don't want to go buy a Corvette or go hit the bar scene. I want more knowledge!

that doesn't quite fit the definition of mid-life crisis . in fact it's a good force and energy brought by accumulated wisdom . you should definitely be proud of your own spirit .

as for learning how to program , just like Westfw said , looking at the amount of needed knowledge to write perfectly optimized code is indeed intimidating at first . just get an Arduino board and start making some "Baby steps" start by setting some simple coding challenges or mini-projects and work on them even without any experience on programming . you will pick all the needed information on the way up , the examples in the Arduino IDE are great for that .
that's how i learned everything i know about programming .

I have gotten my Arduino and am going through the examples.

At least I feel like I am crawling as opposed to standing still. I know I will get out what I put in and hope to learn more every day.

Thanks for everyone's help. It is all very helpful and encouraging.

Dont forget the push button, led and resistors. You can do like.... 500 projects with just those components. And learn 80% of arduino-centric c++ (code you'd have to know to code with arduino)

keystone76:
I have gotten my Arduino and am going through the examples.

At least I feel like I am crawling as opposed to standing still. I know I will get out what I put in and hope to learn more every day.

Thanks for everyone's help. It is all very helpful and encouraging.

Probably 99% of the forum is going to hate me for what I am about to say, but I'm old and I could care less, so let's get into this adult learning stuff:

Adults generally do not do well with the slow, regimented teaching that works for children. I spent over 3 years in adult education and course development and adults need examples that they can recycle - something that they can relate to and then edit to make it their own. This is where Google comes in ... probably (IMO) the greatest tool invented in 15 years for self-learning.

First, find a project that matches a project you want to accomplish. Project should be generally in the 50% area of what you want but concentrate on the power and the display: these are the big items you want to get right on day 1. Power: AC (inc. power brick), DC (battery - primary), DC (battery - secondary/rechargeable incl. LiON), or solar. You will likely find that if you use an UNO, the easiest choice of power is the DC wall brick which puts out about 7V - 9V to power the barrel jack. But the on-board regulator is not very "strong" so there is a limit to using the on-board power.

Second, that display is very important assuming that you want more than blinking lights! Displays can be one of the most frustrating part of any projects because of the libraries, protocols (serial, parallel, I2C, SPI), and voltages: 3.3V or 5.0V. Then there are OLED and LCD that are Black/White and then there are those inexpensive color displays! Never underestimate the annoyance of implementing the display! If you can find a basic project using your board and the display of your choice, then your project is half-way done. You might as well read this because you will eventually need to deal with voltage conversions.

Third, implement the project as the author intended. Comment out areas that are NOT pertinent to your need ... maybe a servo or stepper motor. Leave the display code and any sensor code that you intend on reusing. This part is tricky but you can reload the UNO and test often until you get just the shell. Save you project often. When you get things stripped down and working, make another copy and strip out all of that code you have been commenting!

Now you have a working template to move forward. Your initialization code and display are all working even if it just says "Hello World" in multiple fonts. You should have a loop() that is essentially empty or maybe pulls in a sensor value for display or just implements a counter to display.

At this point, you can begin to start adding your code to customize the template. Save often but on different days, rename the sketch... do not worry about the space on the harddisk, the sketches are saved as text and have little impact on storage - you can clean-up when your project is complete.

Ray
Ray's Projects

Good points Ray.
You don't look that old.


.

LarryD:
Good points Ray.
You don't look that old.

I'm a proud 65; proud because at 18, I never figured on living beyond 21. By 23 and having survived Southeast Asia, I figured maybe I'd make it to 40 but after selling my motorcycle, I up'd that to 45 :o
These days I'm just trying to get to 66 so I do not have to pay county school taxes!

Ray

Only 20 years left to go. :wink:

Edit
South East Asia doesn't sound good.

.

I definitely learn better when shown how to do something rather than reading about it. I have the reading comprehension of a 3 year old.

I did get a kit with my Arduino with all the fixins. I have aready done the Serial Read example. This looks very similar to what I am trying to achieve with a thermocouple. I am going through the examples any time I have a spare minute.

Just a little background on what I am trying to do.

  1. Read temperature of fluid flowing in a pipe.
  2. Display current fluid temperature on a screen/LED/LCD/whatever such that it can be viewed from 20 feet away.
  3. Not neccessary, but a flow meter and display would be nice.

I have already gotten tremendous feedback on this project and I am still very open minded about how to approach this. Thanks in advance for everyone's help

Question -

Is INPUT and INPUT-PULLUP akin to a normally open and normally closed state?

In looking at the example it states:

// Keep in mind the pullup means the pushbutton's
// logic is inverted. It goes HIGH when it's open,
// and LOW when it's pressed. Turn on pin 13 when the
// button's pressed, and off when it's not:

To me that sounds like you are using a set of nomally open contacts but the code sees it as normally closed (or HIGH).

I'm sure I am over simplifying it. But it's as if the input (momentary button) is pulling in a relay in which the signal is across the normally closed contacts.

  1. Read temperature of fluid flowing in a pipe.
  2. Display current fluid temperature on a screen/LED/LCD/whatever such that it can be viewed from 20 feet away.
  3. Not neccessary, but a flow meter and display would be nice.

I think we need to either add the flow-meter in the design or rule it out. My reasoning, in just going up to ebay and looking, many flow meters already have temperature capability. However, this stuff is not cheap.

Maybe I missed it, but exactly what are we going to measure the temperature (and/or flow): Air, fluid, hot air? Anything caustic?

For example, at just under $150, this Proteus meter is very capable:
http://www.ebay.com/itm/PROTEUS-INDUSTRIES-04012BN16-TPD-Flow-Temperature-Pressure-METER-with-display-/162146438218

  • Flow ranges from 4.5 to 61 LPM / 1.2 to 16 GPM
  • Liquid temperatures from -40 to 125°C / -40 to 257°F
  • Pressure to 1723 kPa / 250 psi
  • Relay trip points for all three parameters!
  • Digital display

Now, the BIG job would be hacking into the existing display and extracting the signals for an Arduino to drive a BIG display.

So, flow or no-flow.

Now, about that big display. See if you can locate a similar display used with an Arduino. Once you know the display model and that it has previously worked with an Arduino, it is just a matter of tracking down the LED display library, etc. Ex: Large Digit Driver Hookup Guide - SparkFun Learn

From what I'm seeing of the requirements, much of the effort is non-Arduino.

Ray

keystone76:
Is INPUT and INPUT-PULLUP akin to a normally open and normally closed state?

No.

INPUT is "floating"...

INPUT_PULLUP is the same as INPUT only there is an internal high value resistor (~50 kΩ) between the pin and VCC. You can achieve the exact same result with an external resistor. The resistor prevents the digital input from floating.

I'm still a little fuzzy. In the tutorial below for state change direction they use an external resistor. On the schematic the show the resistor in parallel with the switch leg of the circuit. Could this have been simplified with an INPUT-PULLUP? If so, would you just take 5 volts to one side of the momentary contact and then wire the other side of the contact to the input pin?

https://www.arduino.cc/en/Tutorial/StateChangeDetection?from=Tutorial.ButtonStateChange

I do understand that the goal is get two distinct values to determine the state as HIGH or LOW. But how do you know when to use an INPUT-PULLUP? Is it for situations when there may be no signal being transmitted to the input pin?