t r o n i x s t u f f

fun and learning with electronics

Review – Schmartboard SMT Boards

In this article we review a couple of SMT prototyping boards from Schmartboard.

Introduction

Sooner or later you’ll need to use a surface-mount technology component. Just like taxes and myki* not working, it’s inevitable. When the time comes you usually have a few options – make your own PCB, then bake it in an oven or skillet pan; get the part on a demo board from the manufacturer (expensive); try and hand-solder it yourself using dead-bug wiring or try to mash it into a piece of strip board; or find someone else to do it. Thanks to the people at Schmartboard you now have another option which might cost a few dollars more but guarantees a result. Although they have boards for almost everything imaginable, we’ll look at two of them – one for QFP packages and their Arduino shield that has SOIC and SOP23-6 areas.

boards

QFP 32-80 pin board

In our first example we’ll see how easy it is to prototype with QFP package ICs. An example of this is the Atmel ATmega328 microcontroller found on various Arduino-compatible products, for example:

atmega

Although our example has 32 pins, the board can handle up to 80-pin devices. You simply place the IC on the Schmartboard, which holds the IC in nicely due to the grooved tracks for the pins:

atmegabefore

The tracks are what makes the Schmartboard EZ series so great – they help hold the part in, and contain the required amount of solder. I believe this design is unique to Schmartboard and when you look in their catalogue, select the “EZ” series for this technology. Moving forward, you just need some water-soluble flux:

fluxpen

then tack down the part, apply flux to the side you’re going to solder – then slowly push the tip of your soldering iron (set to around 750 degrees F) down the groove to the pin. For example:

Then repeat for the three other sides. That’s it. If your part has an exposed pad on the bottom, there’s a hole in the centre of the Schmartboad that you can solder into as well:

qfpheat

After soldering I really couldn’t believe it worked, so probed out the pins to the breakout pads on the Schmartboard to test for shorts or breaks – however it tested perfectly. The only caveat is that your soldering iron tip needs to be the same or smaller pitch than the the part you’re using, otherwise you could cause a solder bridge. And use flux!  You need the flux. After soldering you can easily connect the board to the rest of your project or build around it.

Schmartboard Arduino shield

There’s also a range of Arduino shields with various SMT breakout areas, and we have the version with 1.27mm pitch SOIC and a SOT23-6 footprint. SOIC? For example:

soicic

This is the AD5204 four-channel digital potentiometer we used in the SPI tutorial. It sits nicely in the shield and can be easily soldered onto the board. Don’t forget the flux! Although the SMT areas have the EZ-technology, I still added a little solder of my own – with satisfactory results:

The SOT23-6 also fits well, with plenty of space for soldering it in. SOT23? Example – the ADS1110 16-bit ADC which will be the subject of a future tutorial:

ads1110

Working with these tiny components is also feasible but requires a finer iron tip and a steady hand.

sot236

Once the SMT component(s) have been fitted, you can easily trace out the matching through-hole pads for further connections. The shield matches the Arduino R3 standards and includes stacking header sockets, two LEDs for general use, space and parts for an RC reset circuit, and pads to add pull-up resistors for the I2C bus:

otherparts

Finally there’s also three 0805-sized parts and footprints for some practice or use. It’s a very well though-out shield and should prove useful. You can also order a bare PCB if you already have stacking headers to save money.

Conclusion

If you’re in a hurry to prototype with SMT parts, instead of mucking about – get a Schmartboard. They’re easy to use and work well.  Full-sized images available on flickr.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

The boards used in this article were a promotional consideration supplied by Schmartboard.

*myki

April 20, 2013 Posted by | arduino, product review, review, safety, schmartboard, SMD, SMT, soic, soldering, sot-23, tqfp, tronixstuff, tutorial | , , , , , , , , , , , , , , , , , , , , , | 2 Comments

Review: Gooligum Electronics PIC Training Course and Development Board

Introduction

There are many types of microcontrollers on the market, and it would be fair to say one of the two most popular types is the Microchip PIC series. The PICs are great as there is a huge range of microcontrollers available across a broad range of prices. However learning how to get started with the PIC platform isn’t exactly simple. Not that we expect it to be, however a soft start is always better. There are some older books, however they can cost more than $100 – and are generally outdated. So where do you start?

It is with this problem in mind that led fellow Australian David Meiklejohn to develop and offer his PIC Training Course and Development Board to the marketplace via his company Gooligum Electronics.

In his words:

There is plenty of material available on PICs, which can make it daunting to get started.  And some of the available material is dated, originally developed before modern “flash” PICs were available, or based on older devices that are no longer the best choice for new designs.  Our approach is to introduce PIC programming and design in easy stages, based on a solid grounding in theory, creating a set of building blocks and techniques and giving you the confidence to draw on as we move up to more complex designs.

So in this article we’ll examine David’s course package. First of all, let’s look at the development board and inclusions. Almost everything you will need to complete all the lessons is included in the package, including the following PIC microcontrollers:

You can choose to purchase the board in kit form or pre-assembled. If you enjoy soldering, save the money and get the kit – it’s simple to assemble and a nice way to spend a few hours with a soldering iron.

Although the board includes all the electronic components and PICs – you will need are a computer capable of running Microchip MPLAB software, a Microchip PICkit3 (or -2) programming device and an IC extractor. If you’re building the kit, a typical soldering iron and so on will be required. Being the  ultra-paranoid type, I bought a couple extra of each PIC to have as spares, however none were damaged in my experimenting. Just use common-sense when handling the PICs and you will be fine.

