Wednesday, April 27, 2011

Kit review – High Accuracy LC Meter

Hello readers

Time for another kit review. Lately one of my goals has been to make life easier and in doing so having some decent test equipment. One challenge of meeting that goal is (naturally) keeping the cost of things down to a reasonable level. Unfortunately my eyesight is not the best so I cannot read small capacitor markings – which makes a capacitance meter necessary. Although I have that function within my multimeter, it is often required to read resistors in the same work session.

Thus the reason for this kit review. A day trip to Altronics saw me return (amongst other things) with their High Precision LC Meter kit. The details were originally published in the May 2008 issue of Australia’s Silicon Chip magazine. The meter specifications are:

  • Capacitance – 0.1pF to over 800 nF with four-digit resolution;
  • Inductance – 10 nH to over 70 mH with four-digit resolution;
  • Accuracy of better than +/- 1% of the reading;
  • Automatic range selection, however only non-polarised capacitors can be measured.

The power drain is quite low,  between 8 (measurement) and 17 milliamps (calibration). Using a fresh 9V alkaline battery you should realise around fifty to sixty hours of continuous use. At this point some of you may be wondering if it is cheaper to purchase an LC meter or make your own. A quick search found the BK Precision 875B LCR meter with the same C range and a worse L range for over twice the price of the kit. Although we don’t have resistance measurement in our kit, if you are building this you already have a multimeter. So not bad value at all. And you can say you built it :)

Speaking of building, assembly time was just under two hours, and the kit itself is very well produced. The packaging was the typical retail bag:

The first thing that grabs your attention is the housing. It is a genuine, made in the US Hammond enclosure – and has all the required holes and LCD area punched out, so you don’t need to do any drilling at all:

The enclosure has nice non-slip rubberised edging (the grey area) and also allows for a 9V battery to be housed securely. The team at Altronics have done a great job in redesigning the kit for this enclosure, much more attractive than the magazine version. The PCB is solder-masked and silk-screened to fine standard:

There are two small boards to cut and file off from the main PCB. We will examine them later in the article. All required parts for completion were included, and it is good to see 1% resistors and an IC socket for the microcontroller:

At first I was a little disappointed to not have a backlit LCD module, however considering the meter is to be battery operated (however there is a DC socket for a plugpack) and you wouldn’t really be using this in the dark, a backlight wouldn’t be necessary. Construction was easy enough, the layout on the PCB is well labelled, and plenty of space between pins. Lately I have started using a lead-former, and can highly recommend the use of one:

Assembly was quite simple, just start with the lower profile components:

… then mount the LCD and the larger components:

… the switches and others – and we’re done:

The only problem at this point was the PCB holes for the selector switch, one hole was around 1mm from where it needed to be. Instead of drilling out the hole, it was easier to just bend up the legs of the switch and keep going:

At this stage one has to cut out two supports from the enclosure, which can be done easily. Then insert the PCB and solder to the sockets and power (9V battery snap). Initial testing was successful (after adjusting the LCD contrast…):

If you look at the area of PCB between the battery and the left-hand screw there are eight pins – these are four pairs of inputs used to help calibrate and check operation of the meter. For example, by placing a jumper over a pair you can display the oscillator frequency at various stages:

Furthermore, those links can also be used to fine-tune the meter. For example one can increase or decrease the scaling factor and the settings are then stored in the EEPROM within the microcontroller. However my example seemed ok from the start, so it was time to seal up the enclosure and get testing. Starting with a ceramic capacitor, the lowest value in stock:

Spot-on. That was a good start, however trying to bend the leads to match the binding posts was somewhat inconvenient, so I cut up some leads and fitted crocodile clips on the end. The meter’s zero button allows you to reset the measurement back to zero after attaching the leads, so stray capacitance can be taken into account.

Next, time to check the measurement with something more accurate, a 1% tolerance silvered-mica 100 picofarad capacitor:

Again, the meter came through right on specification. My apologies to those looking for inductor tests – I don’t have any in stock to try out. If you are really curious I could be persuaded to order some in, however as the capacitance measurement has been successful I am confident the inductance measurement would also fall within the meter’s specifications.

As shown earlier, there were two smaller PCBs included:

