What is Arduino? Which one should I get to learn and experiment with? - Page 1
Forum section: electronics / projects

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 12, 2015, 06:04:27 am
content: I have read up a bit on Arduino' and am interested in how I can program Micro Controllers etc with a piece of code.I am an IT guy primarily, and have experience in coding (though it is not my primary job), but then I can fiddle around.Been working on electronics and learning things for a while now, I am at best an Amateur at this point. However, I do build guitar effects pedals and have been doing it for 3 years now. So I do have a basic understanding of how analog circuit work, but I am interested in embedded systems as well.It would be great if someone could help me understand more about embedded systems and also how an arduino or the Tiva Launchpad help me? I am pretty lame when it comes to digital electronics or micro chips...please bear with me on that and for my stupid question here.

author: Fungus
author_rank: Super Contributor
timestamp: May 12, 2015, 06:08:59 am
content: Start at the Arduino web site:http://www.arduino.cc/

author: akis
author_rank: Frequent Contributor
timestamp: May 12, 2015, 06:42:45 am
content: Arduino is a range of ready built, general purpose MCU modules. It is a tiny (2" by 1"), medium, or larger board with DIP pins so you can usually plug into a breadboard. The larger Arduinos do not fit on a breadboard so they have female dupont pin terminals so you can use breadboard jumper wires.The modules have names like Uno, Due, Nano, Mini etc etcIn most cases all they have on board is the MCU, a crystal and a DC power supply regulator. Then some add bits like a mini USB connector, or a serial connector, or a DC 5V jack and so on. Depending on the size of the board, they can add more stuff.The range is quite extensive, to suit size and bits and pieces already on board. I use the Pro Mini which is hardly larger than the raw MCU DIP package! I also use the Nano which is slightly larger but has a mini USB connector on board, very conveniently plugged on laptop.The heart of the Arduino modules in most cases is an Atmel Atmega328 - or very similar - MCU. You can think of this as a normal CPU but with added features to minimise the need for external support chips. So that little chip has :0) on board oscillator, in many cases it does not need an external clock!1) Around 16 or more digital output pins, you can set them to 0 or 1, 0V and 5V respectively, and each pin can source or sink like 40mA!2) digital PWM pins. Some pins can be set to PWM mode, where the frequency is usually fixed to something like 900Hz, and you can set them in software from 0 to 255, meaning 0V and full 5V (100% cycle).3) analog input pins: there is a ADC on board allowing you to read analogue voltage from 0 to 5V. You can select the reference voltage if you want a different range (say from 0V to 2V) and you can sense higher voltages with a simple voltage divider.4) communication pins - digital pins 0 and 1 are used for serial comms, so you need 4 wires : 0V, 5V, Rx and Tx and you are talking serially to something. In many cases this something is a FTDI USB-serial converter likehttp://www.ebay.co.uk/itm/CH340-USB-to-Serial-adapter-for-Arduino-mini-pro-not-FTDI-232-PL2303-CP2102-/131373187020?nma=true&si=aTK5RoMCn2qm9It63CYt2JGJUzE%253D&orig_cvip=true&rt=nc&_trksid=p2047675.l2557With that little thing you plug one end to your laptop and the other end via dupont jumper cables and off you go.5) Some arduino modules (eg Nano) have on-board the FTDI serial chip so that you do not need the gadget above, you can plug straight to laptop.*************************From arduino.cc you can download the IDE, it is basic but full so you can build applications in C and C++. All the IDE requires is a connected Arduino module.What can you do with it?You can breadboard it and have it light up LEDs for a laugh. Then you can have it controlling more devices, relays, anything you can build on your own PCBs.Then you can buy modules made for the Arduino. Eg an 1" 128x64 OLED display. Or a rotary encoder switch. Or an AD9850 oscillator. Or a DS1307 RTC clock (unfortunately the Arduino does not have an on-board RTC clock).I can give you a list of items to start with.But to start with I would buy this maybeArduino Nano - like this:http://www.ebay.co.uk/itm/UK-Nano-V3-0-ATmega328-16M-Micro-controller-CH340G-Board-Mini-USB-for-Arduino-/281473053922?pt=LH_DefaultDomain_3&hash=item418919f4e2It plugs straight to your laptop no need for adapter modules. The nuances are if they use the CH340G serial chip (glued underneath) you need special Windows Drivers (and be administrator once when you install them, then you can go back to user).I have done quite a bit of work with the Arduino so free to ask anything you need to know.