Assembly

Putting the kit board together wasn’t difficult at all. There isn’t any surface-mount parts to worry about, and the PCB is silk-screened very well:

The rest of the parts are shipped in antistatic bags, appropriately labelled and protected:

Assembly was straight forward, just start with the low-profile parts and work your way up. The assembly guide is useful to help with component placement. After working at a normal pace, it was ready in just over an hour:

The Hardware

Once assembled (or you’ve opened the packaging) the various sections of the board are obvious and clearly labelled – as they should be for an educational board. You will notice a large amount of jumper headers – they are required to bridge in and out various LEDs, select various input methods and so on. A large amount of jumper shunts is included with the board.

It might appear a little disconcerting at first, but all is revealed and explained as you progress through the lessons. The board has decent rubber feet, and is powered either by the PICkit3 programmer, or a regulated DC power source between 5 and 6V DC, such as from a plug-pack if you want to operate your board away from a PC.

However there is a wide range of functions, input and output devices on the board – and an adjustable oscillator, as shown in the following diagram:

The Lessons

There is some assumed knowledge, which is a reasonable understanding of basic electronics, some computer and mathematical savvy and the C programming language.

You can view the first group of lessons for free on the kit website, and these are included along with the additional lessons in the included CDROM. They’re in .pdf format and easy to read. The CDROM also includes all the code so you don’t have to transcribe it from the lessons. Students start with an absolute introduction to the system, and first learn how to program in assembly language in the first group of tutorials, followed by C in the second set.

This is great as you learn about the microcontroller itself, and basically start from the bottom. Although it’s no secret I enjoy using the Arduino system – it really does hide a lot of the actual hardware knowledge away from the end user which won’t be learned. With David’s system – you will learn.

If you scroll down to the bottom of this page, you can review the tutorial summaries. Finally here’s a quick demonstration of the 7-segment displays in action:

Where to from here? 

Once you run through all the tutorials, and feel confident with your knowledge, the world of Microchip PIC will be open to you. Plus you now have a great development board for prototyping with 6 to 14-pin PIC microcontrollers. Don’t forget all the pins are brought out to the row of sockets next to the solderless breadboard, so general prototyping is a breeze.

Conclusion

For those who have mastered basic electronics, and have some C or C-like programming experience from using other development environments or PCs – this package is perfect for getting started with the Microchip PIC environment. Plus you’ll learn about assembly language – which is a good thing. I genuinely recommend this to anyone who wants to learn about PIC and/or move into more advanced microcontroller work. And as the entire package is cheaper than some books –  you can’t go wrong. The training course is available directly from the Gooligum website.

Disclaimer - The Baseline and Mid-Range PIC Training Course and Development Board was a promotional consideration from Gooligum Electronics.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

October 25, 2012 Posted by | beginnner, kit review, microchip, microcontrollers, pic, tutorial | , , , , , , , , , , , , , , , , | 6 Comments

Initial review: Aery32 Atmel AVR32 UC3A1 Development Board

Introduction

Recently (!) one of my readers sent me the subject of our review – the Aery32 development board from Finland. Based around the Atmel AVR32 UC3A1 128KB microcontroller – it is a painless way to get into AVR32 programming and development. Furthermore the hardware and software are completely open-source, so you can make your own and modify to your heart’s content. The specifications of the Atmel AVR32 UC3A1 show that it is an incredibly powerful microcontroller and they can be found in detail from Atmel here - plus you can download the data sheet from here.

Regular readers will know that I don’t work with this platform, so this review is written from the point of an absolute beginner. My apologies if some of the terminology used isn’t the norm. Moving forward, here is our Aery32 board:

… and the rear:

One could say that there is everything you need – and nothing you do not. Looking at the front of the board, apart from the MCU there is an LED for use, the mini-USB for programming and a switch for changing modes between the bootloader and program. On the rear are the pin references, and on the right-hand side solder pads (on both sides) for the JTAG debugger.  The following video is a short walkthrough:

Setup

The first thing to do is get the required software installed on the machine. Instructions for Windows, MacOS and Linux are provided. Here we have Windows 7 and the installation was simple – the Atmel software installed painlessly enough. You will also need the Aery32 software framework, which contains source files and compiling instructions for your projects. This is updated over time by the Aery32 project, so keep an eye on the github page.

After downloading the framework, keep an unaltered copy in a folder. Then you copy this and rename it for each new project. That is - for each project you start with a fresh framework folder and insert the code into the main.cpp file within the folder. Consider the following:

You can see how I have kept the framework in a folder to keep as a source, then made copies and renamed them for individual projects. Then inside each folder you have the various files – and the main.cpp which contains your project code.

Using the Aery32

From the beginning I was a little worried due to my lack of time and inexperience with AVR32 programming. However after determing how the software framework and code files are used as described earlier – the process of programming the board was easy. You then just need to learn how to program – a topic for another day… In the meanwhile, blinking the LED as a test was simple enough. After making a separate folder (see the image above) one simply edits the main.cpp file and adds the required code. For example – to blink the onboard LED:

#include "board.h"
#include <aery32/all.h>
using namespace aery;
int main(void)
{
 /* Put your application initialization sequence here */
 init_board();
 gpio_init_pin(LED, GPIO_OUTPUT);
for(;;) {
 gpio_toggle_pin(LED);
 delay_ms(250);
}
 return 0;
}

Next, make sure the switch on the Aery32 is moved towards the reset button – this puts the board into bootloader mode. Plug in the USB cable, wait for recognition – then from the command prompt, navigate to the folder which contains the code and enter make program start. If all goes well you will see the following:

And if it doesn’t, the various errors are described as necessary. As you can see all the compilation and uploading is scripted for you making the whole process very simple. Then move the switch away from the reset button – which puts the board in run mode, then press reset. For anything further you’re going to need some external wiring – so for further experimenting purposes the first thing I did was solder in some standard 0.1″ dual inline header pins to allow easy access to a variety of I/O pins and GND. Although wanting to do more I’m pretty time-constrained at the moment so came up with not one but four blinking LEDs. Here’s the code:

#include "board.h"
#include <aery32/all.h>
using namespace aery;
int main(void)
{
 /* Put your application initialization sequence here */
 init_board();
 // set I/O pins to output
gpio_init_pin(AVR32_PIN_PA00, GPIO_OUTPUT);
 gpio_init_pin(AVR32_PIN_PA01, GPIO_OUTPUT);
 gpio_init_pin(AVR32_PIN_PA02, GPIO_OUTPUT);
 gpio_init_pin(AVR32_PIN_PA03, GPIO_OUTPUT);
for(;;) {
gpio_toggle_pin(AVR32_PIN_PA00);
 delay_ms(250);
 gpio_toggle_pin(AVR32_PIN_PA01);
 delay_ms(250);
 gpio_toggle_pin(AVR32_PIN_PA02);
 delay_ms(250);
 gpio_toggle_pin(AVR32_PIN_PA03);
 delay_ms(250);
 }
 return 0;
}

and for the non-believers – the board in action:

Aery32-specific information and help is easy to find. For an open-source project, the documentation is extensive and includes many examples. Have a look around the documentation site to see what I mean. There is also a developer area which contains many articles about using the Aery32 and various examples within.

Conclusion

From my (beginner’s) perspective this board was very easy to setup and get working. Not having to worry about downloading hundreds of megabytes of IDE was great and allows programming from lightweight machines. And there is no doubt about the power or I/O features of the AVR32 UC3A1. Now I’ll get myself a good AVR32 book. So if you’re looking for a powerful and well-supported AVR32 development board, the Aery32 is a good start. You can order the board directly from the website at http://www.aery32.com/.

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column? And join our friendly Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

September 2, 2012 Posted by | aery32, atmel, avr32, UC3A1 | , , , , , , , , | 8 Comments

April 2011 Competition – Results

Hello readers

The month of April has ended and thus another monthly tronixstuff.com competition. There were six questions hidden within the posts, and once again all entrants were correct with their answers. Questions for April were:

  1. Name the two people who founded the predecessor to Agilent Technologies – Bill Hewlett and Dave Packard;
  2. Name the magazine that originally described this kit (Current clamp meter adaptor) – Silicon Chip;
  3. What does the acronym FTDI mean – Future Technology Devices International;
  4. What is the mains power frequency in Australia? 50 Hz;
  5. What is the name of the Evil Mad Science Arduino-compatible development board – Diavolino;
  6. Unit of measurement for elastance – the daraf.
Congratulations to Mike F. and Rob R. – the lucky winners!

The first winner drawn will receves a full PoGa system bundle courtesy of 4D Systems, an Australian-based company who are a worldwide leader in the development and manufacture of intelligent graphic display modules.

What is a PoGa you may ask? Here is an example:

As you can see, the PoGa is an amazing piece of work. The people at 4D Systems have really put together a fun and accessible way to develop your own games. However the PoGa is a lot more powerful than the retail price would suggest:

PoGa Features:

  • Single chip, low cost educational game development platform, incorporating the tiny GOLDELOX-PoGa graphics processor chip.
  • Comes in an easy to build kit form with very low parts count and cost: GOLDELOX-PoGa chip, 6 buttons, Colour LCD-TFT, Battery Holder and few discrete components.
  • Display: 1.44″, 128xRGBx128 resolution, 65K colour TFT-LCD (directly interfaced to the GOLDELOX-PoGa chip).
  • Colours: 65K simultaneous colours.
  • microSD Card Interface: Supports the PoGa-Disk which can store and load up to 512 games and other applications as well as images and video clips. It can also be used as a storage medium for data logging applications during run time.
  • Sound Support: Single channel sound engine with extended RTTTL format and allows complex generation of game sounds.
  • Console: Layout fashion follows most standard game consoles with 6 buttons for game and non game related application control.
  • Expandable: Power and UART lines are available via 8pin expansion port.
  • Battery: Supports 3 x AAA batteries for mobility (hight capacity alkaline or lithium recommended).
  • Supports the high level 4DGL language platform, syntax very similar to C.
  • Software Tools: Free fully integrated 4D Workshop3 IDE software development tool suite.
  • RoHS compliant.

