Archive | learning electronics

Australian Electronics Nostalgia – Talking Electronics Kits

Introduction

From 1981, Australian electrical engineer Colin Mitchell started publishing his home-grown electronics magazine “Talking Electronics”. His goal was to get people interested and learning about electronics, and more so with a focus on digital electronics. It was (and still is) a lofty goal – in which he succeeded. From a couple of rooms in his home the magazine flourished, and many projects described within were sold as kits. At one stage there were over 150 Talking Electronics kits on the market. You could find the books and kits in retail outlets such as Dick Smith Electronics, and for a short while there was a TE store in Moorabbin (Victoria). Colin and the team’s style of writing was easy to read and very understandable – but don’t take my word for it, you can download the magazines from his website (they’re near the bottom of the left column). Dave Jones recently interviewed Colin, and you can watch those for much more background information.

Over fifteen issues you could learn about blinking LEDs all the way to making your own expandable Z80 board computer, and some of the kits may still be available. Colin also published a series of tutorial books on electronics, and also single-magazine projects. And thus the subjects of our review … we came across the first of these single-issue projects from 1981 – the Mini Frequency Counter (then afterwards we have another kit):

cover

How great is that? The PCB comes with the magazine. This is what set TE apart from the rest, and helped people learn by actually making it easy to build what was described in the magazine instead of just reading about it. For 1981 the PCB was quite good – they were silk-screened which was quite rare at the time:

pcb

pcbrear

And if you weren’t quite ready, the magazine also included details of a square-wave oscillator to make and a 52-page short course in digital electronics. However back to the kit…

Assembly

The kit uses common parts and I hoard CMOS ICs so building wasn’t a problem. This (original) version of the kit used LEDs instead of 7-segment displays (which were expensive at the time) so there was plenty of  careful soldering to do:

LEDsin

And after a while the counter started to come together. I used IC sockets just in case:

almostthere

The rest was straight-forward, and before long 9 V was supplied, and we found success:

powerup

To be honest progress floundered for about an hour at this point – the display wouldn’t budge off zero. After checking the multi-vibrator output, calibrating the RC circuits and finally tracing out the circuit with a continuity tester, it turned out one of the links just wasn’t soldered in far enough – and the IC socket for the 4047 was broken So a new link and directly fitting the 4047 fixed it. You live and learn.

Operation

So – we now have a frequency counter that’s good for 100 Hz to the megahertz range, with a minimum of parts. Younger, non-microcontroller people may wonder how that is possible – so here’s the schematic:

schematic

The counter works by using a multi-vibrator using a CD4047 to generate a square-wave at 50, 500 and 5 kHz, and the three trimpots are adjusted to calibrate the output. The incoming pulses to measure are fed to the 4026 decade counter/divider ICs. Three of these operate in tandem and each divide the incoming count by ten – and display or reset by the alternating signal from the 4047. However for larger frequencies (above 900 Hz) you need to change the frequency fed to the display circuit in order to display the higher (left-most) digits of the result. A jumper wire is used to select the required level (however if you mounted the kit in a case, a knob or switch could be used).

For example, if you’re measuring 3.456 MHz you start with the jumper on H and the display reads 345 – then you switch to M to read 456 – then you switch to the L jumper and read 560, giving you 3456000 Hz. If desired, you can extend the kit with another PCB to create a 5-digit display. The counter won’t be winning any precision contests – however it has two purposes, which are fulfilled very well. It gives the reader an inexpensive piece of test equipment that works reasonably well, and a fully-documented project so the reader can understand how it works (and more).

And for the curious –  here it is in action:

[Update 20/07/2013] Siren Kit

Found another kit last week, the Talking Electronics “DIY Kit #31 – 9V siren”. It’s an effective and loud siren with true rise and fall, unlike other kits of the era that alternated between two fixed tones. The packaging was quite strong and idea for mail-order at the time:

kitbox

The label sells the product (and shows the age):

kitlabel

The kit included every part required to work, apart from a PP3 battery, and a single instruction sheet with a good explanation of how the circuit works, and some data about the LM358:

kitparts

… and as usual the PCB was ahead of its’ time with full silk-screen and solder mask:

pcbtop

sirenpcbbottom

Assembly was quite straight-forward. The design is quite compact, so a lot of vertical resistor mounting was necessary due to the lack of space. However it was refreshing to not have any links to fit. After around twenty minutes of relaxed construction, it was ready to test:

PCBfinished

finished

It’s a 1/2 watt speaker, however much louder than originally anticipated:

Once again, another complete and well-produced kit.

Conclusion

That was a lot of fun, and I’m off to make the matching square-wave oscillator for the frequency counter. Kudos to Colin for all those years of publication and helping people learn. Lots of companies bang on about offering tutorials and information on the Internet for free, but Colin has been doing it for over ten years. Check out his Talking Electronics website for a huge variety of knowledge, an excellent electronics course you can get on CD – and go easy on him if you have any questions.

Full-sized images available on flickr. This kit was purchased without notifying the supplier.

And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

LEDborder

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.

Posted in australia, counter, digital, electronics, frequency, history, kit review, learning electronics, magazine, talking, talking electronics, test equipment, tronixstuff, vintage15 Comments

Kit review – Altronics/Silicon Chip DC to DC Converter

Introduction

Every month Australian electronics magazine Silicon Chip publishes a variety of projects, and in March 2004  they published the “DC-DC converter” project. Altronics picked it up and now offers a kit, the subject of our review. The main purpose of this converter kit is to allow replacement of expensive PP3 9V batteries with 2 AA cells, to enable a cheaper and longer lifespan over use. With a slight modification it can also act as a trickle-charger for 2 rechargeable AA cells (that can then supply power to the converter) via a plugpack. And there’s some educational value if you’re so inclined, as you can learn about voltage converters as well.

Assembly

As usual for Altronics the kit is in a typical retail package:

packaged

…which includes the detailed instructions (based on the original Silicon Chip article), a handy reference guide and of course the parts:

contents

The PCB has a good silk screen and solder mask:

pcbtop

pcbbottom

and all the required parts are included:

components

It was nice to see plenty of extra black and red wire for modifications or final installations, the battery snap, 2 x AA cell holder and a DC socket for use with the optional plug pack mentioned earlier. That hand-wound inductor was interesting, and I couldn’t help but measure it on the LC meter:

lcmeter

It was supposed to be a 47 uH inductor, so let’s hope that doesn’t cause too much trouble. Assembly was quite straight-forward – just start with the smallest components first and build up. If you’re not going to have the trickle-charge function, heed the notes in the manual and don’t install D2 or R4. The only fiddly bit was the “short as possible” (red) link across the board:

longlink

And after a few more minutes it was finished. The external connections will vary depending on your application – however for the review I’ve got the 9V snap on the input, which makes it easy to connect the 2 AA cell holder to power the converter. Nice to see the holes around the perimeter of the board, which make mounting it more permanently quite easy.

Operation

After a bench clean-up it was time to connect 2 AA rechargeable cells and see what we can get out of the converter. The cells measured 2.77V together before connection, and without a load on the converter the resulting output was 8.825 V:

firsttest

We can live with that. Furthermore the quiescent current (a situation with the power connected and not having a load on the output) was 2.5 mA. Thus it would be a good idea to have a power switch in a real-world environment. Speaking of the real world (!) how much current can you get out of the converter? Generally PP3 battery applications are low current, as the battery itself isn’t good for that much – even an expensive “Energizer Ultimate Lithium” offers only 800 mAh (for $16). So using higher-capacity rechargeable AA cells and this kit will save money.  A table is included with the instructions that shows the possible uses:

tableofuse

According to the table my 2.77V supply should be good for ~80 mA. With some resistors in parallel we made a dummy load of 69 mA and measured 0.37A current draw from the AA cells. Thus the key to this kit – you find a cheaper or more plentiful power supply at a lower voltage to save you the expense of providing the higher voltage.

For example, if you had a pair of Sanyo Eneloop rechargeable AA cells (total 2.4 V at 2 Ah) they would give you around 5.4 hours of life (ignoring the fall-off of voltage towards the end of their charge life – however the eneloops are pretty good in that regard). Whereas a disposable PP3 mentioned earlier would offer around 2.1 hours (at $16) or a rechargeable unit (which offers 8.4 V at 175 mAh) would only last around 25 minutes. Note that you can change two resistors in the circuit to alter the output voltage, and the values have been listed in the instructions for outputs up to 15 V.

Finally, let’s consider the output waveforms from the circuit. With the aforementioned load, here’s the output on the DSO:

output

… and for interest’s sake, the switching output from the TL499:

switchoutput

switchoutputdata

Conclusion

Apart from the described voltage-boosting functions this kit gives the interested builder experience with boost circuits and also the knowledge to create their own versions based on the original design, at a much lower cost than using other boost ICs . If you wanted a permanent certain voltage output, it would be better to breadboard the kit and experiment with the required resistors – then assemble the kit with the new values. And there is money and effort to be saved when subsituting with PP3 batteries. Finally, learning is a good thing!

So – a lot of fun and education for under $20. Purchase it from Altronics and their resellers, or read more about it in the September 2007 edition of Silicon Chip.

Full-sized images available on flickr. This kit was purchased without notifying the supplier.

And if you made it this far – check out my new book “Arduino Workshop” from No Starch Press.

LEDborder

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.

Posted in altronics, boost, converter, dc dc, K6330, kit review, learning electronics, silicon chip, tronixstuff0 Comments

Book – “Arduino Workshop – A Hands-On Introduction with 65 Projects”

Over the last few years I’ve been writing a few Arduino tutorials, and during this time many people have mentioned that I should write a book. And now thanks to the team from No Starch Press this recommendation has morphed into my new book – “Arduino Workshop“:

shot11

Although there are seemingly endless Arduino tutorials and articles on the Internet, Arduino Workshop offers a nicely edited and curated path for the beginner to learn from and have fun. It’s a hands-on introduction to Arduino with 65 projects – from simple LED use right through to RFID, Internet connection, working with cellular communications, and much more.

Each project is explained in detail, explaining how the hardware an Arduino code works together. The reader doesn’t need any expensive tools or workspaces, and all the parts used are available from almost any electronics retailer. Furthermore all of the projects can be finished without soldering, so it’s safe for readers of all ages.

The editing team and myself have worked hard to make the book perfect for those without any electronics or Arduino experience at all, and it makes a great gift for someone to get them started. After working through the 65 projects the reader will have gained enough knowledge and confidence to create many things – and to continue researching on their own. Or if you’ve been enjoying the results of my thousands of hours of work here at tronixstuff, you can show your appreciation by ordering a copy for yourself or as a gift :)

You can review the table of contents, index and download a sample chapter from the Arduino Workshop website.

Arduino Workshop is available from No Starch Press in printed or ebook (PDF, Mobi, and ePub) formats. Ebooks are also included with the printed orders so you can get started immediately.