author: Psi
author_rank: Super Contributor
timestamp: May 12, 2015, 07:50:47 am
content: Arduino was created so Bachelor of Arts students could write code to put flashy lights and switches in their art projects.If you're an IT person who can code and you've built some guitar effects pedals then you're already 10 times better at Arduino than the bachelor of arts students, even having never used one yet.You may have to learn sequential programming though, if all you're IT coding was object oriented.But you'll find that simple.

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 12, 2015, 08:29:30 am
content: Quote from: akis on May 12, 2015, 06:42:45 amFantastic Info, Thank You so much....really appreciate it...I still have a few queries though, I would like to build things like, function generator, digital display and control for a linear bench supply that I plan to build, some other stuff like guitar looper pedals, where a preset gets stored, and can be recalled when needed, and such stuff...can I achieve all that? Also is there a board where maybe I can program the chip to do a certain function and then add only the chip onto my own PCB and still have the functions run from my PCB? as you can see my query is totally in layman terms, but I am looking for a few things which can be done using the arduino.

author: Rerouter
author_rank: Super Contributor
timestamp: May 12, 2015, 08:43:59 am
content: ok lets break it out,1. Function Generator,Absolutly, using the arduino pins you can generate square wave tones up to about 5Khz from what i can see, or you can use a ready made DDS module like the AD9850 to generate a nice smooth sine waves from fractions of a Hz to Mhz,2. Digital Displaystart at a character LCD, and later on you can work all the way up to something like a nokia phone graphical LCD,3. Control for a linear power supply,Absolutly, but the recommended method would be it would just output the setpoint voltages to the power supply using PWM, and reading back in the voltages you want to keep tabs on with its ADC's, rather than have the micro try and do the feedback control.4. Guitar looper pedals,This might be more involved until i understand what you mean by presets, having the micro digitise the audio, create the effect and play it back would be too much for a beginner, but may be possible with something like the arduino due which has a higher speed ADC and 2 DAC's. if you just want it to switch parts of the circuit on and off, and set voltages to parts of it, then definantly5.Program and then stick in my own PCB,This is what most hobbiests do after they outgrow the little arduino boards, if you give it a crystal and a reset line pull-up resisitor on your board, then your good to go, any code you wrote on your micro will run on your pcb (if you want serial functionality, then you have to add a converter chip)

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: May 12, 2015, 09:00:27 am
content: Everything is totally doable and on the 'easy' side - except the looper pedal.You need a faster micro processor to get a decent sampling rate (even for guitar, I would try to get close to 41k just to capture the entire timbre/formant footprint of your sound).There's this thing called theNyquist theoremwhich basically states you need to sample some signal at more than double the speed of your largest frequency of interest, which for audio is approximately 20kHz.Furthermore, when you sample at this rate, and you want to loop something - you need memory to hold it. Much more than most Arduinos offer. If you want to save your loops I think you're better off storing them in something like an SD card between sessions. Then load the waveform into memory before playback.