PoGa Specifications:

  • CPU: GOLDELOX-PoGa chip.
  • Total RAM: 510 bytes (or 255 word sized variables).
  • Program Memory: 11K bytes (more than adequate for all PoGa applications).
  • Speed: 12Mips (internal).
  • Screen: 1.44″ LCD-TFT, with greater than 160deg viewing angle.
  • Resolution: 128 x RGB x 128 pixels.
  • Colours: 65K colours. Pixels arranged in a 5:6:5 colour format (Red:5 bits, Green:6 bits, Blue: 5 bits).
  • Graphics:Supports all primitives such as:
    • Lines, Circles, Rectangles, Dots, Triangles
    • Chars, Strings, Text Buttons
    • Images and Video clips.
  • Sprites: Up to 64 sprites can be defined, simultaneous display of sprites is unlimited.
  • Sound: Single channel mono, supports extended RTTTL format and allows complex generation of game sounds.
  • Console: 4 x Navigation keys, 2 x Selection keys.
  • PoGa-Disk: microSD card interface that supports most uSD memory cards  for video, images, game and application storage. 2Gb and larger size cards can support PoGa file system application storage.
  • Expansion: External expansion port, (RX, TX, VBat, 3.3V and GND).

The first prize not only includes a fully-assembled PoGa unit, to enable extended application and experimentation with their PoGa the winner also receives a USB programming cable, external breakout board and the GPS receiver module as shown below:

The second prize winner receives exactly the same as the first! Except for being the review hardware used to play… test out the PoGa here at tronixstuff. Nevertheless both winners will have a ball playing the sample games, or spending time to develop their own games, quizzes, possible GPS applications including reverse  geocaching, and so on. In the next week I will review the PoGa system in more detail and document my experience with it. :)

To get your hands on a PoGa, they can be ordered directly from 4DSystems, Little Bird Electronics, Sparkfun and their resellers, or Tigal for EU customers.

So have fun and keep checking into tronixstuff.com. Why not follow things on twitter, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Once again, thank you to our generous competition sponsor 4D Systems!

May 6, 2011 Posted by | competition, games, microcontrollers | , , , , , , , , , , , , , , , , , , | Leave a Comment

April 2011 Competition

Hello readers

The April competition has now closed. Thank you to all those who entered, and the winners have been announced!

Another month has passed, so time for another competition!

To enter, find the six questions that will be spread across the articles published in tronixstuff.com between the first and last day of April. When you have answers to all six questions, email your answers to competition at tronixstuff dot com with “April″ in the subject line. Then in the first week of May, I will compile a list of people with the correct answers, and randomly select two winners. Please note competition rules at end of article.

The first winner drawn will receive a full PoGa system bundle courtesy of 4D Systems, an Australian-based company who are a worldwide leader in the development and manufacture of intelligent graphic display modules.

What is a PoGa you may ask? Here is an example:

As you can see, the PoGa is an amazing piece of work. The people at 4D Systems have really put together a fun and accessible way to develop your own games. However the PoGa is a lot more powerful than the retail price would suggest:

PoGa Features:

  • Single chip, low cost educational game development platform, incorporating the tiny GOLDELOX-PoGa graphics processor chip.
  • Comes in an easy to build kit form with very low parts count and cost: GOLDELOX-PoGa chip, 6 buttons, Colour LCD-TFT, Battery Holder and few discrete components.
  • Display: 1.44″, 128xRGBx128 resolution, 65K colour TFT-LCD (directly interfaced to the GOLDELOX-PoGa chip).
  • Colours: 65K simultaneous colours.
  • microSD Card Interface: Supports the PoGa-Disk which can store and load up to 512 games and other applications as well as images and video clips. It can also be used as a storage medium for data logging applications during run time.
  • Sound Support: Single channel sound engine with extended RTTTL format and allows complex generation of game sounds.
  • Console: Layout fashion follows most standard game consoles with 6 buttons for game and non game related application control.
  • Expandable: Power and UART lines are available via 8pin expansion port.
  • Battery: Supports 3 x AAA batteries for mobility (hight capacity alkaline or lithium recommended).
  • Supports the high level 4DGL language platform, syntax very similar to C.
  • Software Tools: Free fully integrated 4D Workshop3 IDE software development tool suite.
  • RoHS compliant.

PoGa Specifications:

  • CPU: GOLDELOX-PoGa chip.
  • Total RAM: 510 bytes (or 255 word sized variables).
  • Program Memory: 11K bytes (more than adequate for all PoGa applications).
  • Speed: 12Mips (internal).
  • Screen: 1.44″ LCD-TFT, with greater than 160deg viewing angle.
  • Resolution: 128 x RGB x 128 pixels.
  • Colours: 65K colours. Pixels arranged in a 5:6:5 colour format (Red:5 bits, Green:6 bits, Blue: 5 bits).
  • Graphics:Supports all primitives such as:
    • Lines, Circles, Rectangles, Dots, Triangles
    • Chars, Strings, Text Buttons
    • Images and Video clips.
  • Sprites: Up to 64 sprites can be defined, simultaneous display of sprites is unlimited.
  • Sound: Single channel mono, supports extended RTTTL format and allows complex generation of game sounds.
  • Console: 4 x Navigation keys, 2 x Selection keys.
  • PoGa-Disk: microSD card interface that supports most uSD memory cards  for video, images, game and application storage. 2Gb and larger size cards can support PoGa file system application storage.
  • Expansion: External expansion port, (RX, TX, VBat, 3.3V and GND).

The first prize not only includes a fully-assembled PoGa unit, to enable extended application and experimentation with their PoGa the winner also receives a USB programming cable, external breakout board and the GPS receiver module as shown below:

And let’s not forget the second prize – it is exactly the same as the first! Except for being the review hardware used to play… test out the PoGa here at tronixstuff. Nevertheless both winners will have a ball playing the sample games, or spending time to develop their own games, quizzes, possible GPS applications including reverse  geocaching, and so on. In the next week I will review the PoGa system in more detail and document my experience with it. :)

If you don’t want to wait and take a chance you can get a PoGa directly from 4DSystems, Little Bird Electronics, Sparkfun and their resellers, or Tigal for EU customers.

As with any other competition, there needs to be some rules:

  • Prizes will be delivered via Australia Post regular air mail. Winners may elect for other methods upon payment of real cost;
  • Winners outside of Australia will be responsible for any taxes, fees or levies imposed by your local Governments (such as import levies, excise, VAT, etc.) upon importation of purchased goods;
  • If you have won a previous competition you cannot enter;
  • If you have met John Boxall in person you cannot enter;
  • The Judge’s decision is final with regards to any dispute;
  • Entries will be accepted until 2359h GMT on 3rd May 2011.

So have fun and keep checking into tronixstuff.com. Why not follow things on twitter, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

Once again, thank you to our generous competition sponsor 4D Systems!

April 2, 2011 Posted by | competition, games, microcontrollers | , , , , , , , , , , , , , , , , , , | Leave a Comment

Kit Review – MDC Bare-bones Board Kit (Arduino-compatible)

Hello readers

Today we continue to examine Arduino-compatible products by assembling an interesting kit from Modern Device Company – their “Bare Bones Board” (to be referred to as BBB). The BBB kit is an inexpensive way to take advantage of the Arduino Duemilanove-compatible platform, and also fills some gaps in the marketplace. Unlike the usual Arduino and compatible boards, the BBB does not maintain the recognisable form factor – that is, you cannot use the variety of Arduino shields. However, the BBB does have all the input and output connections, just in different positions.

So why would you use this kit? If you are looking to create a more permanent Arduino-based project that did not require a shield, and you are in a hurry – the BBB could be easily integrated into your design. Money is saved by not having the usual USB connection, so uploading your sketch is achieved using a 5V FTDI cable or using another Arduino board as the programmer. Furthermore, the PCB is designed in a way that allows you to plug the BBB into the side of a solderless breadboard, which allows prototyping more complex Arduino-based circuits very easy. But more about that later. For now, let’s have a look at construction. An excellent set of instructions and a guide to use is available for download here.

In the spirit of saving money, the kit arrives in a plastic bag of sorts:

And upon emptying the contents, the following parts are introduced:

Regular readers would know that the inclusion of an IC socket makes me very happy. The PCB is thicker than average and has a great silk-screen which makes following instructions almost unnecessary. One of the benefits of this kit is the ability to connect as little or as many I/O or programming pins as required. And for the pins A0~A5, 5V, GND and AREF you are provided with header pins and a socket, allowing you to choose. Or you could just solder directly into the board. These pins are available on the bottom-left of the PCB. However there was one tiny surprise included with the parts:

This is a 15uH SMD inductor, used to reduce noise on the analog/digital section. According to the instructions, this was originally required with Arduino-style boards that used the ATmega168 microcontroller – however the BBB now includes the current ATmega328 which does not require the inductor. However, it is good to get some SMD practice, so I soldered it in first:

Well it works, so that was a success. Soldering the rest of the main components was quite simple, thanks to the markings on the PCB. The key is to start with the lowest-profile (height) components (such as that pesky inductor) and work your way up to the largest. For example:

As you can see from the PCB close-up above, you can have control over many attributes of your board. Please note that the revision-E kit does include the ATmega328 microcontroller, not the older ’168. For more permanent installations, you can solder directly into I/O pins, the power supply and so on. Speaking of power, the included power regulator IC for use with the DC input has quite a low current rating – 250 mA (below left). For my use, this board will see duty in a breadboard, and also a 5V supply for the rest of the circuit, so more current will be required. Thankfully the PCB has the space and pin spacing for a 7805 5V 1A regulator (below right), so I installed my own 7805 instead:

Finally, to make my Arduino-breadboarding life easier I installed the sockets for the analogue I/O, the DC socket and a row of header pins for the digital I/O. Below is my finished example connected into a breadboard blinking some LEDs:

In this example, the board is being powered from the 5V that comes along the FTDI cable. If doing so yourself, don’t forget that there is a maximum of 500 mA available from a USB port. If you need more current (and have installed the 7805 voltage regulator) make use of the DC socket, and set the PCB power select jumper to EXT. For a better look at the kit in action, here is a short video clip:

As you can see from the various angles shown in the video, there are many points on the PCB to which you can use for power, ground, I/O connection and so on. As illustrated at the beginning of this article, a variety of header pins are included with the kit. And please note that the LED on the board is not wired into D13 as other Arduino-type boards have been… the BBB’s LED is just an “on” indicator. However if you are using this type of kit, you most likely will not need to blink a solitary LED. However some people do use the D13 LED for trouble-shooting, so perhaps you will need it after all. Each to their own!

In conclusion, the BBB is another successful method of prototyping with the Arduino system. The kit was of a good quality, included everything required to get working the first time, and is quite inexpensive if you have a 5V FTDI cable or an Arduino Duemilanove/Uno or compatible board for sketch uploading. It is available in Australia from Little Bird Electronics, or directly from Modern Device in the USA.