The top PCB is a shorting bar used to help zero the inductance reading, and the lower PCB is used to help measure smaller capacitors and also SMD units. A nice finishing touch that adds value to the meter. The only optional extra to consider would be a set of short leads with clips or probes to make measurement physically easier.

When reading this kit review it may appear to be somewhat positive and not critical at all. However it really is a  good instrument, considering the accuracy, price, and enjoyment from doing it yourself. It was interesting, easy to build, and will be very useful now and in the future. So if you are in the market for an LC meter, and don’t mind some work – you should add this kit to your checklist for consideration. It is available from Altronics stores and currently a good deal at Au$76 including GST.

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, follow me on twitter or facebook, or join our Google Group for further discussion.

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! :)

Sunday, April 24, 2011

Tutorial: Control AC outlets via SMS

This is chapter thirty-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. Any files from tutorials will be found here.

Welcome back fellow arduidans!

In this chapter we will continue with the use of the SM5100 cellular shield to turn digital outputs on and off via SMS. However please read chapters twenty-six and twenty-seven first if you are unfamiliar with using the GSM shield with Arduino. As an extension of chapter twenty-seven, we will use our Arduino to turn on or off AC outlets via a common remote-control AC outlet pack. Please note this is more of a commentary of my own experience, and not an exact tutorial. In other words, by reading this I hope you will gain some ideas into doing the necessary modifications yourself and in your own way.

Firstly, we need some remote-control AC outlets. Most electrical stores or giant retail warehouses may have something like this:

Nothing too original, just a wireless remote control that can switch on or off receiver outlets on a choice of four radio frequencies. Before moving forward I would like to acknowledge that this article was inspired by the wonderful book Practical Arduino – Cool Projects for Open Source Hardware by Jon Oxer and Hugh Blemings. In chapter two an appliance remote-control system is devised using a similar system.

At first glance the theory behind this project is quite simple – using the hardware in example 27.2, instead of controlling LEDs, activate the buttons on the wireless remote control for the AC outlets – leaving us with AC outlets controlled via SMS. However there are a few things to keep in mind and as discovered during the process, various pitfalls as well.

Before voiding the warranty on your remote control, it would be wise to test the range of the remote control to ensure it will actually work in your situation. I found this was made a lot easier by connecting a radio to the remote outlet – then you can hear when the outlet is on or off. If this is successful, make a note of the amount of time required to press the on and off buttons – as we need to control the delay in our Arduino sketch.

The next step is to crack open the remote control:

… and see what we have to work with:

Straight away there are two very annoying things – the first being the required power supply – 12 volts; and the second being the type of button contacts on the PCB. As you can see above we only have some minute PCB tracks to solder our wires to. It would be infinitely preferable to have a remote control that uses actual buttons soldered into a PCB, as you can easily desolder and replace them with wires to our Arduino system. However unless you can casually tear open the remote control packaging in the store before purchase, it can be difficult to determine the type of buttons in the remote.

As you can see in the photo above, there is an off and on pad/button each for four channels of receiver. In my example we will only use two of them to save time and space. The next question to solve is how to interface the Arduino digital outputs with the remote control. In Practical Arduino, the authors have used relays, but I don’t have any of those in stock. However I do have a quantity of common 4N25 optocouplers, so will use those instead. An optocoupler can be thought of as an electronic switch that is isolated from what is it controlling – see my article on optocouplers for more information.

Four optocouplers will be required, two for each radio channel. To mount them and the associated circuitry, we will use a blank protoshield and build the Arduino-remote control interface onto the shield. The circuitry for the optocoupler for each switch is very simple, we just need four of the following:

As the LED inside the optocoupler has a forward voltage of 1.2 volts at 10mA, the 390 ohm resistor is required as our Arduino digital out is 5 volts. Dout is connected to the particular digital out pin from the Arduino board. Pins 4 and 5 on the optocoupler are connected to each side of the button contact on our remote control.

The next consideration is the power supply. The remote control theoretically needs 12 volts, however the included battery only measured just over nine. However for the optimum range, the full 12 should be supplied. To save worrying about the battery, our example will provide 12V to the remote control. Furthermore, we also need to supply 5 volts at a higher current rating that can be supplied by our Arduino. In the previous GSM chapters, I have emphasised that the GSM shield can possibly draw up to two amps in current. So once again, please ensure your power supply can deliver the required amount of current. From experience in my location, I know that the GSM shield draws around 400~600 milliamps of current – which makes things smaller and less complex.

