Sunday, February 2, 2014

First foray into the world of Arduino

Before Christmas I was ordering a few things from Amazon and was somewhat surprised when I was unable to check out with a few smaller items that completed the order.  Puzzled, I dug around and discovered that there was, in effect, a minimum order for some items - something that I'd not known about Amazon - and unless I exceeded it, there seemed to be no way to order them.

Not sure what else that I wanted at that last moment it occurred to me to get an Arduino Uno and I was able to check out with all of the items.

I had it around for about a month before I got around to doing anything with it other than make it blink an LED.  In looking at the Arduino "sketches" more closely than I'd done in the past I noted that they were quite "C"-like - albeit a rather limited one in many ways - but it looked like it might be useful when one just wanted to throw something together to do a particular function.

Programming in higher-level languages:

For some years now I've programmed PIC microcontrollers in C.  In using a higher level language, there's the risk of getting too far from the hardware and writing slow, bloated code, but frequently looking at the resulting assembly language can keep one grounded and aware of the sort of C code that will produce the best result.

Up to this point I've not gotten around to using an Arduino, but I did know about its sketch language and the relative convenience of dashing off some code and uploading it to the board.  This process and method has several downsides:
  • An Arduino is fairly expensive compared to just a "raw" microcontroller and the bare-minimum necessary parts.
  • If it's small, compact, fast code that you want, you might not use a high-level (ish) language.
A third point might be the fact that one is sort of straightjacketed by the physical aspect of the Arduino:  Whether you like it or not, any project built with or around it will have to conform it its layout and hardware limitations such as size and power consumption.

Having said all of that, it's very convenient to be able to buy lots of different plug-in accessories and boards for the Arduino family as well as use the vast, free libraries of shared code available for a wide variety of projects.  Not only that, there are a number of different Arduino variants about - both official and unofficial - that provide a lot of different hardware capabilities over a wide range of prices.

Making a shield:

So it came to be that a project came across that interested me - a means of effectively measuring the relative sensitivity of an optical receiver.  In this particular case Barry, G8AGN put together some code that generated a tone and then measured the analog signal from it in the presence and absence of that tone and then calculate the difference in deciBels.

Needing to interface an LCD to the Arduino I did not to have such an LCD "shield", the plug-in board that interfaces with the Arduino, as well as a bit of additional circuity.  Rummaging around in my parts bin I found all of the necessary pieces:  A small piece of perforated prototype board, some SIP headers, an HD44780-based LCD module and a few of the other miscellaneous parts.
Figure 1:
The bottom side of the constructed interface board (a.k.a. "Shield").
Click on the image for a larger version.

In lining up the pins of the SIP headers I noticed something that I'd not known before:  One of the four connectors on the board wasn't spaced in 0.1" (2.54mm) multiples from the other connectors in the "Y" axis.  In doing a bit of quick research on the GoogleFace (or is it the webTube?) the most credible reason for this was an error in the first run of the original Arduino boards due to a fast-approaching deadline.

How to work around this problem?

Fortunately, the pins were fairly long and I was able to bend a slight "dog leg" into each of the 10 pins of the that mate with the upper-right connector on the Arduino board - see Figure 2, below.

Figure 2:
A close-up of the pins (the 10 pins on the left) into which an offset was bent so that they would line up with the connector on the board.
Click on the image for a larger version.

While I was originally unsure if this would work, it was actually quite easy to put the bend in the leads - before soldering them to prevent tearing the etched copper ring from the board - using a pair of stout, fine-tipped needle-nose pliers.  Once the bends were made and I verified that the connectors mated properly I soldered the pins on the bottom side of the board to hold them in place.

On the top side of the board I'd used some solder-in pins with a plastic header, but instead of having a small portion of the pins stick below the board, I pushed the pins flush with the plastic headers and mounted them on the "top" (component side) of the board - see Figure 3, below.

Figure 3:
The operating and completed "shield".
Click on the image for a larger version.

As can be seen in Figure 3 the pins in the plastic headers are flush with the top and doing it this way adds mechanical support as all of the pins are secured from the top side as well as via the solder on the bottom side.  In soldering the connections to these pins, a bit of extra effort must be taken since there is limited room on the bottom side to do this, but it is certainly possible with a bit of care.

This seems to be a viable way to make interface boards of various sorts.  In the case of the above, I could have reduced it size to better-match that of the Arduino board by snapping off some of the extra pieces as well as positioning it over the board but with the rather large display I decided to keep it intact.

[End]

This page stolen from ka7oei.blogspot.com

No comments:

Post a Comment





PLEASE NOTE:


While I DO appreciate comments, those comments that are just vehicles to other web sites without substantial content in their own right WILL NOT be posted!

If you include a link in your comment that simply points to advertisements or a commercial web page, it WILL be rejected as SPAM!