# General > IoT, IoE, and Maker Forum >  Getting Started

## dday9

I'm interested in some of the things that y'all have done(I've been peeking around the threads) and I'd like to dip my toes in the water a bit.

I'm thinking that I'll create a reaction time counter. My idea is that there will be a red light and that light will turn green. Whenever the light turns green you hit a button. It will then display the time measured in milliseconds how quickly you reacted to the light turning green.

My questions are... how do I get started, how much money do I have to spend to get started, what language do I need to learn, etc.?

----------


## wossname

Great question!  You should look into microcontrollers.

A microcontroller is a small electronic device that typically runs from 5 volts or 3.3 volts perhaps from a battery.  You can consider it to be an extremely small computer into which you load some source code of your own design.

Your source code lets you control the input-output pins of the chip to turn on LEDs or to measure the logic state of buttons.

There are many manufacturers of microcontrollers available, some commonly used ones are made by:

"Microchip" -- PIC series"Atmel" -- AVR series"Parallax" -- Propeller series and Basic Stamp series"TI" -- MSP430 and related familyARM -- numerous manufacturers -- super powerful and very complex

That list is in approximately ascending price order, but it's worth looking at all of them.  Personally, if I have a small project like the one you described, I'll instantly grab an Atmel ATTiny85 chip from my parts shelf and build the circuit on a piece of "perfboard" which is cheap and easy to find at any online electronics vendor.  You'd solder down a chip socket, the LEDs, some resistors and some kind of display to show your reaction times.

To write the software that will run on the Atmel chip I would use the free "Atmel Studio" suite that is available (from atmel.com) at version 6.2 as I write this.  It's a big download but it does support Atmel's ENTIRE chip collection (hundreds of parts!).

The other manufacturers mentioned here have corresponding software suites that cater for their own product lines.

So now you've got a chip and a compiler -- but you need to get that code into the chip somehow.
In the case of the Atmel family, you'd probably use the AVRISP MKII programmer device.  This lets you connect the chip directly to the programmer and download the compiled code into the chip from the Atmel Studio suite.

The compiler will communicate with the chip and install the compiled binary file into the microcontroller's internal EEPROM storage.  Then it's in there forever - you disconnect the programmer and hook up a battery and you can start using your device as a stand-alone system.

I've simplified the process a lot in this description and I welcome others to fill int he blanks I've no doubt left.

It's not expensive to get into electronics... you have already got access to the most expensive part -- a computer.  The internet is your most powerful resource in electronics.  The other expenses will be things like a soldering iron ($30 for an entry level one that everyone begins with).  Also you'll want a programming device like the Atmel one I mentioned above, I got mine for about $40.  Then there's the electronics parts themselves, generally pretty cheap.

When I first started electronics I basically bought components as-and-when I needed them, to keep the costs down.

Where do you get parts???  In no particular order (varies from country to country)...
FarnellPremierRSAvnetDigikeyMouser

Parting shot:

If there is one all-important thing I can impart on you, it's this...  Learn how to read datasheets.

Pretty much every electronic part has it's own datasheet (some are better than others).  Learn how to extract the important, salient information from your datasheet and you'll be streets ahead.  Reading datasheets is a *major* skill and one that will serve you well.  At first it will seem frustrating and difficult, I know this from painful experience.  Keep at it, and develop a healthy distrust of the humble datasheet.  Sometimes they tell you lies.

Electronics is a tremendously rewarding occupation, and it's not all that expensive.  Good luck  :Smilie:

----------


## wossname

I forgot to mention programming languages...

Most common microcontrollers will let you write native code in assembly language and C code at least.  Some of the exotic ones will let you code in javascript, C# or forth.  Pascal, ruby, even python are not unheard of.

To keep things simple I'd recommend C as a good place to start since every microcontroller under the sun has a C compiler available.

----------


## dday9

Wow. Thanks for the detailed reply. Hopefully on my next paycheck I'll get started.

----------


## wossname

PS...
I'd recommend watching some reputable basic soldering tutorials on youtube.  It's wise to develop good soldering habits from the get-go.  And always use lead-free solder.

"Adafruit", "MAKE:Magazine" and "Sparkfun" have some good tutorials.

Get some flux too  :Smilie:

----------


## dclamp

Woss didnt mention Arduino at all. Arduino is my favorite platform and makes it EXTREMELY easy to get into electronics. Actually, at lot easier than what woss described because the microcontroller circuit is already created, you just need to create the circuit for the LED and button (in your case).  Plus it comes with the free IDE for Arduino...

I strongly recommend you try out Arduino first. I wrote an article on getting started with Arduino... I have yet to see it posted anywhere (Brad?)  :Smilie:

----------


## wossname

Arduino makes it extremely easy to _make something_.  But in doing so you won't have learned much about electronics.  Grabbing off-the-shelf libraries that make all the magic happen isn't the same as understanding what is going on in the chip.

Try Arduino for a while but move on to building the full circuit yourself as soon as you can.

----------


## dclamp

I have been hesitant to move on from Arduino in fear that my circuits wont work... Perhaps it is time that I take that step?

Arduino can still be really useful and it _is_ a good introductory to electronics if you have never done anything before. I personally like how easy it is to work with Arduino, especially when it comes to home automation devices. The types of projects I work on are network intensive, so it would take a lot of knowledge for me to create my own networking circuit from scratch.

----------


## Nightwalker83

> I have been hesitant to move on from Arduino in fear that my circuits wont work... Perhaps it is time that I take that step?


Why would they no longer work?

----------


## dclamp

I am saying if I designed my own microcontroller circuit. Arduino takes care of the power and microcontroller circuitry, I just design the circuits for the paraphernalia attached. I also dont have to worry about programming with FDTI chip over USB because Arduino has that all built in.

----------


## wossname

Any 5V or 3.3V regulator will work fine for powering up the AVR chip, such as the LM7805 or the LM7833.

Just use Atmel's programmer tool: http://www.atmel.com/tools/AVRISPMKII.aspx.

The bare minimum for getting an AVR running is as follows:

the AVR chip itselfvoltage regulator + 2 caps (typically)a 10K pull-up resistor for the reset pin6 pin ISP connector (wires straight into the AVR)an LED so you can see your code is workinga 10nF decoupling cap for the AVR

You don't even need a crystal, as the AVR can run from it's internal oscillator.

Also the AVRISP MKII can be modified to provide the 5V power so you can run your circuit straight off the 6 pin header if you want.  Saves having to use a battery or a wall wart.

----------


## dclamp

How do those compare to the Arduino ATMega328 chips in terms of memory (code space and processing memory?)

I am going to look into this. Do you suggest any tutorials?

----------


## wossname

Sorry, I wasn't very clear with my wording.  "AVR" is the name of the chip family made by Atmel.  The ATMega328 is an AVR.

The AVR family is pretty large and has a wide range of memory and flash options.  If you want a fast way to choose a chip for your project then you can use Atmel's "Microcontroller selector" link on their main page... http://www.atmel.com/products/microc...s/default.aspx

Handy tip... get the datasheet for any chip (or other electronic part) you are interested in.  The one for the ATMega328 is here http://www.atmel.com/Images/doc8161.pdf

You will notice that it is a seriously large document.  It covers several very similar chips in that sub-family of AVR chips.

Every electronic component has a datasheet.  Get that and you will know everything about that particular component, from it's physical size, to it's "silicon errata"!!!  :Smilie: 

Before looking for a tutorial, just get yourself a copy of the Atmel Studio (v6.2) and begin a new project and choose the ATMega328 as the "target device".  That will set you up with a "hello world" project that you can compile and load into the chip with the programming device.

Atmel Studio is based on the Visual Studio IDE, so it will be familiar to you already no doubt.

----------


## Nightwalker83

> Some of the exotic ones will let you code in javascript, C# or forth.


Such as? I have been looking in to Arduino but that is using C or C++ which, I do not know how to code. I know C# but as we all know C and C++ are not C#.

----------


## dclamp

Arduino C is really easy to learn. If you know C#, Javascript, PHP or any other language based on C, then you are good to go.

----------


## Nightwalker83

> Arduino C is really easy to learn. If you know C#, Javascript, PHP or any other language based on C, then you are good to go.


Well, I have .Net and an old version of Visual C++ (Visual Studios 6.0) but no C.

----------


## wossname

C++ is a super-set of C.  C code will compile correctly in a C++ compiler.

Alternatively, get yourself a linux box (or a virtual) and just use the standard C compiler you get with it (GCC).

----------


## brad jones

*Getting Started with Arduino / Blink LED
By Dylan Sweaza -*Are you ready to jump into the Maker or IoT world? Do  you want to dabble with building electronic solutions? Discover the  Arduino and what it takes to get started today!


http://www.codeguru.com/cpp/misc/get...-blink-led.htm

----------