The project will be supplied 12 volts via a small TO-92 style 78L12 regulator, and 5 volts via a standard TO-220 style 7805regulator. You could always use a 7812, the 78L12 was used as the current demand is lower and the casing is smaller. The power for the whole project will come from a 15V DC 1.5A power supply. So our project’s power supply schematic will be as follows:

Now to mount the optocouplers and the power circuitry on the blank protoshield. Like most things in life it helps to make a plan before moving forward. I like to use graph paper, each square representing a hole on the protoshield, to plan the component layout. For example:

It isn’t much, but it can really help. After checking the plan over, it is a simple task to get the shield together. Here is my prototype example:

It isn’t neat, but it works. The header pins are used to make connecting the wires a little easier, and the pins on the right hand side are used to import the 15V and export 12V for the remote.

Question – What frequency is mains power in Australia?

While the soldering iron is hot, the wires need to be soldered to the remote control. Due to the unfortunate size of the PCB tracks, there wasn’t much space to work with:

But with time and patience, the wiring was attached:

Again, as this is a prototype the aesthetics of the modification are not that relevant. Be careful when handling the remote, as any force on the wiring can force the soldered wire up and break the PCB track. After soldering each pair of wires to the button pads, use the continuity function of a multimeter to check for shorts and adjust your work if necessary.

At this stage the AC remote control shield prototype is complete. It can be tested with a simple sketch to turn on and off the related digital outputs. For example, the following sketch will turn on and off each outlet in sequence:

Example 33.1

/* Example 33.1 - test our AC remote prototype > chapter 33 | CC by-sa-nc */  void setup() { pinMode(9, OUTPUT); // 1 off pinMode(8, OUTPUT); // 1 on pinMode(5, OUTPUT); // 2 off pinMode(4, OUTPUT); // 2 on }  void loop() { // outlets on channel 1 on digitalWrite(8, HIGH); delay(1000); digitalWrite(8, LOW); delay(5000); // outlets on channel 1 off digitalWrite(9, HIGH); delay(1000); digitalWrite(9, LOW); delay(5000); // outlets on channel 2 on digitalWrite(4, HIGH); delay(1000); digitalWrite(4, LOW); delay(5000); // outlets on channel 2 off digitalWrite(5, HIGH); delay(1000); digitalWrite(5, LOW); delay(5000); }

Now to get connected with our GSM shield. It is a simple task to insert the remote shield over the GSM shield, and to connect the appropriate power supply and (for example) GSM aerial. The control sketch is a slight modification of example 27.2, and is shown below:

Example 33.2 (Mega version)

/* Example 33.2  Control two AC remote outlets via SMS > chapter 33 |  CC by-sa-nc NOT for Arduino Mega */  #include   //Include the NewSoftSerial library to send serial commands to the cellular module. char inchar;                //Will hold the incoming character from the Serial Port. NewSoftSerial cell(2,3);    //Create a 'fake' serial port. Pin 2 is the Rx pin, pin 3 is the Tx pin.  int aon = 8; int aoff = 9; int bon = 4; int boff = 5; int pressdelay = 1000; // duration to activate a button on remote  void setup() { // prepare the digital output pins pinMode(aon, OUTPUT); pinMode(aoff, OUTPUT); pinMode(bon, OUTPUT); pinMode(boff, OUTPUT); //Initialize GSM module serial port for communication. cell.begin(9600); delay(30000); // give time for GSM module to register on network etc. cell.println("AT+CMGF=1"); // set SMS mode to text delay(200); cell.println("AT+CNMI=3,3,0,0"); // set module to send SMS data to serial out upon receipt delay(200); }  void loop() { //If a character comes in from the cellular module... if(cell.available() >0) {; if (inchar=='#') { delay(10);; if (inchar=='a') { delay(10);; if (inchar=='0') { digitalWrite(aoff, HIGH); delay(pressdelay); digitalWrite(aoff, LOW); } else if (inchar=='1') { digitalWrite(aon, HIGH); delay(pressdelay); digitalWrite(aon, LOW);  } delay(10);; if (inchar=='b') {; if (inchar=='0') { digitalWrite(boff, HIGH); delay(pressdelay); digitalWrite(boff, LOW);  } else if (inchar=='1') { digitalWrite(bon, HIGH); delay(pressdelay); digitalWrite(bon, LOW);  } delay(10);; cell.println("AT+CMGD=1,4"); // delete all SMS } } } } }

The variable pressdelay stores the amount of time in milliseconds to ‘press’ a remote control button. To control our outlets, we send a text message using the following syntax:


Where a/b are remote channels one and two, and x is replaced with 0 for off and 1 for on.

So there you have it – controlling almost any AC powered device via text message from a cellular phone. Imagine trying to do that ten, or even five years ago. As always, now it is up to you and your imagination to find something to control or get up to other shenanigans.Thank you for your patience in awaiting this series of articles. Although getting it together was a little tricky, it was a lot of fun. I hope you enjoyed reading it as much as I did writing it for you.

If you have any questions about the processes or details in this article, please ask in our Google Group – dedicated to the projects and related items on this website. Sign up – it’s free, there is the odd competition or give-away –  and we can all learn something. Or follow tronixstuff on twitter and facebook. High resolution images available from flickr.

Otherwise, have fun, stay safe, be good to each other – and make something!

Thursday, April 14, 2011

Kit review – Evil Mad Science Larson Scanner

Hello readers

Time yet again for another kit review. Today’s kit is the Larson Scanner from Evil Mad Science. What a different name for a company; their byline is “DIY and open source hardware for art, education and world domination”. Art? Yes. Education? Definitely. World domination? Possibly – you could use the blinking LEDs to hypnotise the less intelligent world leaders out there.

Anyhow, what is a Larson Scanner? Named in honour of Glen A. Larson the creator of television shows such as Battlestar Galactica and Knight Rider – as this kit recreates the left and right blinking motion used in props from those television shows. For example:

The kit itself is quite inexpensive, easy to assemble – yet can be as complex as you want it to be. More about that later, for now let’s put one together and see how it performs. There are two versions of the kit, one with 5mm clear LEDs and our review model with 10mm diffused red LEDs. The kit arrives inside a huge resealable anti-static bag, as such:

Upon opening the bag we have the following parts (there was an extra LED and resistor, thanks):

… the PCB:

… which is nicely done with a good silk-screen and solder mask. And finally:

A very handy item – a battery box with power switch. The kit is powered by 2 x AA cells (not included!). And finally, the instructions:

At this point you can see that this kit is designed for the beginner in mind. The instructions are easy to read, clear, and actually very well done. If you are looking for a kit to get someone interested in electronics and to practice their soldering, you could do a lot worse than use this kit.

Construction was very easy, starting with the resistors:

followed by the capacitor and button:

then the microcontroller:

… no IC socket. For a beginners’ kit, perhaps one should have been included. Next was the battery box. Some clever thinking has seen holes in the PCB to run the wires through before soldering into the board – doing so provides a good strain relief for them:

… and finally the LEDs. Beginners may solder them in one at a time:

however it is quicker to line them up all at once than solder in one batch:

… which leaves us with the final product:

Operation is very simple – the power switch is on the battery box. The button on the PCB controls the speed of LED scrolling, and if held down switches the brightness between low and high. Now for some action video of the Larson Scanner in operation:

Well that really was fun, a nice change from the usual things around here. But wait, there’s more… although the Larson Scanner is a good training kit, it can also function in other interesting ways. The kit is completely open-source, you can download the PCB layout file, circuit schematic and microcontroller code. Get two or more and link them together to make a really wide LED display – expansion instructions are available from here. If you solder in a 6-pin PCB header to the area marked J1 on the PCB, you can reprogram the microcontroller using an STK500-compatible programmer.

After sitting my Larson Scanner next to the computer tower for a few minutes, I had contemplated fitting it into a 5.25″ drive bay to make my own Cylon PC, however that might be a little over the top. However my PC case has some dust filters on the front, which would allow LEDs to shine through in a nicely subdued way. Mounting the Larson Scanner PCB inside the computer case will be simple, and power can be sourced from the computer power supply – 5V is available from a disk drive power lead.

Warning - modify your PC AT YOUR OWN RISK! 

The Larson Scanner can run on 3.3V without any alteration to the supplied components. What needs to be done is to use a voltage regulator to convert the 5V down to 3.3V. My example has used a 78L33 equivalent, the TI LP2950 as it is in stock. The power comes from a drive power cable splitter as such:

You may have a spare power plug in your machine, so can tap from that. 5V is the red lead, and GND is the adjacent black lead. Don’t use yellow – it is 12V. It is then a simple matter of running 5V from the red lead to pin 1 of the regulator, GND from the Larson Scanner and PC together to pin 2, and 3.3V out from the regulator to the PCB 3.3V. Insulation is important with this kind of work, so use plenty of heatshrink:

… then cover the whole lot up:

Now to locate a free power plug in the machine. It has been a while since opening the machine – time for a dust clean up as well:

Mounting the PCB is a temporary affair until I can find some insulated mounting  standoffs:

However it was worth the effort, the following video clip shows the results in action:

So there you have it. The Larson Scanner is an ideal kit for the beginner, lover of blinking LEDs, and anyone else that wants to have some easy blinking fun. You can buy Larson Scanner kits in Australia from Little Bird Electronics, or directly from Evil Mad Science for those elsewhere.

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, follow me on twitter or facebook, or join our Google Group for further discussion.

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! :)