Once again, thank you for reading this kit review, and I look forward to your comments and so on. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts, and if you have any questions – why not join our Google Group? It’s free and we’re all there to learn and help each other.

High resolution photos are available on flickr.

[Note - this kit was purchased by myself personally and reviewed without notifying the manufacturer or retailer]

January 29, 2011 Posted by | arduino, kit review, learning electronics, microcontrollers | , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 4 Comments

Tutorial: Arduino and the DS touch screen

Use inexpensive touch-screens with Arduino in chapter twenty-three of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – A tutorial on the Arduino universe.  The first chapter is here, the complete series is detailed here.

[Updated 19/01/2013]

Today we are going to spend some time with a touch screen very similar to the ones found in a Nintendo DS gaming unit. In doing so, we can take advantage of a more interesting and somewhat futuristic way of gathering user input. Please note that in order to use the screen without going completely insane, you will need the matching breakout board, as shown in the following image:

The flimsy flexible PCB runner is inserted into the plastic socket on the breakout board – be careful not to crease the PCB nor damage it as it can be rather easy to do so. (The screen can be easy to break as well…) However don’t let that put you off. You will most likely want to solder in some header pins for breadboard use, or sockets to insert wires. For this article it is being used with pins for a breadboard.

Before we start to use the screen, let’s have a quick investigation into how they actually work. Instead of me trying to paraphrase something else, there is a very good explanation in the manufacturer’s data sheet. So please read the data sheet then return. Theoretically we can consider the X and Y axes to be two potentiometers (variable resistors) that can be read with the analogRead() function. So all we need to do is use two analog inputs, one to read the X-axis value and one for the Y-axis value.

However, as always, life isn’t that simple. Although there are only four wires to the screen, the wires’ purpose alters depending on whether we are measuring the X- or Y-axis. Which sounds complex but is not. Using the following example, we can see how it all works.

Example 23.1

In this example, we will read the X- and Y-axis values returned from the touch screen and display them on an LCD module. (Or you could easily send the values to the serial monitor window instead). From a hardware perspective, you will need:

Connection of the touch screen to the Arduino board is simple, Arduino analog (yes, analog - more on this later) pins A0 to Y1, A1 to X2, A2 to Y2 and A3 to X1 – as below:

Mounting the rest for demonstration purposes is also a simple job. Hopefully by now you have a test LCD module for easy mounting :)

I have mounted  the touch screen onto the breadboard with some spare header pins, they hold it in nicely for testing purposes. Also notice that the touch screen has been flipped over, the sensitive side is now facing up. Furthermore, don’t forget to remove the protective plastic coating from the screen before use.

From a software (sketch) perspective we have to do three things – read the X-axis value, the Y-axis value, then display them on the LCD. As we (should) know from the data sheet, to read the X-axis value, we need to set X1 as 5V, X2 as 0V (that is, GND) and read the value from Y2. As described above, we use the analog pins to do this. (You can use analog pins as input/output lines in a similar method to digital pins – more information here. Pin numbering continues from 13, so analog 0 is considered to be pin 14, and so on). In our sketch (below) we have created a function to do this and then return the X-axis value.

The Y-axis reading is generated in the same method, and is quite self-explanatory. The delay in each function is necessary to allow time for the analog I/O pins to adjust to their new roles as inputs or outputs or analog to digital converters. Here is our sketch: (download)

/*  Example 23.1 - Arduino and touch screen
http://tronixstuff.com/tutorials > Chapter 23
CC by-sa-nc */
#include <LiquidCrystal.h> // we need this library for the LCD commands
LiquidCrystal lcd(12, 11, 5, 4, 2, 3); // your pins may vary
int x,y = 0;
void setup()
{
lcd.begin(20,4); // need to specify how many columns and rows are in the LCD unit
lcd.clear();
}
int readX() // returns the value of the touch screen's X-axis
{
int xr=0;
pinMode(14, INPUT);   // A0
pinMode(15, OUTPUT);    // A1
pinMode(16, INPUT);   // A2
pinMode(17, OUTPUT);   // A3
digitalWrite(15, LOW); // set A1 to GND
digitalWrite(17, HIGH);  // set A3 as 5V
delay(5); // short delay is required to give the analog pins time to adjust to their new roles
xr=analogRead(0); //  return xr;
}
int readY() // returns the value of the touch screen's Y-axis
{
int yr=0;
pinMode(14, OUTPUT);   // A0
pinMode(15, INPUT);    // A1
pinMode(16, OUTPUT);   // A2
pinMode(17, INPUT);   // A3
digitalWrite(14, LOW); // set A0 to GND
digitalWrite(16, HIGH);  // set A2 as 5V
delay(5); // short delay is required to give the analog pins time to adjust to their new roles
yr=analogRead(1); //
return yr;
}
void loop()
{
lcd.setCursor(0,0);
lcd.print(" x = ");
x=readX();
lcd.print(x, DEC);
y=readY();
lcd.setCursor(0,1);
lcd.print(" y = ");
lcd.print(y, DEC);
delay (200);
}

Next, let’s have a look at this example in action. The numbers on the LCD may be not what you expected…

