Si Dunn

Archive for the ‘Arduino’ Category

Make an Arduino-Controlled Robot – #diy #bookreview

In Arduino, Book review, Book reviews, DIY, Education, Homeschooling, How-to, Kindle, robotics, Software, Technology on January 2, 2013 at 11:09 am

Make an Arduino-Controlled Robot
Michael Margolis
(O’Reilly – paperback, Kindle)

Technology now makes it relatively easy to build simple robots that can be controlled remotely or can control themselves autonomously using built-in sensors and software.

This engaging how-to guide focuses on how to build and program a small robot that can roam around, sense its environment, and perform a variety of tasks, using either type of control.

Make an Arduino-Controlled Robot is an excellent book for teachers, hobbyists and experimenters who like working with software and hardware. The book’s simple robot moves about on a chassis that has two-wheel or four-wheel drive. And its heart is an Arduino Uno or Arduino Leonardo microcontroller running programs (“sketches”) provided in the book and available at a link for download.

Some basic assembly is required, including gathering parts and circuit boards and doing some soldering and mechanical assembly, following the book’s instructions. The robot can be built on small platforms from DFRobot or platforms of your own creation. And devices can be added, including distance sensors, infrared reflectance sensors, and remote control receivers.

The book is “not an introduction to programming,” however. If you have no experience with programming or programming Arduino microcontrollers, the author recommends two books: Getting Started with Arduino, 2nd Edition, and Arduino Cookbook, 2nd Edition.

Make an Arduino-Controlled Robot has 11 chapters and six appendices. The chapters are:

  1. Introduction to Robot Building
  2. Building the Electronics
  3. Building the Two-Wheeled Mobile Platform
  4. Building the Four-Wheeled Mobile Platform
  5. Tutorial: Getting Started with Arduino
  6. Testing the Robot’s Basic Functions
  7. Controlling Speed and Direction
  8. Tutorial: Introduction to Sensors
  9. Modifying the Robot to React to Edges and Lines
  10. Autonomous Movement
  11. Remote Control

The appendices are:

  • Appendix A: Enhancing Your Robot
  • Appendix B: Using Other Hardware with Your Robot
  • Appendix C: Debugging Your Robot
  • Appendix D: Power Sources
  • Appendix E: Programming Constructs
  • Appendix F: Arduino Pin and Timer Usage

Whether you love serious experimentation and invention or just tinkering for fun and mental challenge, Make an Arduino-Controlled Robot opens up many possibilities for individual, family, and classroom activities and learning.

Si Dunn

Make: Volume 32 – Zany and practical projects and articles for DIY builders – #bookreview

In Arduino, Book review, Book reviews, DIY, Electronics, Hardware, How-to, Paperback, Programmer, Programming, science, Technology on December 11, 2012 at 1:26 pm

Make: Volume 32
(O’Reilly, paperback)

Make: is a science, technology, and do-it-yourself (DIY) projects magazine published quarterly in paperback book format. Volume 32 not only has intriguing articles about private rocketeers, flying motorcycles, and human-size replicas of videogame costumes and weapons. It also has about two dozen “complete plans” for a wide array of useful and zany projects.

One of the projects in Volume 32 is “The Awesome Button,” a big red desktop button that you can hit when you can’t think of a synonym for the totally overused word “awesome” while you’re composing email or a letter or a manuscript. The project uses a $16 Teensy USB Development Board made by PJRC, plus some downloaded code. When your fist hammers down on the big red button, the board generates random synonyms for “awesome” and sends them to your computer so you can quickly accept or reject them in your document.

Another project is a catapult launcher that will send a tiny balsa wood glider zooming 150 feet into the air. Beats the heck out of a rubber band looped around a Popsicle stick.

And another DIY article focuses on the joys of salvaging perfectly good electronic and mechanical parts from discarded laser printers, so you can use the parts in other projects.

Make: Volume 33 is due to appear in January. In the meantime, Volume 32 is full of fun reading and intriguing projects, such as how to transform data files into synthesized music.

Si Dunn

Oh, say can you C? Learning to program with Head First C – #bookreview #in #programming

In Arduino, Book review, Book reviews, Books, C programming, game, games, How-to, Linux, Mac OS X, Paperback, Programmer, Programming, Software, Video games, Windows on April 27, 2012 at 7:37 pm

Head First C
By David Griffiths and Dawn Griffiths
(O’Reilly,
paperback, list price $49.99)

 Long ago, in a universe now very far away, I was an ABC programmer: assembler, BASIC, and C. I learned C from a book popularly known as “K&R,” after its authors, Brian W. Kernighan and Dennis M. Ritchie. (Their classic work is now available in an updated second edition.)

But I had no mentors, so I struggled to figure out and apply many of the basic concepts that were not quite spelled out clearly enough or illustrated well enough for me in K&R.

I really wish I had had a book like Head First C, instead. My geeky logical side often is ruled and frequently overruled by my unstructured, illogical artistic side.