author: akis
author_rank: Frequent Contributor
timestamp: May 12, 2015, 09:01:19 am
content: 1) Function generator - AD9850, cheap as chips on ebay. It produces 1V p2p waves so stick on a LM6172 or better LT1366 op-amp. The op-amp you will power with +/-18V the Arduino and the AD9850 with 5V. You will need 7818, 7918 (or 15) plus 7805 and a drop resistor (50R 5W) before it to power the Arduino and the AD9850 (it is hungry it needs 120-140mA).2) Digital Display - try the OLED SSD1306 from ebay 1" square, and I have written libraries for it because the public ones are crap3) Control a linear PSU module : as Rerouter has said but big big warning. The voltage and current controls cannot be controlled reliably by the MCU, its DAC can only do so many conversions per second and the code needs to react - you will need a full analogue current limiter/protection. And the stability of the PSU's output (eg driving weird loads and oscillations) cannot be ensured with anything Arduino based. Must be all analogue.4) Guitar pedals and presets. Absolutely, this would be my next project. You must be familiar with guitar effects like the Pod XT, this is something the Arduino would excel at.5) Program and stick on PCB. As rerouter said but. The raw "chip", eg the Atmega328 DIP plus two three resistors, plus a voltage regulator, plus an external crystal - all that will take considerably more space on your PCB than an Arduino Pro Mini if you bolt it on your PCB just alike any other component. Think of the Arduino Pro Mini, or the Arduino Nano even, as a "larger chip". Do not make the mistake to think that the raw chip can go onto your PCB and save space. Absolutely not, unless you can manufacture SMD at home. Since I make my own PCBs, I use the Pro Mini and the AD9850 modules onto my PCBs, just like any other component. And there nothing to gain by using the raw chip over the ready made Arduino. So even though you think "all I need is the chip, why should I bother with the whole Arduino?" well the answer is given above.

author: akis
author_rank: Frequent Contributor
timestamp: May 12, 2015, 09:04:07 am
content: Quote from: alexanderbrevig on May 12, 2015, 09:00:27 amI think he only wants to store presets. Eg "preset 1" == "heavy metal, lots of treble, lots of distortion etc", "preset 2" = "gentle crunch, low treble"While on stage you have a foot pedal console and you have A B C D pedals and when you step on them it changes your presets like having lots of stomp boxes in a row but so much easier to control. It also has a large display with "A" "B" "C" etc so you know what preset you're on.

author: alexanderbrevig
author_rank: Frequent Contributor
timestamp: May 12, 2015, 09:09:09 am
content: Quote from: akis on May 12, 2015, 09:04:07 amIf this is the case then I'd retrofit MIDI on my pedals and use that. No problem in making the controller board as well, but using midi will let him interface to other things at a later time. For example a laptop running a DAW with automatic switching of presets.

author: tggzzz
author_rank: Super Contributor
timestamp: May 12, 2015, 09:14:24 am
content: Quote from: aryasridhar on May 12, 2015, 06:04:27 amI guess that your major learning curve will be the real-time and lack of operating system aspects.With audio is it is necessary to have minimal jitter between samples, since any jitter will be audible. There are two fundamental approaches:use hardware (interrupts/DMA) to do the IO, and ensure the CPU has time to deal with the data between the samplesuse a hard realtime multicore processor like the XMOS devices, which are having a good deal of success in the audio realm. My definition of hard realtime: the IDE states the exact number of clock cycles the code will take. Seehttp://www.xmos.com/products/boardsThe lack of operating system, i.e. bare silicon, is also a fun challenge. To start with you can somewhat ignore that by using the arduino environment and libraries, but I expect that you will eventually want to go beyond that and program directly in <ahem> "pure" C/C++. Go to it!

author: IanJ
author_rank: Unknown
timestamp: May 12, 2015, 10:58:08 am
content: I'd recommend bringing together one of your other hobbies and Arduino, you'll get the most enjoyment out of it that way.....well, at least I did.Related to guitar effects etc, here's a project I did a while ago:-My Zoom practise amp has all the effects built in with no option for a floor mounted switch.....so I used an Arduino to sort that.An Arduino sits inside the amp and interfaces to the front panel switches and indicators. There's an I2C link down to a pedal on the floor c/w lcd readout.More here:-http://www.ianjohnston.com/index.php?option=com_content&view=article&id=61:zommamp&catid=3:hobbies&Itemid=8Good luck.Ian.