The accuracy of the screen is not all that great – however first take into account the price of the hardware before being too critical. Note that there are values returned even when the screen is not being pressed, we could perhaps call these “idle values”. Later on you will learn tell your sketch to ignore these values if waiting for user input, as they will note that nothing has been pressed. Furthermore, the extremities of the screen will return odd values, so remember to take this into account when designing bezels or mounting hardware for your screen.

Each touch screen will have different values for each X and Y position, and that is why most consumer hardware with touch screens has calibration functions to improve accuracy. We can now use the X and Y values in sketches to determine which part of the screen is being touched, and act on that touch.

In order to program our sketches to understand which part of the screen is being touched, it will help to create a “map” of the possible values available. You can determine the values using the sketch from example 23.1, then use the returned values as a reference for designing the layout of your touch interface. For example, the following is a map of my touch screen:

Example 23.2

For the next example, I would like to have four “zones” on my touch screen, to use as virtual buttons for various things. The first thing to do is draw a numerical “map” of my touch screen, in order to know the minimum and maximum values for both axes for each zone on the screen:

At this point in the article I must admit to breaking the screen. Upon receiving the new one I remeasured the X and Y points for this example and followed the  process for defining the numerical boundaries for each zone is completed by finding average mid-points along the axes and allowing some tolerance for zone boundaries.

Now that the values are known, it is a simple matter of using mathematical comparison and Boolean operators (such as >, <, &&, etc)  in a sketch to determine which zone a touch falls into, and to act accordingly. So for this example, we will monitor the screen and display on the LCD screen which area has been pressed. The hardware is identical to example 23.1, and our touch screen map will be the one above. So now we just have to create the sketch.

After reading the values of the touch screen and storing them into variables x and y, a long if…then…else if loop occurs to determine the location of the touch. Upon determining the zone, the sketch calls a function to display the zone type on the LCD. Or if the screen is returning the idle values, the display is cleared. So have a look for yourself with the example sketch: (download)

/*
Example 23.2 - Arduino and touch screen - four zone demonstration
http://tronixstuff.com/tutorials > Chapter 23 CC by-sa-nc
*/
#include <LiquidCrystal.h> // we need this library for the LCD commands
LiquidCrystal lcd(12, 11, 5, 4, 2, 3); // your pins may vary
int x,y = 0;
int d = 500; // used for display delay
void setup()
{
lcd.begin(20,4); // need to specify how many columns and rows are in the LCD unit
lcd.clear();
}
int readX() // returns the value of the touch screen's X-axis
{
int xr=0;
pinMode(14, INPUT);   // A0
pinMode(15, OUTPUT);    // A1
pinMode(16, INPUT);   // A2
pinMode(17, OUTPUT);   // A3
digitalWrite(15, LOW); // set A1 to GND
digitalWrite(17, HIGH);  // set A3 as 5V
delay(5); // short delay is required to give the analog pins time to adjust to their new roles
xr=analogRead(0); //  return xr;
}
int readY() // returns the value of the touch screen's Y-axis
{
int yr=0;
pinMode(14, OUTPUT);   // A0
pinMode(15, INPUT);    // A1
pinMode(16, OUTPUT);   // A2
pinMode(17, INPUT);   // A3
digitalWrite(14, LOW); // set A0 to GND
digitalWrite(16, HIGH);  // set A2 as 5V
delay(5); // short delay is required to give the analog pins time to adjust to their new roles
yr=analogRead(1); //  return yr;
}
// the next four functions just display a zone label on the LCD
void displayA()
{
lcd.clear();
lcd.setCursor(0,0);
lcd.print("AAAAAAAAAA");
lcd.setCursor(0,1);
lcd.print("AAAAAAAAAA");
delay(d);
}
void displayB()
{
lcd.clear();
lcd.setCursor(10,0);
lcd.print("BBBBBBBBBB");
lcd.setCursor(10,1);
lcd.print("BBBBBBBBBB");
delay(d);
}
void displayC()
{
lcd.clear();
lcd.setCursor(0,2);
lcd.print("CCCCCCCCCC");
lcd.setCursor(0,3);
lcd.print("CCCCCCCCCC");
delay(d);
}
void displayD()
{
lcd.clear();
lcd.setCursor(10,2);
lcd.print("DDDDDDDDDD");
lcd.setCursor(10,3);
lcd.print("DDDDDDDDDD");
delay(d);
}
void loop()
{
// get values from touch screen
x=readX();
y=readY();
// now determine where the touch was located on the screen
if (y>510 && x>520 && x<1000 && y <1000)
{
displayA();
} else
if (y>510 && x<510)
{
displayB();
} else
if (y<500 && x>520)
{
displayC();
} else
if (y<500 && x<510)
{
displayD();
} else
if (x>1000 && y>1000)
{
lcd.clear();
}
}

And see it in operation:

So there you have it, I hope you enjoyed reading this as much as I did writing it. Now you should have the ability to use a touch screen in many situations – you just need to decide how to work with the resulting values from the screen and go from there.

Have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS using the links on the right-hand column, or join our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, helpful to each other –  and we can all learn something.

December 29, 2010 Posted by | arduino, BOB-09170, education, hardware hacking, LCD-08977, microcontrollers, tutorial | , , , , , , , , , , , , , , , , , , , , , , , , , , , , | 11 Comments

Kit Review – adafruit industries DS1307 Real Time Clock breakout board kit

Hello readers