For learners like me, O’Reilly’s “Head First” series makes effective and entertaining use of graphics. It also addresses readers with a conversational style that avoids lecturing. And it focuses on trying to make sure you understand and can apply each new element.

Thus, Head First C does not try to be a complete C language reference guide. It shows you how to work with C’s major concepts, and you begin using them right away, so you can start understanding the process of becoming an effective C programmer. After that, if you are motivated to continue, you can push on into other books that do attempt to be complete C reference texts.

This “brain friendly guide” shows how to download free C compilers for Linux, Macintosh, and Windows machines. And, the authors assure: “All the code in this book is intended to run across all these operating systems, and we’ve tried hard not to write anything that will only work on one type of computer.”

Another positive for this book: You don’t have to key in or wade through dozens of lines of code to get to the few lines you are really supposed to be studying. “Most examples in this book are shown within the smallest possible context, so that the part you’re trying to learn is clear and simple.”

And, the book has been given a thorough technical review. So the code examples that are intended to work generally will work.

The book’s 12 chapters focus on the following topics:

  1. Getting Started with C
  2. Memory and Pointers
  3. Strings
  4. Creating Small Tools
  5. Using Multiple Source Files
  6. Structs, Unions, and Bitfields
  7. Data Structures and Dynamic Memory
  8. Advanced Functions
  9. Static and Dynamic Libraries
  10. Processes and System Calls
  11. Interprocess Communication
  12. Sockets and Networking
  13. Threads

About midway through the book, you are presented with your first lab exercise. You write some C code and hook up a few hardware components to create an Arduino-powered plant monitor that lights up an LED and repeatedly sends the string “Feed me!” to your screen if a plant needs to be watered.

In the book’s second lab exercise, you write C code that lets your computer and its web cam act as an intruder detector. You do this with help from OpenCV, “an open source computer vision library. It allows you to take input from your computer camera, process it, and analyze real-time image data and make decisions based on what your computer sees.”

In the third and final lab exercise, you use your new C skills to write a video game called “Blasteroids,” with help from the Allegro open source game development library.

Head First C is a first and foremost a very good book for beginners, especially those who have at least a little bit of programming experience. But it delves into some advanced-level topics, too, such as multithreading and network programming.

If learning C is your goal, Head First C can help you stay focused, stay entertained and happily soak up the things you need to know.

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir. He is the author of an e-book detective novel, Erwin’s Law, now also available in paperback, plus a novella, Jump, and several other books and short stories.

Control this! Four new how-to books that use Arduino – #electronics #programming #bookreview #in

In Arduino, Book review, Book reviews, Books, How-to, Kindle, Paperback, Programmer, Programming, science, Software, Technology on April 18, 2012 at 1:27 pm

The Arduino microcontroller and programming environment let you create, program, and control a variety of devices that interact with the physical world.

Some of the things you can do with Arduino are very simple, such as adjusting the color of an RGB (red, green, blue) LED under program control. Other projects are more complex, such as creating a system that will notify you by email when a package has been left at your front door or controlling a small robotic arm.

According to the Arduino website: “Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It’s intended for artists, designers, hobbyists, and anyone interested in creating interactive objects or environments.”

Four new Arduino-related books recently have been released by O’Reilly and Pragmatic Bookshelf. They are: Arduino Cookbook, 2nd Edition; Programming Your Home; Programming Interactivity, 2nd Edition; and Making Things See.

Arduino Cookbook, 2nd Edition
By Michael Margolis
(O’Reilly, paperback, list price $44.99; Kindle edition, list price $35.99)

If you’ve been curious about Arduino, this book is a fine place to start and learn a lot about what you can do with the popular little microprocessor hardware and its software. And don’t be intimidated by the book’s hefty size: 699 pages. It is packed with how-to projects, and you won’t need experience with electronics or programming to get started.

Michael Margolis has updated his Cookbook to cover Arduino 1.0. A variety of “official boards” can be found via the Web, according to Margolis, but the “basic board that most people start with [is] the Arduino Uno.” Radio Shack and other outlets sell it. The Uno has a USB connector “that is used to provide power and connectivity for uploading your software onto the board.”

Speaking of software, you will want to install Arduino’s Integrated Development Environment (IDE) on your computer. The software, available for Windows, Mac, and Linux, can be downloaded here. Margolis explains how to set up each version and also how to set up the Arduino board (and some new boards such as Leonardo).

In the Arduino world, a piece of source code is known as a “sketch.” Virtually every how-to-program book for computers starts out with a simple “Hello World” example. And the Ardunio Cookbook is no exception. It shows how to load a very simple program into the board and make an LED blink on and off. From there, the projects become increasingly more robust, until you are generating audio tones, controlling motors and servos, reading temperatures with digital thermometers, and even using Arduino to send messages to Twitter.

This well-written and well-illustrated book nicely lives up to its tagline: “Recipes to Begin, Expand, and Enhance Your Projects.”

The three other Arduino-related books focus on more specific applications of the microprocessor and its software.

Programming Your Home: Automate with Arduino, Android, and Your Computer
By Mike Riley, edited by Jacquelyn Carter
(Pragmatic Bookshelf, paperback, list price $33.00)

For those who have some basic experience with Arduino, Programming Your Home offers several fun and useful home automation projects, such as an electronic guard dog, a Web-enabled light switch, a door lock you can open or latch from an Android phone, and a package-delivery alert tool that can send you an email.

Programming Your Home is well written and shows, step-by-step, how to wire up the external components to the Arduino board, program the applications, test them and use them. A second goal is to give you the skills and confidence necessary to create “custom home automation projects of  your own design.”

The author states:Programming Your Home is best suited to DIYers, programmers, and tinkerers who enjoy spending their leisure time building high-tech solutions to further automate their lives and impress their friends and family with their creations.”

He adds: “The projects also make great parent-child learning activities, as the finished products instill a great sense of accomplishment.”

One family-oriented example is an Arduino-controlled bird feeder that time-stamps bird visits and their durations and stores the data. It also sends out Twitter tweets that alert nearby bird watchers and signal the need for more bird food. 

The most complex project in his book is also one of the coolest: a smartphone app that lets you call home and unlock or lock a door remotely. It uses a first-generation Android phone, a Sparkfun IOIO board and a few other components. This project does not use the Arduino board, but the programming and hardware experience gained from working with the Arduino comes in handy.

Programming Interactivity, 2nd Edition
By Joshua Noble
(O’Reilly, paperback, list price $49.99; Kindle edition, list price $39.99 )

“This book,” says Joshua Noble, ”is called Programming Activity because it’s focused primarily on programming for interaction design, that is, programming to create an application with which users interact directly.”

His 704-page how-to guide is aimed at readers who “don’t have a deep, or even any, programming or technical background [but] you’re a designer, artist, or other creative thinker interested in learning about code to create interactive applications in some way or shape.”

The tagline for this updated edition is: “A Designer’s Guide to Processing, Arduino, and openFrameworks.” Those are the three key areas covered in the book.

Processing,” Noble points out, “was the one of the first open source projects that was specifically designed for simplifying the practice of creating interactive graphical applications so that nonprogrammers could easily create artworks. Artists and designers developed Processing as an alternative to similar proprietary tools.”

As for Arduino, Noble focuses first on programming using the Arduino IDE. Then he introduces wiring parts and devices to the board and making them work. Soon, he jumps into object-oriented programming using C++, and then he moves to openFrameworks (oF), “which is a collection of code created to help you do something in particular.”

He adds: “Specifically, oF is a framework for artists and designers working with interactive design and media art.”

From there, his book moves into physical input, programming graphics, bitmaps and pixels, sound and audio, Arduino and creating physical feedback (such as turning on motors, servos or household appliances), protocols and communication, graphics and OpenGL, motion and gestures, movement and location, spaces and environments, and further resources.

Noble covers a lot of ground, using a mixture of text, illustration and code examples. And he offers plenty of links and additional topics. Unlike many how-to guides, he includes “interviews with programmers, artists, designers, and authors who work with the tools covered in this book.”

Making Things See: 3D Vision with Kinect, Processing, Arduino, and MakerBot
By Greg Borenstein
(O’Reilly, paperback, list price $39.99; Kindle edition, list price $31.99)

Arduino becomes a key factor beginning on page 353 of this fascinating and challenging 416-page book aimed at gamers, artists, technology hobbyists and others.

The microprocessor becomes the brain of a small, easy-to-build robotic arm that can, within  limits, ”reproduce the motions of a real arm.”

Much of this book focuses on the Microsoft Kinect, a popular peripheral for Microsoft’s XBox 360 video game system, which the author of Making Things See terms a “depth camera.” A Kinect contains an infrared projector and infrared camera, an RGB camera, and some microphones. “The Kinect…records the distance of the objects that are placed in front of it…[and]…uses infrared light to create an image (a depth image) that captures not what the objects look like, but where they are in space….[A] depth image is much easier for a computer to ‘understand’ than a conventional color image,” Borenstein writes.

There is focus, as well, on Processing and on 3-D printing using a MakerBot ReplicatorG or the Shapeways online service.

The book offers several projects, and, in the final one, Kinect and Arduino are linked together and the Arduino is programmed to control a basic robotic arm that responds to forward or inverse kinematics. Using two servos, the arm can move up and down at “elbow” and “shoulder” and follow the movements of a particular point.

“Our bodies respond to physical objects differently than graphics on a screen,” Borenstein states, “and there’s something powerful about closing that loop by making interactive objects that can see us move around the room and respond by moving in kind.”

He adds: “Rather than just waving at computers, now we’ve taught them to wave back.”

#

Si Dunn is a novelist, screenwriter, freelance book reviewer, and former software technical writer and software/hardware QA test specialist. He also is a former newspaper and magazine photojournalist. His latest book is Dark Signals, a Vietnam War memoir. He is the author of an e-book detective novel, Erwin’s Law, now also available in paperback, plus a novella, Jump, and several other books and short stories.

Follow

Get every new post delivered to your Inbox.

Join 1,349 other followers