author: Fungus
author_rank: Super Contributor
timestamp: May 12, 2015, 11:22:53 am
content: Quote from: Rerouter on May 12, 2015, 08:43:59 amMuch easier/cheaper to buy a Pro Mini instead of messing about with bare chips and crystals and stuff.http://www.ebay.com/sch/i.html?_nkw=arduino+pro+mini

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 12, 2015, 12:33:23 pm
content: WOW - Thank you for all the info guys, this surely helps a ton...@Psi- Hahaha, Yes I have worked on OO programming as well as scripting in Shell, PowerShell, Batch etc for automating various systems/processes on Windows/Unix/Macintosh etc. I sure am ready to learn whatever it takes to get onto embedded systems, what can be achieved at the end of the day is really the driving force behind it, so i will be at it.@Rerouter- Thank you so much for the details man, this breakup has helped me out a lot, I saw some videos of Arduino Uno been used as a generator, wondering if I should get that or maybe the Uno to start with, I also plan to get into IoT, which seems like the next big thing, but then I do not want to get into it only because it may/could be the next big technology revolution.@akis & alexanderbrevig - Yes you are right, I want to save presets for different songs, say one song may have chorus, slight overdrive and a boost, the other may have high gain and so on....Your tip for the function generator is killer man, I am going to try that route, will be placing my order for a couple of boards to fool around with...and the Arduino Pro Mini idea is excellent too, I see these go very cheap, and I think will save me a ton of hassle on building the entire circuit for the micros on my PCB, instead sticking these onto the unit is a great idea....Damn, i did not know this could be done, I am freaking dumb...@akis - Yes i absolutely am familiar with POD XT/XT live and tons of other processors, I do not like the way they sound though, when it comes to my sound, I prefer analog pedals, here's my rig as on todayand also some of the pedal builds I have done so far....http://s1291.photobucket.com/user/aryasridhar/slideshow/DIY@alexanderbrevig - Yes, MIDI interface would be a lot helpful, most amps, pedals etc use MIDI, I could integrate what I want to other units without issues.@tggzzz - Not sure what you mean by this -- "I guess that your major learning curve will be the real-time and lack of operating system aspect" elaborate please.Overall, would it be a good idea to get a UNO to learn the basics, and also get the TI 430MFP board so I could learn a bit more across the sprectrum, and also the Arduino Pro Mini??

author: technix
author_rank: Super Contributor
timestamp: May 12, 2015, 12:47:51 pm
content: Quote from: Rerouter on May 12, 2015, 08:43:59 am1) Not a good idea as it only emits square wave.2) Dumb terminals anybody?3) Won't work - linear supply is all analog. Switch-mode will work though and I do have some very good experiences making a switch-mode out of an Arduino board.4) Will work as long as you keep the signals out of the chip - use relays, 4066s or the like to switch the lines.5) Or you can turn your Arduino into an ISP for your micro on PCB.

author: Fungus
author_rank: Super Contributor
timestamp: May 12, 2015, 03:26:08 pm
content: Quote from: aryasridhar on May 12, 2015, 12:33:23 pmYes.Quote from: aryasridhar on May 12, 2015, 12:33:23 pmPro Mini is 100% compatible with the Uno - all you projects will move straight across to it when you build your devices. Pro Mini pin spacing is standard so you can put it in breadboards, perf board, etc.You'll need one of these to upload programs to the Pro Mini:http://www.ebay.com/itm/321154851439

author: Fungus
author_rank: Super Contributor
timestamp: May 12, 2015, 03:31:07 pm
content: Quote from: technix on May 12, 2015, 12:47:51 pmUm, "square" ... that's what he said.PS: It can generate square waves up to half the CPU frequency, ie. 8MHz on a 16MHz Arduino.A little AD9850 board is a good idea for sine waves and they're cheap on eBay. They usually go up to about 20Mhz.