LEDborder

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.

Posted in arduino, Arduino Workshop, book, books, cellular, clocks, display, distance, ds1307, DS3232, education, EEPROM, freetronics, GPS, graphic, GSM, hardware hacking, I2C, internet, LCD, learning electronics, lesson, no starch press, numeric keypad, part review, product review, projects, RDM630, RDM6300, relay, review, sensor, servo, SMS, time clock, timing, tronixstuff, tutorial, twitter, wireless, xbee13 Comments

Project: Clock Four – Scrolling text clock

Introduction

Time for another instalment in my highly-irregular series of irregular clock projects.  In this we have “Clock Four” – a scrolling text clock. After examining some Freetronics Dot Matrix Displays in the stock, it occurred to me that it would be neat to display the time as it was spoken (or close to it) – and thus this the clock was born. It is a quick project – we give you enough to get going with the hardware and sketch, and then you can take it further to suit your needs.

Hardware

You’ll need three major items – An Arduino Uno-compatible board, a real-time clock circuit or module using either a DS1307 or DS3232 IC, and a Freetronics DMD. You might want an external power supply, but we’ll get to that later on.

The first stage is to fit your real-time clock. If you are unfamiliar with the operation of real-time clock circuits, check out the last section of this tutorial. You can build a RTC circuit onto a protoshield or if you have a Freetronics Eleven, it can all fit in the prototyping space as such:

If you have an RTC module, it will also fit in the same space, then you simply run some wires to the 5V, GND, A4 (for SDA) and A5 (for SCL):

By now I hope you’re thinking “how do you set the time?”. There’s two answers to that question. If you’re using the DS3232 just set it in the sketch (see below) as the accuracy is very good, you only need to upload the sketch with the new time twice a year to cover daylight savings (unless you live in Queensland). Otherwise add a simple user-interface – a couple of buttons could do it, just as we did with Clock Two. Finally you just need to put the hardware on the back of the DMD. There’s plenty of scope to meet your own needs, a simple solution might be to align the control board so you can access the USB socket with ease – and then stick it down with some Sugru:

With regards to powering the clock – you can run ONE DMD from the Arduino, and it runs at a good brightness for indoor use. If you want the DMD to run at full, retina-burning brightness you need to use a separate 5 V 4 A power supply. If you’re using two DMDs – that goes to 8 A, and so on. Simply connect the external power to one DMD’s terminals (connect the second or more DMDs to these terminals):

The Arduino Sketch

You can download the sketch from here. Please use IDE v1.0.1 . The sketch has the usual functions to set and retrieve the time from DS1307/3232 real-time clock ICs, and as usual with all our clocks you can enter the time information into the variables in void setup(), then uncomment setDateDs1307(), upload the sketch, re-comment setDateDs1307, then upload the sketch once more. Repeat that process to re-set the time if you didn’t add any hardware-based user interface.

Once the time is retrieved in void loop(), it is passed to the function createTextTime(). This function creates the text string to display by starting with “It’s “, and then determines which words to follow depending on the current time. Finally the function drawText() converts the string holding the text to display into a character variable which can be passed to the DMD.

And here it is in action:

Conclusion

This was a quick project, however I hope you found it either entertaining or useful – and another random type of clock that’s easy to reproduce or modify yourself. We’re already working on another one which is completely different, so stay tuned.

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.

Posted in arduino, clocks, dmd, ds1307, DS3232, freetronics, learning electronics, LED matrix, microcontrollers, projects, scrolling, time clock, timing, tutorial10 Comments

Kit Review – JYE Tech FG085 DDS Function Generator

Introduction

There has been a lot of talk lately about inexpensive DDS (direct digital synthesis) function generators, and I always enjoy a kit – so it was time to check out the subject of this review. It’s the “FG085 miniDDS function generator” from JYE Tech. JYE is a small company in China that makes inexpensive test equipment kits, for example their capacitance meter (my first kit review!) and DSO. The capacitance meter was good, the DSO not so good – so let’s hope this is better than their last efforts.

Assembly

The instructions (AssemblyGuide_085G) are much better than previous efforts, and if you have bought the kit – read them. The kit arrives in a large zip-lock bag, with the following bundle of parts:

The AC adaptor is 100~240V in, 15V DC out. Everything is included with the kit including a short BNC to alligator clips lead for output. The PCBs are very good, with a nice solder mask and silk screen:

and back:

At this point we realise that most of the work is already done. There’s two microcontrollers ATmega48 and ATmega168- one for display and user-interface control, and the other for function generation. It takes only a few minutes to solder in the through-hole parts, headers and sockets:

… then you flip over the PCB and add the LCD:

… followed by the buttons and rotary encoder. From previous research this is the part that causes people a lot of trouble – so read carefully. There’s a lot of buttons – and if they aren’t inserted into the PCB correctly your life will become very difficult. The buttons must be inserted a certain way – they’re “polarised” – for example:

As you can see above, one side has a double-vertical line and the other side has a single. When you fit the buttons to the PCB – the side with the double-vertical must face the left-hand side of the PCB – the side with the DC socket. For example:

Furthermore, don’t be in a rush and put all the buttons in then try to solder them all at once.  Do them one at a time, and hold them tight to the PCB with some blu-tac or similar. If they don’t sit flush with the PCB the front panel won’t fit properly and the buttons will stick when in use. So exercise some patience, and you’ll be rewarded with an easy to use function generator. Rush them in and you’ll be very unhappy. I warned you! After fitting each button, test fit the front panel to check the alignment, for example:

Then you end up with nicely-aligned buttons:

… which all operate smoothly when the panel is fitted:

After the buttons comes the rotary encoder. Be very careful when fitting it to the PCB – the data legs are really weak, and bend without much effort. If you push in the encoder, be mindful of the legs not going through the holes and bending upwards. Furthermore, when soldering in the encoder note that you’re really close to an electrolytic – you don’t want to stab it with a hot iron:

The CP2012 chip in the image above is for the USB interface. More on that later. Now the next stage is the power-test. Connect DC power and turn it on – you should be greeted by a short copyright message followed by the operation display:

If you didn’t – remove the power and check your soldering –  including the capacitor polarities and look for bridges, especially around the USB socket. Now it’s time to fit the output BNC socket. For some reason only known to the designers, they have this poking out the front of the panel for the kit – however previous revisions have used a simple side-entry socket. Thus you need to do some modifications to the supplied socket. First, chop the tag from the sprocket washer:

… then remove the paper from the front panel:

Now solder a link to the washer in a vertical position:

… then fit the BNC socket to the panel, with the washer aligned as such:

Finally, align the top panel with the PCB so the BNC socket pin and washer link drop into the PCB and solder them in:

If you want to use the servo mode, solder three short wires that can attach to a servo form the three “output” pads between the BNC and USB socket.

Finally, screw in the panels and you’re finished!

Using the function generator

Operation is quite simple, and your first reference should be the manual (manual.pdf). The display defaults to normal function generator mode at power-up – where you can adjust the frequency, offset, amplitude and type of output – sine, square, triangle, ramp up, ramp down, staircase up and down:

The ranges for all functions is 0~10 khz, except for sine which can hit 200 kHz. You can enter higher frequencies, such as up to 250 kHz for sine – but the results aren’t so good.

Instead of filling this review with lots of screen dumps from an oscilloscope to demonstrate the output – I’ve made the following video where you can see various functions being displayed on a DSO:

You can also create signals to test servos, with adjustable pulse-width, amplitude and cycle times. However you’ll need to solder three wires onto the PCB (next to the BNC socket area) to attach to the servo.

According to the user manual and various retailers’ websites – the FG085 can generate frequency sweeping signals. These are signals that sweep from a start to as finish frequency over a period of time. However the firmware on the supplied unit is old and needs updating to enable this function. You can download the firmware in .hex file format from here. Then go and dig up an AVR programmer and avrdudeAt the time of writing we had some issues with the signature not being recognised when updating the firmware, and solidly bricked the FG085. Our fault – so when that’s sorted out we’ll update the review – stay tuned.

There is also a USB port on the side – after installing CP2102 drivers in Windows we could connect at 115200 bps with terminal, however all the FG085 returned was the firmware version number. Perhaps later on the designers will update the firmware to allow for PC control. Somehow I wouldn’t bank on it.

Oh – if you’re wondering what DDS is - click here!

Conclusion

It’s an interesting piece of equipment. Putting the firmware upgrade issues to one side, the FG085 does what it sets out to do. During testing it worked well, and we didn’t come across any obvious inaccuracies during use.  The price varies between US$43 and $50 – so for that money it’s  a good kit. Just take care during construction and you’ll be fine.

The function generator is available in kit form or assembled, with or without panels from China. The kit version with panels is also available from Sparkfun (KIT-11394) and their resellers. Full-sized images available on flickr. This kit was purchased and reviewed without notifying the supplier.

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.

Posted in dds, ds2102, FG085, function generator, jyetech, kit review, KIT-11394, learning electronics, rigol, test equipment2 Comments

Tutorial: Analog input for multiple buttons – Part Two

This is chapter forty-six 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]

A while back I described how to read multiple buttons using only one analogue input pin. However we could only read one button at a time. In this instalment we revisit this topic and examine an improved method of doing so which allows for detecting more than one button being pressed at the same time. This method is being demonstrated as it is inexpensive and very easy to configure.

(For a more exact and expensive method please consider the use of the Microchip MCP23017 which allows for sixteen inputs via the I2C bus).

As you know the analogue input pins of the Arduino can read a voltage of between zero and five volts DC and return this measurement as an integer between zero and 1023. Using a small external circuit called a “R-2R ladder”, we can alter the voltage being measured by the analogue pin by diverting the current through one or more resistors by our multiple buttons. Each combination of buttons theoretically will cause a unique voltage to be measured, which we can then interpret in our Arduino sketch and make decisions based on the button(s) pressed.

First the circuit containing four buttons:

circuit1

Can you see why this is called an R-2R circuit? When building your circuit – use 1% tolerance resistors – and check them with a multimeter to be sure. As always, test and experiment before committing to anything permanent.

Now to determine a method for detecting each button pressed, and also combinations. When each button is closed, the voltage applied to analogue pin zero will be different. And if two buttons are pressed at once, the voltage again will be different. Therefore the value returned by the function analogRead() will vary for each button-press combination. To determine these, I connected a numeric display to my Arduino-compatible board, then simply sent the analogRead() value to the display. You can see some of the results of this in the following video:

The analogRead() results of pressing every combination of button can be found in the following table:

After this experiment we now have the values returned by analogRead() and can use them in a switch… case function or other decision-making functions in our sketches to read button(s) and make decisions based on the user input. Unfortunately there was some overlap with the returned values and therefore in some cases not every possible combination of press will be available.

However, we’re still doing well and you can get at least eleven or twelve combinations still with only one analog input pin. You can add delay() functions in your sketch if necessary to take care of switch debouncing or do it with hardware if you feel it is necessary.

So now you have a more useful method for receiving input via buttons without wasting many digital input pins. I hope you found this article useful or at least interesting. This series of tutorials has been going for almost two years now, and may soon start to wind down – it’s time to move forward to the next series of tutorials.

LEDborder

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.

Posted in arduino, education, electronics, learning electronics, lesson, multiple buttons, tutorial7 Comments

Experimenting with Surface-Mount Component Prototyping

Experimenting with hand-soldering SMT components.

Updated 18/03/2013

Now and again I have looked at SMT (surface-mount technology) components and thought to myself “I should try that one day”. But not wanting to fork out for a toaster oven and a bunch of special tools I did it on the cheap – so in this article you can follow along and see the results. Recently I ordered some ElecFreaks SOIC Arduino Mega-style protoshields which apart from being a normal double-sided protoshield, also have a SOIC SMT pad as shown below:

First up I soldered in two SOIC format ICs – a 555 and a 4017:

These were not that difficult – you need a steady hand, a clean soldering iron tip and some blu-tac. To start, stick down the IC as such:

… then you can … very carefully … hand-solder in a few legs, remove the blu tac and take care of the rest …

The 4017 went in easily as well…

…however it can be easier to flood the pins with solder, then use solder-wick to soak up the excess – which in theory will remove the bridges between pins caused by the excess solder. And some PCB cleaner to get rid of the excess flux is a good idea as well.

Now to some smaller components – some LEDs and a resistor. These were 0805 package types, which measure 2.0 × 1.3 mm – for example a resistor:

The LEDs were also the same size. Unlike normal LEDs, determining the anode and cathode can be difficult – however my examples had a small arrow determining current flow (anode to cathode) on the bottom:

Another way is to use the continuity function of a multimeter – if their output voltage is less than the rating of the LED, you can probe it to determine the pins. When it glows, the positive lead is the anode. Handling such small components requires the use of anti-magnetic tweezers – highly recommended…

… and make holding down the components with one hand whilst soldering with the other much, much easier. Unlike normal veroboard, protoshield or other prototyping PCBs the protoshield’s holes are surrounded with a “clover” style of solder pad, for example:

These solder pads can make hand-soldering SMT parts a little easier. After some experimenting, I found the easiest way was to first flood the hold with solder:

… then hold down the component with the tweezers with one hand while heating the solder with the other – then moving and holding one end of the component into the molten solder:

The first time (above) was a little messy, but one improves with practice. The clover-style of the solder pads makes it easy to connect two components, for example:

With some practice the procedure can become quite manageable:

As the protoshields are double-sided you can make connections between components on the other side to keep things neat for observers. To complete the experiment the six LEDs were wired underneath (except for one) to matching Arduino Mega digital output pins, and a simple demonstration sketch used to illuminate the LEDs, as shown below:

For one-off or very low-volume SMD work these shields from elecfreaks are quite useful. You will need a steady hand and quite a lot of patience, but if the need calls it would be handy to have some of these boards around just in case. For a more involved and professional method of working with SMT, check out this guide by Jon Oxer.

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.

Posted in 555, education, elecfreaks, learning electronics, SMD, soldering, tutorial6 Comments

Review – Freetronics Module Family

Hello

In this article we examine a new range of eleven electronic modules from Freetronics. When experimenting with electronics or working on a prototype of a design, the use of electronic components in module form can make construction easier, and also reduce the time between thoughts and actually making something :) So let’s have a look at each module in more detail…

PoE Power Regulator – 28V

This is a tiny switchmode voltage regulator with two uses – the first being regulation of higher voltage up to 28V carried via an Ethernet cable to a Freetronics Ethernet shield or EtherTen to power the board itself. The PCB is designed to drop into the shield or EtherTen as such:

… and converts the incoming voltage down to 7V which can be regulated by the EtherTen’s inbuilt regulator. The second use of this board is a very handy power supply for breadboarding or other experimentation. By bridging the solder pads on the rear of the board, the output is set to 5V DC, as such:

Note the addition of the header pins, which make insertion into a breadboard very easy – so now you have a 5V 1A DC power supply. For more information visit the product page.

N-MOSFET Driver/Output Module

This module contains an On Semi NTD5867NL MOSFET which allows the switching of a high current and voltage line – 60V at up to 20A – with a simple Arduino or other MCU digital output pin. The package is small and also contains enlarged holes for direct connection of high-current capability wire:

The onboard circuitry includes a pull-down resistor to ensure the MOSFET is off by default. For more information see the product page.

Logic Level Converter Module

This is a very simple and inexpensive method to interface 3.3V sensors to 5V microcontrollers in either direction.The module contains four independent channels, as shown in the image below:

However you can interface any low or higher voltage, as long as you connect the low and high voltages to the correct sides (marked on the PCB’s silk screen). For more information please visit the product page.

RGBLED Module

Surprisingly this module contains a RGB LED module (red, green and blue LEDs) which is controlled by a WS2801 constant-current LED driver IC. This module is only uses two digital output pins, and can be daisy-chained to control many modules with the same two pins. The connections are shown clearly on the module:

The WS2801 controller IC is on the rear:

There are several ways to control the LEDs. One way is using the sketch from the product home page, which results with the following demonstration output:

Or there is a unique Arduino WS2801 library available for download from here. Using the strandtest example included with the library results with the following:

During operation the module used less than 24 mA of current and therefore can happily run from a standard Arduino-type board without any issues. For more information please visit the product page.

TEMP Temperature Sensor Module

This module allows the simple measurement of temperature using the popular DS18B20 temperature sensor. You can measure temperatures between -55° and 125°C with an accuracy of +/- 0.5°C. Furthermore as the sensor uses the 1-wire bus, you can daisy-chain more than one sensor for multiple readings in the one application. The board is simple to use, and also contains a power-on LED:

Using the demonstation Arduino sketch from the product page results in the following output via the serial monitor:

Using this module is preferable to the popular Analog Devices TMP36, as it has an analogue output which can be interfered with, and requires an analogue input pin for each sensor, whereas this module has a digital output and as mentioned previously can be daisy-chained. For more information please visit the product page.

Humidity and Temperature Sensor Module

For the weather-measuring folk here is a module with temperatures and humidity. Using the popular DHT22 sensor module the temperature range is -4°C to +125°C with an accuracy of +/- 0.5°C, and humidity with an accuracy of between two and five percent. Only one digital input pin is required, and the board is clearly labelled:

There is also a blue power-on LED towards the top-right of the sensor. Using the module is quite simple with Arduino – download and use the example sketch included in the sensor library you can download from here. For the demonstration connect the centre data pin to Arduino digital two. Here is an example of the demonstration output:

Although the update speed is not lightning-fast, this should not be an issue unless you’re measuring real-time external temperature of your jet or rocket. For more information please see the product page.

Shift Register/Expansion Module

This board uses a 74HC595 serial-in parallel-out shift register which enables you to control eight digital outputs with only three digital pins, for example:

You can daisy-chain these modules to increase the number of digital outputs in multiples of eight, all while only using the three digital output pins on your Arduino or other microcontroller. For more information about how to use shift registers with Arduino systems, read our detailed tutorial. Otherwise for more information about the module please visit the product page.

Hall Effect Magnetic and Proximity Sensor Module

This module contains a sensor which changes output from HIGH to LOW when a magnetic presence is detected, for example a magnet. The board also has an LED which indicates the presence of the magnet to aid in troubleshooting:

Using this module and a small magnet would be an easy way to create a speedometer for a bicycle, the module is mounted to the fork, and the magnet on the rim of the front wheel. For more ideas consider the speedometer project in this tutorial. Otherwise for more information about this module please visit the product page.

Microphone Sound Input Module

This module performs two functions – it can return the sound pressure level (SPL) or the amplified audio waveform from the electret microphone. The LED (labelled “DETECT”) on the board visually displays an approximation of the SPL – for example:

… however the value can be returned by using an analogue input pin on an Arduino (etc). to return a numerical value. To do this connect the SPL pin to the analogue input. The MIC pin is used to take the amplified output from the microphone, to be processed by an ADC or used in an audio project. For more information please visit the product page.

Light Sensor Module

This module uses the TEMT6000 light sensor which returns more consistent values than can be possible using a light-dependent resistor. It outputs a voltage from the OUT pin that is proportional to the light level. The module is very small:

Use is simple – just measure the value returned from the OUT pin using an analogue input pin on your Arduino (etc). For more information please visit the product page. And finally, the:

Sound and Buzzer Module

This module contains a piezoelectric element that can be used to generate sounds (in the form of musical buzzes…):

Driving the buzzer is simple, just use pulse-width modulation. Arduino users can find a good demonstration of this here. Furthermore, as piezoelectric elements can also generate a small electrical current when vibrated, they can be used as “shock” detectors by measuring the voltage across the terminals of the element. The procedure to do this is also explained clearly here.

Now for a final demonstration – we use the light sensor to demonstrate making some noise with the buzzer module:

One final note I would like to make is that the design and construction quality of each module is first rate. The PCBs are strong, and the silk-screening is useful and descriptive. If you find the need for some or all of the functions made available in this range, you could do worse by not considering a Freetronics unit. Finally, although this has only been a short introduction to the modules for now, we will make use of them in later projects.

The modules are available directly from Freetronics or through their network of resellers.

Disclaimer – Modules reviewed in this article are a promotional consideration made available by Freetronics

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.

Posted in arduino, freetronics, learning electronics, microcontrollers, modules, review0 Comments

Tutorial – Parallax Ping))) Ultrasonic Sensor

Sense distance with ultrasonic sensors in chapter forty-five of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – a series of articles on the Arduino universe. The first chapter is here, the complete series is detailed here.

Updated 05/02/2013

Whilst being a passenger in a vehicle with a ‘reversing sensors’, I became somewhat curious as to how the sensors operated and how we can make use of them. So for this chapter we will investigate an ultrasonic sensor from Parallax called the Ping)))™ Ultrasonic Distance Sensor. It can measure distances between ~2cm and ~3m in length. Here is our example sensor:

(Memories of Number Five …)

Parallax have done a lot of work, the board contains not just the bare sensor hardware but controller circuitry as well:

Which is great as it leaves us with only three pins – 5V, GND and signal. More on those in a moment, but first…

How does it work?

Good question. The unit sends out an ultrasonic (a sound that has a frequency which is higher than can be heard by the human ear) burst of sound from one transducer (the round silver things) and waits for it bounce off an object and return – which is detected by the other transducer. The board will then return to us the period of time taken for this process to take, which we can interpret to determine the distance between the sensor and the object from which the ultrasonic sound bounced from.

The Ping))) only measures a distance when requested – to do this we send a very short HIGH pulse of five microseconds to the signal pin. After a brief moment a pulse will come from the board on the same signal pin. The period of this second pulse is the amount of time the sound took to travel out and back from the sensor – so we divide it by two to calculate the distance. Finally, as the the speed of sound is 340 metres per second, the Arduino sketch can calculate the distance to whatever units required.

It may sound complex, but it is not –  so let’s run through the theory of operation with an example. Using our digital storage oscillscope we have measured the waveforms on the signal pin during a typical measurement. Consider the following example of measuring a distance of 12cm:

fulltwelvecm

You can see the 5uS pulse in the centre and the pulse returned from the sensor board on the right. Now to zoom in on the returned pulse:

twelvecm

Without being too picky the pulse is roughly 720uS (microseconds) long – the duration of ultrasonic sound’s return trip from the sensor board. So we divide this by two to find the time to travel the distance – 360uS. Recall the speed of sound is 340 metres per second – which converts to 29.412 uS per centimetre. So, 360uS divided by 29.412 uS gives 12.239902081… centimetres. Rounded that gives us 12 centimetres. Easy!

Finally, there are some limitations to using the Ping))) sensor. Download the data sheet (pdf) and read pages three to five for information on how to effectively mount the sensor and the sensitivity results from factory resting.

How do we use it with Arduino?

As described previously we first need to send a 5uS pulse, then listen for the return pulse. The following sketch does just that, then converts the data to centimetres and displays the result on the serial monitor. The code has been commented to explain each step.

And the results of some hand-waving in the serial monitor:

So there you have it – you can now measure distance with a degree of accuracy. However that image above isn’t very exciting – instead let’s use a 7-segment display shield to get things up in lights. The shield uses the NXP SAA1064 LED display driver IC (explained quite well here). You can download the demonstration sketch from here. And now for the video:

So there you have it – now the use of the sensor is up to your imagination. Stay tuned using the methods below to see what we get up to with this sensor in the future.

LEDborder

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.

Posted in arduino, distance, learning electronics, lesson, microcontrollers, parallax, ping, sensor, tutorial, ultrasonic, Uncategorized44 Comments

Tutorial: Arduino and Numeric Keypads

Use numeric keypads with Arduino in chapter forty-two of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – a series of articles on the Arduino universe. The first chapter is here, the complete series is detailed here. Any files from tutorials will be found here.

This is part one of two chapters that will examine another useful form of input – the numeric keypad; and some applications that hopefully may be of use.  Here is the example we will be working with:

It seems quite similar to the keypad from a 1980s-era Dick Smith Electronics cordless phone. Turning the keypad over we find seven pins:

Personally I like this type of connection, as it makes prototyping very easy using a breadboard – you just push it in. Looking at the back the pins are numbered seven to one (left to right). My example was from Futurlec of all places. You can also find types that have solder pads. At this point you need to download the data sheet.pdf, as it shows the pinouts for the rows and columns. At first glance trying to establish a way of reading the keypad with the Arduino does seem troublesome – however the basic process is to ‘scan’ each row and then test if a button has been pressed.

If your keypad has more than seven pins or contacts – and the data sheet was not supplied, you will need to manually determine which contacts are for the rows and columns. This can be done using the continuity function of a multimeter (the buzzer). Start by placing one probe on pin 1, the other probe on pin 2, and press the keys one by one. Make a note of when a button completes the circuit, then move onto the next pin. Soon you will know which is which. For example, on the example keypad pins 1 and 5 are for button “1″, 2 and 5 for “4″, etc…

In the interest of keeping things simple and relatively painless we will use the numeric keypad Arduino library. Download the library from here, copy the “Keypad” folder into your ../arduino-002x/libraries folder, then restart the Arduino IDE.

Now for our first example. From a hardware perspective you will need

  • An Arduino Uno or 100% compatible board
  • A numeric keypad
  • An LCD of some sort. We will be using an I2C-interface model. If you are unsure about LCD usage, please see this tutorial
  • If you don’t have an LCD – that’s ok. After installing the keypad library, select File>Examples>Keypad>Examples>HelloKeypad in the IDE.
Connect the keypad to the Arduino in the following manner:
  • Keypad row 1 to Arduino digital 5
  • Keypad row 2 to Arduino digital 4
  • Keypad row 3 to Arduino digital 3
  • Keypad row 4 to Arduino digital 2
  • Keypad column 1 to Arduino digital 8
  • Keypad column 2 to Arduino digital 7
  • Keypad column 3 to Arduino digital 6
Now for the sketch:

For the non-believers, here it is in action:


As you can see the library really does all the work for us. In the section below the comment “keypad type definition” we have defined how many rows and columns make up the keypad. Furthermore which digital pins connect to the keypad’s row and column pins. If you have a different keypad such as a 16-button version these will need to be modified. Furthermore you can also map out what the buttons will represent in the array “keys”. Then all of these variables are passed to the library in the function Keypad keypad = Keypad() etc.

Reading the buttons pressed is accomplished in void loop()… it reads the keypad by placing the current value into the char variable “key”. The if… statement tests if a button has been pressed. You can reproduce this loop within your own sketch to read values and then move forward to other functions. Let’s do that now in our next example.

Keypad Switch

Using our existing example hardware we can turn something on or off by using the keypad – replicating what can be found in some alarm systems and so on. Our goal with this example is simple – the systems waits for a PIN to be entered. If the PIN is correct, do something. If the PIN is incorrect, do something else. What the actions are can be up to you, but for the example we will turn on or off a digital output. This example is to give you a concept and framework to build you own ideas with.

The hardware is the same as the previous example but without the LCD. Instead, we have a 560 ohm resistor followed by an LED to GND from digital pin ten. Now for the sketch:

And the ubiquitous demonstration video:

This sketch is somewhat more complex. It starts with the usual keypad setting up and so on. We have two arrays, attempt and PIN. PIN holds the number which will successfully activate the switch, and attempt is used to store the key presses entered by the user. Users must press ‘*’ then the PIN then ‘#’ to activate the switch.

The comparison to check for accuracy is in the function checkPIN(). It compares the contents of PIN against attempt. If they match, the function correctPIN() is called. If the entered PIN is incorrect, the function incorrectPIN() is called. We also call the function incorrectPIN() in void setup to keep things locked down in case of a power failure or a system reset.

You can now see that such a complex device can be harnessed very easily, and could have a variety of uses. In part two, we will look at the 16-digit 

LEDborder

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.

Posted in arduino, learning electronics, lesson, microcontrollers, numeric keypad, tutorial9 Comments

Tutorial: Gravitech Arduino Nano MP3 Player

Hello readers

[Update: 21/05/2013. Tutorial now out of date, and I don’t have a Nano to test it with the new code. Try this instead. If you have hardware questions or enquiries relating to the Arduino Nano or MP3 board, please direct them to Gravitech via their contact page.

Posted in arduino, gravitech, learning electronics, lesson, microcontrollers, mp3, tutorial

Learn to solder with eevblog’s David L. Jones!

Hello Readers

How is your soldering? Have you always wanted to improve your soldering skills, or never heated an iron in your life and didn’t know where to start? No matter your level of skill you could do a lot worse than review the following video blogs in this article by David L. Jones.

Who? 

[David] shares some of his 20 years experience in the electronics design industry in his unique non-scripted naturally overly enthusiastic and passionate style.
Bullsh!t and political correctness don’t get a look-in.

Dave started out in hobby electronics over 30 years ago and since then has worked in such diverse areas as design engineering, production engineering, test engineering, electro-mechanical engineering, that wacky ISO quality stuff, field service, concept design, underwater acoustics, ceramic sensors, military sonar systems, red tape, endless paperwork trails, environmental testing, embedded firmware and software application design, PCB design (he’s CID certified), power distribution systems, ultra low noise and low power design, high speed digital design, telemetry systems, and too much other stuff he usually doesn’t talk about.

He has been published in various magazines including: Electronic Today International, Electronics Australia, Silicon Chip, Elektor, Everyday Practical Electronics (EPE), Make, and ReNew.

Few people know Dave is also a world renowned expert and author on Internet Dating, a qualified fitness instructor, geocacher, canyoner, and environmentalist.

Regular readers of this website would know that I rarely publish outside material – however the depth and quality of the tutorials make them a must-see for beginners and experienced people alike. Furthermore, if you have the bandwidth they can be viewed in 1080p. And as a fellow Australian I’m proud to support Dave and his efforts. So I hope you can view, enjoy and possibly learn from the following videos:

The first covers the variety of tools you would use:

And the second covers through-hole PCB soldering:

The third covers surface-mount soldering:

Finally, watch the procedure for soldering a tiny SMD IC using the ‘dead bug’ method:

And for something completely different:

If you enjoyed those videos then don’t forget to check out what’s new on Dave’s eevblog website and forum. Videos shown are (C) David L. Jones 2011 and embedded with permission.

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 on twitterfacebook, or join our Google Group.

Posted in education, eevblog, hardware hacking, learning electronics, soldering2 Comments

Project – Single button combination lock

Time for something different  - a single button combination lock. Allow me to explain…

Updated 18/03/2013

Normally a combination lock would require the entry of a series of unique numbers in order to unlock something or start an action. For example:

800px-masterpadlock

(image information)

A more contemporary type of lock could be controlled electronically, for example by a keypad where the user enters a series of digits to cause something to happen. Such as the keypad on this dodgy $30 safe from Officeworks:

As you can see there is a button for each digit. You would think that this would be a good idea –  however people can watch you enter the digits, or users can be silly enough to write down the combination somewhere. In some cases the more cunning monkeys have even placed cameras that can observe keypads to record people entering the combination. There must be a better way. Possibly! However in the meanwhile you can consider my idea instead – just have one button. Only one button – and the combination is made up of the time that elapses between presses of the button. There are many uses for such an odd lock:

  • A type of combination lock that controls an electric door strike, or activates a device of some sort;
  • A way of testing mind-hand coordination for skill, or the base of a painfully frustrating game;
  • Perhaps an interlock on motor vehicle to prevent drink driving. After a few drinks there’s no way you could get the timing right. Then again, after a double espresso or two you might have problems as well.
How does it work? Consider the following:

We measure the duration of time between each press of the button (in this case – delay 1~4). These delay times are then compared against values stored in the program that controls the lock. It is also prudent to allow for some tolerance in the user’s press delay – say plus or minus ten to fifteen percent. We are not concerned with the duration of each button press, however it is certainly feasible.

To create this piece of hardware is quite easy, and once again we will use the Arduino way of doing things. For prototyping and experimenting it is simple enough to create with a typical board such as a Uno or Eleven and a solderless breadboard – however to create a final product you could minimise it by using a bare-bones solution (as described here). Now let’s get started…

For demonstration purposes we have a normally-open button connected to digital pin 2 on our Arduino-compatible board using the 10k ohm pull down resistor as such:

democircuit

The next thing to do is determine our delay time values. Our example will use five presses, so we measure four delays. With the following sketch, you can generate the delay data by pushing the button yourself – the sketch will return the delay times on the serial monitor:

So what’s going on the this sketch? Each time the button is pressed a reading of millis() is taken and stored in an array. [More on millis() in the tutorial]. Once the button has been pressed five times, the difference in time between each press is calculated and stored in the array del[]. Note the use of a 500 ms delay in the function dataCapture(), this is to prevent the button bouncing and will need to be altered to suit your particular button. Finally the delay data is then displayed on the serial monitor. For example:

The example was an attempt to count one second between each press. This example also illustrates the need to incorporate some tolerance in the actual lock sketch. With a tolerance of +/- 10% and delay values of one second, the lock would activate. With 5% – no. Etcetera.

Now for the lock sketch. Again it measures the millis() value on each button press and after five presses calculates the duration between each press. Finally in the function checkCombination() the durations are compared against the stored delay values (generated using the first sketch) which are stored in the array del[]. In our example lock sketch we have values of one second between each button press. The tolerance is stored as a decimal fraction in the variable tolerance; for example to have a tolerance of ten percent, use 0.1:

When choosing your time delays, ensure they are larger than the value used for button debounce (the delay() function call) in the dataCapture() function. Notice the two functions success() and failure() – these will contain the results of what happens when the user successfully enters the combination or does not. For a demonstration of the final product, I have connected an LCD to display the outcomes of the entry attempts. You can download the sketch from here. The key used in this example is 1,2,3,4 seconds:

Although there are four buttons on the board used in the video, only one is used. Well I hope someone out there found this interesting or slightly useful…

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.

Posted in arduino, combination lock, education, learning electronics, lesson, microcontrollers, millis, projects, tutorial, twitter6 Comments

Tutorial: Arduino timing methods with millis()

This is chapter thirty-seven of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – in what feels like an endless series of articles on the Arduino universe. The first chapter is here, the complete series is detailed here. Any files from tutorials will be found here.

[Updated 20/01/2013]

In this article we introduce the millis(); function and put it to use to create various timing examples.

Millis? Nothing to do with lip-syncers… hopefully you recognised milli as being the numerical prefix for one-thousandths; that is multiplying a unit of measure by 0.001 (or ten to the power of negative 3). Interestingly our Arduino systems will count the number of milliseconds (thousands of a second) from the start of a sketch running until the count reaches the maximum number capable of being stored in the variable type unsigned long (a 32-bit [four byte] integer – that ranges from zero to (2^32)-1.

(2^32)-1, or 4294967295 milliseconds converts to 49.71027-odd days. The counter resets when the Arduino is reset, it reaches the maximum value or a new sketch is uploaded. To get the value of the counter at a particular juncture, just call the function – for example:

Where start is an unsigned long variable. Here is a very simple example to show you millis() in action:

The sketch stores the current millis count in start, then waits one second, then stores the value of millis again in finished. Finally it calculates the elapsed time of the delay.  In the following screen dump of the serial monitor, you can see that the duration was not always exactly 1000 milliseconds:

To put it simply, the millis function makes use of an internal counter within the ATmega microcontroller at the heart of your Arduino. This counter increments every clock cycle – which happens (in standard Arduino and compatibles) at a clock speed of 16 Mhz. This speed is controlled by the crystal on the Arduino board (the silver thing with T16.000 stamped on it):

Crystal accuracy can vary depending on external temperature, and the tolerance of the crystal itself. This in turn will affect the accuracy of your millis result. Anecdotal experience has reported the drift in timing accuracy can be around three or four seconds per twenty-four hour period. If you are using a board or your own version that is using a ceramic resonator instead of a crystal, note that they are not as accurate and will introduce the possibility of higher drift levels. If you need a much higher level of timing accuracy, consider specific timer ICs such as the Maxim DS3232.

Now we can make use of the millis  for various timing functions. As demonstrated in the previous example sketch, we can calculate elapsed time. To take this idea forward, let’s make a simple stopwatch. Doing so can be as simple or as complex as necessary, but for this case we will veer towards simple. On the hardware perspective, we will have two buttons – Start and Stop - with the 10k ohm pull-down resistors connected to digital pins 2 and 3 respectively.

When the user presses start the sketch will note the value for millis – then after stop is pressed, the sketch will again note the value for millis, calculate and display the elapsed time. The user can then press start to repeat the process, or stop for updated data. Here is the sketch:

The calls to delay() are used to debounce the switches – these are optional and their use will depend on your hardware. Below is an example of the sketch’s serial monitor output – the stopwatch has started, and then button two pressed six times across periods of time:

If you had a sensor at the start and end of a fixed distance, speed could be calculated: speed = distance ÷ time.

You can also make a speedometer for a wheeled form of motion, for example a bicycle. At the present time I do not have a bicycle to mess about with, however we can describe the process to do so – it is quite simple. (Disclaimer – do so at your own risk etc.)  First of all, let’s review the necessary maths. You will need to know the circumference of the wheel. Hardware – you will need a sensor. For example – a reed switch and magnet. Consider the reed switch to be a normally-open button, and connect as usual with a 10k ohm pull-down resistor. Others may use a hall-effect sensor – each to their own). Remember from maths class:

(image licence)

To calculate the circumference – use the formula:

circumference = 2πr 

where r is the radius of the circle. Now that you have the wheel circumference, this value can be considered as our ‘fixed distance’, and therefore the speed can be calculated by measuring the elapsed time between of a full rotation.

Your sensor – once fitted – should act in the same method as a normally-open button that is pushed every rotation. Our sketch will measure the time elapsed between every pulse from the sensor. To do this, our example will have the sensor output connected to digital pin 2 – as it will trigger an interrupt to calculate the speed. (Interrupts? See chapter three). The sketch will otherwise be displaying the speed on a normal I2C-interface LCD module. The I2C interface is suggested as this requires only 4 wires from the Arduino board to the LCD – the less wires the better.

Here is the sketch for your perusal:

There isn’t that much going on – every time the wheel completes one revolution the signal from the sensor will go from low to high – triggering an interrupt which calls the function speedCalc(). This takes a reading of millis() and then calculates the difference between the current reading and the previous reading – this value becomes the time to cover the distance (which is the circumference of the wheel relative to the sensor – stored in

and is measured in metres). It finally calculates the speed in km/h and MPH. Between interrupts the sketch displays the updated speed data on the LCD as well as the raw time value for each revolution for curiosity’s sake. In real life I don’t think anyone would mount an LCD on a bicycle, perhaps an LED display would be more relevant.

In the meanwhile, you can see how this example works in the following short video clip. Instead of a bike wheel and reed switch/magnet combination, I have connected the square-wave output from a function generator to the interrupt pin to simulate the pulses from the sensor, so you can get an idea of how it works:

That just about sums up the use of millis() for the time being. There is also the micros(); function which counts microseconds. So there you have it – another practical function that can allow more problems to be solved via the world of Arduino. As always, now it is up to you and your imagination to find something to control or get up to other shenanigans.

LEDborder

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.

Posted in arduino, education, learning electronics, lesson, microcontrollers, millis, speedometer, stopwatch, timing, tutorial18 Comments

Tutorial: Arduino and the SPI bus part II

This is chapter thirty-six of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – A seemingly endless series of articles on the Arduino universe. The first chapter is here, the complete series is detailed here

[Updated 10/01/2013]

This is the second of several chapters in which we are investigating the SPI data bus, and how we can control devices using it with our Arduino systems. If you have not done so already, please read part one of the SPI articles. Again we will learn the necessary theory, and then apply it by controlling a variety of devices. As always things will be kept as simple as possible.

First on our list today is the use of multiple SPI devices on the single bus. We briefly touched on this in part one, by showing how multiple devices are wired, for example:

Notice how the slave devices share the clock, MOSI and MISO lines – however they both have their own chip select line back to the master device. At this point a limitation of the SPI bus becomes prevalent – for each slave device we need another digital pin to control chip select for that device. If you were looking to control many devices, it would be better to consider finding I2C solutions to the problem. To implement multiple devices is very easy. Consider the example 34.1 from part one – we controlled a digital rheostat. Now we will repeat the example, but instead control four instead of one. For reference, here is the pinout diagram:

Doing so may sound complex, but it is not. We connect the SCK, MOSI and  MISO pins together, then to Arduino pins D13, D11, D12 respectively. Each CS pin is wired to a separate Arduino digital pin. In our example rheostats 1 to 4 connect to D10 through to D7 respectively. To show the resistance is changing on each rheostat, there is an LED between pin 5 and GND and a 470 ohm resistor between 5V and pin 6. Next, here is the sketch:

Although the example sketch may be longer than necessary, it is quite simple. We have four SPI devices each controlling one LED, so to keep things easy to track we have defined led1~led4 to match the chip select digital out pins used for each SPI device. Then see the first four lines in void setup(); these pins are set to output in order to function as required. Next – this is very important – we set the pins’ state to HIGH. You must do this to every chip select line! Otherwise more than one CS pins may be initially low in some instances and cause the first data sent from MOSI to travel along to two or more SPI devices. With LEDs this may not be an issue, but for motor controllers … well it could be.

The other point of interest is the function

We pass the value for the SPI device we want to control, and the value to send to the device. The value for l is the chip select value for the SPI device to control, and ranges from 10~7 – or as defined earlier, led1~4. The rest of the sketch is involved in controlling the LED’s brightness by varying the resistance of the rheostats. Now to see example 36.1 in action via the following video clip:


(If you are wondering what I have done to the Freetronics board in that video, it was to add a DS1307 real-time clock IC in the prototyping section).

Next on the agenda is a digital-to-analogue converter, to be referred to using the acronym DAC. What is a DAC? In simple terms, it accepts a numerical value between zero and a maximum value (digital) and outputs a voltage between the range of zero and a maximum relative to the input value (analogue). One could consider this to be the opposite of the what we use the function analogRead(); for. For our example we will use a Microchip MCP4921 (data sheet.pdf):

(Please note that this is a beginners’ tutorial and is somewhat simplified). This DAC has a 12-bit resolution. This means that it can accept a decimal number between 0 and 4095 – in binary this is 0 to 1111 1111 1111 (see why it is called 12-bit) – and the outpout voltage is divided into 4096 steps. The output voltage for this particular DAC can fall between 0 and just under the supply voltage (5V). So for each increase of 1 in the decimal input value, the DAC will output around 1.221 millivolts.

It is also possible to reduce the size of the voltage output steps by using a lower reference voltage. Then the DAC will consider the reference voltage to be the maximum output with a value of 4095. So (for example) if the reference voltage was 2.5V, each increase of 1 in the decimal input value, the DAC will output around 0.6105 millivolts. The minimum reference voltage possible is 0.8V, which offers a step of 200 microvolts (uV).

The output of a DAC can be used for many things, such as a function generator or the playback of audio recorded in a digital form. For now we will examine how to use the hardware, and monitoring output on an oscilloscope. First we need the pinouts:

By now these sorts of diagrams shouldn’t present any problems. In this example, we keep pin 5 permanently set to GND; pin 6 is where you feed in the reference voltage – we will set this to +5V; AVss is GND; and Vouta is the output signal pin – where the magic comes from :) The next thing to investigate is the MCP4921′s write command register:

Bits 0 to 11 are the 12 bits of the output value; bit 15 is an output selector (unused on the MPC4921); bit 14 controls the input buffer; bit 13 controls an inbuilt output amplifier; and bit 12 can shutdown the DAC. Unlike previous devices, the input data is spread across two bytes (or a word of data). Therefore a small amount of work needs to be done to format the data ready for the DAC. Let’s explain this through looking at the sketch for example 36.2 that follows. The purpose of the sketch is to go through all possible DAC values, from 0 to 4095, then back to 0 and so on.

First. note the variable outputvalue - it is a word, a 16-bit unsigned variable. This is perfect as we will be sending a word of data to the DAC. We put the increasing/decreasing value for a into outputValue. However as we can only send bytes of data at a time down the SPI bus, we will use the function highbyte() to separate the high side of the word (bits 15~8) into a byte variable called data.

We then use the bitwise AND and OR operators to set the parameter bits 15~12. Then this byte is sent to the SPI bus. Finally, the function lowbyte() is used to send the low side of the word (bits 7~0) into data and thence down the SPI bus as well.

Now for our demonstration sketch:

And a quick look at the DAC in action via an oscilloscope:

By now we have covered in detail how to send data to a device on the SPI bus. But how do we receive data from a device?

Doing so is quite simple, but some information is required about the particular device. For the rest of this chapter, we will use the Maxim DS3234 “extremely accurate” real-time clock. Please download the data sheet (.pdf) now, as it will be referred to many times.

The DS3234 is not available in through-hole packaging, so we will be using one that comes pre-soldered onto a very convenient breakout board:

It only takes a few moments to solder in some header pins for breadboard use. The battery type is CR1220 (12 x 2.0mm, 3V); if you don’t have a battery you will need to short out the battery holder with some wire otherwise the IC will not work. Readers have reported that the IC doesn’t keep time if the USB and external power are both applied to the Arduino at the same time.

A device will have one or more registers where information is read from and written to. Look at page twelve of the DS3234 data sheet, there are twenty-three registers, each containing eight bits (one byte) of data. Please take note that each register has a read and write address. An example – to retrieve the contents of the register at location 08h (alarm minutes) and place it into the byte data we need to do the following:

Don’t forget to take note of  the function SPI.setBitOrder(MSBFIRST); in your sketch, as this also determines the bit order of the data coming from the device. To write data to a specific address is also quite simple, for example:

Up to this point, we have not concerned ourselves with what is called the SPI data mode. The mode determines how the SPI device interprets the ‘pulses’ of data going in and out of the device. For a well-defined explanation, please read this article. With some devices (and in our forthcoming example) the data mode needs to be defined. So we use:

to set the data mode, within void(setup);. To determine a device’s data mode, as always – consult the data sheet. With our DS3234 example, the mode is mentioned on page 1 under Features List.

Finally, let’s delve a little deeper into SPI via the DS3234. The interesting people at Sparkfun have already written a good demonstration sketch for the DS3234, so let’s have a look at that and deconstruct it a little to see what is going on. You can download the sketch below from here, then change the file extension from .c to .pde.

Don’t let the use of custom functions and loops put you off, they are there to save time. Looking in the function SetTimeDate();, you can see that the data is written to the registers 80h through to 86h (skipping 83h – day of week) in the way as described earlier (set CS low, send out address to write to, send out data, set CS high). You will also notice some bitwise arithmetic going on as well. This is done to convert data between binary-coded decimal and decimal numbers.

Why? Go back to page twelve of the DS3234 data sheet and look at (e.g.) register 00h/80h – seconds. The bits 7~4 are used to represent the ‘tens’ column of the value, and bits 3~0 represent the ‘ones’ column of the value. So some bit shifting is necessary to isolate the digit for each column in order to convert the data to decimal. For other ways to convert between BCD and decimal, see the examples using the Maxim DS1307 in chapter seven.

Finally here is another example of reading the time data from the DS3234:

So there you have it – more about the world of the SPI bus and how to control the devices within.

LEDborder

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.

Posted in arduino, BOB-10160, dac, DS3234, education, learning electronics, lesson, MCP4162, MCP4921, microcontrollers, SPI, tutorial, Uncategorized13 Comments

Tutorial: Arduino and the SPI bus

Learn how to use the SPI data bus with Arduino in chapter thirty-four of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – A seemingly endless tutorial on the Arduino universe. The first chapter is here, the complete series is detailed here

[Updated 10/01/2013]

This is the first of two chapters in which we are going to start investigating the SPI data bus, and how we can control devices using it with our Arduino systems. The SPI bus may seem to be a complex interface to master, however with some brief study of this explanation and practical examples you will soon become a bus master! To do this we will learn the necessary theory, and then apply it by controlling a variety of devices. In this tutorial things will be kept as simple as possible.

But first of all, what is it? And some theory…

SPI is an acronym for “Serial Peripheral Interface”. It is a synchronous serial data bus – data can travel in both directions at the same time, as opposed to (for example) the I2C bus that cannot do so. To allow synchronous data transmission, the SPI bus uses four wires. They are called:

  • MOSI – Master-out, Slave-in. This line carries data from our Arduino to the SPI-controlled device(s);
  • MISO – Master-in, Slave out. This line carries data from the SPI-controlled device(s) back to the Arduino;
  • SS – Slave-select. This line tells the device on the bus we wish to communicate with it. Each SPI device needs a unique SS line back to the Arduino;
  • SCK – Serial clock.

Within these tutorials we consider the Arduino board to be the master and the SPI devices to be slaves. On our Arduino Duemilanove/Uno and compatible boards the pins used are:

  • SS – digital 10. You can use other digital pins, but 10 is generally the default as it is next to the other SPI pins;
  • MOSI – digital 11;
  • MISO – digital 12;
  • SCK – digital 13;

Arduino Mega users – MISO is 50, MOSI is 51, SCK is 52 and SS is usually 53. If you are using an Arduino Leonardo, the SPI pins are on the ICSP header pins. See here for more information. You can control one or more devices with the SPI bus. For example, for one device the wiring would be:

Data travels back and forth along the MOSI and MISO lines between our Arduino and the SPI device. This can only happen when the SS line is set to LOW. In other words, to communicate with a particular SPI device on the bus, we set the SS line to that device to LOW, then communicate with it, then set the line back to HIGH. If we have two or more SPI devices on the bus, the wiring would resemble the following:


Notice how there are two SS lines – we need one for each SPI device on the bus. You can use any free digital output pin on your Arduino as an SS line. Just remember to have all SS lines high except for the line connected to the SPI device you wish to use at the time.

Data is sent to the SPI device in byte form. You should know by now that eight bits make one byte, therefore representing a binary number with a value of between zero and 255. When communicating with our SPI devices, we need to know which way the device deals with the data – MSB or LSB first. MSB (most significant bit) is the left-hand side of the binary number, and LSB (least significant bit) is the right-hand side of the number. That is:

Apart from sending numerical values along the SPI bus, binary numbers can also represent commands. You can represent eight on/off settings using one byte of data, so a device’s parameters can be set by sending a byte of data. These parameters will vary with each device and should be illustrated in the particular device’s data sheet. For example, a digital potentiometer IC with six pots:

sdata

This device requires two bytes of data. The ADDR byte tells the device which of six potentiometers to control (numbered 0 to 5), and the DATA byte is the value for the potentiometer (0~255). We can use integers to represent these two values. For example, to set potentiometer number two to 125, we would send 2 then 125 to the device.

How do we send data to SPI devices in our sketches?

First of all, we need to use the SPI library. It is included with the default Arduino IDE installation, so put the following at the start of your sketch:

Next, in void.setup() declare which pin(s) will be used for SS and set them as OUTPUT. For example,

where ss has previously been declared as an integer of value ten. Now, to activate the SPI bus:

and finally we need to tell the sketch which way to send data, MSB or LSB first by using

or

When it is time to send data down the SPI bus to our device, three things need to happen. First, set the digital pin with SS to low:

Then send the data in bytes, one byte at a time using:

Value can be an integer/byte between zero and 255. Finally, when finished sending data to your device, end the transmission by setting SS high:

Sending data is quite simple. Generally the most difficult part for people is interpreting the device data sheet to understand how commands and data need to be structured for transmission. But with some practice, these small hurdles can be overcome.

Now for some practical examples!

Time to get on the SPI bus and control some devices. By following the examples below, you should gain a practical understanding of how the SPI bus and devices can be used with our Arduino boards.

Example 34.1

Our first example will use a simple yet interesting part – a digital potentiometer (we also used one in the I2C tutorial). This time we have a Microchip MCP4162-series 10k rheostat:


Here is the data sheet.pdf for your perusal. To control it we need to send two bytes of data – the first byte is the control byte, and thankfully for this example it is always zero (as the address for the wiper value is 00h [see table 4-1 of the data sheet]).  The second byte is the the value to set the wiper, which controls the resistance. So to set the wiper we need to do three things in our sketch…

First, set the SS (slave select) line to low:

Then send the two byes of data:

Finally set the SS line back to high:

Easily done. Connection to our Arduino board is very simple – consider the MCP4162 pinout:

Vdd connects to 5V, Vss to GND, CS to digital 10, SCK to digital 13, SDI to digital 11 and SDO to digital 12. Now let’s run through the available values of the MCP4162 in the following sketch:

Now to see the results of the sketch. In the following video clip, a we run up through the resistance range and measure the rheostat value with a multimeter:

Before moving forward, if digital potentiometers are new for you, consider reading this short guide written by Microchip about the differences between mechanical and digital potentiometers.

Example 34.2

In this example, we will use the Analog Devices AD5204 four-channel digital potentiometer (data sheet.pdf). It contains four 10k ohm linear potentiometers, and each potentiometer is adjustable to one of 256 positions. The settings are volatile, which means they are not remembered when the power is turned off. Therefore when power is applied the potentiometers are all pre set to the middle of the scale. Our example is the SOIC-24 surface mount example, however it is also manufactured in DIP format as well.

 

To make life easier it can be soldered onto a SOIC breakout board which converts it to a through-hole package:

ad5204boardss

In this example, we will control the brightness of four LEDs. Wiring is very simple. Pinouts are in the data sheet.pdf.

ex34p2schematic

And the sketch:

The function allOff() and allOn() are used to set the potentiometers to minimum and maximum respectively. We use allOff() at the start of the sketch to turn the LEDs off. This is necessary as on power-up the wipers are generally set half-way. Furthermore we use them in the blinkAll() function to … blink the LEDs. The function setPot() accepts a wiper number (0~3) and value to set that wiper (0~255). Finally the function indFade() does a nice job of fading each LED on and off in order – causing an effect very similar to pulse-width modulation.

Finally, here it is in action:

Example 34.3

In this example, we will use use a four-digit, seven-segment LED display that has an SPI interface. Using such a display considerably reduces the amount of pins required on the micro controller and also negates the use of shift register ICs which helps reduce power consumption and component count. The front of our example:

7segfrss

and the rear:

7segrearss

Thankfully the pins are labelled quite clearly. Please note that the board does not include header pins – they were soldered in after receiving the board. Although this board is documented by Sparkfun there seems to be issues in the operation, so instead we will use a sketch designed by members of the Arduino forum. Not wanting to ignore this nice piece of hardware we will see how it works and use it with the new sketch from the forum.

Again, wiring is quite simple:

  • Board GND to Arduino GND
  • Board VCC to Arduino 5V
  • Board SCK to Arduino D12
  • Board SI to Arduino D11
  • Board CSN to Arduino D10

The sketch is easy to use, you need to replicate all the functions as well as the library calls and variable definitions. To display numbers (or the letters A~F) on the display, call the function

where a is the number to display, b is the base system used (2 for binary, 8 for octal, 10 for usual, and 16 for hexadecimal), and c is for padded zeros (0 =off, 1=on). If you look at the void loop() part of the example sketch, we use all four number systems in the demonstration. If your number is too large for the display, it will show OF for overflow. To control the decimal points, colon and the LED at the top-right the third digit, we can use the following:

After all that, here is the demonstration sketch for your perusal:

And a short video of the demonstration:

So there you have it – hopefully an easy to understand introduction to the world of the SPI bus and how to control the devices within. As always, now it is up to you and your imagination to find something to control or get up to other shenanigans. In the next SPI article we will look at reading and writing data via the SPI bus.

LEDborder

In the meanwhile have fun and keep checking into tronixstuff.com. Why not follow things on twitterGoogle+, subscribe  for email updates or RSS usng 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.

Posted in AD5204, arduino, COM-09767, education, learning electronics, lesson, MCP4162, microcontrollers, SPI, tutorial34 Comments

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 with (amongst other things) 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:

retailkitss

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:

hammondcasess

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:

pcbss2

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:

partsss1

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:

leadformerss

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

assemble1ss

 

… then mount the LCD and the larger components:

assemble2ss

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

finishedsolderingss

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:

switchlegsss

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…

inittestss

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:

calibrationss

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:

3p9pfss

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:

99pfss

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:

pcbadaptorsss

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 resellers.

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.

Posted in altronics, K2533, kit review, LC meter, learning electronics, test equipment18 Comments

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:

1ss

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

4ss

… the PCB:

3ss

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

5ss

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:

2ss

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:

6ss

followed by the capacitor and button:

7ss

then the microcontroller:

8ss

… 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:

9ss

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

10ss

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

11ss

… which leaves us with the final product:

13ss

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.

If you are going to modify your PC in a similar fashion, please read my disclaimer under “boring stuff” first.

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:

splitss

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:

ldo1ss

… then cover the whole lot up:

ldo2ss

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:

ldo3ss

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

ldo4ss

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]

Posted in evil mad science, kit review, larson scanner, learning electronics, tutorial0 Comments

Kit review – Current Clamp Meter Adaptor

Hello readers

Time for another kit review. Over the last few days I have been enjoying assembling a useful piece of test-equipment – a Current Clamp Meter adaptor. This kit was originally described in the September 2003 issue of Silicon Chip magazine. The purpose of this adaptor is to allow the measurement of AC current up to around 600 amps and DC current up to 900 amps. A clamp meter is a safe method of measuring such high currents (which can end you life very quickly) as they do not require a direct connection to the wire in question. As you would realise even a more expensive type of multimeter can only safely measure around ten amps of current, so a clamp meter becomes necessary.

To purchase a clamp meter can be expensive, starting from around $150. Therein lies the reason for this kit – under $30 and a few hours of time, as well as a multimeter that can measure millivolts DC/AC.

How the adaptor works is quite simple. It uses a hall-effect sensor to measure magenetic flux which is generated by the current flowing through the wire being measured. The sensor returns a voltage which is proportional to the amount of magnetic flux. This voltage is processed via an op-amp into something that can be measured using the millivolts AC/DC range of a multimeter. As the copyright for the kit is held by Silicon Chip magazine, I cannot give too much away about the design.

John’s soapbox: People may ask “hey, can you send me the schematic? I don’t want to pay for the reprinted article or buy the kit”. My answer will be no. The hobby electronics industry in this country is shrinking every day, so please support Leo and the gang at Silicon Chip by paying for a reprint or Altronics by buying the kit (it’s out of production at Jaycar). The less kits they sell, the less-inclined they will be to produce new kits.

You can purchase a complete kit from Altronics, or build one yourself by following the article in the magazine.  The hall effect sensor UGN3503 is now out of production, but according to the data sheet (.pdf), the Allegro A1302 is a drop-in replacement.

Now, time to get started. To make life easier I forked out for the whole kit, which arrived as below:

bagofpartsss

Upon opening the bag up, one is presented with the following parts:

parts1ss

parts2ss

It is great to see everything required included with a kit. And the extra battery-clamp is a nice bonus. As usual an IC socket was not included, however these can be had for less than five cents each… so I have recently solved that problem by importing a few hundred myself. The hall effect sensor is very small; considering the graph paper below is 5mm square:

hallsensorss

The PCB was very well done – to a degree. The solder-mask and silk-screening was up to standard:

pcbss

… however a few holes needed some adjustment. Doing a component test-fit before soldering really paid off, as none of the holes for the PCB pins were large enough to accept the pins, and one of the sensor socket holes needed some modification:

holedrillss

A small hand-held drill is always a handy thing to have around. Once those errors were taken care of, actually soldering the components to the PCB was simple and took less than ten minutes. The potentiometer VR3 needed to be elevated by 3.5mm so it would fit through the enclosure panel in line with the power switch. As I couldn’t use PCB pins, a few link offcuts from the resistors worked just as well. When soldering the components, start with the low-profile items such as resistors, and finish with the switch and potentiometer:

pcbsolderedss

Now it was time to make the clamp. First up was to cut the iron-powdered toroidal core in half. All I had to do this with was a small hacksaw, so I hacked away at it for about half an hour. This process will make a mess, filings will go everywhere. So you will need some pointless rubbish to catch the filings with:

rubbishss

Each half of the core is placed inside the clamp. Until I am completely happy with the clamp they will be held in with blutac. A lead also needs to be constructed, with the sensor at one end and the 3.5mm stereo plug at the other. Some heatshrink is provided to cover the ribbon cable, but I recommend placing some over the solder joints where the sensor meets the ribbon cable, as such:

clampleadss

Next, the sensor needs to be placed between the two halves of the core – however a piece of plastic slightly thicker needs to sit next to the sensor, to stop the clamp damaging the sensor by closing down on it. Then, using the continuity function of a multimeter, check that there aren’t any shorts in the lead. Feed the newly-constructed lead through the battery clamp in order to keep things relatively neat and tidy, and you should result with something like this:

clampdoness

As you can see I have had a few attempts at cutting the core. The next step was to drill the holes for the enclosure, and then solder the wires that run from the PCB, run them through the hole in the side of the enclosure, and fasten the banana plugs to plug into the multimeter.

Now it was time to start calibration. There are two stages to this, and both are explained well in the instructions. This involves adjusting the trimpots which control the output voltage in millivolts, which can be affected by charge in the human body. Therefore it is recommended to use a plastic screwdriver/trimming tool to make the adjustments:

plasticsdriver

They are generally available in a set or pack for a reasonable price. The second stage of calibration involves creating a dummy DC current load using a 12v power supply, 5 metres of enamelled copper wire and a 18 ohm 5 watt resistor:

clampdoness

By putting 100 turns of the copper wire around one side of the clamp, putting the resistor in series and looping it into 12 volts, the current drawn will be 0.667 amps. (Ohm’s law – voltage/resistance = current). Then it is a simple task to set the multimeter to millivolts DC and adjust potentiometer VR1 until it displays 66.7 mA:

calibratedss

So there you have it – 66.7 millivolts on the multimeter represents 660 milliamps of current. So 1 amp of current will be 100 millivolts on your multimeter. Excellent – it works! The whole mess was inserted into the enclosure, and I was left with something that looked not terribly unprofessional (time to invest in a label-maker):

finishedss

It turns out that the thick OFC cable and the battery wouldn’t be able to coexist in the enclosure, so the battery is external.

The current clamp meter kit was an interesting and satisfying kit to assemble. Originally I assumed it would be simple, but it required plenty of drilling, cutting the darn toroid in half, tricky soldering for the clamp lead, and some patience with lining up the holes for the enclosure. Not a kit for the raw beginner, but ideal for teaching with a beginner to improve their assembly skills, or anyone with some experience. Plus it really does work, so money has been saved by not having to buy a clamp meter or adaptor.

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

Posted in altronics, current clamp meter, K2582, kit review, learning electronics, test equipment4 Comments

Tutorial: Arduino and Infra-red control

Learn how to use Arduino and infra-red remote controls in chapter thirty-two 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 10/07/2013

In this article we will look at something different to the usual, and hopefully very interesting and useful – interfacing our Arduino systems with infra-red receivers. Why would we want to do this? To have another method to control our Ardiuno-based systems, using simple infra-red remote controls.

A goal of this article is to make things as easy as possible, so we will not look into the base detail of how things work - instead we will examine how to get things done. If you would like a full explanation of infra-red, perhaps see the page on Wikipedia. The remote controls you use for televisions and so on transmit infra-red beam which is turned on and off at a very high speed – usually 38 kHz, to create bits of serial data which are then interpreted by the receiving unit. As the wavelength of infra-red light is too high for human eyes, we cannot see it. However using a digital camera – we can. Here is a demonstration video of IR codes being sent via a particularly fun kit – the adafruit TV-B-Gone:

Now to get started. You will need a remote control, and a matching IR receiver device. The hardware and library used in this tutorial only  supports NEC, Sony SIRC, Philips RC5, Philips RC6, and raw IR protocols. Or you can purchase a matching set for a good price, such as this example:

irpackage

Or you may already have a spare remote laying around somewhere. I kept this example from my old Sony Trinitron CRT TV after it passed away:

sonyremote1

It will more than suffice for a test remote. Now for a receiver – if you have purchased the remote/receiver set, you have a nice unit that is ready to be wired into your Arduino, and also a great remote that is compact and easy to carry about. To connect your receiver module – as per the PCB labels, connect Vcc to Arduino 5V, GND to Arduino GND, and D (the data line) to Arduino digital pin 11.

Our examples use pin 11, however you can alter that later on. If you are using your own remote control, you will just need a receiver module. These are very cheap, and an ideal unit is the Vishay TSOP4138 (data sheet .pdf). These are available from element-14 and the other usual retail suspects. They are also dead-simple to use. Looking at the following example:

From left to right the pins are data, GND and Vcc (to Arduino +5V). So it can be easily wired into a small breadboard for testing purposes. Once you have your remote and receiver module connected, you need to take care of the software side of things. There is a new library to download and install, download it from here. Please note that library doesn’t work for Arduino Leonardo, Freetronics Leostick, etc with ATmega32U4. Instead, use this library (and skip the modification steps below). Extract the IRremote folder and place into the ..\arduinoxxx\libraries folder. Then restart your Arduino IDE if it was already open.

Using Arduino IDE v1.0 or greater? Open the file “IRRemoteInt.h” in the library folder, and change the line

Then save and close the file, restart the Arduino IDE and you’re set.

With our first example, we will receive the commands from our remote control and display them on the serial monitor:

Open the serial monitor box, point your remote control to the receiver and start pressing away. You should see something like this:

What have we here? Lots of hexadecimal numbers. Did you notice that each button on your remote control resulted in an individual hexadecimal number? I hope so. The number FFFFFFFF means that the button was held down. The remote used was from a yum-cha discount TV. Now I will try again with the Sony remote:

This time, each button press resulted in the same code three times. This is peculiar to Sony IR systems. However nothing to worry about. Looking back at the sketch for example 32.1, the

section is critical – if a code has been received, the code within the if statement is executed. The hexadecimal code is stored in the variable

with which we can treat as any normal hexadecimal number. At this point, press a few buttons on your remote control, and take a note of the matching hexadecimal codes that relate to each button. We will need these codes for the next example…

Now we know how to convert the infra-red magic into numbers, we can create sketches to have our Arduino act on particular commands. As the IR library returns hexadecimal numbers, we can use simple decision functions to take action. In the following example, we use switch…case to examine each inbound code, then execute a function. In this case we have an LCD module connected via I2C, and the sketch is programmed to understand fifteen Sony IR codes. If you don’t have an LCD you could always send the output to the serial monitor. If you are using the DFRobot I2C LCD display, you need to use Arduino v23.

Furthermore you can substitute your own values if not using Sony remote controls. Finally, this sketch has a short loop after the translateIR(); function call which ignores the following two codes – we do this as Sony remotes send the same code three times. Again. you can remove this if necessary. Note that when using hexadecimal numbers in our sketch we preced them with 0x:

And here it is in action:


You might be thinking “why would I want to make things appear on the LCD like that?”. The purpose of the example is to show how to react to various IR commands. You can replace the LCD display functions with other functions of your choosing.

At the start working with infra-red may have seemed to be complex, but with the previous two examples it should be quite simple by now. So there you have it, another useful way to control our Arduino systems. Hopefully you have some ideas on how to make use of this technology. In future articles we will examine creating and sending IR codes from our Arduino. Furthermore, a big thanks to Ken Shirriff for his Arduino library.

LEDborder

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.

Posted in arduino, control, DFR0107, dfrobot, education, infrared, IR, learning electronics, lesson, microcontrollers, remote, tronixstuff, tutorial16 Comments

March 2011 Competition

Competition over!

Posted in arduino, competition, learning electronics

Moving Forward with Arduino – Chapter 30 – twitter

Learn how to tweet from your Arduino in chapter thirty of a series originally titled “Getting Started/Moving Forward with Arduino!” by John Boxall – A tutorial on the Arduino universe.

[Updated 26/7/2013]

In this article we will learn how to send messages from our Arduino to twitter. For the uninitiated who may be thinking “what is all this twitter nonsense about?”, twitter is a form of microblogging. You can create a message with a maximum length of 140 characters, and broadcast this on the twitter service. For people to receive your messages (or tweets) they also need to be a member of twitter and choose to subscribe to your tweets.

Generally people will use the twitter service using one of three methods: using a web browser on a personal computer or internet device, on a mobile phone, or using a specific application such as TweetDeck on one of the aforementioned devices. For example, here is a typical web browser view:

And here is an example of a twitter application running on an Android OS smartphone:

tweetdeck

So as you can see, it is easy enough to read peoples’ tweets. Therein lies the reason for this article – we can harness twitter as an output device for our Arduino systems. We can broadcast various messages, so systems can be created to monitor specific parameters and report on their status at regular intervals, upon an event occurring, and so on.

In some areas, you can set twitter to send tweets from a certain user to your mobile phone via SMS – however if doing so be careful to confirm possible charges to your mobile phone account. Finally, if you are worried about privacy with regards to your tweets, you can set your account to private and only allow certain people to follow your tweets.

So let’s get started. First of all – you will need a twitter account. If you do not have one, you can sign up for one here. If you already have a twitter account, you can always open more for other uses – such as an Arduino. For example, my twitter account is @tronixstuff, but my demonstration machine twitter account is @tronixstuff2. Then I have set my primary account to follow my machine’s twitter account. Once you have logged into twitter with your machine account, visit this page and get yourself a token by following the Step One link. Save your token somewhere safe, you’ll need to insert it into your Arduino sketch.

Next, you will need some hardware. Apart from your usual Arduino board, you will need an Ethernet shield. However to save space and money I’ll be using the Freetronics EtherTen:

If you are unfamiliar with using Arduino and Ethernet, please review chapter sixteen before continuing forward with this article. From a software perspective, we will need another library for our Arduino IDE. Download and install the twitter library from here. Now, at this point – please run the Webserver example described in chapter sixteen and ensure it is working before moving forward from this point. While you do that, we’ll have a break…

lopburi-0606

Now it is time to send our first tweet. The following sketch is a modification of the demonstration version, in which we have isolated the tweet-sending into a separate function called (strangely enough) tweet();. It is not complex at all:

So after uploading the above sketch, running a network cable from your access point to the Ethernet shield, and powering up the Arduino board – your tweet should appear as such:

Excellent – it works. And I hope yours did as well. If it did not, open the serial monitor box to get some feedback from the sketch. From experimentation the most amount of errors are caused by incorrect IP and trying to send multiple tweets too quickly. If you get excited and try to run the sketch again by hitting reset, twitter will reply back with an error – it does not allow duplicate tweets to be sent (over a short period of time). Twitter will reply to your tweet with a code which describes the result of your tweet. This code is stored in an integer variable using the function:

For example, 200 means the tweet was sent successfully, and 403 means you have attempted a duplicate tweet. However you can omit the code-checking if you are not fussed about your tweet’s status.

Although it was fun tweeting Hello world, let’s create an example that reacts to various events and tweets about them. To simulate some events I have connected four buttons to digital inputs (using the button board from chapter twelve). Pressing a button sends of the matching message. However you can use any form of digital output or decision-making in your sketch. For now, here is the example sketch:

And here is a screen shot of the results after pressing buttons one, four, two then three:

So there you have it, another useful way to send information from your Arduino to the outside world. Stay tuned for upcoming Arduino tutorials by subscribing to the blog, RSS feed (top-right), twitter or joining our Google Group. Big thanks to @neocat for their work with the twitter  Arduino libraries.

LEDborder

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.

Posted in arduino, cellular, ethernet, learning electronics, microcontrollers, tutorial, twitter2 Comments

Kit review – ogi lumen Nixie Tube system

Hello readers

Time to finish off the month with a fascinating kit review  - the ogi lumen nixie tube system. The younger readers amongst us may be thinking “what is a nixie tube?” Here is an example of four in a row:

p1080918

If you cast your mind back to before the time of LCDs, and before LEDs… to the mid-1950s. Nixie tubes were used to display data in various forms on electrical devices, from test equipment, scales, elevator indicators, possible doomsday machines, clocks – anything that required visual output would be a candidate. Although nixie tubes are now totally out of date, as with many things there is a growing trend to use them again, for cool retro-style, nostalgia and those people who enjoy living in the past.

How nixie tubes work is quite simple, an element is within a vacuum tube full of gas, such as neon. When a high-voltage (~190 volts DC) current flows through the element, it glows. For more information, here is a great explanation. You will note that they are similar to in look but different in design to the vacuum-fluorescent displays, as used in the ice tube clock reviewed a few months previously. The tubes used in this kit are the Soviet model IN-12A:

p1080865

The IN-12A tube can display the digits zero to nine, with a nice orange glow.  For the uninitiated, sourcing and making nixie tubes can be quite difficult. Apart from procuring the tubes themselves, you need a suitable power supply and logic ICs that can handle the higher voltage to control the tubes. Thankfully Ogi Lumen have put together a system of kits to make using these nixie tubes simple and interesting. There are three components to the system, the first being the power supply:

p1080879

Note that the power supply is preassembled. This supply can generate the necessary 150 to 220 volts DC to energise our nixie tubes. Yes – up to 220 volts! For example:

p1080922

However the current required is quite small – one power supply can handle up to twenty-four IN12A nixie tubes. My example in the photograph above is drawing 110~120 milliamps from a 12V DC supply. For those of you assembling these kits, please be careful. It can be easy to physically move the kit about whilst in operation, and touching the live HV pads will hurt a lot. After bumping the HV line on the PCB, my whole left arm went into a spasm and hurt for the time it took to see my doctor. So be careful.

The second item required is the driver kit. This is a board that takes care of the shift-registers and power for two of the nixie tubes. Driver kits can be slotted together to form a row of nixie tubes. The third and final item is the nixie duo kit. This contains two IN-12A tubes, matching sockets and a PCB to muont them. This PCB then slots into the driver kit PCB. You can buy the driver and duo kit as a set for a discount.

From a hardware perspective, assembling the kits is relatively simple. There isn’t any tricky soldering or SMD to worry about, however you will need a lot of solder. The contents of the duo and driver kits are as follows:

p1080869

Before you start soldering, please download and take note of the instructional .pdf files available for the duo and driver board kits. Assembling the driver kit (on the right) is very straight forward. However – please read the instructions! An interesting part of note is the K155ИД1IC:

p1080872

This is the Russian equivalent of the 74141. This is a BCD-decimal decoder IC that can handle the high voltages required for nixie tubes. When soldering the resistors, take care with R2 – it will need to be positioned horizontally so as to not rub against the duo board:

p1080934

When it is time to assemble the duo board, you will need time and patience. At a first glance, one would imagine that the sockets drop into the PCB, and the nixie tubes will happily be seated into the sockets. This is not so, don’t solder in the sockets first! The pins on the bottom of the socket also form part of the socket for the tube legs – which can alter the positioning of the socket legs. Make sure you have the socket with pin 1 at the top of the PCB. After some trial and error, the best way to insert the tubes is to first partially place the sockets into the PCB:

p1080880

… then fully insert the tubes into their sockets. Make sure