Today we are going to examine another small yet useful kit from adafruit industries – their DS1307 Real Time Clock breakout board kit. My purpose of acquiring this kit was to make life easier when prototyping my clock and timer Arduino-based projects on a breadboard. For example, blinky, or the various clock projects in the Arduino tutorials.

When breadboarding a DS1307 circuit, there are a few problems – the legs of the crystal are very fine, and break easily, and trying to mount the backup battery holder on the breadboard can be difficult due to their odd pin-spacing. That is why this breakout board is just perfect for breadboarding.

Finally, (in Australia anyway) the price of the kit is less than the sum of the retail cost of the parts required. Anyhow, time to get cracking!

Again, as usual the adafruit kit packaging is simple, safe and reusable:

And with regards to the contents within:

… no surprises here, another quality solder-masked, silk-screened PCB  that has everything you need to know printed on it. Now that you can see the crystal (above image, bottom-right) you can realise why this board is a good idea. Furthermore, the inclusion of a quality battery and not some yum-cha special is a nice touch.

Assembly is incredibly simple. The IC position is printed on the PCB, the resistors are the same, and the capacitor and crystal are not polarised. Again, no IC socket, but perhaps it is time not to worry about that anymore – my soldering skills have improved somewhat in the last twelve months. Plus the DS1307 can handle 260 degrees Celsius for ten seconds when soldering (according to the data sheet.pdf).

However if you like to read instructions (which is generally a good idea) the excellent documentation is laid out here for your perusal.

Soldering the board is quite straightforward, however when it comes time to solder in the coin cell holder, note that there are large gaps in the mounting holes:

It is important to solder the pins solidly to the PCB, without letting lots of solder flow through the hole and block the other side. If you can bend the pins slightly closer to the circumference of the hole, soldering will be a lot easier. And don’t forget to put a blob of solder on the top-facing pad between the two pin holes before soldering in the coin cell holder.

Finally, when time to solder in the header pins, mount the lot onto a breadboard, and support the gap between the PCB and the breadboard at the opposite end of the PCB. An old CD works very well:

And within ten minutes of starting, we have finished!

Insert the backup cell (writing facing up!) in the holder and you’re ready to time. A new backup cell should last between seven to ten years, so unless you want to reset the clock completely, leave the cell in the board.

Now it is time to use the board. My only experience is with the Arduino-based systems, and even so using the DS1307 can seem quite difficult at the start. However with the right library and some basic reusable sketch modules you can do it quite successfully. The board is a standard DS1307 circuit, and is explained in great detail within the data sheet.pdf.

Don’t forget you can get a nice 1 Hz (or 4, 8 or 32 kHz) square wave from this IC – here is a sketch that allows you to control the square-wave generator:

/*
 DS1307 Square-wave machine
 Used to demonstrate the four different square-wave outputs from Maxim DS1307
 See page nine of data sheet for more information
 John Boxall - tronixstuff.wordpress.com
*/
#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68 // each I2C object has a unique bus address, the DS1307 is 0x68
void setup()
{
  Wire.begin();
}
void sqw1() // set to 1Hz
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0x07); // move pointer to SQW address
  Wire.send(0x10); //  sends 0x10 (hex) 00010000 (binary)
  Wire.endTransmission();
}
void sqw2() // set to 4.096 kHz
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0x07); // move pointer to SQW address  
  Wire.send(0x11); //  sends 0x11 (hex) 00010001 (binary)
  Wire.endTransmission();
}
void sqw3() // set to 8.192 kHz
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0x07); // move pointer to SQW address  
  Wire.send(0x12); // sends 0x12 (hex) 00010010 (binary)
  Wire.endTransmission();
}
void sqw4() // set to 32.768 kHz (the crystal frequency)
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0x07); // move pointer to SQW address  
  Wire.send(0x13); // sends 0x13 (hex) 00010011 (binary)
  Wire.endTransmission();
}
void sqwOff()
// turns the SQW off
{
  Wire.beginTransmission(DS1307_I2C_ADDRESS);
  Wire.send(0x07); // move pointer to SQW address
  Wire.send(0x00); // turns the SQW pin off
  Wire.endTransmission();
}
void loop()
{
  sqw1();
  delay(5000);
  sqw2();
  delay(5000);
  sqw3();
  delay(5000);
  sqw4();
  delay(5000);
  sqwOff();
  delay(5000);
}

And here is a demonstration of measuring the SQW output with a very old frequency counter:


adafuit have written about using this with Arduino, or you may like my way of doing things in Getting Started with Arduino - Chapter Seven.

Well I hope you found this review interesting, and helped motivate you to expand your knowledge and work with real-time clocks, Arduino and the I2C bus.

You can purchase the kit directly from adafruit industries.

As always, thank you for reading and I look forward to your comments and so on. Furthermore, don’t be shy in pointing out errors or places that could use improvement. Please subscribe using one of the methods at the top-right of this web page to receive updates on new posts. Or join our new Google Group. High resolution images are available on flickr.

[Note - The kit was purchased by myself personally and reviewed without notifying the manufacturer or retailer]

Otherwise, have fun, be good to each other – and make something! :)

September 7, 2010 Posted by | kit review, microcontrollers, Uncategorized | , , , , , , , , , , , , , , , , , , , , , , | 6 Comments

   

Follow

Get every new post delivered to your Inbox.

Join 3,842 other followers

%d bloggers like this: