Saturday, March 20, 2010

The Beginning of the Arduino Project


Last summer, my son and I attended an introductory Arduino prototyping class taught through DPRG by Dale Wheat (www.dalewheat.com). I really liked the chip and kept fooling with it. One day, I emailed Dale concerning what I had been doing with the Arduino and on January 17, 2010, he emailed me thus:
Perhaps where you're at right now, Arduino-wise, you could help me map out my "advanced" class. Controlling servos, H-bridges, relays, etc. is one path I would like to do. What say you?

How could I resist? In my usual reserved and cautious manner, I pretty much bulldozed the project and took it over. Dale really has enough to do. I outlined the course and sent that information to Dale for perusal. Since then, I have been fleshing out the course, writing the… I hate to say “lecture” … portion of the class, writing the programs and wiring up breadboards with the class examples. If you are not already familiar with breadboard prototyping, Wikipedia has a very good explanation at this link: http://en.wikipedia.org/wiki/Breadboard Two of their examples make my boards look absolutely pristine.

In the introductory class, students built a breadboarded circuit using the Arduino and built a few projects. This class builds on that same breadboarded Arduino and continues forward. Students will build multiple projects on this breadboard, disassembling the current circuit in favor of the new. As an instructional tool, the boards for teaching must already be assembled to demonstrate a working model and a physical example of what the board should look like when completed. Well, more or less, anyway.

So, for each session in the class, I have assembled a breadboard to demonstrate all the lessons covered in that session. For the first session, Flashy, Winky, Blinky, Traverse, Fader, Fading Traverse and Cylon are all programs to be demonstrated (I will define these programs in a later post). Fortunately, one row of six LEDs is sufficient. I did have to add a push button to demonstrate all these functions in one program. The push button is beyond the scope of the first session, so the result is that we have the instructor’s board that is similar to, but not quite identical to the student board.

The second session on switching was a bit more challenging in that four distinct and independent functions are demonstrated on the board, requiring independent hardware. Once again, the demonstration mode runs all the programs, but this time, there is just a pause between programs. The programs demonstrate Arduino switching in the following forms:
· using a PN 2222A transistor to switch
· using a PN 2222A with PWM
· using a PN2222A to switch a relay
· using a MosFET to switch
· using a MosFET with PWM
That is really only three distinct circuits, but there is the addition of a voltage regulator in that the MosFET is used to switch a heavier, non-USB-5-volt supplied source. When not hooked up to the USB to TTL converter, a 12-volt battery runs the entire circuit.

The third board is more coherent in that the Arduino control of a single H-bridge (SN754410 Quadruple Half-H Driver) is the only demonstration. There is more wiring due to the manner in which each communicates. Once again, the voltage regulator is present. There will also be two motors involved with this project. I have to figure out a good demonstration for the motors that fit within the mission of the Breadborad Arduino project (simply, commonly available to all the students and cheap).

Board five is already built- it is the one that got me into this. It is a demonstration of the PING ))) ® ultrasonic transducer with the Arduino. That board is already too crowded to incorporate another project, so session three will have two instructor boards- one for other input handling (board four) and one board for ultrasonic sonar.

In the picture above, you can see, from left to right, boards one, two, three and five. Board one has the array of LEDs, board two has transistors, relay and MosFET, Board three has the H-bridge and is sporting the USB to TTL converter and board five is set up for ultrasonic sonar and is sporting the Arduino from the original class. If you have been following from the introduction class, you can see that I have done a couple of things to lower the profile of the board- I put the power-on LED down at the board level with its dropping resistor, I was fortunate to find electrolytic capacitors with a lower profile. I didn't want to change the appearance of the board radically, but the less components I bump off during handling, the better.

At least two more boards are needed; board six for motion (Passive InfraRed [PIR], infrared proximity sensors and whatever else I can fit in) and board seven for position (compass, three-axis accelerometer, GPS). GPS Is not a solid class element yet in that it stretches the affordability part of the mission statement.

Pieces that have not yet been worked into the class are that push button mentioned above- yes, it’s a simple piece of hardware, but it requires some specific handling in the software, the voltage regulator that keeps popping up and a serial LCD screen. The LCD screen is perhaps a little pricey for the class, but it would be fun. All programs currently use serial output to the computer to communicate text. This limits the portability of each example in that the board must be tethered to the computer with a USB cable.

So, now you know how the Arduino project got started. And yes, I do touch base with Dale from time to time to stay in sync. We will probably spend some quality time together ironing out details after I get all the rough work done. If I can keep after it, we may have a valuable class to offer in a couple of months.

More updates as they happen.