Saturday, February 26, 2011

Shopping List - Feb 26

A quick check of ACK's online catalog revealed they are out of stock on the HC595 chips. So, online shopping I go...

I figured I'd try and spread out the cost of shipping by buying additional items needed later in the book. Sparkfun seemed to have quite a bit of the missing components (many of them high $ - bleh). So, I've updated the Projects Spreadsheet with a list of the items I've purchased along with costs.

When I'm done with this blog, I'm hoping to be able to offer up potential readers some sort of ballpark price for what they'll spend to do everything... still not certain if I'll break down and buy the Arduino Mega needed for Project 31 and 32. The author states that the standard Arduino can be used and explains how, but it's a bit beyond me right now and I'll cross that bridge when I get closer to Project 31.

In the meantime, as I wait for UPS Ground to deliver my goods, I'll probably go ahead and solder up the LoL Shield and the MotorShield that MakerShed sent me on loan... and document the work in one or two upcoming posts. Project 19 is temporarily on hold until then...

Project 18 - Dual 8-Bit Binary Counters

Looks like I'll be paying a visit to my local electronics store on Monday... I believe that one of my 595 chips is damaged. Let me explain.

I wired up the circuit as shown in Figure 6-4... it's a fairly logical layout if you understand Project 17. When I fired it up, I could get the LEDs on the left (sorry, I had to use all red LEDs) to start counting down from 255... but the LEDs on the right (connected to new 595 chip) weren't lighting up.

I tried quite a few things:

1. I switched out the LEDs with a few random ones (green, yellow, red mix) but no luck.
2. I switched out the LEDs on the left (that I knew worked) with the ones on the right... no luck.
3. I reversed the two 595 chips and the LEDs on left stopped working but ones on right did work.


Then I went back to my wiring... just in case. The wiring was fine, but given that swapping the 2 chips also reversed the LEDs lighting up, I'm fairly certain I've got a damaged HC595. But it's my fault... when I was inserting the 2nd HC595, one of the pins got bent... I used my small pliers to fix it. But after removing the chips numerous times with small bends in various pins, I'm certain that one of the 595s has died at my hands.

RIP HC595 #2...

This also means that Project 19 is on hold until I can get a replacement. Scratch that - if I can find them locally, I'll likely buy 3 or 4 to have extras. And I'm going to invest in a chip puller.

On a different note... my wife got me a Hakko 936 solder station for Valentine's Day (yes, she's pretty awesome) that I've been playing with and loving. It's got a dial-in temp gauge on front, however, that's been tricky for me as the documentation came with nothing related to finding the proper temps for solder.

I was in ACK Electronics last week to get a few spare tips (should have bought some spare 595s!) and mentioned the issue to Scott who works there... he pulled out this great little card (from 1977) that, among other things, has a sliding scale that allows you to find the melting temp in C and F for different mixes of solder. Look at one of the photos and you can see that I've selected a 60/40 mix of tin/lead and the guide gives me a range of 361-374F for the melting temp. Scott gave me the card to keep and it's now sitting next to my 936.

Wednesday, February 23, 2011

Project 17 - Shift Register 8-Bit Binary Counter

I enjoyed this project... for the first time in a long time, I finally understand how this type of chip works. I've encountered it before in other circuits, but there's never really been a good explanation for how it gets the data in there, holds it, and then knows when to release it.

The author covers quite a bit here, so I read the project text over twice before beginning. I already had a strong understanding of binary, so that part was easy enough to follow, but the explanation of Latch, Data, and Clock pins took an extra read... but it was worth it. Make sure to step through Table 6-4 on page 117 if this confuses you... that table really helped.

Not sure if the binary value the author uses at bottom of page 117 is an error or not, but it only shows 8 bits as 0011011 and the author references a Logic Analyzer figure on page 118 that appears to show the binary value of 00110111 for a total of 8 bits... maybe I'm wrong, but can someone else take a look?

The code is fairly easy to follow, but I had to really pay attention on the bit shifting portion of the code to understand what's going on there. It's an interesting project and the code totally makes sense now.

The video shows what happens when it's plugged in - I didn't record the entire count up from 0 to 255, but it does eventually light up all the LEDs for a value of 255!

Monday, February 21, 2011

Project 16 - Using an L293D Motor Driver IC

Well... a LOT to write about regarding Project 16. So, in no particular order, here are some observations, notes, etc.

* I used the SN754410 IC in lieu of the L293D. The author reports the L293D chip builds up a LOT of heat, but I didn't really encounter that problem. It may be either because I didn't let the single motor run for more than 20-30 seconds OR the small motor I'm using may be a factor... just don't know.

* Reader ctdahle provided a comment for Project 15 that clarified the issue of motors requiring their own power supply and not pulling from the Arduino. Understood, and thank you for clearing it up! This time around, I put in a single 9V battery (see photos) that I felt would do the job.

* Although it isn't easy to tell from Figure 5-3, the IC chip needs to have pin 1 pointing left... towards the Arduino. You can figure this out easily enough with the program and the pin layout on page 109, but I figured I'd save you a few seconds and tell you.

* I tried to use a heat sink that I purchased for this project... it slides over the IC and makes contact on the top of the chip. The problem was that with the heat sink, I couldn't insert the chip into the breadboard. I also tried a 16 pin socket (see photo of socket and heat sink) but the heat sink also prevented the chip from being inserted into the socket. The author shows what appears to be a heat sink that must require the chip paste but I couldn't find that particular item at or (A quick search of - the author's werbsite - didn't show anything for "heat sink" either, so please tell me if you find it and where.)

The program works fine... I am able to flip the toggle to change the direction of the motor spin. Once again I have to crank up the potentiometer quite a bit to get spin, but once it's spinning and I flip the toggle, you can hear the motor stop for a moment and then start up spinning in the opposite direction. (Not sure what the purpose of the 10k resistor is on the toggle - can someone offer an explanation? It looks like it's simply serving as a pulldown resistor... but no mention in the book.)

I was going to attempt the variation of this project (see page 109) but I'm including a closeup photo here of one of my tiny DC motors. As you can see, the wire has broken off... the leads on these tiny motors just can't hold up to even the slightest of tugs... will have to re-solder a stronger wire soon.

Sorry for the rat's nest of wires again... I simply love these flexible jumper wires and I'm not really trying to use any kind of color coding right now... maybe later. That said, if you look closely at some of the photos, you'll see I didn't follow the author's wiring diagrams exactly - the 9V positive wire connects directly to the chip... same with the motor wires. I just basically ignored where the author used jumper wire to continue a connection elsewhere.

Video below... you can hear the change of the motor when the toggle is thrown.

Wednesday, February 16, 2011

Project 15 - Simple Motor Control

You need to read over this project carefully - the author does a good job of warning you about the risks to your DC motor if you don't take care to provide the right amount of power to the motor. That said, I ordered a tiny motor that the Arduino is capable of providing power to (without an external power jack plug specified in the hardware listing) as long as the 10K potentiometer is thrown into the mix.

If you're not certain what you're doing, then wire up the project exactly as described in the book - he shows two AA batteries providing the power but if you have a variable voltage wall adapter, that could likely be used if you set the voltage to a level that matches your DC motor specs.

So... as you can see from my photos (and video), I've skipped the power jack and I have my DC motor getting power directly from the V+ line on my breadboard that, in turn, is getting power from the Arduino when plugged into the USB port. Maybe over time this would be a bad thing for the little motor, but for short bursts like in the video, and with the 10K cranked up a bit, it's not a problem. (And at $1.95 each, if the motor dies I won't lose too much sleep.)

I did use the specified 1N4001 diode in my circuit as well as the TIP120... I also removed the MakerShield to give myself a bit more room on the larger breadboard to spread out and wire it all up. I could easily have wired all this up on the mini-breadboard on the MakerShield now that I look at it, but I liked having the room to spread out.

In the video, when I apply power, there's a slight hum coming from the motor... only when I crank the 10K down a substantial amount does the motor start to spin. I put a piece of tape on the motor shaft so you can see the spinning action... it happens fast in the video before the tape is spun off... so watch carefully. Also not sure if you can hear the hum of the motor, but it's there, too.

Friday, February 11, 2011

Project 14 - Light Sensor

I've double and triple-checked my wiring - and I've switched out the resistor for values between 1K and 10K, but so far I'm not getting any variation of the Piezo when I cover the photoresistor (LDR) or shine a bright LED flashlight on it. You'll hear the Piezo in the video - maybe you can hear a difference, but the tempo sounds the same no matter what I try.

If anyone has any suggestions, I'll keep the circuit intact for a day or so before moving on to Project 15.

Meanwhile, in anticipation of some upcoming projects, I contacted some friends at and inquired about getting a "loan" of some parts that I'm hesitant to purchase right now - these two parts are the MotorShield and the Robot Chassis (base) that will be needed in Project 29 (Chapter 10). The folks over there were kind enough to send over the items for me to use (may be a few weeks before I get to them) and I just wanted to say thank you... and that I'll return them in good condition when I'm done. (The MotorShield requires assembly - another test of my soldering skills coming up - will share photos and results when I get it finished.)

Interestingly, they also threw in a couple of other items to test ... one is the Mintronics: Survival Pack which is very nice. I actually took the LDR out of it and swapped out the one in my video, but the results were the same. And finally, they've loaned me a LoL (Lots of LEDs) Shield which I'll play around with in Chapter 7 when I learn how to use the Arduino to control displays... should be fun.

It's probably no surprise that I'm a huge fan of Make magazine and - both resources are helpful to the hobbyist and I've found the folks working for both to be supportive and extremely generous. Be sure to throw them some business if/when you can - I've already got my eyes on the Mega which I'll be ordering soon... apparently one will be needed for Project 31 (Chapter 11).

(I'll add some of these items to the Projects Spreadsheet and will note that they are loaners and not purchased...)

Thursday, February 10, 2011

Interesting Read - Why the Arduino Won

Just a short post tonight - be sure to read "The Arduino Won... and Why It's Here to Stay" and see if you agree or disagree... the article, written by Phillip Torrone, can be found here.

Wednesday, February 9, 2011

Project 13 - Piezo Knock Sensor

Project 13 uses the Piezo as a sensor... be sure to plug it into Analog pin 5 and not Digital pin 5! (Made that mistake and took me a few minutes to figure out what was wrong.)

When the program runs, the LED blinks twice to indicate the program is running... then it patiently waits for you to tap the Piezo. The video shows it in action.

Sorry for the rat's nest of wires... because I'm using a slightly different type of screw terminal, I used the jumper wires to allow me to share the GND pin. The MakerShield is still making it very easy to wire up these circuits so I'm taking advantage of it while I still can.

One question this program raised - the last bit of the code:

if (ledValue <=0) {ledValue = 0;} I'm not really understanding why this is required (although it is - see Video 2)... if ledValue drops below 0 and goes negative, the ledValue variable should simply jump to 255 when the Piezo is tapped, so it's not like the variable has to count up from a large negative value or anything. My best guess is that there must be a lower limit to the variable and when it hits it, it then "rolls over" back to 255. I may not be expressing that in the proper terminology, but... am I right? Wrong? Anyone have a better explanation for the pulsing?

BTW - A variation of this project is featured in Make magazine, Volume 25 - it's a candy dispenser that uses this technique to "listen" to a person's knock - if the knock is the proper tune, a piece of candy is released down the chute. You can watch an interview with the builder and see it in action in this video.

Tuesday, February 8, 2011

Make Live

I can't believe I forgot to post about this, but two Wednesdays ago (Jan 26) premiered the first Make:Live online broadcast. The topic of the night focused on the Arduino (and it's also the topic of the latest issue of Make - Volume 25).

The Make: Live event is supposed to occur ever other Wed, so that means a new broadcast will happen tomorrow at 9pm EDT. If you missed the first broadcast, they've collected the highlights of the event in a collection of videos that you can view here. (Scroll down and look for Episode 01 labels.)

Tomorrow's episode will focus on soldering. As I've stated in previous posts, my soldering skills could handle an upgrade... I'm hoping to see or hear something tomorrow that will give me a +1 bonus to my Soldering ability.

Hope to see you there... I'll be logged in as JamesFloydKelly.

Project 12 - Piezo Sounder Melody Player

A fun little project, but I have to say the Piezo buzzer is not my favorite choice of noisemaker. I'm not sure if the video quite captures just how grating the high pitch squeals really are...

One thing I really was glad to learn in this project was the ability to use the #define command to equate a value with a token. Similar, I guess, to a variable, but the value cannot be changed in the program (only at the #define statement). The author did a good job of explaining why this feature is useful with the dot matrix display example... makes sense if you think about it - substituting in a larger display is simple when all you have to do is change the height and width values in the #define statements.

It was also nice to be able to download the code rather than type it in - typing in all those #define statements followed by the tune and the duration information would have been tedious (probably good to do just to hammer in the idea, but I think I've got it...)

One thing I'm still not clear on, however, is the discussion of the length variable. The author divides 26 (notes) by 2 (the number of bytes in a single element) to get a value of 13. The loop will count from 0 to 13, playing the tune(x)... the way I'm reading this seems to indicate only the first 13 (of 26) notes will get played. Am I missing something?

I'm including a video below that I hope doesn't annoy anyone in the room (or office) - it's definitely Puff the Magic Dragon, but I'd never play this for my 8 month old with a Piezo!

Monday, February 7, 2011

Green Appeal

I've ordered a LOT of electronics components over the past 13 months, many of it for my previous blog that covered my work through the Make: Electronics book. One really annoying (to me) business practice I've seen time and time again is best summed up with the included picture here.

On the left is the box I got from that contained two small plastic baggies, each with a single 8x8 LED. On the right is a small box I got from that contains a total of 11 different components ordered, packed nice and tight (and with bubble wrap) and shipped in an envelope that was only slightly larger than the box.

By and far, the worst I ever received was a box larger than the one on the left from that contained a single relay. One. Relay. Smaller than a golf ball.

I'm part of the problem, of course... I try to save funds and gas by ordering online rather than driving all over Atlanta buying up pieces from various vendors. Yes, I pay more at Radio Shack, but I'm really starting to think that the amount of gas I use in my truck has to be less than the amount of fuel these big boxes take (by air and ground vehicles).

I'm glad to see that these companies want to protect my order and keep it from getting damaged, but there's got to be a better way. I really have to give a HUGE hand to for their efforts in reducing waste - I have a strong feeling this is a choice they've made and not just happenstance. And even if they are trying to save money by using less packaging, that's still a big plus in my book.

So... I guess what I'm trying to say is try and order from if you can... if this kind of thing bothers you. And please let me know if you are aware of other electronics supply companies that don't just throw a couple small resistor bags into the nearest shoebox (or larger).

Sorry for the rant... now back to the blog.

Project 11 - Piezo Sounder Alarm

Project 11 is very simple to wire up... and the program is one of the shortest we've seen so far. It uses a sine wave, again, to generate values that fluctuate, allowing the piezo buzzer to warble like an alarm.

I've got the sound from the unedited program playing in the first video. It's loud... and obnoxious. This would definitely annoy a brother or sister who entered your room without permission! I modified the variable value to start with a base of 1000 (instead of 2000) and the alarm has a lower tone... but still loud.

I'm amazed at the volume generated from this tiny device - it was the smallest one in the bins at Radio Shack. I'm sure the larger ones require more voltage, but little fella is rated for between 3 and 20 volts. I'm glad I'm not hitting it with 20 volts!

Thursday, February 3, 2011

Project 10 - Serial Controlled Mood Lamp

Project 10 opened up a lot of questions - all of them related to the code and not the actual electronics. I have to admit that I read over this project about four times, just trying to get my hands around the code. (The pseudo code at the end of the project is very helpful - read it!) But still... there are a LOT of things in this project that are not likely to be familiar to those new to programming. For instance, on page 72, the author refers to a "pointer" - I know what that is (and sort of how it works) but it may be totally new to some readers... (the author does explain it briefly, but it's BRIEF and really more confusing IMO than anything else... but chalk that up to my limited C/C+ and general programming knowledge in general...)

Let's see... what else...

I think there's also an assumption here that the reader will understand that the Serial.available command is not going to start until the Enter button is pressed and sending your RGB values but that's not expressly stated.

There's also no explanation of why the numChar is limited to 15 characters. I'm guessing that spaces are ignored, because in the example "R255, G255, B255" (including the ending NULL), if I count the spaces, I'm getting 17 characters just as the author states... but if it gets cut to 15, that means the last 2 characters get deleted, right? If not the NULL, then at least the '55' at the end of the 'B255' - I may need someone to explain this a bit better.

Page 73 - the author explains the * as designating a pointer, but he states it's been added to the variable name as '*data' - but the code in the book and the code I actually ran has the * added to the char data type - char* - any ideas why? Simply a typo?

The rest of the code, especially parsing the RGB code you type in and having it checked and then routed to the right LED - got it. Not a problem.

Overall, I like the power that Project 10 demonstrates (controlling things via a keyboard) but much of the code is still confusing to me... and I imagine it will be to a lot of readers. I certainly don't have time to dive deep into the C/C+ programming language right now, so I'll just accept that not everything makes sense right now and take what I can and move on...

Wednesday, February 2, 2011

Project 9 - LED Fire Effect

Project 9 was easy to wire up - I simply replaced the RGB LEDs from Project 8 with two yellow and one red LED. The resistor values are high enough that I don't have to worry about burning them out.

Without the diffusion provided by the white paper, the flicker is easily visible to the naked eye. I got a much better result getting the fire effect as you can hopefully see in the video. Once again, I didn't have to modify the author's code for Project 9, so no screen capture of my code here.

Also, I'm still using my MakerShield here... the mini-breadboard is just the right size for these early projects, but the upcoming projects are going to require a bit more space and a larger breadboard. Still, it's a nice little shield and definitely reduces the clutter for these smaller experiments.

I spent a few minutes digging around looking for two white LEDs (I know I have a few somewhere) but couldn't find them... so I'm not going to attempt the extra modifications for Project 9 (welding effect and rescue vehicle lights). The Welding Effect would simply require tinkering with the random flickering of the blue and white LEDs... and the Rescue Vehicle Effect would require a non-random timing of the red/blue LEDs...a trivial task at this point in time.