author: JackP
author_rank: Regular Contributor
timestamp: May 12, 2015, 03:44:21 pm
content: You can use an arduino to make a linear PSU, use PWM to drive the Adjust pin on your regulator (see Dave's PSU tutorial)

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 14, 2015, 05:16:42 am
content: Thank You all guys...I have placed and order for a UNO...it ia in the mail. Should be here in a day or two.

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 14, 2015, 11:31:44 am
content: So I got the board just a while back, time to work on it....

author: technix
author_rank: Super Contributor
timestamp: May 14, 2015, 11:46:51 am
content: Quote from: aryasridhar on May 14, 2015, 11:31:44 amThis is not genuine Arduino (but it should work just fine).

author: akis
author_rank: Frequent Contributor
timestamp: May 14, 2015, 11:52:14 am
content: You should buy some Nanos (or Pro Minis) from ebay, cheap as chips, they plug straight onto the breadboard, and are powered off the USB port.Here are two pictures so you get an idea.On one photo is a breadboard with an Arduino Nano, a rotary encoder, an OLED SSD1306 display and a Tiny RTC DS1307 clock/memory module.On the other photo is the finished device, under the wires you can see an Arduino Pro Mini, next to it an DDS AD9850 module, plus op-amps, regulators etc

author: electr_peter
author_rank: Unknown
timestamp: May 14, 2015, 12:13:45 pm
content: Quote from: technix on May 14, 2015, 11:46:51 amThese register as the same USB<->Serial port on a PC (each time with different boards). Works well, but may be an annoyance if you try to use more than one at once as serial ports.

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 14, 2015, 12:19:14 pm
content: Quote from: technix on May 14, 2015, 11:46:51 amTrue this is not a genuine unit, but so far is working fine...

author: akis
author_rank: Frequent Contributor
timestamp: May 14, 2015, 12:24:28 pm
content: I have bought dozens on ebay and none are genuine Sparkfun or Ardafruit or whatever other brands there are. But they seem to be fine. What I have had quality troubles with are (a) SSD1306 OLED displays and (b) rotary encoder switches - these are particularly bad with the switch soldered badly (at an angle) and defective parts etc

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 14, 2015, 12:53:37 pm
content: For the price I paid for this, which really is peanuts, I am happy to see the functionality is good. Most of these are fakes/remakes, and why not when Arduino themselves share all the details to literally build the board, there is no reason why others won't do it.I did not see any bad soldering on my unit, neither did i find any bad components, especially the USB port is good, I have experienced earlier some metal parts have had rust and other issues.

author: zapta
author_rank: Super Contributor
timestamp: May 14, 2015, 02:49:18 pm
content: Quote from: aryasridhar on May 14, 2015, 05:16:42 amGood choice for a first board and it goes well with this excellent bookhttp://amzn.com/1118549368

author: Fungus
author_rank: Super Contributor
timestamp: May 14, 2015, 05:41:41 pm
content: Quote from: aryasridhar on May 14, 2015, 12:53:37 pmYes, but you could buyonegenuine board, just to support their effort. They actually had to do some work to produce those designs the Chinese are using for free. They also had to create the IDE, etc.

author: zapta
author_rank: Super Contributor
timestamp: May 14, 2015, 06:36:52 pm
content: Quote from: Fungus on May 14, 2015, 05:41:41 pmThat's what open source is about.

author: aryasridhar
author_rank: Regular Contributor
timestamp: May 14, 2015, 06:50:53 pm
content: Quote from: Fungus on May 14, 2015, 05:41:41 pmI sure will get an original one, but when buying this unit, I knew I was not getting one made by Arduino, but then I had to test the waters to see how I would fare with one before really getting deep into it and spending on a genuine board....and as Zapta mentioned - since it is open source, i did not mind getting the Chinese one, I generally do not buy fakes/clones/pirated stuff.I plan to get the Mega and the Pro mini down the line, and those will be originals, i assure everyone that

author: Fungus
author_rank: Super Contributor
timestamp: May 14, 2015, 07:09:02 pm
content: Quote from: aryasridhar on May 14, 2015, 06:50:53 pmThe Mega is expensive and not really worth it unless you need to write very large programs and if that's your thing you might be better off with something ARM based.Don't worry too much about number of I/O pins. You can add almost unlimited pins to Arduinos with shift registers, I2C expanders, etc.Plus the chip on the Mega is difficult to change if/when you fry an pin or two. With an Uno you can just pop the AVR chip out and replace it.