Wednesday, April 13, 2011

Kit review – Freeduino v1.22 Arduino-compatible

Hello readers

Time again for another kit review. Today we will examine the Freeduino Arduino Duemilanove-compatible board in a kit. It is always interesting to see how the different types and makes of Arduino-compatible boards present themselves, so this is review is an extension of that curiosity. This kit was originally designed by NKC Electronics and released under a Creative Commons license.

The packaging can either be classed as underwhelming or environmentally-friendly, as the kit arrives in several plastic resealable bags. Upon emptying them out we are presented with the following, the parts:

and the PCB:

Hopefully you noticed what ends up being the key features of this kit – the pre-soldered FTDI IC and mini-USB socket. This means the Freeduino can be used with a USB cable (not included) and not an expensive FTDI cable. The PCB itself is very solid, has a very description silk-screen layer with all the component positions labelled, is solder-masked, and has nice rounded corners.

Reviewing the included parts did make me wonder why the supplier has used 5% carbon-film resistors and ceramic capacitors instead of polyesters (except for one). It turns out that Seeedstudio (the distributor for my example kit) claim 5% resistors are easier to read. More likely an excuse to save a few cents.

Question – What does the acronym FTDI mean?

Furthermore, this one missed out on the polyfuse for USB overcurrent and short-circuit protection. And whether or not the larger tolerances affect the operation of the board, the cheaper components make the finished product look very 1977. However on a brighter note, and IC socket is included.

Assembly was quick and simple. There are excellent online instructions published by the Freeduino creator NKC available here. However you can also follow the silk-screen labels on the PCB as well. A good method is to start with the lowest-profile compontents, such as resistors and capacitors:

… then followed by the capacitors, crystal, LEDs and reset button:

Notice how the ceramic capacitors lead-spacing is too narrow for the holes on the PCB – this makes me think that the distributor has skimped out on the final product and been too lazy to update the PCB layout. The ATmega168 label is an example of this. Moving forward, the voltage regulator and sockets. The easiest way to solder in the shield sockets is to place them into the pins of an Arduino shield and solder – as such:

And there you have it, one Freediono v1.22 Arduino Duemilanove-compatible board:

The image above also displays another bugbear with this kit – the LED placement. When you have a shield inserted, all of the LEDs are covered up. Furthermore, unlike other Arduino board kits (such as the Freetronics KitTen) you are stuck with the maximum current output of 50mA for the 3.3V rail as there isn’t a dedicated 3.3V voltage regulator on board. Finally, the power switching between USB and the DC socket is controlled with a jumper and header pins between the USB socket at the 7805 voltage regulator.

Although I might have sounded a little harsh about this kit, it is relatively inexpensive, easy to assemble, and has the USB interface onboard. These are all good things. However the PCB layout could have been improved by correctly spacing the holes for the ceramic capacitors, and moving the LEDs to the end of the board so they are visible with shields inserted. What’s the point of having all those LEDs if you cannot see them…

So if you really get the urge to make your own board with the USB interface, or want to give someone some reasonable soldering practice, this isn’t a bad choice at all. Otherwise get a KitTen or save time and buy an Eleven.

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, follow me on twitter or facebook, or join our Google Group for further discussion.

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! :)