Docsity
Docsity

Prepare-se para as provas
Prepare-se para as provas

Estude fácil! Tem muito documento disponível na Docsity


Ganhe pontos para baixar
Ganhe pontos para baixar

Ganhe pontos ajudando outros esrudantes ou compre um plano Premium


Guias e Dicas
Guias e Dicas


Arduino - book2, Notas de estudo de Eletrônica

Arduino-book2

Tipologia: Notas de estudo

2017

Compartilhado em 07/11/2017

vinicius-tomaz-4
vinicius-tomaz-4 🇧🇷

4.5

(2)

14 documentos

1 / 116

Toggle sidebar

Esta página não é visível na pré-visualização

Não perca as partes importantes!

bg1
Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . v
1/Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1
Intended Audience ......................................................2
What Is Physical Computing? ............................................ 3
2/The Arduino Way . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
Prototyping ............................................................ 6
Tinkering .............................................................. 7
Patching ............................................................... 8
Circuit Bending ........................................................1 0
Keyboard Hacks .......................................................1 2
We Love Junk! ......................................................... 14
Hacking Toys ..........................................................1 5
Collaboration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3/The Arduino Platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .19
The Arduino Hardware ................................................. 19
The Software (IDE) ....................................................22
Installing Arduino on Your Computer .. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Installing Drivers: Macintosh ............................................23
Installing Drivers: Windows .............................................23
Port Identification: Macintosh ...........................................25
Port Identification: Windows ............................................26
4/Really Gettin g Started with Arduino . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
Sensors and Actuators .................................................30
Blinking an LED ........................................................30
Pass Me the Parmesan .................................................34
Arduino Is Not for Quitters ..............................................35
Real Tinkerers Write Comments .........................................35
The Code, Step by Step ................................................36
What We Will Be Building ...............................................38
What Is Electricity? ....................................................39
Using a Pushbutton to Control the LED . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .42
How Does This Work? ..................................................44
One Circuit, A Thousand Behaviours . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .45
5/Advanced Input and Output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .53
Trying Out Other On/Off Sensors ........................................53
Controlling Light with PWM .............................................56
Use a Light Sensor Instead of a Pushbutton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Arduino_ch00_09final.indd 3 10/3/08 4:34:17 PM
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Pré-visualização parcial do texto

Baixe Arduino - book2 e outras Notas de estudo em PDF para Eletrônica, somente na Docsity!

Contents

  • 1 / Introduction Preface v
    • Intended Audience
    • What Is Physical Computing?
  • 2 / The Arduino Way
    • Prototyping
    • Tinkering
    • Patching
    • Circuit Bending
    • Keyboard Hacks
    • We Love Junk!
    • Hacking Toys
    • Collaboration.
  • 3 / The Arduino Platform
    • The Arduino Hardware
    • The Software (IDE)
    • Installing Arduino on Your Computer
    • Installing Drivers: Macintosh
    • Installing Drivers: Windows
    • Port Identification: Macintosh
    • Port Identification: Windows
  • 4 / Really Getting Started with Arduino
    • Sensors and Actuators
    • Blinking an LED.
    • Pass Me the Parmesan
    • Arduino Is Not for Quitters
    • Real Tinkerers Write Comments
    • The Code, Step by Step
    • What We Will Be Building
    • What Is Electricity?
    • Using a Pushbutton to Control the LED
    • How Does This Work?
    • One Circuit, A Thousand Behaviours
  • 5 / Advanced Input and Output
    • Trying Out Other On/Off Sensors
    • Controlling Light with PWM
    • Use a Light Sensor Instead of a Pushbutton
    • Analogue Input
    • Try Other Analogue Sensors
    • Serial Communication
    • Driving Bigger Loads (Motors, Lamps, and the Like)
    • Complex Sensors
  • 6 / Talking to the Cloud
    • Planning
    • Coding
    • Assembling the Circuit
    • Here’s How to Assemble It
  • 7 / Troubleshooting
    • Testing the Board
    • Testing Your Breadboarded Circuit
    • Isolating Problems
    • Problems with the IDE
    • How to Get Help Online
  • Appendices
    • Appendix A/The Breadboard
    • Appendix B/Reading Reistors and Capacitors
    • Appendix C/The Quick Reference
    • Appendix D/Reading Schematic Diagrams

i Getting Started with Arduino

projects at the time were a dishwasher and an early computer that came from an insurance office, which had a huge printer, electronics cards, magnetic card readers, and many other parts that proved very interesting and challenging to completely take apart.

After quite a lot of this dissecting, I knew what electronic components were and roughly what they did. On top of that, my house was full of old electronics magazines that my father must have bought at the beginning of the 1970s. I spent hours reading the articles and looking at the circuit diagrams without understanding very much.

This process of reading the articles over and over, with the benefit of knowledge acquired while taking apart circuits, created a slow virtuous circle.

A great breakthrough came one Christmas, when my dad gave me a kit that allowed teenagers to learn about electronics. Every component was housed in a plastic cube that would magnetically snap together with other cubes, establishing a connection; the electronic symbol was written on top. Little did I know that the toy was also a landmark of German design, because Dieter Rams designed it back in the 1960s.

With this new tool, I could quickly put together circuits and try them out to see what happened. The prototyping cycle was getting shorter and shorter.

After that, I built radios, amplifiers, circuits that would produce horrible noises and nice sounds, rain sensors, and tiny robots.

I’ve spent a long time looking for an English word that would sum up that way of working without a specific plan, starting with one idea and ending up with a completely unexpected result. Finally, “tinkering” came along. I recognised how this word has been used in many other fields to describe a way of operating and to portray people who set out on a path of explora- tion. For example, the generation of French directors who gave birth to the “Nouvelle Vague” were called the “tinkerers”. The best definition of tinkering that I’ve ever found comes from an exhibition held at the Exploratorium in San Francisco:

Tinkering is what happens when you try something you don’t quite know how to do, guided by whim, imagination, and curiosity. When you tinker, there are no instructions—but there are also no failures, no right or wrong ways of doing things. It’s about figuring out how things work and reworking them.

Contraptions, machines, wildly mismatched objects working in harmony— this is the stuff of tinkering.

Tinkering is, at its most basic, a process that marries play and inquiry.

—www.exploratorium.edu/tinkering

From my early experiments I knew how much experience you would need in order to be able to create a circuit that would do what you wanted start- ing from the basic components.

Another breakthrough came in the summer of 1982, when I went to London with my parents and spent many hours visiting the Science Museum. They had just opened a new wing dedicated to computers, and by follow- ing a series of guided experiments, I learned the basics of binary math and programming.

There I realised that in many applications, engineers were no longer build- ing circuits from basic components, but were instead implementing a lot of the intelligence in their products using microprocessors. Software was replacing many hours of electronic design, and would allow a shorter tinkering cycle.

When I came back I started to save money, because I wanted to buy a computer and learn how to program.

My first and most important project after that was using my brand-new ZX81 computer to control a welding machine. I know it doesn’t sound like a very exciting project, but there was a need for it and it was a great chal- lenge for me, because I had just learned how to program. At this point, it became clear that writing lines of code would take less time than modify- ing complex circuits.

Twenty-odd years later, I’d like to think that this experience allows me to teach people who don’t even remember taking any math class and to infuse them with the same enthusiasm and ability to tinker that I had in my youth and have kept ever since.

—Massimo

Preface ii

 Getting Started with Arduino

» The hardware is cheap. The USB board costs about €20 (currently,

about US$35) and replacing a burnt-out chip on the board is easy and costs no more than €5 or US$4. So you can afford to make mistakes.

» There is an active community of users, so there are plenty of people

who can help you.

» The Arduino Project was developed in an educational environment and

is therefore great for newcomers to get things working quickly.

This book is designed to help beginners understand what benefits they can get from learning how to use the Arduino platform and adopting its philosophy.

Intended Audience

This book was written for the “original” Arduino users: designers and artists. Therefore, it tries to explain things in a way that might drive some engineers crazy. Actually, one of them called the introductory chapters of my first draft “fluff”. That’s precisely the point. Let’s face it: most engineers aren’t able to explain what they do to another engineer, let alone a regular human being. Let’s now delve deep into the fluff.

NOTE: Arduino builds upon the thesis work Hernando Barragan did on the Wiring platform while studying under Casey Reas and me at IDII Ivrea.

After Arduino started to become popular, I realised how experimenters, hobbyists, and hackers of all sorts were starting to use it to create beauti- ful and crazy objects. I realised that you’re all artists and designers in your own right, so this book is for you as well.

Arduino was born to teach Interaction Design, a design discipline that puts prototyping at the centre of its methodology. There are many defini- tions of Interaction Design, but the one that I prefer is:

Interaction Design is the design of any interactive experience.

In today’s world, Interaction Design is concerned with the creation of meaningful experiences between us (humans) and objects. It is a good way to explore the creation of beautiful—and maybe even contro- versial—experiences between us and technology. Interaction Design encourages design through an iterative process based on prototypes

of ever-increasing fidelity. This approach—also part of some types of “conventional” design—can be extended to include prototyping with technology; in particular, prototyping with electronics.

The specific field of Interaction Design involved with Arduino is Physical Computing (or Physical Interaction Design).

What Is Physical Computing?

Physical Computing uses electronics to prototype new materials for designers and artists.

It involves the design of interactive objects that can communicate with humans using sensors and actuators controlled by a behaviour imple- mented as software running inside a microcontroller (a small computer on a single chip).

In the past, using electronics meant having to deal with engineers all the time, and building circuits one small component at the time; these issues kept creative people from playing around with the medium directly. Most of the tools were meant for engineers and required extensive knowledge. In recent years, microcontrollers have become cheaper and easier to use, allowing the creation of better tools.

The progress that we have made with Arduino is to bring these tools one step closer to the novice, allowing people to start building stuff after only two or three days of a workshop.

With Arduino, a designer or artist can get to know the basics of electronics and sensors very quickly and can start building prototypes with very little investment.

Introduction 

 Getting Started with Arduino

Prototyping is at the heart of the Arduino Way: we make things and build objects that interact with other objects, people, and networks. We strive to find a simpler and faster way to prototype in the cheapest possible way.

A lot of beginners approaching electronics for the first time think that they have to learn how to build everything from scratch. This is a waste of energy: what you want is to be able to confirm that something’s working very quickly so that you can motivate yourself to take the next step or maybe even motivate somebody else to give you a lot of cash to do it.

This is why we developed “opportunistic prototyping”: why spend time and energy building from scratch, a process that requires time and in- depth technical knowledge, when we can take ready-made devices and hack them in order to exploit the hard work done by large companies and good engineers?

Our hero is James Dyson, who made 5127 prototypes of his vacuum cleaner before he was satisfied that he’d gotten it right (www.international. dyson.com/jd/1947.asp).

Prototyping

Tinkering

We believe that it is essential to play with technology, exploring different possibilities directly on hardware and software—sometimes without a very defined goal.

Reusing existing technology is one of the best ways of tinkering. Getting cheap toys or old discarded equipment and hacking them to make them do something new is one of the best ways to get to great results.

The Arduino Way 

The Arduino Way 

10 Getting Started with Arduino

Circuit Bending

Circuit bending is one of the most interesting forms of tinkering. It’s the creative short-circuiting of low-voltage, battery-powered electronic audio devices such as guitar effect pedals, children’s toys, and small synthesiz- ers to create new musical instruments and sound generators. The heart of this process is the “art of chance”. It began in 1966 when Reed Ghazala, by chance, shorted-out a toy amplifier against a metal object in his desk drawer, resulting in a stream of unusual sounds. What I like about circuit benders is their ability to create the wildest devices by tinkering away with technology without necessarily understanding what they are doing on the theoretical side.

12 Getting Started with Arduino

Keyboard Hacks

Computer keyboards are still the main way to interact with a computer after more than 60 years. Alex Pentland, academic head of the MIT Media Laboratory, once remarked: “Excuse the expression, but men’s urinals are smarter than computers. Computers are isolated from what’s around them.” 1

As tinkerers, we can implement new ways to interact with software by replacing the keys with devices that are able to sense the environment. Taking apart a computer keyboard reveals a very simple (and cheap) de- vice. The heart of it is a small board. It’s normally a smelly green or brown circuit with two sets of contacts going to two plastic layers that hold the connections between the different keys. If you remove the circuit and use a wire to bridge two contacts, you’ll see a letter appear on the computer screen. If you go out and buy a motion-sensing detector and connect this to your keyboard, you’ll see a key being pressed every time some- body walks in front of the computer. Map this to your favourite software, and you have made your computer as smart as a urinal. Learning about keyboard hacking is a key building block of prototyping and Physical Computing.

The Arduino Way 13

(^1) Quoted in Sara Reese Hedberg, “MIT Media Lab’s quest for perceptive computers,” Intelligent Systems and Their Applications, IEEE, Jul/Aug 1998.

Hacking Toys

Toys are a fantastic source of cheap technology to hack and reuse, as evidenced by the practise of circuit bending mentioned earlier. With the current influx of thousands of very cheap high-tech toys from China, you can build quick ideas with a few noisy cats and a couple of light swords. I have been doing this for a few years to get my students to understand that technology is not scary or difficult to approach. One of my favourite resources is the booklet “Low Tech Sensors and Actuators” by Usman Haque and Adam Somlai-Fischer (lowtech.propositions.org.uk). I think that they have perfectly described this technique in that handbook, and I have been using it every since.

The Arduino Way 1 

1  Getting Started with Arduino

Collaboration

Collaboration between users is one of they key principles in the Arduino world—through the forum at www.arduino.cc, people from different parts of the world help each other learn about the platform. The Arduino team encourages people to collaborate at a local level as well by helping them set up users’ groups in every city they visit. We also set up a Wiki called “Playground” (www.arduino.cc/playground) where users document their findings. It’s so amazing to see how much knowledge these people pour out on the Web for everybody to use. This culture of sharing and helping each other is one of the things that I’m most proud of in regard to Arduino.