■Hiiveftity Courses for Electronics & Electrical Engineering www.elektor.com FEBRUARY 2008 £ 3.90 electronics worldwide DIY: CAN Bus Explorer DIY: LED Ringflasher for macro photography Disassembled: Philips LivingColors R08 02 9 770268 45113 sts \. / ON-LINE 1 •ALL PRICING IN POUND STERLING •MINIMUM ORDER ONLY £10 1 0A 1 2VDC Motor Speed Controller KC-5225 £7.95 + post & packing Ideal for controlling 12V DC motors in cars such as fuel injection pumps, water/air intercoolers and water injection systems. You can also use it for headlight dimming and for running 12V DC motors in 24V vehicles. The circuit incorporates a soft start feature to reduce inrush currents, especially on 12V incandescent lamps. Includes PCB and all electronic components. Clock Watcher’s Clock KC-5404 £41 .75 + post & packing KC-5416 £55.25 + post & packing This amazing clock uses an AVR driven circuit, and produces a dazzling display with 60 LEDs around the perimeter. It looks amazing, but can't be properly explained here. We have filmed it in action so you can see for yourself on our website www.jaycarelectronics.com. Kit supplied with double sided silkscreened plated through hole PCB and all board components as well as the special clock housing! Available in Red or Blue Red KC-5404 Blue KC-5416 St Bm n) W Smart Fuel Mixture Display for Fuel Injected Cars KC-5374 £8.95 + post and packing This kit features auto dimming for night driving, emergency lean-out alarm, and better circuit protection. Another great feature is the 'dancing' display which operates when the ECU is operating in closed loop. Kit supplied with PCB and all electronic components with clear English instructions. * Car must be fitted with air flow and EGO sensors (standard on all EFI systems) for full functionality. 45 Second Voice Recorder Module KC-5454 £1 1 .75+ post & packing This kit can be set up to record two, four or eight different messages for random-access playback, or a single message for ‘tape mode' playback. It provides clean, glitch-free line-level audio output suitable for feeding to an amplifier or PA system. It can be powered from any source of 9-1 4V DC. Supplied with silk screened and solder masked PCB and all electronic components. Audio Playback Adaptor for CD-ROM Drives KC-5459 £19.00 + post & packing Put those old CD-ROM drives to good use as CD players using this nifty adaptor kit. The adaptor accepts signals from common TV remote controls and operates the audio functions of the drive as easily as you would control a normal CD player. Kit features a double sided PCB, pre-programmed micro controller, and IDC connectors for the display panel. Supplied with solder masked and screen printed PCB and all required electronic components. Build-Yourself Electronic Project Kits Looking for a particular KIT? Checkout Jaycar’s extensive range. We have kits and electronic projects for use in: • Audio & Video • Car & Automotive • Computer • Learning & Educational • Lighting • Power • Test & Meters • General Electronics Projects r 430+ pages - just for fun! U LL prices in Post and Packing Charges Order Value Cost Order Value Cost £200 - £499.99 £500+ £10 - £49.99 £5 £50 - £99.99 £10 £100 - £199.99 £20 Max weight 121b (5kg). Heavier parcels POA Minimum order £10. £30 £40 Note: Products are despatched from Australia, so local customs duty and taxes may apply. How to order: Phone: Call Australian Eastern Standard Time Mon-Fri on 0800 032 7241 Email: techstore@jaycarelectronics.co.uk Post: PO BOX 6424, Silverwater NSW 1811. Australia Expect 10-14 days for air parcel delivery Check out the Jaycar range in your FREE Catalogue - logon to www.jaycarelectronics.co.uk/elektor or check out the range at www.jaycarelectronics.co.uk 0800 032 7241 (Monday - Friday 09.00 to 17.30 GMT + 10 hours only) For those who want to write: 100 Silverwater Rd Silverwater NSW 2128 Sydney AUSTRALIA Handy Helpers Fujiya 175mm Screw Removing Pliers TH-2330 £7.00+ post and packing Remove screws even with completely stripped heads. Simply grab the screw head with these Japanese made pliers and turn. Beautiful. • 175mm long • Soft grip handle i Waterproof (IP67) LED Lighting Modules Each £5.75 + post and packing Endless possibilities - backlighting signs, strip lighting in stairwells & passageways, boats, garages etc. Supplied as 10x3 LEDs module, 10 modules, with 500mm flying leads for termination. Each module is spaced at approximately 110mm between centres. Simply connect up a 12VDC 600mA supply and away you go. Two types available ZD-0490 White ZD-0492 Blue Low Voltage Battery Warning KG -9000 £3.00 + post and packing This circuit monitors any battery voltage between 3-15 volts. Whenever the voltage falls below a predetermined value a Red LED lamp lights up to alert you. Uses a tiny amount of power from the battery being monitored. Use it for monitoring all sorts of battery systems and avoiding battery damage. Light-Sensitive Switch 240VAC 1 0A AA-0326 £3.00 + post and packing Turn a mains powered device on or off according to the ambient light level. Ideal for garden lighting or security applications. The controller is weather resistant and includes a mounting bracket. Approx 80mm high. B PC Oscilloscopes <& Analyzers DSO Test Instrument Software for BitScope Mixed Signal Oscilloscopes '- 101*4 -.I — - WhQf | JL . - i Li j . "■ fl TEtH / V- *Sb. ■ 1 ' Vrf ^ i 4 ii iY j 1 ■ Zj JltI „U nxj JUl Pin njifin 4 Channel BitScope Digital Storage Oscilloscope Up to 4 analog channels using industry standard probes or POD connected analog inputs. Mixed Signal Oscilloscope Capture and display up to 4 analog and 8 logic channels with sophisticated cross-triggers. Spectrum Analyzer Integrated real-time spectrum analyzer for each analog channel with concurrent waveform display. Logic Analyzer 8 logic, External Trigger and special purpose inputs to capture digital signals down to 25nS. Data Recorder Record anything DSO can capture. Supports live data replay and display export. Networking Flexible network connectivity supporting multi-scope operation, remote monitoring and data acquisition. Data Export Export data with DSO using portable CSV files or use libraries to build custom BitScope solutions. 2 Channel BitScope Pocket Analyzer BitScope DSO Software for Windows and Linux BitScope DSO is fast and intuitive multi-channel test and measurement software for your PC or notebook. Whether it's a digital scope, spectrum analyzer, mixed signal scope, logic analyzer, waveform generator or data recorder, BitScope DSO supports them all. Capture deep buffer one-shots or display waveforms live just like an analog scope. Comprehensive test instrument integration means you can view the same data in different ways simultaneously at the click of a button. DSO may even be used stand-alone to share data with colleagues, students or customers. Waveforms may be exported as portable image files or live captures replayed on other PCs as if a BitScope was locally connected. BitScope DSO supports all current BitScope models, auto-configures when it connects and can manage multiple BitScopes concurrently. No manual setup is normally required. Data export is available for use with third party software tools and BitScope's networked data acquisition capabilities are fully supported. www . bitscope .com 2/2008 - elektor 3 Theme of the month With trade magazines it is custo- mary for the editorial planning for the year to be based on themes or points of focus set for each issue. However the theme planning is not just a crucial bit of informa- tion to the magazine editors — it also offers guidance to press and PR agencies, advertisers and, importantly, potential authors who will typically use the list to report a relevant article to... the editor! Elektor's theme plan for 2008 is available for all & sundry to see at www.elektor.com if you click on the Service tab. For sure, a number of our themes can be accessed from so many angles that they can be relied on to fill the magazine pages on their own strength. The January 2008 issue had a strong focus on energy, energy savings and the environment. For this month, LEDs and LED technology form the plot, unmistakably. Immediately after releasing our theme plan, articles and projects using LEDs poured in to the extent that they could easily have filled the pages of an Elektor issue exclusively on LEDs. LEDs are hot (and / cool / ) as we've noticed from the response to relevant news items on our News & New Products pages and in the Elektor E-weekly. Not a week goes by without 'breaking news' of a yet brighter or more efficient LED, or a stunning application. The light emitting diode has come a long way since its introduction in the mid 1 970s. Today the full spectrum from infrared right up to ultra-violet is readily available, and white LEDs (a class of their own) get brighter and whiter all the time. Efficiency-wise LEDs have long since surpassed halogen lamps and they now look poised to match low-energy CFLs. In the automotive industry, to talk of a LED array as a replacement for xenon lights is no longer utopian. Not forgetting TFT backlighting (till now the exclusive domain of incandescent lamps) where LEDs will be seen soon — literally! Jan Buiting Editor leKlo r electronics worldwide Due to the fact that we received two circuit designs for television mood lighting and they both fit with the theme of this issue, we initiated a unique Elektor project: in this issue we present two completely dif- ferent designs that produce nearly the same effect. Our French contribu- tor Alex Vercey took the analogue approach, while Steffen Schutte from Germany went the 'microcontroller way'. See, compare, experience for yourself! BEng., MEng., perhaps a PhD.? Here's a 3-step primer on the subject: first get oriented; then hear opinions and finally, de- cide where to hang out. So you were thinking of study- ing for an Electronics and Electrical Engineering degree or similar qualification at a UK university or other higher level educational establishment? 30 What University CONTENTS CAN Explorer P ‘“ CANBUS R3 M |! S n * 1 “ * p s- - k IC 3 m ^ *5V ^ R5 «— «B nir- Tjj IC1 M r - C Q t! SJ f 5 ^ Implementing the CAN bus network is C 2 Q - e : L I : df ZO&6 ' , '■> ' x o g g r; g o © ■•!> 3 9 O V O G Ij G £■ I jrni3^.il Tad Online Price £13995 I9QQ 70Vv Sol dtr mg Station Online Price Test-pins.co.uk 0 * TfM- o 1 >:.y-r -f Pwfrw For Tea (-pins & Probe s Vi$ it Www, te&t-piftSr CP. uh cods a so applies www.pcb-soldering.co.uk Allflofljle HocJflfKlOJt !rtT World-Class Development Tool A state-of-the-art very fast USB 2.0 programmer including mikrolCD (In-circuit Debugger) on- board with simplified driver installation. The Best Just got Better Following the tradition of its predecessor EasyPIC4 as one of the best PIC development systems on the market, the EasyPIC5 has more new features for the same price. Train for the future EasyPIC5 was designed to allow students or engineers to easily exercise and explore the capabilities of the PIC microcontrollers. Designed to suit your needs Your development time can be considerably reduced, resulting in an early proto- type design and fast time-to-market for your end product. mikroElektronika Compilers Pascal, Basic and C Compilers for PIC microcontrollers Supporting an impressive range of PIC microcon- trollers, an easy-to-use IDE, several hundreds of ready-to-use functions and many integrated tools makes Mikro Elektronika compilers one of the best choices on the market today. Besides mikrolCD, mikroElektronika compilers offer a statistical mod- ule, simulator, bitmap generator for graphic dis- plays, 7-segment display conversion tool, ASCII table, HTML code export, communication tools for SD/MMC, UDP (Ethernet) and USB, EEPROM editor, programming mode management, etc. Touch screen controller with connector is available on-board. Please visit our web page for more info http://www.mikroe.com SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD 2/2008 - elektor 13 INFO & MARKET NEWS & NEW PRODUCTS Technology Highway at Nepcon UK Powered By g \ v 71 S / li /M V 7 J NEC2008 (o • 29TH APRIL - 1ST MAY 2008* NEC www,nepeon.co.uk {r THE UK EVENT FOR THE ELECTRONICS INDUSTRY Nepcon UK invites exhibitors to step on board the 'Technology Highway' - where AOI and X- Ray Inspection will be firmly in the headlights for the 2008 event. From the entrance to the Nepcon event and running right through the hall, this hands-on feature will be visible to visitors from the moment they step onto the show floor. The Technology Highway will pro- vide an exclusive opportunity to view a whole range of AOI and X- Ray equipment used across the pro- duction line. As visitors make their way along the Highway they will be able to see equipment in action and quiz technical operators from participating companies — with stands adjacent to the Highway — on issues which affect their in- dividual manufacturing process. Towards the end of the highway populated boards will be tested by both low and high volume sys- tems, with real time data being col- lected from the inspection process. This invaluable information will be made available to visitors to assist them in their purchasing decisions according to their budget. The Technology Highway will be the central feature at the UK's na- tional electronics manufacturing event, providing participating ex- hibitors with a unique occasion to display equipment and to dem- onstrate capabilities to key indus- try buyers, alongside competitor products. A 'Technology Highway Inspec- tion Guide' featuring information on participants' products will be made available prior to the show, and handed out to visitors during the 2008 exhibition. For more in- formation on how to take part in the Technology Highway, call the Nepcon team on +44 (0)20 8910 7706. Nepcon will take place 29th April - 1st May 2008 at the Birming- ham NEC in Hall 20. www.nepcon.co.uk (070996-VI) CAN for long-wire and low speed industrial apps AMI Semiconductor (AMIS) has an- nounced an ASSP family for long- wire and low baud rate Controller Area Network (CAN) applications. Designers now can use a qualified and proven CAN transceiver for very long wires and/or low baud rates, enabling the use of CAN-en- abled equipment in industrial ap- plications requiring line lengths in excess of 500 meters. Available in 3.3 V and 5 V inter- face variants, the new ASSP family includes a device with a functional- ity that automatically adapts com- munication rates to the observed line speed. In addition, all of AMI Semiconductor's CAN transceivers have exceptional over- voltage protection on the CAN bus of +/-45 V (common mode). The CAN protocol requires an in- frame response which, for long wires, is achieved by reducing transmission speed. However, at low speeds (below 60 kbaud), a timeout system limits CAN use and hence line length. To support long-wire CAN communications in industrial applications, AMIS has extended its CAN product line by providing versions with adapted time-out function for all of its long- wire CAN transceiver products. The AMIS long-wire CAN trans- ceiver ASSPs target end applica- tions with wired communication in physically long or distributed sys- tems. Examples of these systems include elevators, security moni- toring systems, in-building com- munication, building control, proc- ess control, machine control, and HVAC systems. There are five members of the long- wire high-speed CAN transceiver family: AMIS-42670 (5V), AMIS- 42671 (3.3V, auto-baud rate), AMIS-42673 (3.3V), AMIS-42675 (low power) and AMIS-42770 (CAN repeater). www.amis.com (070996-VIII) LEDs for railway applications Historically LEDs have been per- ceived as difficult to use, requiring a range of power supplies, drivers, resistors, soldered connections, making them tricky to market in railway applications. CML-IT's new Connect&Glo© program is de- signed to make solid state lighting easy, and is changing this percep- tion. The company is offering a sys- tem of linking LED lighting units that anyone can connect together, just as easily as ordinary light bulbs. LED lighting modules from CML-IT allow the environmentally friendly replacement of inefficient incandes- cent lighting and offer increased performance, increased life of approximately 50,000 h against 3,000 h for traditional incandes- cent lights, reduced maintenance and up to 80% reduction in energy consumption. When total life costs of lighting systems are considered, modern LED-based lights nowadays already come at a comparable cost to traditional incandescent lights. Part of the Connect&Glo© pro- gram and specifically targeted at train interiors is the Acsentio series of LED accent lights. Easy to fit and install, the lights feature an internal heat management system enabling them to run at relatively low tem- peratures. Acsentio offers subtle shades of light and are available in blue, red, green, yellow and white as part of a complete LED-based in- terior lighting system for commuter and underground trains. Also part of the Connect&Glo© program from CML-IT are LEDules, a behind-the-scenes system of LEDs mounted on PCBs in a whole variety of shapes and sizes and designed to allow designers to mount lighting into whatever shape is available. LEDules feature 1 , 3, 4, 8, 9 or 1 4 watt power and a consistent unit-to- unit colour temperature. Available colours are cool white, warm white, blue, cyan, green, amber and red. A new RGB version (featuring red, green and blue LEDs) enabling subtle colour changing for 'mood' lighting applications has also been added to the range. www.cml-it.com (070996-IX) 14 elektor - 2/2008 The No Compromise o PC Oscilloscopes 250 MHz bandwidth 1 GS j>. real-time sample rate 123 mega sample record length O With da is-Eeading bandwidth* sampling rate, memory depth aod an Array of Advanced high-end features, the PicoScope 5000 PC Oscilloscopes give you the features and performance you need without any compromise. The P'-co Scope 3000 Ser et of oscilloscopes from Pico TechnoFogy Advanced Triggers In addition to the si andard triggers the PicoScope 5000 series comes as standard with pulse width, window, dropout, delay, and logic level triggering. 250 MHi Spectrum Analyser High-speed USB 2*0 Connection Automatic Measurement! Arbitrary Waveform Generator Dcfme your own waveforms or select from 0 predefined signals with the 12 bit, 12 5 MS/s ■irbilr.iry w^vr'forrn gi , *n , r .liar, Waveform Playback Tool Pic.dk ope sofvwiu'o now allows you to go back, review,. W and analyse up to 1000 capture? vrirhln In waveform play bade wot. Technology in: ludi-V j^i j niT.il ptFpOS^ and h^h resoluilofl hkhMs: Wi|h 12 bll resolution and 11b accuracy, the lOMHi RicoScupc 3*121 is able to detect changet as small m 0.024^ (244ppm) - making it ihr ideal 4-chflnftti oscilloscope for analog dc-s- jjn and analysis. The MjjJwt speed B bit imsdds m the FkcoScopc 3000 senes u ra i sampi r r. -. :- u j 1 :■ 20GM5/S and up to 1 M5/s record le^Lhs for p^eneral purpose nod portable applications. . The PicoScopc 2000 series oscilloscopes offer single and dual channel units Thai offer highly ^ portable/ tow cost solutions Jo general purpose testing The award winn ng 2 SM I \? handheld PscoScope 210^ fits ft R comfortably Imo die palm of your hand yet tnil indudct m J the powerful Fcalurcs Found in larger osc bioscopes. www.picotech.com/scope452 to check out our full iin^ of PC-based instruments or call 01480 396 395 for information and a product catalogue SURROUND LIGHT SYSTEMS Due to the fact that we received two circuit designs for television mood lighting and they both fit with the theme of this issue, we initiated a unique Elektor project: in this issue we present two completely different designs that produce nearly the same effect. Our French contributor Alex Vercey took the analogue approach, while Steffen Schulte from Germany went the 'microcontroller way 7 . 16 elektor - 2/2008 The analogue approach Surround Alex Vercey, alex.vercey@wanadoo.fr When Philips launched the Ambilight system for its television sets in 2004, the author immediately had the idea of building a similar system for PCs. The result is described here. The operating principle of both de- signs consists of measuring the aver- age colour of an image and using col- our LEDs to emit the same colour in order to ‘paint’ an impression of the image on the background behind the screen. This generates a more intense experience, creates a visual point of reference, and produces refined mood lighting. The target audience for this product consists of dedicated film fans and vo- racious gamers. Technical considerations In its product, Philips uses a spectrum analyser integrated in the video matrix processor. This method is only used with LCD and plasma displays. The control logic of non-scanned displays of this sort allows digital analysis of the signal based on the individual regions of the internal display driver matrix. Philips originally used a system with small neon tubes and an acrylic reflec- tor to diffuse the light. However, LEDs are used in the latest models. The sys- tem uses three basic col- ours controlled by pulse-width modulated (PWM) signals with a res- olution of only four bits. The design described here operates on a different principle, with the objective of achieving better reproducibility. In addition, the system described here can also be used with a PC or a raster- scan monitor (an ‘old-fashioned’ CRT monitor). The system described in this arti- cle is the PC version of the Surround Light design. The television version is more complex, primarily due to safety considerations rather than technical issues. The Surround Light system consists of a three-colour LED lamp driven by ana- logue signals, which allows all possible colour combinations (14 billion) to be generated from the three basic colours. For comparison, the software-control- led version uses an ADC and PWM sig- nal with 16-bit resolution, which yields 65,536 possible colours. Three identical circuits are used for the LED drivers (one for each colour). However, different calibration curves are used for the individual colours to adapt the visually perceived colours to the spectrum of the LEDs used in the system. As specified by the CCIR VGA stand- ard, the maximum amplitude of a PC video signal (700 mV) corresponds to a full white image. This was confirmed by measurements made using a Geo- force FX7300 card. There is also an op- tion for isolation of the input signal. As a minor detail, this system (un- like the Philips system) does not sup- port generation of different colours on the left and right sides of the monitor, since this would require a much more complicated colour analyser. LEDs are active semiconductor de- vices with a non-linear response to an electrical signal, and they are current driven instead of voltage driven. This means that the brightness of a LED cannot be controlled by adjusting the supply voltage. In theory, it would be possible to vary the intensity of a LED by very accu- rately adjusting the voltage across the 2/2008 - elektor 17 SURROUND LIGHT SYSTEMS LED, but this approach has a very small tolerance and essentially requires indi- vidual calibration of each type of LED in order to obtain good results. For this reason, current control is used here, which allows any desired type of LED to be used with an assured output control range of 0 to 100%. Protection The LEDs used in the prototype be- came hot when stationary white are- as were present in the image (such as during word processing, working with text windows, or Web browsing), and in such situations mood lighting is any- how not especially meaningful. For this reason, the whiteness of the image is measured and after a suitable delay the brightness of the LEDs is re- duced by decreasing the drive current supplied by the MOSFET. Each colour is measured, and if white is detected a timeout is initiated us- ing a capacitor charging circuit and a reference voltage, and a protection circuit is triggered at the end of a de- fined time. This is a distinctly analogue approach. This timeout is only necessary to avoid restrictions on the system when a sta- tionary white image is displayed. The timeout is approximately 20 sec- onds, which is long enough to ignore ‘white’ sequences in films. The discharge time (after the screen is no longer white and the Surround Light can thus return to normal operation) is the same to keep things simple, and it avoids flickering when changing win- dows in an office application. Block diagram The block diagram in Figure 1 is rel- atively complex. This arises from the processing of the video signal, which is received in VGA or X-XGA format. The signal first passes through a buff- er. It is then amplified using a precise- ly defined gain. The resulting signal is clipped in a block that uses a diode. After this, the signal is fed to a resis- tor network to limit the rising edges of the signal with high-resolution video (1600 x 1200). An RC network integrates the signal to obtain the average voltage (the col- our signal resulting from this process), which is fed to an adjustable voltage divider. The LEDs are driven by a voltage-to- current converter with a MOSFET power stage. Finally, the protection circuit responds to detection of a stationary image and the output level of the voltage regula- tor. If the supply drops too low or the regulator malfunctions, the LED drive current is reduced to prevent damage due to an unstable supply voltage or an inappropriate image. The overall transfer function of the system can be described with the following formula: (V inp ut - 2 x 18.49 - 1.2 V) - 9.33 Schematic diagram The schematic diagram in Figure 2 shows the functional elements of the block diagram in more detail. Let’s ex- amine the technical aspects of some of them more closely. Video input and clipping (A) The input impedance is 10 kQ to 22 kQ, depending on the fitted resistors. This value provides a good match to the am- plifier input, avoids overloading the output of the graphic card, and avoids distortion of the video signals due to excessively low parallel impedance. The input circuit attenuates the signal by 50% because the serial and parallel resistors have the same value. Jumpers are fitted at the input. They can be replaced by serial capacitors if clamping is necessary. Clamping is optional because it is not compatible with the video signal, but it may be necessary in some cases. The gain (kl) is determined by the col- our threshold value, which is set to 1210 mV by two 1N4148 diodes con- nected in series (this approach was chosen because it provides a stable threshold value). This value must cor- respond to 15% of the nominal signal voltage. This is the key to the entire design, and maintaining a threshold level of 15% of the dynamic range of the signal is essential for good results. We can now calculate the gain as follows: 1210 mV across the series-connected diodes = 15% of (350 mV x kl) This yields a value of 18.49 for kl. This must be increased to compensate 070491 - 12 Figure 1. Block diagram of the Surround Light. Although the block diagram of the analogue version of this system looks much more complicated than its digital counterpart, the circuit is a lot smaller than you might expect. 18 elektor - 2/2008 K5 RIO Figure 2. Schematic diagram of the Surround Light. You can easily see the various functions of the block diagram here. 2/2008 - elektor 19 SURROUND LIGHT SYSTEMS Table 1 . Power dissipation of the driver transistors at various LED voltages. Minimum Average Maximum LED voltage Power LED voltage Power LED voltage Power Red LED 2.31 V 1.254 W 2.95 V 870 mW 3.51 V 534 mW Green LED 2.79 V 966 mW 3.42 V 588 mW 4.23 V 102 mW Blue LED 2.79 V 966 mW 3.42 V 588 mW 4.23 V 102 mW for the loss over the diodes that pro- vide the threshold value. The SENSE lines are connected to the watchdog circuit, which monitors the average input voltage to see whether it rises above 600 mV. If it exceeds this value too long, the LEDs are placed in the protected mode. Signal integration and converter ad- justment (B) The signal must be integrated before it is fed to the input of the voltage-to- current converter. The integration time constant is matched to the timing of the line pulses. The raster line puls- es cause relatively weak modulation of the current, which is nevertheless sufficient to reduce the average pow- er dissipation of the LEDs. (The LEDs used here are not suitable for pulse- mode operation.) The time required to charge to 2/3 of the maximum level is 650 [is with com- ponent values of 10 kQ and 100 nF, which is sufficient to eliminate the line sync pulses from the VGA signal. The corresponding discharge time is 100 [is due to the presence of R53 in the voltage divider formed by R14 and R53. This value produces only a small delay in determining the colour (due to the total capacitance of the measuring chain), so the system has a sufficiently short response time. Drive circuits for the LUXEON K2 LEDs (C) As already mentioned, the LEDs are operated under current control. The LEDs are powered from the 5-V sup- ply voltage with an average current of less than 700 mA (or 2.1 A peak if you ignore the breaks during the video sig- nal flyback intervals). The individual LEDs are driven by emitter followers (T1-T3) that form cur- rent sources in combination with the opamps in IC2. The value of resistor R22 is small enough to supply sufficient current to T1 and large enough to limit the cur- rent from the opamp if no load (LED) is connected. The voltage rises to the maximum value when the output of the amplifier is open-circuited. The LED current is sensed by resistors R25, R26 and R33 in the emitter circuit of the transistor, which also conduct the base current. The sensed value is j'led = J c + 2 B’ so j b mus t be kept as small as possible to avoid adverse- ly affecting current sensing: (i Bmax = J Cmax Vnn) = 700-60 = 11 mA max, or 1.57%). The transistor type used here is de- signed for operation with a small V CE , so it does not lose much of the 5 V even when in saturation. This ensures that there is sufficient voltage available for the LED. The design value of the sense voltage is around 500 mV at the rated current, which yields a power dissipation of 350 mW in the resistors. A larger re- sistance would yield somewhat better accuracy, but it would also increase the power dissipation. The transistors are thermally coupled to a copper plane on the PCB with an area of approximately 7 cm 2 to improve cooling. The nominal dissipation depends on two parameters: the actual cur- rent through the LED and the voltage across the LED. With regard to thermal dissipation at 25 °C, the manufacturer’s data sheet indicates that the power is approxi- mately 500 mW per transistor at maxi- mum brightness (with an average volt- age of 3.75 V at 650 mA). The thermal coefficient of the transistor is 6.25 K/W, which would yield a temperature rise of 3.5 °C with an ideal heat sink. The thermal resistance from the PCB to the air is not known, so the maximum temperature rise is not known precise- ly. An estimate based on the copper area on the PCB and the total volume of copper yields a value of 45 °C/W, which yields a maximum temperature rise of 24.5 °C (plus 3.5 °C due to the thermal resistance of the package), or 0 amb + 24.5 °C. Transistor derating and possible effects from the power dissipation of adjacent devices have been ignored here. Power dissipation Each transistor dissipates a power P proportional to the current level: P = (5 V — V LED — V SEN ) x i The power dissipation of the driver transistors at various LED voltages is shown in Table 1 for a LED current of 600 mA, a supply voltage of exactly 5 V, and V SEN = 500 mV. Protection circuit The circuit is protected against station- ary images on the monitor. There is not much point in mood lighting for office applications, so the current is reduced in such situations to minimise power dissipation and increase the useful life of the LEDs. The protection circuit is triggered when a very bright image is present for longer than a defined time. When this occurs, the current through the LED specifications LUXEON K2 Basic colour Royal Blue Green Red Blue Red-Orange Max. continuous current [mA] 1 500 1 500 700 1 500 700 Continuous voltage [V] 3.85 3.85 3.4 3.85 3.4 Effective continuous voltage [V] 3.2 V @350 mA 3.2 V @310 mA 2.56 V @230 mA 3.5 V @280 mA 2.7 V @190 mA Wavelength [nm] 455 530 630 470 617 Luminous flux [lumen] 250 mW/rad. 130 75 46 100 Total included angle [°] 160 140 140 140 140 With the LUXEON configuration , Red-Orange is preferable to Red and Blue is preferable to Royal Blue. 20 elektor - 2/2008 XX Xx XX Figure 3. The component layout of the main circuit board... LEDs is reduced by a factor of 10 and the power dissipation remains below 1 W (with a 5-V supply voltage). Detection The image is considered to be very bright if all three colours have high levels at the same time. A circuit with three transistors measures these high levels approximately, since the detec- COMPONENTS LIST Resistors R1 -R6,R1 4,R1 5 / R20 / R39 / R52 / R61 / R62 / R65 / R 66,R67 = lOkD (SMD 1206) R7 / R8 / R9 / R1 3,R1 7,R1 8,R1 9,R3 1 ,R49,R50,R5 1,R57 = 3kD9 (SMD 1206) R1 0,R1 1 ,R1 2 = 68kD (SMD 1 206) R1 6,R53,R56 = 1 l (D oo£ R56 rp0 g i^i l liHJWKU PDlBHiSS i r^i l Msupmifft nrSlHriiih 1 ' Pllllllllllll^ m I vCJB^Mk^vfi lEsll WwwTftftft ^ >> n S4 Figure 3. PCB layout for the TV Light circuit (reduced scale). Note that two positions are provided for components IC7 to IC9. or VGA connector (K3). Now let’s work through the schematic diagram from left to right and top to bottom. The system clock is provided by IC4, a type ICS502 [5]. This IC con- tains a PLL circuit that oscillates at 20 MHz thanks to crystal XI. The ‘in- ter-PIC ’ traffic is handled by five signal lines comprising a clock line and a line for each of the four data bits. There are also 18 clock signals for the nine LEDs. The final clock pulse is held at a high level for a slightly longer interval to en- sure proper synchronisation. The LM1881 (IC6) does exactly what COMPONENTS LIST Resistors R1 ,R5-R20,R22-R29,R40,R42-R47,R54,R59,R 63,R68,R72,R77 = 100D R2,R3 = 22Q R4,R21,R30,R39, = 4kD7 R31 -R38,R41 = 180D R48 = 680Q R49,R52,R61 ,R70 = 75D R50 = 620D R51 = 680kQ R53,R62,R71 = 3kQ6 R55 / R64 / R73 = 1 20Q R56,R65,R74 = lOkD R57 / R66 / R75 = 8kD2 R58,R67,R76 = 220D R60 / R69 / R78 = 47D Capacitors C3 = 470nF C4,C5,C7,C8,C1 0-C1 4,C21 ,C22,C23,C30, C31,C32 = lOOnF C9 = 560pF C1,C20,C29 = lOOpF C2,C1 5-C1 9 / C24-C28 / C33-C36 = 10jL/F 25V C6 = 220a/F 25V Semiconductors D1-D4 = LL4148 D5 = LL4007 (SOD- 106) D6 = LED, 5mm, red T3,T6,T9 = BC857 T1 ,T2,T4,T5,T7,T8 = BC847 IC1 = PIC1 8F4550-I/F) programmed, Elektor Shop # 070487-41 IC2 = PIC1 6F628-20I/8 programmed, Ele- ktor Shop # 070487-42 IC3 = ICS502 (S08) IC4 = 7805 IC5 = 74AC00N (DIPT 4) IC6 = LM1881 (DIP8) IC7,IC8,IC9 = ADC1 175 IC10-IC18 = CNY17-1 XI = 20 MHz Miscellaneous SI ,S2,S3 = 2-way SIL pinheader (pushbutton) 54 = 4-way DIP switch 55 = single-pole on/off switch (Farnell # 9575502) K1 = DC supply socket, PCB mount K2 = SCART socket K3 = VGA socket JP1 ,JP2 = 2-way SIL pinheader with jumper K4,K5 = 5-way SIL pinheader K6 = USB-B socket K7 = connector (optional) K8,K9,K10 = 5-way DIN socket PTC = Current protection (PTC660 or wire link) Enclosure, e.g. Vero # 16-3638089 PCB # 070487-1 , see Elektor Shop section or www.elektor.com Project software; PIC source and hex files in archive # 070487-1 1 .zip, free download from www.elektor.com 2/2008 - elektor 27 SURROUND LIGHT SYSTEMS Reset button pressed 070487 - 13 Figure 4. Summary of the functional modes of the TV Light. it is designed to do: extract the sync signal from the composite video signal. The signal provided by this IC goes straight to the first PIC (IC 1), which is the ‘brain’ of this complex design. The four-way DIP switch (S4) can be used to connect termination resistors to the signal lines of the input connec- tors (SC ART and VGA). They have the same effect here as in the Surround Light circuit described elsewhere in this issue. When the switches are open, the inputs have a relatively high impedance. When they are closed, the input impedance is 75 Q. The supply voltage for the circuit is pro- vide by a 7805T (IC3) using a conven- tional circuit design that hardly needs any comment. LED D6 on the front side indicates that the supply voltage is present. Switch S5 can be used to se- lect one of two supply voltage sources. This allows the supply voltage to be taken from a USB port if the TV Light is used in combination with a PC. The supply current is drawn via a thermis- tor that interrupts the supply voltage if the current becomes too large. The red, green and blue LED light bars are connected to the system via 5-way DIN connectors (K8-K10). This method ensures reliable connections. Optocou- plers IC10-IC18 provide galvanic isola- tion between the circuit and the LED light bars. PCB If you look at the PCB layout in Fig- ure 3 (designed using Layo 1 PCB), you can see right away that it uses quite a few SMD components. Due to possible availability problems with the ADC 1175, the board is designed to accommodate two different SMD ver- sions: JM and TC. The locations on the PCB for the smaller version (TC) are marked with an ‘A’ . As this circuit operates using high-fre- quency signals, a large ground plane extending over the entire board is pro- vided on the component side. Ground plane areas are also placed beneath the connectors on the other side. Assembly Successful completion of this project re- quires a certain amount of experience in handling SMD devices. For readers with relatively little experience, we of- fer a PCB with all of these components pre-assembled (order number 070487- 91), so all you have to do is solder the connectors and operator control com- ponents. Preprogrammed PIC micro- controllers are also available from the Elektor Shop (070487-41 and -42). With the exception of a few ICs and connectors, all of the components are SMD types. It is thus important to al- ways check everything that has to be done at each stage of assembly. Pay particular attention to correct orienta- tion of the SMD ICs, since unsoldering incorrectly fitted IC can cause damage to the tracks on the PCB. Soldering the smaller version of the A/D converter re- quires special care to avoid producing shorts that will subsequently have to be eliminated. A pair of pushbutton switches must be connected to the points marked ‘SI’ and ‘S2’. They should be fitted to the rear panel of the enclosure between the 12-V power supply connector (Jl) and the DIN connector for the red, green and blue LED light bars. These two buttons, which are labelled ‘Re- set’ (SI) and ‘Mode/Bootload’ (S2), are used to select the operating mode of the unit. This is described in more de- tail below under the ‘Operating modes’ heading. Note: jumpers JP1 and JP2 must be fit- ted (closed) if the LEDs are powered via supply voltage connector Kl. Operating modes The PIC that generates the PWM sig- nals (IC2) can be programmed using an ordinary programmer. The second PIC (the 18F4550) can be programmed us- ing a USB cable, which is very practical if you want to develop your own soft- ware for the TV Light. The circuit can remain switched on during program- ming, and you can program the PIC us- ing a laptop computer next to the tel- evision set. Naturally, a boot loader has to be installed first. This is explained further on in this article. The first button (SI, Reset) is used to restart the unit, while the second but- ton (S2, Mode/Bootload) is used to se- lect the operating mode after a restart. You can press the second button dur- ing a restart to activate the USB boot loader so you can reprogram the TV Light circuit, or press it in normal oper- ating mode to switch between 4:3 and 16:9 image aspect ratios. The various operating modes are sum- marised in Figure 4 with associated comments. To enter boot loader mode, hold the Mode button pressed while you switch on power or press the Reset button. When you have finished programming the TV Light via the USB port, press the Reset button again (this time with- out pressing the Mode button). In re- sponse, the TV Light will initialise vari- ous parts of the circuit and then exe- cute a test program that switches all the LEDs on and then switches off the nine outputs in sequence. This gives you an opportunity to check that the LEDs are positioned properly around the television set. This test is also very convenient for initial testing of the cir- cuit after you have assembled the PCB, especially because it does not require any A/D conversion or input signals. After the first test is completed, the TV Light switches to Light Show mode with RGB colours. In this mode it runs through a rainbow cycle with all nine LED light bars, which is repeated eve- ry 45 seconds. This low speed lets you get a good idea of the various colours. To exit this RGB mode, simply press the Mode button briefly. This causes the TV Light to switch immediately to the normal operating mode, in which the input signals are sampled and processed. With films displayed in wide-screen format (16:9), it is not advisable to an- alyse the upper 10 percent of the im- age. To avoid this, simply press the Mode button once again. In response, the program will search for the first non-black line (note that here ‘black’ is not exactly zero, but instead a very low value from the A/D converter). The first non-black line is the uppermost line that is used for colour analysis (corresponding to the variable Start- Line in the code segment detectTop of the source code). 28 elektor - 2/2008 An example of the LED light bars used in this project. Development tips and tricks We are often asked to shed a bit more light on the design and development processes of our authors. Some of the interesting aspects are described here. RGB generator (PIC16F628A-I/P) It is recommended to disable the brown-out reset while you are pro- gramming the PIC16F628. After a bit of experimenting, it proved to be better to take the supply power for the LED light bars from a separate power supply. It is advisable to use the I/P version of the PIC16F628A in this circuit be- cause the PWM signals generated by a standard 16F628A produce flicker- not noticeable to the naked eye. If you want to recompile the loader routine, you need the full version of the C18 compiler (or an educational version for a trial period) due to the optimisation performed by the compiler. The configuration bits [6] are used to program the loader. We hope you have a lot of fun with your TV Light! ( 070487 - 1 ) TV Light control logic (PIC18F4550) Almost all pins of the PIC are used here. As the Microchip loader routine normally uses RB4, the author rec- ompiled the code to use RBO instead. This means that one of the colours has a resolution of only 7 bits, but this is ing effects. The author does not know the exact reason for this, but the I/P ver- sion is intended for industrial applica- tions and is probably less sensitive to elect cal noise - and this circuit generates lots of noise. Photo of the author's initial prototype. It is somewhat larger than the final version described in this article. Web Links [1] www.mediaprofis.net [2] SuperFlux LEDs datasheet: www.lumileds.com/pdfs/DS05.pdf [3] LM1881 datasheet: http://cache.national.com/ds/LM/LMl 881 . pdf [4] ADC1 1 75 datasheet: http://cache.national.com/ds/DC/DCl 1 75. pdf [5] ICS502 datasheet: www.idt.com/products/getDoc. cfm?doclD= 1 6325487 [6] www.burger-web.com/Projects/PIC- 1 8F4550USB/en_PICl 8UsbBoard.htm. en 2/2008 - elektor 29 INFO & MARKET UNIVERSITIES GUIDE What University Steve Gold So you were thinking of studying for an Electronics and Electrical Engineering degree or similar qualification at a UK university or other higher level educational establishment? BEng., MEng., perhaps a PhD.? Here at Elektor, we decided to take the pain out of asking the obvious not so obvious questions with our 3-step primer on the subject: (1) get oriented; (2) hear opinions and (V9) where to hang out. 1 . www and what / where / who? Studying at a university or higher educational establishment offering degree-level (or similar) courses in electronics and electrical engineering has never been easier in the United Kingdom. The availability of low-cost loans (indexed to inflation and repayable only when obtaining employment with an annual income of more than £ 25,000, means that the age-related barriers to study are no longer there. Students on these courses can now be (and are) of almost any age and from almost any country, although students from outside the European Union are generally charged higher fees. We looked at six degree educational establishments in some depth and spoke to their Electronics and Electrical Engineering course staff. Whilst the establishments varied in funding and size, their main attribute — in common with all the colleges and uni- versities we spoke to when researching this feature — was high levels of enthusiasm and, despite government cutbacks, healthy funding in the Electronics and Electrical Engineer- ing departments. It's also worth noting that the main table, which shows the UK establishments offering BEng (Bachelor of Engineer- ing) and MEng (Master of Engineering) degree courses in Electronics and Electrical Engineering, and the places avail- able. The data is based on 2006/2007 figures from HESA (www.hesa.ac.uk ) and are the latest available at the time of writing. 30 elektor - 2/2008 Universities in England, Scotland, Wales and Northern Ireland offering courses in Electronics & Electrical Engineering England website places Anglia Ruskin University www.anglia.ac.uk 215 Aston University www.aston.ac.uk 135 The University of Bath www.bath.ac.uk 230 University of Bedfordshire www.beds.ac.uk 5 The University of Birmingham www.bham.ac.uk 400 The University of Bolton www.bolton.ac.uk 255 Bournemouth University www.bournemouth.co.uk 30 The University of Bradford www.bradford.ac.uk 195 The University of Brighton www.brighton.ac.uk 90 The University of Bristol www.bristol.ac.uk 285 Brunei University www.brunel.ac.uk 275 Buckinghamshire Chilterns University College www.bcuc.ac.uk 5 University of Central England in Birmingham www.bcu.ac.uk 820 The University of Central Lancashire www.uclan.ac.uk 125 City University www.city.ac.uk 465 Coventry University www.coventry.ac.uk 190 Cranfield University www.cranfield.ac.uk 5 De Montfort University (Leicester) www.dmu.ac.uk 105 University of Derby www.derby.ac.uk 275 The University of East Anglia www.uea.ac.uk 5 The University of East London www.uel.co.uk 190 The University of Essex www.essex.ac.uk 135 The University of Exeter www. exete r. a c . u k 45 The University of Greenwich www.gre.ac.uk 270 University of Hertfordshire www.herts.ac.uk 420 The University of Huddersfield www.hud.ac.uk 370 The University of Hull www.hull.ac.uk 95 Imperial College of Science, Technology & Medicine (London) www.imperial.co.uk 505 The University of Kent www.kent.ac.uk 170 King's College London www. kcl.ac.uk 175 The University of Lancaster www.lancs.ac.uk 40 Leeds Metropolitan University www.leedsmet.ac.uk 25 The University of Leeds www.leeds.ac.uk 260 The University of Leicester www.leicester.ac.uk 1 10 Liverpool John Moores University www.ljmu.ac.uk 260 The University of Liverpool www.liv.ac.uk 255 London Metropolitan University www.londonmet.ac.uk 240 London South Bank University www.lsbu.ac.uk 225 Loughborough University www.lboro.ac.uk 420 The Manchester Metropolitan University www.mmu.ac.uk 250 The University of Manchester www.manchester.ac.uk 465 The University of Newcastle-upon-Tyne www.ncl.ac.uk 170 The University of Northumbria at Newcastle www.northumbria.ac.uk 45 The Nottingham Trent University www.ntu.ac.uk 65 The University of Nottingham www.nottingham.ac.uk 380 Oxford Brookes University www.brookes.ac.uk 180 The University of Plymouth www.plymouth.ac.uk 155 The University of Portsmouth www.port.ac.uk 515 Queen Mary and Westfield College of London www.qmul.ac.uk 210 Ravensbourne College of Design and Communication www. rave.ac.uk 85 The University of Reading www.reading.ac.uk 280 The University of Salford www.salford.ac.uk 30 Sheffield Hallam University www.shu.ac.uk 265 The University of Sheffield www.shef.ac.uk 365 Southampton Solent University www.solent.ac.uk 60 The University of Southampton www. soes . soto n . a c . u k 380 Staffordshire University www.staff.ac.uk 80 The University of Sunderland www.sunderland.ac.uk 60 (continued overleaf) 2/2008 - elektor 31 INFO & MARKET UNIVERSITIES GUIDE The University of Surrey www.surrey.ac.uk 355 The University of Sussex www.sussex.ac.uk 120 The University of Teesside www.tees.ac.uk 240 Thames Valley University www.tvu.ac.uk 5 University College London www.ucl.ac.uk 170 The University of Warwick www.warwick.ac.uk 215 University of the West of England, Bristol www.uwe.ac.uk 170 The University of Westminster www.wmin.ac.uk 235 The University of Wolverhampton www.wlv.ac.uk 15 The University of York www.york.ac.uk 335 Wales University of Wales, Aberystwyth www.wales.ac.uk 65 University of Wales, Bangor www.bangor.ac.uk 70 Cardiff University www.cf.ac.uk 230 University of Wales Institute, Cardiff www.uwic.ac.uk 75 University of Glamorgan www.glam.ac.uk 200 The North-East Wales Institute of Higher Education www.newi.ac.uk 55 Swansea Institute of Higher Education www.sihe.ac.uk 20 University of Wales, Swansea www.swan.ac.uk 145 Scotland 1740 The University of Aberdeen www.abdn.ac.uk no University of Abertay Dundee www.abertay.ac.uk 35 Bell College (Note 1 ) www.paisley.ac.uk 5 The University of Dundee www.dundee.ac.uk 60 The University of Edinburgh www.ed.ac.uk 285 Glasgow Caledonian University www.gcal.ac.uk 185 The University of Glasgow www.gla.ac.uk 195 Heriot-Watt University www.hw.ac.uk 185 Napier University www.napier.ac.uk 70 The University of Paisley 1 www.paisley.ac.uk 25 The Robert Gordon University www. rgu.ac.uk 275 The University of Strathclyde www.strath.ac.uk 305 UHI Millennium Institute www.uhi.ac.uk 5 Northern Ireland 335 The Queen's University of Belfast www.qub.ac.uk 245 University of Ulster www.ulster.ac.uk 90 1 University of Paisley merged with Bell College in 2007. Considerable changes are taking place at many universi- ties during the current academic year, with many campuses merging or changing their roles. Please check the relevant websites for more information. For less official stuff the por- tal website www.whatuni.com is also a good starting point. Birmingham University www.eece.bham.ac.uk Electronic , Electrical & Computer Engineering The University of Birmingham, Birmingham B15 2TT. Tel. 0121 414-5630. The EE & CE Department is research-led and has 28 aca- demic staff and 15 support staff who look after over 500 undergraduate students, around 60 MS c Students and a similar number of students studying for their doctorate. Turnover on research is £ 2 million per year, and in the last government Research Assessment Exercise the Depart- ment attained a grade 5 listing, as well as 24/24 marks on Teaching Quality Assessment Th e £ 2 million funding derives from a variety of sources including government and industry as well as the Euro- pean Union. Brunei University www.brunel.ac.uk School of Engineering and Design Brunei University, Uxbridge, Middlesex UB8 3PH. Tel. 01895 274000 Brunei is a world-class university based in Uxbridge, West London and just over 40 years old. There are several elec- tronics and Electrical Engineering courses available includ- ing the new Electronic and Computer Engineering M Eng; Electronic and Electrical Engineering (Communications Sys- tems) BEng; Electronic and Electrical Engineering (Control Systems) BEng; Electronic and Electrical Engineering (Power Electronics Systems) BEng; Electronic and Electrical Engi- neering BEng &MEng; and Electronic and Microelectronics Engineering BEng. The Electronics and Electrical Engineering (Communications Systems) BEng. course, for example, is a three year full-time 32 elektor - 2/2008 course, of four years 'thick' sandwich (block study) course that seeks to deliver well-rounded engineers with a high level of analytical and engineering design skills. Students are said to develop a sound knowledge of all as- pects of Electronic and Electrical Engineering and related areas. The course is accredited by the Institution of Engi- neering and Technology (IET). City University London www.city.ac.uk School of Engineering & Mathematical Sciences City University, Northampton Square, London EC IV OHB. Tel. 020 7040-8130. The School of Engineering has entered a new dynamic phase following the University's decision in 1999 to invest heavily in the School, its restructuring in 2001 into a de- partment-less School headed by a new Dean and its merger with the Department of Mathematics to form the School of Engineering and Mathematical Sciences. Research in the School of Engineering and Mathematical Sciences has a basic and applied component and has a strong interdisciplinary character and it is characterised by close links with industry and awareness of its location in London. London Electronics College www.lec.org.uk 20 Penywern Road, London SW 5 9SU. Tel. 020 7373-8721. The London Electronics College is a centre of adult learning providing technical training dating back to 1 892. This unique college attracts a wide range of students from all backgrounds, notable international and ethnic. The col- lege says that small classes and a friendly environment help make learning enjoyable and rewarding. The college is very close to the exhibition centre in Earls Court and 20 minutes walk from Olympia. The area is well served by buses, tubes and rail. University of Manchester School of Electrical and Electronic Engineering www.manchester.ac.uk Oxford Road, Manchester Ml 3 9PL. Tel. 0161 306-6000. Established in 1924, the school has six research groups: 1 . Microwave and Communication Systems (MACS) The MACS group considers a wide range of advanced topics applicable to communications and radar; from highly mo- bile wireless networks, propagation, microwave and mil- limetric components, through to digital signal processing, coding and signal analysis. 2. Control Systems (CS) — has an international reputa- tion for its pioneering research in systems theory includ- ing the development of frequency domain design tools for multivariable systems, self-tuning and adaptive control and the use of symbolic algebra in the development of control algorithms. 3. Sensing, Imaging and Signal Processing (SISP) — pur- sues collaborative and cross-disciplinary research that ex- ploits the complementary expertise in sensing, imaging and signal processing that is brought together in the group. 4. Electrical Energy and Power Systems (EEPS) — is at the forefront of research and teaching in the field of electric power engineering in the United Kingdom and internation- ally with its 1 0 permanent academic members of staff and its 30+ researchers. 5. Power Conversion — The efficient conversion & control of electrical energy is a vital infrastructure technology that underpins much of what we take for granted in an industr- ialised country; electricity generation & distribution, land, sea & air transport, computer & communications systems, & countless industrial processes. 6. Microelectronics and Nanostructures (M&N) — Research activities cover a range of topics concerned with the funda- mental materials and physics issues surrounding advanced semiconductor devices, novel high speed electronic and op- toelectronic devices, and advanced sensors and systems. Robert Gordon University School of Engineering www.rgu.ac.uk Schoolhill, Aberdeen AB10 1 FR. Tel. 01224 62000 Robert Gordon University's Garthdee library with its techno-futuristic architecture. The University has developed an international reputation for providing high quality education from Undergraduate to PhD level. In 2006 The Times newspaper named RGU as the top uni- versity for graduate employment. The uni says that all its electronics and electrical engineer courses are designed in close co-operation with industry, with collaborative work with professional bodies, industrial organisations, govern- ment departments and research institutes. Many courses are designed with a part-time study option and a number of courses are available through the Univer- sity's virtual campus, a remote university computer system. Sheffield University Department of Electronic & Electrical Engineering www.shef.ac.uk/eee Mappin Street, Sheffield SI 3JD. Tel. 01 14-222-5355 Sheffield Uni's E&EE Department is respected internationally for its many important contributions in the field of Electronic and Electrical Engineering. The Department currently has 35 academic staff (including 12 professors), 8 academic-related staff, 29 research staff, 81 PhD students, 54 MSc students and approximately 360 undergraduate students. The Department's reputation in both teaching and research has been confirmed by the highest possible award in the Teaching Quality Assessment (24/24 points) and a five star award in the HEFCE Research Assessment Exercise. 2/2008 - elektor 33 INFO & MARKET UNIVERSITIES GUIDE London Electronics College (LEC) classroom. Malcolm Spalding of LEC has reason to disagree with the proposed statement. 2. Opinions: how far would you agree or disagree with the statement "electronics as a science, a study, a pastime and professional activity is migrating fast to India, China and the Far East 7' This is not so, says Dr. Geoff Baines, an admissions tu- tor with Manchester University's School of Electri- cal and Electronic Engineering, who says that, whilst a number of UK call centre jobs have been flowing steadily overseas to the Indian sub-continent in the last five years, students from around the world are now flowing into UK universities as never before. "Around 40 per cent of our electronic and engineering students are from outside the European Union, despite the fact that their fees are around the £ 1 2,900 a year mark, compared to £ 3,145 a year for UK and European Union students," he told Elektor. And, he added, overseas students' fees are paid from a wide range of sources, including parental contributions, bank loans, foreign government and similar scholarships and company sponsorships, "In addition, once the international students have finished their courses, not all of them return to their country of origin. Many choose to stay in the UK and get a job or go on for post-graduate training," he said. "This task has been made a lot easier by the fact that the UK government allows students to go on to get a relevant job for up to 12 months without having to get a work per- mit," he added. Coupled with the fact that applying for a work permit on the employer's side, particularly in the electronics and electrical engineering industry, is now a lot easier than it used to be, Baines says that a sizeable minority of non-European Union students go on to settle in the UK. "There's always been a shortage of graduates in the elec- tronics and electrical engineering fields, so getting a work permit is easy enough, provided you fill in the required forms", he explained. Over at the London Electronics College, Malcolm Spalding, the college's Principal, also dismisses any sug- gestion that electronics and engineering jobs are drifting overseas. He should know, as the college has been providing techni- cal training since 1 892, when it was first established. "We trained Harold Bridge, the radio operator of the Titan- ic, as well as his counterpart, Harold Cottam, on the Car- pathian, the first boat to arrive as the Titanic was sinking after it hit an iceberg. Our students go on to a wide range of positions in the UK, as well as abroad," he told Elektor. According to Spalding, since the college is located close to the exhibition centre in London's Earls Court on the west side of London, it attracts a sizeable number of international students from all over the world. "These students then go on to hold high-ranking positions in the electronics industry. Today the courses range from BTECs through to HNC/HNDs and we have around 160 students aged 1 9 years or older studying for a wide range of courses". Unlike the traditional universities teaching electronics and electronic engineering courses, Spalding says that the av- erage age of students at the London Electronics College is 36 years. Course fees at the college are well below those of a tra- ditional university at £ 600 per course per year and, says Spalding, anyone on benefits — any form of government benefits — can attend the college for their first course, free of all tuition fees. International (non-European Union) fees come in at around £ 5, 1 00 — again well below that of a traditional university, which is why, says Spalding, the college has around 70 of its students from ethnic minorities. "Around 50 per cent of our students are from London, with the majority of the remainder coming from overseas," said Spalding, adding that his educational team stay in contact with their students after they have left the college. "I'd say that around half of them go into further education with the remainder going into regular employment, both here and when they return to their home country." Up in Scotland, at the Robert Gordon University in Aberdeen, which describes itself as a professional's uni- versity, having attained the distinction of being the top Scottish university for graduate employment, Dr Chris- topher Macleod, a Lecturer in Electronic Engineering, says there is some truth in the claim that electronics jobs are flowing abroad. "Companies like Hewlett-Packard, Intel and Motorola are doing some of the production overseas, but the design and development is still largely here in the UK, as well as the US," he said. Macleod, who is a course leader in Artificial Intelligence and Robotics with the university, as well as being lead- er of the university's artificial neural networks research group, says that, in some ways a move towards India may suit the UK. 34 elektor - 2/2008 "This is because we have strong historical links in India — and arguably better than with the US, even if we do speak the same language — and there will be good opportunities for companies to expand on this," he said. If anything, he told Elektor, the UK needs to view this as an opportunity and develop these links, rather than see them as a threat. Interestingly, Macleod says that, as a pastime, electronics has been dead among the young for many years. "When I started lecturing 20 years ago, if you asked a class of 50 how many of them were hobbyists, most stu- dents would have put up their hands, Now I ask the same question and only one or two do," he said. According to Macleod, there are many reasons for this, es- pecially — and somewhat paradoxically — when it comes to the field of new technology. "Why spend hours building a crystal (radio) set when you can experience the wonders of the Internet," he said, add- ing that at least some of the blame for this has to lay at the door of hobbies like amateur radio. "If you pick up a copy of RodCom (the journal of the Ra- dio Society of Great Britain) or Practical Wireless (now it is full of arguments about the use of morse code and the technical aspects of the hobby have been brushed aside," he explained. "In many ways, the hobbies have no relevance for kids any more in what has become a mobile phone, Internet and iPod-enabled 21st Century. The hobbies have failed to keep up with modern times and integrate new technology as part of the pastime," he said. Against this backdrop, Macleod predicts that these aspects of the hobby of electronics and radio amateurs, will be populated by an increasingly ageing membership ('old far- tdonrT, as he calls it), so further alienating the younger ele- ments of society. 3. Atmospheric soundings from Mc^lhchester Manchester - bridge at the Lowry. With no less than three universities — the University of Sal- ford, the University of Manchester and Manchester Metro- politan University — Manchester is truly a student city. Electronics and Electrical Engineering courses are available at all three universities, who are also inextricably linked with each other historically. According to Abigail Ridgway, a student studying Infor- mation Systems at Manchester Metropolitan University for two years, and who transferred to the university's Crewe campus for final year, Manchester is a great place to study and live. "I lived in the student halls during my stay in Manchester, which was great for my social life, as the halls are so cen- tral" she said, adding that the only issue she had with her stay was the cost of living in Manchester from a student's perspective. The cost of living in the halls of residence, she says, was not that cheap, even though the halls provided excellent self-catering facilities, but it was the cost of leisure pursuits that she found heavy on her pocket. "Entertainment in Manchester, as in all large cities, is al- ways going to be an expensive option. Going out in the evening, especially to one of the city's clubs, can be expen- sive," she explained. When it came to choosing between stay in the halls of resi- dence and renting private property, Abigail says she was only given minimal information by the university authorities to help her choose. "I think we were given a leaflet on the accommodation choices and that was about it. I was, however, able to log into one of the many student forums on the Internet and read about other student's experiences with choosing where to live", she said. 2/2008 - elektor 35 INFO & MARKET UNIVERSITIES GUIDE Manchester University's Whitworth Hall. The Internet forums for the various universities, she went on to say, has helped students immensely, since it allows stu- dents from different years share their information informally, even to the extent of allowing people to post their views between universities. Manchester Metropolitan University is slightly unusual for a UK university in being split across five campuses in Man- chester and a further two in nearby Alsager and Crewe. Abigail moved to the Crewe campus for her final year as it allowed her to move out of the halls of residence in order to save on her living expenses, which, she says, are the most troublesome part of university life. Her advice to prospective students wanting to study an Elec- tronics and Engineering course at a UK university — or, for that matter any course at university — is to check whether they want to stay in the halls of residence or take up private accommodation. "Renting privately can be cheaper than living in the halls, especially if you live in shared accommodation", she told (left) Manchester's night life and general atmosphere are well geared to students, (right) Cryogenic research at EEPS Manchester. Elektor, adding that the cost of phoning home and to/from friends is another cost. "In the halls we had phones of our own, but they all took phonecards, which proved to be expensive. In private rent- ed accommodation, you can share the cost of a phone line with others and, if you have a mobile phone, that can help you reduce the cost of staying in touch with your friends and family", she said. Manchester nightlife has changed immensely in the last few years, with the relaxation in UK licensing laws allowing bars and clubs to stay open much later than previously, and sometimes on a 24-hour basis. This hasn't triggered a drinking culture, however, as many students are now choosing to go out for a drink or club much later than they would have done just a few years ago. Clubs in Manchester now numbers into several dozen, with the top four clubs — Sonkeys in Radium Street, Mint Lounge in Oldham Street, Twisted Elegonce@Ampersond in Long- 36 elektor - 2/2008 (left) Programming microprocessors at EEPS Manchester.... (right) ... requires total memory clearing at certain times. worth Street and Funkodemia in Central Street — attracting regular visitors. Although entrance fees at these clubs can easily run to £ 20 or £ 30, competition between the clubs for new customers is ferocious, meaning that discount schemes for students and/or regular visitors all help to cut the costs. And, of course, the fact that the University halls of residence in Manchester are quite centrally located means that late night revellers can travel home by night bus or even walk, rather than taking a cab, which all helps to keep entertain- ment costs to sensible levels. "The central location of the halls whilst I was there meant that, even if had to share a cab between us, the cost was relatively inexpensive", said Abigail, adding that the sheer variety of culture in Manchester is a great plus point for liv- ing and studying there. The culture scene in Manchester has also improved im- mensely in recent years, with a number of museums and other 'cultural sites' available during extended opening hours free of charge. One key site that students should check out immediately on arrival in Manchester is the Urbis Centre in Cathedral Gar- dens in the heart of Manchester. Urbis is an exhibition centre focusing on city life with en- trance to exhibitions, which cover photography, design, architecture, music, contemporary art and other topics, free of charge. The centre, which has become a cultural icon in its own right has free interactive exhibits, a range of family activi- ties, a shop and a cafe bar. The interactive exhibits allow visitors to take a ride through different cities around the world, create your own identity card or go global to discover a 3D satellite view of any city on the planet. And, of course, because everything is centrally located in Manchester, as Abigail says, students can generally walk home to their halls of residence or private accommodation, if they miss their night bus. ( 071019 - 1 ) Urbis Centre - a must-visit for everyone arriving in Manchester. 2/2008 - elektor 37 BUS SYSTEMS Fredi Kruger The CAN bus network is usually associated with vehicle systems or industrial automation but it can also be used in many other situations including home automation. Implementing the network is not a trivial undertaking. This low-cost solution is a CAN board which sits between the CAN bus and a PC. Using the versatile (free) software it can monitor activity on the network and test the functioning of other nodes. CAN Explorer Versatile PC-CAN Interface Although originally conceived (by Bosch) to provide a network linking to- gether electronic vehicle subsystems, the CAN bus was later adopted by com- panies specialising in industrial control systems. A quick trawl of the Internet indicates that the CAN bus has many devotees who have used it in a number of interesting applications [1]. Among the advantages of this network are its excellent error detection, good interfer- ence rejection and a wide range of low- cost components. Following links [2a] and [2b] will fill in some of the back- ground information on this network standard. The available node hardware extends from so-called Stand-Alone- Controllers up to microcontrollers with integrated CAN controllers. One of the difficulties in a network is to establish communication, so that information can be sent reliably be- tween different system components. The level of difficulty is further mul- tiplied if it is necessary to build the whole network from scratch and man- age bidirectional data on the network. This article presents a CAN bus-to-PC interface card which together with the use of free software can not only moni- tor traffic on an existing CAN network but also send and receive CAN-format messages and monitor the functioning of other nodes on the network. Use of these features gives the user a good insight into the workings and capabili- ties of the CAN bus. Simple, low-cost and versatile The CAN controller chip MCP2515 from Microchip is relatively low-priced while the PC software is available free- of-charge from Microchip [3]. The soft- ware allows direct access to the CAN controller’s registers to configure the controller for specific applications. CAN bus messages can also be sent and received and a configurable filter/ mask allows the user to set-up and test for message acceptance. The board interfaces to the PC using the parallel printer port which nowa- days (unless your printer is very old) is hardly ever used. This port offers good communication speed and low- cost interface hardware (with regard to Windows Vista problems, see the LabTalk article elsewhere in this mag- azine). The parallel printer port must be configured in software for bidirec- tional data flow. In order for the hardware to run the software from Microchip it is neces- sary that the circuit diagram (Fig- ure 1) corresponds closely to the CAN bus board described by Microchip on their web site [3]. Two 74HCT245 bus transceivers (IC1, IC2) are used to buffer signals between the printer port and the MCP2515 CAN controller chip (IC3). Communication to the chip takes place using the serial SPI interface with the necessary signals produced/ received by the PC software via par- allel port pins. The additional signals are used to poll/control the status of other signals of the CAN controller. An MCP2551 (IC4) is used as the CAN bus driver/receiver but alternatives like the PCA82C521 are also suitable. The PCB for this project, no. 060201 - 1 can be ordered through Elektor’s business partner ThePCBShop. Jump- 38 elektor - 2/2008 Figure l.Bus transceivers 1C land IC2 buffer signals between the printer port and the CAN controller chip (IC3). IC4 is a CAN bus driver. er JP1 can be used to connect a 120 Ohm terminating resistor across the network cable if this board is the end node. This is recommended to reduce signal reflections in the cable. Physi- cal connection to the CAN bus is made via a PCB mounted 9-way sub-D con- nector (K2). Pin assignments are giv- en on the circuit diagram and spare pins are used to allow the board to be powered from the bus connector with either 12 V or 5 V (use JP2 to select). Alternatively a separate mains adapt- er input is provided (K3) to power the board. The bridge rectifier (Bl) ensures that a mains adapter (‘wall wart’) pro- ducing a low-voltage AC or DC output (with a plug wiring of either polarity) can be used without problem. Fitting it all together The resistors and capacitors can be fitted first, followed by the other com- ponents according to their size. Make sure that the correct polarity is ob- served for the electrolytic capacitors (C7; CIO), LED (Dl), rectifier (Bl), and do pay attention to the correct orien- tation of the ICs on the board. Once you are happy that the layout is cor- rect and you have not made any un- intentional solder bridges between pads and tracks, it is time to connect the power supply (8 V to 12 V) to con- nector K3. LED Dl should now light. With the board connected to the par- allel printer port of a PC and with the software (described below) running the hardware will automatically be recognised as an ‘Eval-Board’. Software Software for the project can be down- loaded free-of-charge from the Micro- Figure 2. Following software installation and a few mouse clicks, these options are available. 2/2008 - elektor 39 BUS SYSTEMS 16.0C69 CAN bus;, n , R 3 R 4 R5 HllllN r2*-4III|*~ ri OJ?Ci2«r3fil30S C2 O Q CC O OflftOfl • tS i i h 9 WCcC66 F |j lOitVZUHViwiJv 7.3 r> rj (5 © Q £> 060201-1 . © ELEKTOR :■ COMPONENTS pitch 04, 05 = 22pF Miscellaneous JP1 = 2-way pinheader with jumper LIST 07 = 470a/F 25V (radial) JP2 = 3-way pinheader with jumper CIO = 47yL/F 25V (radial) K1 = 25-way sub-D plug, right-angled pins, PCB mount Resistors Semiconductors K2 = 9- way sub-D plug, right-angled pins, R1 ,R2,R3 = 10kn B1 = KBP2005G (bridge rectifier) PCB mount R4 = 1 20Q D1 = LED, 3mm, 2mA K3 = mains adaptor socket (HEBW25), R5 = 1 k£2 101,102 = 74HCT245 right-angled pins IC3 = MCP2515 (SOIC) XI = 1 6MHz quartz crystal (HC49U) Capacitors IC4 = MCP2551SN (SOIC) PCB, no. 060201-1 from 01,02,03,06,08,09 = lOOnF, 5mm lead IC5 = 7805 (TO220) www.thepcbshop.com - [mi 5_r egitle r.wt: I] i iff MCPZblb Configuration □ ► H Fillers TrvlBuf ll Teil Ei# 1 ftlMft IIWO ;0 RJTI |q" C o RHfll F KVF7 0 RXT3 5 liH-4 F RJF5 ft" C o 0 r ^ a™i fipMtiCA Mode Nomai H ^nrligi rahein Mndft B-ftwnlfif: SJlt: ^amptet: □ u _u ,1 ayer Frr^.'Vhj: FtBSCbCfll Phase i — d TXRTSCTRl DO - - 0 0 0 0 0 0 WPfTHJ no - - n n n 0 ft ft fANIMIT 00 0 n n 0 n n ft ft f AfJIOTF 00 n n a 0 n o ft ft CANCIRL 00 ft 0 0 0 0 0 0 0 D IRTS: TX1RT5 Status ^ R«*t !JH uu M u M U u 0 MCP251 5 Status LNK? uu ft ft U U If u U ft R rcjisl i-r Vdfiir Mrsurinij i:fo DtC 00 - 0 0 ft ft ft 0 ft W 00 0 ft 0 ft ft ft a ft 0l:)0 D5^0 ftl ou u ft ft ft ft ft u ft 02 UU u ft ft ft ft u Cl u w r LJ uu ft ft ft ft ft u u ft DE-: i D7b|ft 01 00 ft ft ft ft a 0 0 D DG 00 ft 0 0 ft a 0 0 0 £ WMd rv, no ft ft ft ft ft ft ri a 1 1 07 nn ft ft ft ft ft ft n n ‘1« ft.iOvrfl j£* Wrlr ^ Br stT •2H Cle-» RxOvrl IS Er.flns.mil Uutlei ! - , ^ lx Buffer : u cm id: F tentfh; 0 H Ofi: F HI: ft i>£; F Ctf: F 0£ F n&: F Oil 0 p;: F Jep S.™ 1 CTHI 04 ■# 0 ft ft n + n ft 5 IDH 00 ft 6 ft ft ft ft o 0 SlftL 00 ft ft ft 4 g + 0 0 EIDft CO ft ft C D g 0 a 0 DM 00 ft ft ft ft D 0 0 ft tic CO - ft - - 0 0 0 0 M CO ft ft ft ft D ft 0 ft Pi lift ft ft ft U ft u u u D 2 Oft ft ft ft ft ft u u u P 3 CO □ ft ft ft ft u u u 01 CO D D 0 ft ft ft 0 0 DS 00 0 D D ft ft ft 0 0 Of, at □ ft ft ft ft n ft ft 07 no ft ft ft ft ft n ft ft Figure 3. Using / MCP2515 Register View' gives access to all of the MCP2515 registers. chip web site [3]. It is based on the CANking software produced by the company Kvaser [4] with a driver add- ed specifically for the MCP2515. The software is compatible with all ver- sions of Microsoft PC operating sys- tems from Windows 95 upwards. To enable access to the port, a copy of dl- portio.sys will also need to be saved to the C:\Windows\system32\drivers folder on the PC. It is free and can be downloaded from [5]. Once the Microchip software has been downloaded, installed and running the user is presented with the menu op- tions shown in Figure 2. On some PCs the dlportio.sys driver does not run au- tomatically and an error message ap- pears on the screen. In this case the driver will need to be started manually. It is also necessary to select the cor- rect address for the printer port; fur- ther information to help resolve these problems can be found in the accompa- nying file CANHelp.pdf which is avail- 40 elektor - 2/2008 able from the Elektor website [6]. Selecting ‘MCP2515 Register View’ gives you access to all the internal reg- isters of the MCP2515. A new window pops up for each of the selected func- tions (Figure 3). Selecting ‘MCP2515 Evaluation Board’ / ‘MCP2515 Basic’ switches the software into bus-moni- toring mode and bus activity is dis- played (Figure 4). More detailed in- formation of the software is available from the Microchip website [3]. ( 060201 - 1 ) Web Links [1 ] http://caraca.sourceforge.net [2a] http://www.computer-solutions.co.uk/info/ E m bed ded_tuto ria I s/ca n_tutorial.htm [2b] http://en. wikipedia. org/wiki/Controller_Area_Networl< [3] http://www.microchip.com/stellent/ idcplg?ldcService=SS_GET_PAGE&nodel d= 1 406&dDocName = en531 891 [4] www. kva s e r. co m [5] www.driverlinx.com/download/dlportio. htm [6] www.elektor.com/canbusE □ of 14 t J'.F AT !.-inci.,i I :i Efp|s fto-FW. A-J3LH9 OH r.iri “■ y 3 T I "f n+fjc ► ] IjPh Mi j «hv 1 (T 1 Cswi n ■§ MxnJ I L i '>L'h • r1 On h i " Er» l • m " lU ! d JJI I**— llfln Vtb. iC. . 1 .. F. T.m L 4 II H ±1 * IA7.LU1 tl-n'i I hi .H-i". L rn-ij t >-r LI t iti l ! • V L -j.- -I -j r ItkHdil HCP.' J ‘, r- ■■r.'o jr m m 4381 iwti M I s — 1 tic 11; Map et? tat jlrt — L I bIbij’s r ■ * ■i 4 • H^I na jrlj’^TV HuAJi 5. in ft-**# f UBcftta r' buflcn M f Eudm S" |ll C - FMq jml Figure 4. Choosing 'MCP2515 Evaluation Board 7 / 'MCP2515 Basic' (see Figure 2) switches the software into bus monitor mode showing all bus traffic. Advertisement r\i~\n\r\r~\ A N T E X U 7 LJWLJLJ Ante* offer a wide choice of input voltages and bit profiles for our soldering iron range 1>TU HI 2 230V- ce **T*« Mil 230V U 60 + years of experience It may surprise you but buying an Ante* soldering iron costs less than you think in the long run, British made to exacting standards, they Fast significantly longer than many imported brands. With a wide range of thermally balanced models, and temperature controlled irons too, you can always be sure to find an iron that meets your needs. A large range of replacement tips are available for most irons, and technical help is on hand from our offices in Devon UK. Buy Online Our new website has all of our irons, and soldering spares and accessories available 24hrs a day. Most items are shipped next day, and we offer free carriage throughout Europe. Why not give antex.co.uk a try! i . v - www.antex.co.uk FREE shipping on all orders Antex Electronics Ltd 2 Westbridge Industrial Estate Tavistock, Devon PL1 9 8DE, UK Tel: +44(0)1 822 613565 Fax: +44(0)1822 617598 Email: sales@antex.co.uk Web: www.antex.co.uk 2/2008 - elektor 41 TECHNOLOGY LED LIGHTING Ambience courtesy of an MSP430 Dirk Gehrke and Christian Hernitschek High-brightness LEDs are being used more and more widely in lighting applications. Here we present a simple 'mood light' using just a few components. Each of three LEDs is provided with a constant current using a switching regulator, and brightness control is performed by an MSP430 microcontroller generating three PWM signals. The printed circuit board could be fitted inside a table lamp with a frosted glass envelope or could be used with an LED spotlight for indirect lighting. Whatever their power, LEDs are now normally driven using a constant cur- rent source. This is because their light output, measured in lumen (lm), is pro- portional to the current flow. All LED manufacturers therefore spec- ify parameters such as light output (sometimes expressed as optical ef- ficiency), viewing angle and wave- length as functions of forward current I F rather than of forward voltage V F as might be expected. We therefore use suitable constant current regulators in our circuit. Constant current for high-brightness LEDs The majority of switching regulators on the market are configured as constant voltage sources rather than as constant current sources. A small and easy-to- understand modification to the circuit is required to convert a constant volt- age regulator to constant current op- eration. Instead of the voltage divider normally used to set the output voltage we use a current sense resistor, across which the voltage drop is regulated. Figure 1 illustrates the circuit in simplified form. Dimming LEDs There are essentially two ways to dim LEDs. The first, and simplest, way is analogue control, where the current flowing through the LED is controlled directly: a lower current gives a low- er brightness. Unfortunately there are two severe disadvantages to this meth- od. First, the brightness of the LED is not exactly proportional to the current, Caution! High- brightness LEDs! Never look directly into the LEDs! Very bright LEDs are not just uncomfort- able to look at; they can actually be dan- gerous to the eyes as they can damage the retina. We therefore recommend oper- ating the board with the LEDs pointing at a white wall to give indirect illumination. V 0 ut = Vfb R2 + R1 Figure 1. A switching regulator can be configured as a voltage source or as a current source. 42 elektor - 2/2008 and second, the wave- length (and hence colour) of the emitted light shifts as the current is varied away from the nominal value for the LED in question. These two phenom- ena are seldom desirable. The slightly more complicated control method uses a constant current source configured to deliver the nominal op- erating current for the LED. An addi- tional circuit can then quickly switch the LED on and off with a given mark- space ratio, on average emitting less light. This is perceived as a reduc- tion in light intensity. By adjusting the mark-space ratio we can easily adjust the perceived brightness of the LED. This method is known as pulsewidth modulation (or PWM). Dimming using PWM We will look at ways of implementing PWM control using the TPS62260 as an example. The TPS62260 is a synchro- nous step-down converter with inte- Figure 2. Three ways to implement the dimmer function. grated switching element, operating at a typical clock frequency of 2.25 MHz. In the circuit of Figure 2 we show in black the possibility of connecting the PWM signal directly to the EN (ena- ble) pin. The whole switching regula- tor circuit is started up and shut down in sympathy with the PWM signal. Ex- periments in our laboratory indicate that in this configuration we can use a PWM frequency of up to 100 Hz. The advantage of this arrangement is its simplicity: no additional components are required. It is also the most en- ergy-efficient implementation, as the switching regulator draws very lit- tle quiescent current when disabled. Its disadvantage is that the reaction of the LED to a high level on the en- able pin is delayed. This is because the switching regulator has a ‘soft- start’ function: when the device is en- abled the output current is gradually ramped up until it reaches the nominal LED current. In some applications this ramp can be problematic as the wave- length of the light emitted by the LED varies as the current builds up from its minimum value to the normal operat- ing level. For example, in a DLP projec- 2/2008 - elektor 43 TECHNOLOGY LED LIGHTING +3V3 © +3V3 © R5 C3 +3V3 © 10 ENCODER R1 11 I 24 4 3 R4 I 23 vcc NMI/RST U1 TEST P2.0/ACLK/CA2 PI .7/TA2/TDO/TDI P2.1/INCLK/CA3 P1.6/TA1/TDI/TCLK P2.2/CAOUT/TAO/CA4 PI .5/TAO/TMS P2.3/TA1/CA0 P1.4/SMCLK/TCK P2.4/TA2/CA1 PI .3/TA2 P2.5/CA5 PI .2/TA1 XIN/P2.6/CA6 P1.1/TA0 XOUT/P2.7/CA7 PI .0/TACLK MSP430F2131 IRGE vss PwPd nr 22 21 20 18 17 16 15 14 13 R6 JP1 +3V3 © 11 13 O 04^ O O O O-l- O O o oP° o --o o-- 14 -O net - d|mm - ledi -OnET-DIMM_LED2 "O NET-DIMM_LED3 O net-en 070892 - 13 Figure 3. Control part of the circuit, based on an MSP430 microcontroller, with JTAG connection (JP1), eZ430 connector (JP2) and rotary encoder (Rl). tor or in the LED backlight for an LCD television panel, such variation might not be acceptable. For this demonstra- tion project, however, the effect is not noticeable to the eye. In the second variant (shown in red in Figure 2) the PWM signal is coupled into the error amplifier input of the TPS62260 via a small-signal diode. In this circuit a positive voltage in excess of 600 mV applied to the control input will over-drive the error amplifier in- put and thus switch off the LED. Since this circuit does not use the enable in- put it does not suffer from the start-up delays associated with the soft-start function of the regulator, and the LED is switched on and off very rapidly. The shift in output wavelength due to the current ramp mentioned above is therefore negligibly small in this con- figuration. Furthermore, we found in the laboratory that the PWM frequency could be raised to 5 kHz. The third possibility is shown in blue in Figure 2. Here the PWM signal is used to control a MOSFET wired across the LED. The MOSFET shorts out the LED and allows it to be switched on and off even more rapidly. The regulator is op- erating in constant current mode, and this current will flow either through the LED or through the MOSFET. Dis- advantages of this approach include the additional cost of the MOSFET and poor energy efficiency: up to 180 mW of power can be dissipated continuously in the 2 Q current sense resistor. Its ad- vantage is the high switching frequen- cy: in experiments we saw successful operation of the TPS62260 in this con- NET-DIMM _LED2 +5V © C32 t TP31 R12, R22, R32 = 2Q R12, R22, R32 = 1Q69 O NET-EN R33 — | 10k D33 m TP33 1 ^NET-DIMM "U _LED3 TS4148RY +5V +3V3 Figure 4. Circuit section consisting of three switching regulators configured as constant current sources and a 3.3 V stabilised supply built using discrete components. 44 elektor - 2/2008 A brief history of LEDs The story of the light emitting diode (or LED), or luminescence diode', starts in earnest in 1962 when General Electric (GE) began to manu- facture and sell red LEDs on the commercial market. Customers had to be satisfied with a rather poor light output: an LED of that time had an output of just 0.1 Im/W, corresponding to an efficiency of barely 0.1 %. The material used was a mixed crystal comprising gallium ar- senide and gallium phosphide. Since then the market for LEDs has changed out of all recognition, with many other manufacturers making advances in LED technology, and light output available for a given cur- rent has increased steadily. Efficiency, as well as electrical and thermal robustness, needed to increase still further before LEDs could be practically used as light sources in any significant quantity. At the same time, prices have fallen rapidly, opening up entirely new application areas. Such has been the result of forty years of research and development. Today it is possible to buy very bright LEDs at moderate prices which run at respectable levels of efficiency: for example, the Golden Dragon range from OSRAM Opto (formerly Infineon), the Rebel LED range from Lumileds (Philips Semiconductors) and the X-Lamp range from Cree. There are of course many other manufacturers of high-bright- ness LEDs, although for reasons of time we were unable to evaluate them all for this article. The light output of LEDs available today has risen to 20 Im/W, and some examples manage as much as 40 Im/W. These values corre- spond to efficiencies of 5 % and 10 % respectively, rather higher than the efficiency of a standard commercially-available incandescent bulb, which offers in the region of 10 Im/W, or an efficiency of around 2 %. High-brightness LEDs are already more efficient than halogen bulbs (around 25 Im/W) and will probably also soon be outperforming en- ergy-efficient bulbs (around 60 Im/W). figuration with PWM frequencies as high as 50 kHz. The practical circuit At the heart of the circuit (Figure 3 and Figure 4) is an MSP430F2131 micro- controller. This is programmed to op- erate as a triple PWM generator and to read values from the rotary encoder (Rl). The encoder value is used to in- dex a look-up table containing mark- space ratio values for each of the red, green and blue LEDs. The correspond- ing PWM signals are then made avail- able on output pins TA0, TA1 and TA2 at a frequency of approximately 122 Hz. This is high enough to ensure that the LEDs do not appear to flicker, as the eye smoothes out the individual pulses of light to an average perceived inten- sity value. For a practical implementation we chose the PWM control method shown in red in Figure 2, which gives a good compromise between circuit complex- ity and performance. Each LED, red (D14), green (D24) and blue (D34) is supplied with a constant current from a separate TPS62260 DC/DC convert- er. The 2 Q resistor sets the nominal current flowing through the LED at 300 mA. Higher currents (up to 1 A) can be obtained using a TPS62290, the TPS62260’s ‘big brother’, which comes in the same package style. Clock generation MSP430 microcontrollers have a choice of integrated clock sources. In software, the MSP430 can switch between an external crystal-based oscillator and an internal RC-oscillator. To keep circuit costs down we have dispensed with external components and used the internal cali- brated RC oscillator. 'Calibrated' means that the calibration parame- ters, stored in the MSP430's 'information memory', simply need to be copied into the relevant control registers in the clock generator module. Using these calibration parameters gives an overall accu- racy for the RC oscillator of ±2.5 % over the temperature range from 0 °C to 85 °C. The RC oscillator frequency lies between 7.8 MHz and 8.2 MHz: this frequency is used as the CPU clock frequency and to drive the counter in the Timer A module. Implementation of triple PWM The Timer_A module in the MSP430 consists of a counter block and a range of capture and compare blocks. The frequency of the generated PWM signals is determined by the rate at which the counter overflows. Since the Timer_A counter is 1 6 bits long, the PWM frequency is given by f PWM = f| N /2 1 6 = 8 M Hz/65536 = 1 22.07 Hz, where f !N is the fre- quency of the clock input to Timer_A. = = 2 16 65536 f pwM '■ PWM signal frequency f t : Timer _ A frequency — input clock If we repeat this calculation using the minimum and maximum fre- quencies given above, we obtain the maximum deviation of the PWM signal frequency from its nominal value. We find that 1 1 9 Hz < f PWM <125 Hz. T PWM I \9Hz < f PWM <\25 Hz Generation of the PWM signals themselves is carried out by the 'output units' which form a part of each capture and compare block. In the MSP430F2 1 3 1 the Timer_A module has a total of three capture and compare blocks and therefore three output units. Each capture and compare block consists of a digital comparator which compares the current value in the counter with a value specified independently for each block (TACCR0, TACCR1 , and TACCR2). If the values match then the comparator output triggers the output unit, setting the correspond- ing PWM output to a '1 '. The PWM outputs are reset in software. The overflow of the 1 6-bit counter causes an interrupt; the interrupt service routine sets all the PWM outputs to zero in turn. Using software to reset the PWM outputs puts a limit on the available range of mark-space ratios. Execution of the Timer_A interrupt service routine takes approximately 1 00 cycles, and so the three colour table arrays may only contain values in the range from 100 to 65535. 2/2008 - elektor 45 TECHNOLOGY LED LIGHTING Rotary encoder The PWM mark-space ratios can be set manually using a rotary enco- der (or 'shaft encoder'), which is a device similar in appearance to a potentiometer. However, instead of containing a resistive track, it em- ploys two contacts which open and close as the shaft is turned in a 2- bit Gray code pattern. The internal construction of the encoder is very simple. A wiper with two contacts sweeps over two conducting rings, insulated from one another. An insulating material covers the rings in a pattern such that as the wiper turns it operates as a switch, producing the two-bit Gray code on the output pins. The upper figure shows in outline how the encoder is connected to the microcontroller, and the lower figure shows the output signals when the shaft is turned steadily in either direction. Using the two signals A and B we can detect when the shaft is turned, as well as in which direction. In the timing diagram four states, a, b, c and d, are shown. These states repeat continuously as the shaft is turned. If the MSP430 software detects a change from state a to state b, it knows that the colour table pointer LEDptr needs to be incremen- ted. Conversely, a change from state b to state a causes the pointer to be decremented. If the encoder oscillates between states a and b the pointer will be alternately incremented and decremented. This can give rise to a flicke- ring of the LEDs as the settings change to and fro. For this reason (as well as to reduce the effective resolution of the encoder to a more com- fortable value for the user) the pointer LEDptr is divided by four before it is used to access the colour table arrays. Finally, a note on the wiring of the rotary encoder. In the circuit dia- gram of Figure 3 the pull-up resistors for each contact are connected to pin 8 of the MSP430 (P2.2) rather than to VCC. This is not a mistake: P2.2 is taken high in software and is therefore at 3.3 V, the same volta- PWM1 PWM2 PWM3 ge as VCC. Of course, the pull-up resistors could be connected directly to VCC (3.3 V), freeing up P2.2 for other purposes. COMPONENTS LIST Resistors (SMD 0603 unless otherwise stated) R2 = 330C2 R3,R4,R6 = 1 00kT2 R5 = 47k£2 R1 1 ,R1 3,R21 ,R23,R31 ,R33 = ^0kQ R12,R22,R32 = 2Q (SMD 1206) Capacitors Cl, Cl 1,C13,C21,C23,C31,C33 = 4ji/F7 6.3V; X5R, (SMD 0603) C2 = lOOnF (SMD 0603) C3 = 1 OnF (SMD 0603) C4,C1 2,C22,C32 = 22ji/F (SMD1210) Semiconductors D1 = BZX84-C3V3 (SMD SOT23) D13,D23,D33 = TS4148 RY (SMD 0805) D14 = 1W LED, Golden Dragon, red (Osram)* D23 = 1W LED, Golden Dragon, green (Osram)* D33 = = 1W LED, Golden Dragon, blue (Osram)* Ul = MSP430F21 31 RGB (Tl) U1 1 ,1121 ,U31 = TPS62260DRV SMD SON- 6 (Tl) Inductors LI 1 ,L2 1 ,L3 1 = 2jL/H2, 1.1 A, 110 mQ, SMD 2x2.5 mm (MIPSA2520D2R2, FDK) Miscellaneous R1 = rotary encoder, Bourns 3315-001 JP1 = 1 4-way boxheader JP2 = 6-way connector (Samtec TMS-106-XX-X-S-RA) TP1 1 ,TP1 2,TP1 3,TP21 ,TP22,TP23,TP31 ,TP32 ,TP33 = test pin, e.g. Keystone 5001 Heatsink, Fischer SK 477 100 Heat conducting self-adhesive tape, Fischer WLFT 404 R25 PCB, order code 070892-2** *LED alternatives: Lumiled REBEL LED using PCB 070892-1** CREE XLAMP LED using PCB 070892-3** ** Artwork download and PCB ordering at www. e I e kto r. co m Colour table The colour look-up table takes the form of an array stored in the MSP430. The array is arranged so that it can at any time be extended with additional pulse width modulation values for the red, green and blue LEDs. Whenever the rotary encoder is turned new red, green and blue values are read from the array and used to generate the three PWM output signals. Currently 252 values are stored, which can be changed if desired. A decimal value of 100 switches the LED off, and a value of 65535 produces a mark-space ratio of 100 %. When the 5 V supply is applied the MSP430 goes into a demonstration mode where the values stored in the array are read and output in se- quence in an infinite loop. As soon as the rotary encoder is turned the sequence stops and a particular fixed colour value can be selected. 46 elektor - 2/2008 The PWM signal is coupled in using a small-signal diode (D13, D23 and D33). When the PWM signal is high it over- rides the normal error signal input of the corresponding switching regulator, which has a threshold voltage level of 600 mV. This means that a high level on the PWM signal forces the LED to extinguish. When the PWM signal sub- sequently goes low the regulator starts up again and the LED lights. The whole circuit is powered from a regulated 5 V 1 A DC mains adaptor. A simple voltage stabiliser built using a resistor and a Zener diode reduces the 5 V level to 3.3 V for the MSP430 microcontroller. The circuit can be built on the printed circuit board shown in Figure 5. There are three versions of the circuit board differing only in the footprint and con- nection arrangement of the LEDs. This allows various types of LED to be used. The LED options available are listed in the parts list. Heat map Operating temperature is an impor- tant parameter in the performance of a high-power LED. It strongly affects operating life, forward voltage, output wavelength and even the brightness of the device. The higher the operat- ing temperature of the LED, the short- er will be its expected lifetime. For this reason the dimensions of our ex- perimental printed circuit board have been chosen to allow a type SK477100 heatsink (made by Fischer Elektronik) to be fixed to the reverse of the board using double-sided adhesive thermal transfer material. Running at full pow- er, this reduces the temperature of the LEDs from 61 °C (without heatsink) to 54 °C (with heatsink). The heatsink also helps to spread the dissipation of heat over the area of the printed cir- cuit board. To make an example thermal image we populated the board with LEDs from Cree. Figure 6 shows the results viv- idly, illustrating the temperature of the LEDs without heatsink (on the left) and with heatsink (on the right). Software The source code for the MSP430 soft- ware for this application is available for download from the Elektor web- site. The code begins by including the Figure 5. Printed circuit board for building the circuits of Figure 3 and Figure 4. Three variants are available for download, supporting different types of LED. 2/2008 - elektor 47 TECHNOLOGY LED LIGHTING i -63 -60 -56 -52 -48 -44 -40 -36 -32 -28 -24 °c Figure 6. Thermal image of the circuit board, populated with LEDs from Cree. Left: without heatsink; right: with attached heatsink. ‘MSP430F21x2.h’ header file, which contains definitions of all the con- trol register names and of the control bits available in the MSP430. Next the length of the colour table is defined. Notice here that the value of ‘LEDTa- bLength’ is actually set to four times the length of the table. Then follows About the authors Dipl. Ing. (FH) Dirk Gehrke Dirk Gehrke was born in Munster in Germa- ny and studied communications technology at Dortmund University of Applied Sciences and Arts. He started working for Texas Instru- ments in 1998 as a Field Application Engi- neer (FAE) in Britain, France and the United States. From 2000 he worked in Freising, Germany, as an FAE for power management products, and in January 2006 he became Business Development Manager for ana- logue products in EMEA (Europe, the Mid- dle East and Africa). Contact: http://www. ti.com/europe/csc. Dipl. Ing. (FH) Christian Hernitscheck Christian Hernitscheck studied electronic engineering at the Landshut University of Applied Sciences in Germany, specialising in microelectronics. Since 1998 he has worked as an FAE for Texas Instruments covering the whole of Europe, focussing on the MSP430 microcontroller product line. Contact: http:// www.ti.com/europe/csc. the colour table itself, with a separate array for each individual LED. Pointer ‘LEDptr’ is used to read the relevant PWM mark-space ratio settings for each of the three outputs from the in- dividual colour table arrays: see also the text box ‘Colour table’. The microcontroller is initialised at the beginning of the function ‘main()\ The watchdog timer is disabled, the cali- bration values for the adjustable sys- tem clock are loaded, the Timer_A module is configured and the multi- plexed inputs and outputs are suitably initialised. The main loop consists of two ‘while’ blocks. In the first ‘while’ block the colour table pointer LEDp- tr is incremented, which results in a continuous change in the PWM mark- space ratios and thus in the generat- ed colour. The overall timing of these colour changes is governed using two nested ‘for’ loops. The first ‘while’ loop runs until the rotary encoder reports a change on one of its outputs. The sec- ond ‘while’ block, written as an infinite loop, then takes control: it increments or decrements the colour table pointer according to the direction in which the rotary encoder is turned. A bright future The printed circuit board allows addi- tional functionality to be implement- ed. For example, there is a socket for a Texas Instruments eZ430-RF2500 radio module. The eZ430-RF2500 kit is sup- plied with two radio modules. One of these can be fitted with a rotary encod- er (using the test pins on the microcon- troller in the radio module), creating a radio link to the LED board. The circuit board described here is pri- marily intended for experimentation and evaluation purposes. Since the MSP430 source code is made available, it is possible to modify it for a range of other projects. The switching regula- tors can also find use in other applica- tions: have fun! ( 070892 - 1 ) 48 elektor - 2/2008 The new Easy-PC reaches even higher! The breathtaking new Easy- PC for Windows Version I E is released. Winning accolades the world over, VIE of the market reading Easy- PC delivers even more remarkable value for money and secs the new benchmark for performance in PCB CAD. Version 1 1 features ■ Dittigri anaEy&Eg ■ Star, 'Delta paints I Apply layout pattern & group} ■ Design cakuLnoFS ■ Electrical rules check ( E RC ) ■ Shispc editing pan*! II editing I Track analysis Plus many more exciting features. i M just cry a demonstration copy of Easy-PC and prepare to be amazed.... Easy- PC delivers a simpfe to understand, fully integrated Schematics & PCB layout in a single application. Design and rules checks at all stages ensure integrity at all times. Professional manufacturing outputs allow you to finish the design process with ease.. Stop press.,. Stop press*** Stop press*** Easy-PC is supported running under Windows Vista Call fora brochure, prices & CO on *44 (£5)1694 273662 or e-mail salei^^Tiumtberone.com you can also download a demo from www. N umberOne.com 0;il< Lsnc, ftredon, Tewkesbury. Glo}. GL 20 7LR. United Kingdom Microchip PIC Boards Embedded Webserver USB* ELhyrnuL Dallas 1-wire RS23Z/dB5 r I2C CAM-BUS Sericl LCD Free project download with source code ARM Development Boards High performance 22bit RISC USB JTAG Ethernet and USB R5233. I2C. CAN-BUS NXP lpc and Atm el sam Free C compiler and IDE Free ARM 7 tutorial download Embedded Linux Boards Low cost embedded Linux soand Two USB host interact Two 40 pins sockets For exp* ns ion GSM / Ghs Module add on Create CGI using C language Apache r RHP find SQLite RSS Reader and uCu demo Free SDK compiler download Secure online ordering www.5kpang.co.uk sales@skpang.co.uk Professional PCB SuppEier 1 kjl v) T [ll r J Twrn ! L ■ 1 s i [ i L 1 I ■ T 1 P _ J URL: www.EzPCR.cam Email: sale5-@ezpcb.com Tel: +36 139 1002 1704 I IDI Up To 50 Layers 2.5mil T/C, O.linm I Idle Size Glher Products' Spends, Keypads, Frontpanels. Flex FC6, Enclosures. Turnkey Services 2/2008 - elektor 49 PHOTOGRAPHY The availability of increasingly high-performance digital cameras and falling prices has encouraged a good many people to take an interest in photography, and macro-photography too. If lighting conditions are not ideal, it will be necessary to resort to the use of flash, with the attendant risk of shadows. The solution is a ringflash - and while we're about it, why not one using LEDs? The author found himself confronted with the challenge of constructing a flash specially designed for mac- ro-photography. That needed some thinking about, out of which came a list of. . . Requirements Not a mere wish-list, but a specifica- tion of what the operational device has to do: O build a flash unit suitable for taking macro photos; O produce a soft light (no risk of hard shadows); Ouse sufficiently powerful white LEDs (20,000 mcd); O arrange the LEDs in a circle (to avoid shadows); O put as many LEDs on the ring as pos- sible (32 if possible); O have control over the duration of the flash, independently of the camera’s shutter speed; Obe able to take, for example, photos of the splash of a water droplet. It’s all very well spelling out what you want on paper, but meeting these specifications means you have to solve certain... Problems The first hurdle we face is powering the LEDs. Although there aren’t too many options to choose from - parallel or series - the implications of these are more restrictive (see Table 1). Solutions in the form of a circuit diagram Rarely have circuits published in Ele- ktor been any simpler than our ring- flash. To keep it both compact and sim- ple, there’s only one option: a micro- controller. It is used to: O detect when the camera fires the 50 elektor - 2/2008 Photo : Huib Theunissen flash; O display the chosen flash duration via LEDs; O switch the ringflash. The author opted for series connection of the LEDs, and rather than re-invent the wheel, chose to use an electronic flash board cannibalised from a dispos- able camera - this was in fact the only readily- available electronics capable of supplying a voltage significantly in ex- cess of the 64 V actually needed. The circuit (Figure 1) of this electron- ics board from Kodak can be found on numerous websites, including the one listed at [1]. It’s important to note that this is only a typical circuit — the vari- ous models of disposable camera may well have different electronics, but the principle remains the same. Using this type of board has undoubt- ed advantages: it comes ready-built, works very well, and is easy to get hold of. You can always ask your local photographer to let you have a dispos- able camera that’s been opened for de- veloping the film. If not, you could al- ways go out and buy one. Once the electronics from the dispos- able camera are available, all that re- mains is to separate off the part that’s going to be useful for this project, i.e. everything upstream of capacitor C2. The high voltage will be taken from across the terminals of C2 (take care to discharge the electronics properly before you start - if capacitor C2 dis- charges to your fingers, you’ll get a nasty jolt). Let’s move on to the electronics of the flash control board shown in Figure 2. The heart and brain of the ringflash takes the form of a PIC16F628 from the Microchip stable [2]. The PIC16F628’s port B inputs have in- ternal pull-ups. Line RBO is used to detect triggering. Line RB3 is used to trigger the MOS- FET, an IRFBF20 [3] switched at 5 V and having a V (BD)DSS (drain-source breakdown voltage) of 900 V; this line is intended for setting the flash Table 1. Parallel or series - that's the question Configuration Current Voltage Dropper resistor Parallel High 32 x 40 mA = 1.28 A Low ~ 2 V Either all LEDs in parallel 1 resistor Q: Will all the LEDs give good brightness? Or each LED has its own dropper means a large number of resistors Series Low ~ 40 mA High >32x2 ...>64 V 1 single resistor 2/2008 - elektor 51 PHOTOGRAPHY V+ Flash (300V) Figure 1. Typical circuit of disposable camera flash electronics (source: Kodak). duration. Line RB4 is simply used to select a pre- defined switching time. By default, the first position corresponds to a duration equal to that of the camera itself (to within a few PIC instructions). Display of the selection is achieved by way of a 4051 CMOS analogue multi- plexer/demultiplexer IC, whose out- puts drive a series of eight LEDs, all the cathodes of which are connected to ground. Provision is made for eight du- rations, encoded on lines RA0-RA2. The flash can be tested using minia- ture pushbutton SI, while S2 is used to set the flash duration. Each time S2 is pressed, the duration increments, in- dicated by lighting of the next LED in the bargraph. Connector K2 has been provided to allow the microcontroller to be pro- grammed if necessary. The block shown adjacent to the V+ Flash (300 V) and 0 Flash (300 V) points represents the recycled capacitor mod- ule mentioned throughout this article. This high voltage module connects be- tween PCI and PC2 (GND) points. Pay attention to the polarity of the capaci- tor module when connecting it to the control board. The system uses a dual power system: one 9 V battery for the PIC -based con- trol electronics, and a separate 1.5 V battery for the flash electronics - this cell can easily supply the over 2.5 A needed when capacitor C2 (160ji/F/ 350 V) starts charging. The PSU is con- ventional: the 9 V supplied by the bat- tery is smoothed and reduced to +5 V by the 78L05 regulator IC3. LED D10 is used to indicate the supply voltage is present. And to end with, the most important module in this project, the ring fitted K2 O O ISP 1 GND +5V Q BAT42 11 12 13 10 PC3 RCA plug S\°oH S2i o o > MCLR RB5 RB6 RB7 RBO RB4 IC1 PIC16F628 RB3 RAO RA1 RA2 RA3 RA4 RBI RB2 c/> £ to to > O CM o to o m GND 6 o CO Cl 22p m XI 4M h Hz 17 18 C2 22p GND K1 T1 V A ^ Jack 3,5mm a ^ ,tt 32x led .n 4 70Q 5W n. PCI -Up IRFBF20 T o GND +5V O -0V+ Flash (300V) high voltage generator -0 0 Flash (300V) At D2 13 14 15 tfm D4 rttr 12 D5 I- ■ft. D6 >D7 ft- D8 ft. 09 IC3 +12V S3 78L05 ❖ ♦ CO 0 0 - C3 330n +5V Q C4 1u 16V C5 lOOn DIO ¥ GND 070612-11 Figure 2. Circuit of the home-brew electronics: the ringflash control board. 52 elektor - 2/2008 with the 32 LEDs and their current limiting resistor connects to the main board via a 3.5 mm mono jack. Construction This involves two stages: constructing the electronics, and the ring. The ‘electronics’ stage itself breaks down into two steps: 1) ‘cannibalising’ the flash board. As the photo in Figure 3 shows, this sub- unit doesn’t look particularly impres- sive. On certain models, the miniature neon is replaced by an LED. You will need, by some means or another, to prepare this module by replacing the pushbutton (which controls charging of the capacitor) by a switch. The al- ternative solution suggested by the author is to use a dual reed relay (in order to avoid pressing the switch inadvertedly). Once you have the flash charger, it’s time to move on to constructing the control board, the component overlay for which is given in Figure 4. The components should be fitted in the usual order, starting with the smaller components: jumpers, resistors, capac- itors, diodes (watching out for their po- larity), and then the larger components: pushbuttons, transistor, switches, crys- tal, ICs. The two DIL ICs should be fit- ted in sockets (good quality ones). The actual position of the LEDs and switch- es S1-S3 depends on how you plan on housing the circuit. We strongly recom- mended putting everything into one case, to which the ring of LEDs will be connected (the inset ‘Constructing the ring’ explains how to build it). That way there’s no risk of getting a shock if you make a false move. If you opt for this solution, you’ll need to mount the various indicator LEDs on the case, along with the on/off switch and push- buttons SI and S2. The free end of the link cable going to the flash socket on the camera con- nects to the PC 3 and GND in the vicin- ity of SI. Note that some cosmetic mod- ifications have been made between the prototype shown in the photo (Figure 4) and the final version of the PCB. Operation in practice The way the capacitor module works may vary from one disposable camera to another. On some, you have to keep the button pressed until the LED lights to show the capacitor is fully charged; on others (like the one we’ve used) you only have to press the button mo- Figure 3. Photo of the active part of the flash recycled from a disposable camera. Figure 4. Photo of the prototype's control board. COMPONENTS LIST Resistors R1 = lOkD R2 = 1MQ R3,R4 = 330D Capacitors Cl ,C2 = 22pF C3 = 330nF C4 = 1 a/F C5 = lOOnF Semiconductors D1 = BAT42 D2-D10 = LED, 3mm, red T1 = IRFBF20 IC1 = PIC16F628, programmed, Elektor Shop # 070612-41 IC2 = 4051 IC3 = 78L05 Miscellaneous XI = 4MHz quartz crystal S1,S2 = miniature switch, PCB mount S3 = on/off switch K2 = 6-way SIL pinheader K1 = 3.5mm jack socket 6 solder pins PCB, ref. 070612-1 from www.thepcbshop.com Project software, PIC source and hex. files, free download # 07061 2-1 1 -UK. zip from www. e I e kto r. co m LED ring parts Semiconductors 32 LEDs, 5mm, white, HLMP-CW1 1 -XI 000 (Avago; from Farnell) Miscellaneous Ring support, home made (see inset "Con- structing the ring") 2/2008 - elektor 53 PHOTOGRAPHY Constructing the ring There are several options for constructing the ring to hold the 32 LEDs. The author chose to turn up a special plastic ring in Ertalon® on a lathe. But not everyone has such a tool, so we set out to find another solution. A visit to a number of builders' merchants enabled us to get our hands on a 110 mm/80 mm soil pipe adaptor (seen in the background of the pho- to in Figure 5) which seems almost to have been designed especially for our purpose! We're going to cut off the top part at a height of around 1 7 mm. Once the ring has been nicely trimmed and sanded, it's time to drill the holes for fitting the LEDs. We start by marking a circle mid-way between the inner and outer circumferences of the ring. To make this job easier, you can divide the ring into four 90° sectors, which will each hold 8 LEDs. The cen- tres of the LEDs are spaced by 9.8 mm. Once the 32 points have been accurately marked around the circle, all that remains is to drill the 32 holes (5 mm dia.) for the LEDs. The LEDs can be fixed using a dab of hot-melt glue, and interconnected, anode of one to cathode of the next, as far as the last pair, whose respective anodes and cathodes will be left free to connect to the cable that plugs into jack K1 . mentarily and then wait for the LED to light showing the capacitor is charged ready. In the light of experience The author has been using this ring- flash for over six months, and it has become indispensable for macro work (see photos in Figure 6). Practical experience has shown it to be very worthwhile for macro work at distances of less than 40 cm from the camera. As our spec sheet stipulated, arrang- ing the LEDs in a ring provides a nicely diffused light. However, the 20,000 mcd (each) bright- ness of the LEDs is not enough to al- low much stopping down (from // 2.8 to // 8, for example) to increase the depth of field. Even white LEDs tend to be rather blu- ish in colour. So always remember to do a white balance before starting macro work. Or else reduce the blueness later using a photo retouching programme (‘to photoshop’ has become a very hip term of late in the world of mass-distri- bution magazine publishing. . .). Since the LEDs are controlled inde- pendently, it’s preferable to keep the camera in ‘Manual’ mode and try to find an acceptable compromise be- tween f - stop and shutter speed. As the LEDs brightness is not too pow- erful (and fortunately not the main ob- ject of the exercise), it has never in fact proven necessary to reduce the flash duration on the camera (works inde- pendently of the photo shutter). The author uses a magnet to operate the reed relay to recharge the flash ca- pacitor, and has noted that the LED system uses comparatively little pow- er. You can fire off around ten or so l/100 th second flashes before thinking about recharging the capacitor. This project offers lots of scope for de- velopment. In view of the high voltage generated by the disposable flash mod- ule, it might be interesting to try using other LEDs, like the Luxeon 1 watt or even 3 watt types - photographers are always after more light, to get as close as possible to natural daylight. Neither we nor the author have tried this ap- proach - we’ll leave that and other pos- sibilities to our readers’ imaginations. Happy macro photography! Don’t hesitate to send us the best of your masterpieces. ( 070612 - 1 ) 54 elektor - 2/2008 Web Links [1 ] http://www.geocities.com/lemagicien_ 2000/elecpage/maxflash/maxflash.html [2] PIC16F628 datasheet http://www.datasheetcatalog.com/datasheets pdf/P/l/C/1 /PIC 1 6F628.shtml [3] IRFBF20 datasheet http://www.datasheetcatalog.com/da- tasheets_pdf/l/R/F/B/IRFBF20.shtml [4] 4051 datasheet http://www.fairchildsemi.com/ds/CD/CD- 4051BC.pdf Figure 5. Our LED ring started life as a pipe connector found in many DIY stores. Advertisement ECD 4 A#* Elektor's Components Database A must-have for all electronics enthusiasts. Instant access to data on more than 68,000 components! ektor SHOP The program package consists of eight databanks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers. A further eleven applications cover the calculation of, for example, LED series droppers, zener diode series resistors, voltage regulators and AMVs. A colour band decoder is included for determining resistor and inductor values. ECD 4 gives instant access to data on more than 68,000 components. All databank applications are fully interactive, allowing the user to add, edit and complete component data. r \ ISBN 978-90-5381-159-7 • £15.90 • US$31.80 Order now using the Order Form in the Readers Services section in this issue. Elektor Reg us Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel. +44 20 8261 4509 J More information on www.elektor.com/shop 2/2008 - elektor 55 E-BLOCKS Thermometer / Thermostat Let's take the temperature... and then maintain it Jean-Paul Brodier The previous applications we presented for E-blocks made use of fairly elementary data input/output modes: switches or photo-electric barriers as inputs, LEDs as outputs, always involving purely binary on/off information, often referred to as 'digital'. Now it's time to go analogue and hey presto Flowcode and E-blocks again turn out a perfect combination! The thermometer described here measures the tempera- ture as an analogue quantity and displays it in text form on the liquid crystal display (LCD). The thermostat operates in a binary manner on one output, to turn a heating device on or off. Hardware The liquid crystal screen used comes in the EB-005-00- 2 E-blocks module, and plugs into the Multi-programmer board's port B socket. It's powered via a wire from the display board's +V terminals and the one on the Multi-pro- grammer board. No negative wire is needed, as the mod- ule's ground is already connected to the Multi-programmer via the sub-D socket. The microcontroller chosen is the PIC16F877. This appli- cation requires a type that includes an analogue-to-digital converter (ADC). This one has a resolution of 10 bits with eight inputs multiplexed onto the pins of port A. The screen can be included into the circuit by clicking on the 'LCD' symbol in the left-hand vertical bar. For all com- ponents added this way, you can click on the arrow on the top bar to display the Properties menu and modify, for example, the connection location. By default, the display is connected to port B. The same thing has to be done for the thermometer on analogue input ADCO and the control pot connected to analogue input ADC1 . The display form chosen is the cursor, but you can also opt for a conventional button and choose the colours. The output LED is connected to pin 3 of port A. The pins of port A can in fact be configured at will between analogue inputs and binary input/outputs - and if necessary, any mix of these. Macro-commands associated with the hardware The program handles the hardware by way of software li- braries (available in Flowcode), loaded as and when they are called by the macro-commands. The Flowcode file 'ther- mo. fcf' for the project discussed here is available free from the Elektor website. Let's start with the LC display. Click on the square (hatched outline, in the symbol bar), announced by the help bub- ble as Component Macro, and keeping the mouse button pressed, drag it to its place in the flowchart. Right-clicking on Properties lets you choose the component (LCD), the macro to be executed to initialize it (Init), and to rename the box. 56 elektor - 2/2008 ¥ k Ldt «« v iao Klt chp WndoA 1 cfc “1 si q # e | h a 1 t 1 » ii ■ j i lr ■■ »~.r% Ip"- 1 - Pq A Ihi |Jfci bftif I Ik ■ mui r p PM Uml#— iHHU H Register today on www.elektor.com/newsletter M FU tel. 01298 70012 fax. 01298 70046 www.peakelec.co.uk sales@peakelec.co.uk ei&ctrruc de* Handheld Test Gear - Cool, Smart. Atlas DCA^SjJ k Atlas ESR Atlas DCA Model DCA55 Semiconductor Analyser Identifies type and pinout! Atlas ESR Model ESR60 ESR and Capacitance Meter Resolution of 0.01 ohms! Atlas LCR^'Jj Atlas SCR New Low Pri Atlas LCR Model LCR40 Atlas SCR Model SCR100 Inductor, Capacitor, Resistor Analyser Triac and Thyristor Analyser Automatic part identification. Auto gate test current up to 100mA UK: Please add £1.00 p&p to your order. Prices include UK VAT. Please see website for overseas pricing. - • • •■; SERVICING YGUR COMPLETE PROTOTYPE NEEDS 1 EUROCARD (160 x 100 mm) + Tooling + Photoplots + VAT IB, DUO .V I Price example Any size and contour possi Optional: • Soldermask • Fast-turnaround • Silkscreen • 4-Layer Multilayer • 6-Layer Multilayer ttwkm® oust Freephone Q) 0800-3898560 Tel, +353 (0)61 701170 Fax: +353 (0)61 701165 pcb-pool@bet+||iyout.com 'm~7i f Simply send your files A/IO A /I /If //Iff and order ONLINE: rW©*rl 9 \ V l/fi I AwOWL LftMQTKE'a M l ATI ON LtJhPW S?xr-B‘' r -aTEr- to Build ji-L-jj arjaia#g toua worn crcwriirMf-j i>w frnjl&i kftpinxf by Ihv W 0 / 3 WD. Slr^oii ZX ■_ Ajjpks II AGmti morion G 4 1 M*W-- INCLUDES- /'? '$'■ < ' ~ ■ TiTCrlh, ftp m« Ji. iltIH IfW I * ■ •G>npCf jrHcUir» 1 i AH 5 jkwrti! L Tht fm Wip «■ Leg'll EmtoAfed Ejnwniil rfi*S ■ Dftntfapttiem. Hit! ' i-a-rivL pm Ihr XDB, Cefurt-! .' rfcripi U Pwr SiJU V *; AtA d WWW.Xt3AMESTATION.CDM r; ,r .L _jf£i lb aa i : Hi l+UaVlli 1 - I - Mil Tel: 01635 40347 I'.lr.vlii.iry EJm:l r 1 1 1 b i : : Llri Frn: DIG® 36143 hinfof Hl»j H-Hdiwy te Infill 4 HID 2 in: kdrc.ilhf iift.vh rv.fc:*ii.rn.iik K^vrMi'nHbMrydefAnrlns.^a.iik: 2/2008 - elektor 59 DRIVING HIGH-POWER LEDS Programmable control (or LED lighting Jorg Prim It is of course possible to drive LEDs using a simple series resistor. However, in a modern efficient lighting system we would not want to tolerate the wastage of power in these resistors. Also desirable is a remotely controlled dimming function. The circuit described here, called ‘LED- BUS\ fits the bill perfectly. It also al- lows a practically unlimited number of LEDs to be controlled and up to ten lighting programs can be configured, which can be called up at the press of a button using a standard infrared re- mote control. Each lighting program specifies the desired brightness of each LED module individually. For example, one program could make the lights bright for reading while another could dim the lights and add a warm red tint for a more relaxing atmosphere. In theory The circuit consists of two printed circuit boards, the main unit and the power module (Figure 1). The main unit can control a number of power modules over the ‘LEDBUS’, and one power module can drive from one to six 1 W LEDs, with the LED brightness ad- justable in 256 steps. The LEDBUS op- erates like a shift register, and so there is no addressing in the protocol. Other parameters besides LED brightness can also be controlled from the main unit. In the example configuration in Fig- ure 1 the main unit is connected to a chain of three power modules. The main unit has an output shift register and an input shift register, while each power module has a shift register at its input and a pass-through output. A termination connector is therefore re- quired at the end of the chain so that the signal can be shifted back to the main unit. Normally a shift register would re- quire a clock signal, a data signal and a strobe, but in the LEDBUS these three signals are replaced by a single wire, with the protocol being decoded in software. The transmission of one byte is illus- trated at the bottom of Figure 1. First comes the start bit which lasts for half a bit time. This is followed by a low level for the same period. Then comes the command bit and then the data bits from bit 7 to bit zero: each of these bits occupies a full bit time. The command bit indicates whether the accompany- ing byte is a command (1) or is data (0). A command is transferred immediately to the output of the power module so that all the power modules in a chain receive a command essentially simul- taneously. If the byte is data then the contents of the internal data shift reg- ister are output. Rather than waiting for the entire byte to be received the module starts outputting data immedi- ately after the start bit is seen, which means that each power module intro- duces a delay of one bit time. A more detailed description is given in the text box All about bits’. Circuits The circuit of the main unit is shown in Figure 2. An LCD panel with two lines of twenty characters displays status information and the selected program, all functions being accessible via men- us. An I 2 C connector allows for easy expansion of the circuit: a mains relay board is already planned. The main unit is based on an AT- mega32 microcontroller; other compo- Figure 1. Block diagram of the complete system. In this example three power modules are connected to the main unit. 60 elektor - 2/2008 +5V +5V Figure 2. Circuit of the main unit, centred on an ATmega32. 2/2008 - elektor 61 DRIVING HIGH-POWER LEDS All about bits A command byte is divided into two four-bit nibbles. The high nibble specifies one of 16 possible command groups as follows: 0: Group 0: see below 1 : Write register: lower nibble gives register address 2: Read register: lower nibble gives register address 3 to F: not used Group 0 commands: 0: Clear data shift register 1 : Device select: when the data register is zero the device is deselected; otherwise it is selected 2: Device activate 3: Query selection: data register is set to 1 if the device is selected 4 to E: not used F: Permanent save A device (i.e., a power module) is either selected or not. When selected its green LED lights and it takes part in data transfers. If the device is not selected it does not take part in data transfers on the LEDBUS, and its output is equal to its input. In this state only commands in group 0 are executed. Command 02 (device activate) always activates a device. Command 01 (device select), on the other hand, only activates a device if its data shift register holds a non-zero value. This allows the main unit to select individual devices and exchange data with them without having to clock the data through every device on the LEDBUS. Up to 16 registers can be read and written using commands in groups 1 and 2. 0: Current brightness: brightness changes immediately when this register is written 1: Brightness change speed: 0 = fast; 1 = slow 2: Current brightness: brightness changes gradually (at a speed determined by the contents of register 1 ) when this register is written 3. ..12 Not used 13: Inversion flag: 0: 0 = off, FF = maximum brightness; 1 : vice versa 14: Minimum brightness 15: PWM frequency: 0 = 8 kHz; 1 = 2 kHz; 2 = 500 Hz In order to get a power module to operate at full brightness, first write FF into the data register. Then use command 1 0 to copy the value into re- gister 0: the PIC will then switch the module to full brightness. In order to make a gradual transition to half brightness, write the value 80 into the data register and then send command 1 2. The PWM signal will then gradually change (at a speed determined by the contents of register 1) until brightness 80 is reached. The PIC can be configured to make it compatible with different LED driver ICs. If the value in register 1 3 is zero, FF will correspond to the LED being at full brightness and zero to the LED being off. Since in our circuit T1 inverts the PWM signal, we need to set register 1 3 to 1 . Register 1 4 sets the minimum brightness. The value varies from module to module, but the LED does not normally start to light until the brightness value reaches approximately 05. It would be preferable if the LED started to light at a value of 01 , and this can be achieved using a suitable set- ting of register 1 4. Register 1 5 sets the PWM frequency to 500 Hz, 2 kHz or 8 kHz. However, in practice there is no need for any mental binary arithmetic, as the main unit controls the power modules in response to simple com- mands. The settings for each power module can be stored in the PIC's internal EEPROM using command OF so that the modules do not need to be reconfigured every time power is applied. On reset the PIC loads the values stored in its EEPROM into the 1 6 registers: observe that this also deter- mines the brightness of the LED at power-on. nents form the LCD interface, I 2 C bus and LEDBUS interfaces, and there are four status LEDs, four buttons, an IR re- ceiver and a programming interface. The LCD data bus is connected to Port A of the microcontroller, and the R/W, RS and E signals are connected to port pins PD5, PD6 and PD7. The backlight can be switched on via tran- sistor Tl, connected to microcontroller port pin PD4. PI sets the contrast of the display. Pins PC0 (SCL), PCI (SDA) and PC6 of the microcontroller are taken to the I 2 C connector K6. The connector also carries the 5 V supply and the unreg- ulated 12 V supply, so that 12 V re- lays can easily be used on expansion boards. PC6 acts as an spare enable signal. If I 2 C bus expansion is not re- quired, components K6, R3 and R4 can be dispensed with. The current version of the software does not support the I 2 C bus. PC2, PC3, PC4 and PC5 drive the sta- tus LEDs, with D5 being an infrared LED. The unit can generate RC5 format 62 elektor - 2/2008 K3 C/3 PS2-6PIN K5 CO PS2-6PIN IC1 IJA78L05ACD C2 100n 12 11 10 IN OUT NC GND NC CM — < CO 1 — < CO r^- i — < >— +5V O IC2 o o > MAX491CSD a z o a z o r -0+5V ci 100n K2 fQ Q Q Q Q +5VO — +5V IC3 I GP5 VDD GP0 GP4 GP1 GP3 C/3 GP2 C/3 > PIC12F683-I/SN C3 2u2 K1 0 0 0 0 + 0 R1 1 0R33 | 1W D1 — H 10BQ100 IC4 ZXLD1350ET5CT R4 T1 Vin LX ADJ Isense G MD | ■© " 21- BC850B | (( 1 LI 68uH K4 A C 070495 - 12 Figure 3. Circuit of a power module. Here again a microcontroller (a PIC12F683) provides the intelligence. signals, making it easy to program a remote control that is capable of ‘learn- ing’ commands. PBO, PB1, PB3 and PB4 are connected to buttons, which are not needed for normal operation: they are used for configuring the RC5 code parameters and setting the user inter- face language. All other functions are carried out using the remote control. The LEDBUS interface consists of a MAX491 (IC3) which conforms to the RS-422 differential signalling standard, which is relatively immune to interfer- ence. The LEDBUS also carries the un- regulated 12 V supply, used to supply the PICs in the power modules. The remote control input uses a TSOP1736, which is connected to PB2 on the microcontroller. The device con- verts the 36 kHz-modulated infrared signals into a digital signal. It can be soldered directly to the printed circuit board or, if required in a particular ap- plication, it can be mounted off-board and connected using a cable. In our prototype we wired a stereo audio jack socket to the board, which we could then hide away in a cupboard with just the infrared receiver externally visible. If a 2.5 mm jack socket is used, a Haup- pauge TV card remote control sensor can be pressed into service: indeed, we found that we could connect the sensor to the TV card and to the main unit simultaneously (isolating the pow- er supplies using a diode), and then use a single remote control to operate both. Alternatively, a TSOP1736 and some heat-shrink sleeving will do the job just as well. The 10- way ISP connector K4 is com- patible with the standard Atmel con- Figure 4. Printed circuit board for the main unit. Figure 5. Printed circuit board for a power module. 2/2008 - elektor 63 DRIVING HIGH-POWER LEDS COMPONENTS LIST Power module 070459-1 Resistors R1 = 0Q33 1 W (SMD 2515) R2,R3 = 220Q (SMD 0805) R4 = 1 OkU (SMD 0805) Capacitors Cl ,C2 = lOOnF (SMD 0805) C3 = 2jllF 2 (SMD1 2 10; dielectric X7R or X5R) Semiconductors D1 = 10BQ100 (Schottky) D2,D3 = SMD LED (SMD 1206) T1 = BC850 IC1 = A/A78L05ACD IC2 = MAX491CSD IC3 = PIC1 2F683-I/SN, programmed, Elektor Shop # 070459-41 IC4 = ZXLD1 350ET5CT Miscellaneous LI = 68jllH SMD inductor, 10x10; e.g. Epcos B82464G4683M K1 = 4-way PCB terminal block, lead pitch 5mm K2 = 6-way SIL pinheader K3,K5 = 6-way mini-DIN socket, PCB mount Up to 6 power LEDs; e.g. Luxeon 1W types (see text) PCB, ref. 070459-1 from www.thepcb- shop.com Project software, free download from www.elektor.com COMPONENTS LIST Central unit 070459-2 Resistors R1,R2 = 15kU R3,R4,R6 = 4kQ7 R5 = 33U R7-R10 = IkQ R1 1-R14 = lOkU PI = 1 OkU preset Capacitors Cl ,C2,C4,C5,C6 = lOOnF C3 = IOOjuF 25V radial C7,C8 = 22pF Semiconductors D1 = 1N4001 D3, D4 = LED 3mm; low-current (D2 omitted) D5 = LD271; IR-LED T1 = BC337 IC1 = 7805 IC2 = ATmega32-l 6PC (SMD), pro- grammed, Elektor Shop # 070459-42 IC3 = MAX491CSD Miscellaneous S1-S4 = pushbutton, 6x6 mm XI = 1 6MHz quartz crystal K4,K6 = 1 0-way boxheader K5 = 6-way mini-DIN socket, PCB mount RC-5 receiver, e.g. SFH51 10-36 (on K3) LCD Module witn 2x20 characters; e.g. Displaytech 202A (on K2) PCB, ref. 070459-2 from www.thepcb- shop.com Project software and Guide to Operation, free download from www.elektor.com nector and hence also with USBprog. The power module (Figure 3) uses a Zetex ZXLD1350 (IC4) to drive the LEDs. This device is a step-down con- verter with current regulation, with R1 setting the maximum current through the LEDs. A value of 0.33 Q corre- sponds to a current of 300 mA. With a 24 V supply up to six 1 W LEDs can be driven in series. IC4 is very efficient and there is no noticeable heat dissipa- tion. Control commands are processed by the PIC12F683. The power module needs its own sep- arate power supply: only the PIC is powered from the LEDBUS, via a 78L05 regulator. The microcontroller produces a PWM signal which is used to con- trol the driver IC to dim the LED via Tl. The PIC can generate a PWM sig- nal with a choice of 256 different mark- space ratios, giving 256 different LED brightnesses. The software for the main unit was written using AVR Studio 4 and the free WinAVR C/C + + compiler. Only the interrupt routine is written in as- sembler, the higher-level functions be- ing written in C. The PIC software was written using the free MPLAB environ- ment from Microchip (and is download- ed to the microcontroller using connec- tor K5). The software uses interrupts to react to serial, infrared and LEDBUS signals: the interrupt routines simply set flags, leaving the actual processing to the main program loop. Construction Figure 4 and Figure 5 show the print- ed circuit boards for the main unit and the power module. The latter is chiefly populated with SMD components: the LED driver IC is particularly small. A fine-tipped soldering iron and a good measure of patience are required to solder this device successfully. When using PICkit2 to program the PIC via K2 pin 1 (marked by a triangle) should be nearest the corner of the board. If you are using a ready-programmed microcontroller, K2 may of course be dispensed with. Take care to allow enough space around K1 to connect the programmer if you need to. You will of course need to assemble as many cop- ies of the power module as you need. The main unit employs only one SMD (IC3), which requires care in soldering. The buttons, LEDs, display connector, and IR receiver (if fitted) are soldered to the reverse of the board. After the board has been populated the ATmega is programmed using USB- prog or other suitable programmer. All software files for the project are avail- able for free download from the Elektor website (reference 070459-11). Ready- programmed microcontrollers are also available for purchase from the Elektor shop (see parts list). The power modules are connected in a chain using 6-pin mini-DIN connectors. The first cable runs from the main unit to K3 on the first power module. The second runs from K5 on the first power module to K3 on the next, and so on. A terminator plug (see Figure 7) is fitted to K5 of the last module in the chain. The author has prepared a guide to programming and operation of the system, which for reasons of space we cannot print here. It is, however, avail- able for free download from the Elektor website. ( 070459 - 1 ) Figure 6. A couple of assembled boards in action. 64 elektor - 2/2008 QUASAR electron ics The Electronic Specialists Since 1993 Quasar Electronics Limited PO Box 6935, Bishops Stortford CM23 4WP, United Kingdom Tel: 0870 246 1826 Fax: 0870 460 1045 E-mail: sales@quasarelectronics.cor Web: www.QuasarElectronics.com 7 Postage! & Packing Options (Up to 0.5Kg gross weight): UK Standard 3-7 Day Delivery - £3. 95; UK Mainland Next Day Delivery - £8.95; Europe (EU) - £6.95; Rest of World - £9.95 (up to 0.5Kg) lOrder online for reduced price UK Postage! We accept all major credit/debit cards. Make cheques/PO’s payable to Quasar Electronics. Prices include 17.5% VAT. Call now for our FREE CATALOGUE v/ith details of over 300 kits, projects;, modules and publications. Discounts for bulk quantities. USX A E V: i r: -i Card 177 168 % > LMrrn Motor Drivers/Controllers I Controllers & Loggers Here are just a few of our controller and driver modules for AC, DC, Unipolar/Bi^olar stepper motors and servo piotors. See website for full details. Here are just a few of the controller and data acquisition See website for for all units: Ord full details. S er Code PSU and control units we have uitable PSU 445 £8.95 PC / Standalone Unipolar Stepper Motor Driver Drives any 5, 6 or 8-lead unipolar stepper motor rated up to 6 Amps max. Provides speed and direc- tion control. Operates in stand-alone or PC- controlled mode. Up to six 3179 driver boards can be connected to a single parallel port. Supply: 9Vdc. PCB: 80x50mm. Kit Order Code: 3179KT - £12.95 Assembled Order Code: AS3179 - £19.95 Bi-Polar Stepper Motor Driver Drive any bi-polar stepper motor using externally sup- plied 5V levels for stepping and direction control. These usually come from software running on a computer. Supply: 8-30Vdc. PCB: 75x85mm. Kit Order Code: 3158KT - £17.95 Assembled Order Code: AS3158 - £27.95 Bi-Directional DC Motor Controller (v2) Controls the speed of most common DC _ motors (rated up to 32Vdc, 10A) in both the forward and re- verse direction. The range of control is from fully OFF to fully ON in both directions. The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 3166v2KT - £17.95 Assembled Order Code: AS3166v2 - £27.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common DC motor rated up to 100V/7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-15Vdc. Box supplied. Dimensions (mm): 60Wx100Lx60H. Kit Order Code: 3067KT - £13.95 Assembled Order Code: AS3067 - £21.95 lost items are available in kit form (KT suffix) >r assembled ^nd ready for use (AS prefix). 8-Ch Serial Isolated I/O Relay Module Computer controlled 8- channel relay board. 5A mains rated relay out- puts. 4 isolated digital inputs. Useful in a vari- ety of control and sens- ing applications. Controlled via serial port for programming (using our new Windows inter- face, terminal emulator or batch files). In- cludes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 3108KT - £54.95 Assembled Order Code: AS3108 - £64.95 Computer Temperature Data Logger 4-channel temperature log- ger for serial port. °C or °F. Continuously logs up to 4 separate sensors located 200m+ from board. Wide range ot tree software applications for stor- ing/using data. PCB just 45x45mm. Powered by PC. Includes one DS1820 sensor. Kit Order Code: 3145KT - £17.95 Assembled Order Code: AS3145 - £24.95 Additional DS1820 Sensors - £3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Art. High security 4 channels. Momentary or latching relay output. Range up to 40m. Up to 15 Tx’s can be learnt by one Rx (kit in- cludes one Tx but more avail- able separately). 4 indicator LED ’s. Rx: PCB 77x85mm, 12Vdc/6mA (standby). Two and Ten channel versions also available. Kit Order Code: 3180KT - £44.95 Assembled Order Code: AS3180 - £54.95 DTMF Telephone Relay Switcher Call your phone num- ber using a DTMF phone from anywhere in the world and re- motely turn on/off any of the 4 relays as de- sired. User settable Security Password, Anti- Tamper, Rings to Answer, Auto Hang-up and Lockout. Includes plastic case. Not BT ap- proved. 130x110x30mm. Power: 12Vdc. Kit Order Code: 3140KT - £54.95 Assembled Order Code: AS3140 - £69.95 Infrared RC Relay Board Individually control 12 on- board relays with included infrared remote control unit. Toggle or momentary. 15m+ " range. 112x122mm. Supply: 12Vdc/0.5A Kit Order Code: 3142KT - £47.95 Assembled Order Code: AS3142 - £59.95 PIC & ATM EL Programmers We have a wide flange of low ATMEL Programmers. Comply documentation available from Programmer Ac 40-pin Wide ZIF 18Vac Power su Leads: Parallel (LDC441)£3.95 cessortes: socket (ZIF40W) £14.95 pply (PSU010) £18.95 (ILDC136) £395 /Serial / USB (LDC644) £2.95 (tost PIC and te range anc| bur web site. NEW! USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows XP software. Wide range of ;upported PICs - see website for complete listing. ZIF Socket/USB lead hot included. Supply: 16-18Vdc. Kit Order Code: 3149EKT - £39.95 Assembled Order Code: AS3149E - £49.95 NEW! USB 'All-Flash' PIC Programmer USB PIC programmer for all ‘Flash’ devices. No external power supply making it truly portable. Supplied with box and Windows Software. ZIF Socket and USB lead not included. Assembled Order Code: AS3128 - £44.95 “PICALL” PIC Programmer “PICALL” will program virtu- ally all 8 to 40 pin serial- mode AND parallel-mode (PIC16C5x family) pro- grammed PIC micro control- lers. Free fully functional software. Blank chip auto detect for super fast bulk programming. Parallel port connection. Supply: 16-18Vdc. Assembled Order Code: AS31 17 - £24.95 ATMEL 89xxxx Programmer Uses serial port and any standard terminal comms program. Program/ Read/ Verify Code Data, Write Fuse/Lock Bits, Erase and Blank Check. 4 LED’s display the status. ZIF sockets not included. Supply: 16-18Vdc. Kit Order Code: 3123KT - £24.95 Assembled Order Code: AS3123 - £34.95 www. QuasarElectronics. corn Secure Online Ordering Facilities • Full Product Listing, Descriptions & Photos • Kit Documentation & Software Downloads 2/2008 - elektor 65 TECHNOLOGY LIGHT EMITTING DIODES Power to the Luxeon Rebel - cool on a ceramic die Rob Alferink, Philips Lumileds Lighting Systems R&D LEDs are all the rage lately and the high-power blue and white ones in particular even appeal to unexpected audiences like youths of the msn & mp3 generation who use them to pimp their scooters and PCs. In two short picture stories we tell not only how LEDs are designed and produced (basically!), but also look at what Philips Lumileds Lighting Systems are pursuing technically in a bid at making a versatile high-power LED for mass production. LED basics What's an LED? Electrically, thermally, optically, mechanically? Basic principle An LED (light emitting diode) converts electrical energy into light, with heat as an unwanted and highly problem- atic by-product. The heart of an LED is called ‘die’ (“dai"). A die is composed of several materials specially selected for certain physical properties and exhibiting the so-called semiconductor effect. Its size is approx, lxl mm. To prevent overheating, the die for a high-power LED is secured on a heat- sink that often doubles as the case. electrical connections. The die has wires attached to it for the What basic materials? For red, orange/red and amber LEDs the basic semiconductor material is AlInGaP, where A1 = aluminium In = indium Ga = gallium P = phosphor Blue, cyan and green LED dies are pro- duced using InGaN, where N = nitrogen Ball Bond In a reactor, these materials are ‘sput- tered’ at a certain mixing ratio onto a ruby (wafer-) carrier called the sub- strate. The wafer has a diameter of 2 or 4 inch. 66 elektor - 2/2008 Low power LEI with traditional leads. No problems with high temperatures, so no heatsink required. High power LED; the case/heatsink and the lens/dome are the largest parts. " InGaN technology Patterns may be created using lithography. The positive and negative electrodes are at one side. The LED colour can be chosen from a wide spectrum. In practice, this is achieved by combin- ing several semiconductor materials. How to make white light led shade of white. Blue light from an InGaN LED is con- verted into yellow using a phosphor layer. The result is a carefully control- Making it light An ordinary incandescent bulb can be powered by DC or AC voltage source. An LED can also be powered by a voltage source if a suitably dimen- sioned resistor is included. Howev- er, for more repeatable results and better control of the LED response, the preferred method is pure current sourcing. Lumiramics New technologies allow a thin phos- phor plate to be used instead of a damped-on powder. 2/2008 - elektor 67 TECHNOLOGY LIGHT EMITTING DIODES How the Luxeon Rebel came about The Luxeon Rebel LED from Philips Lumileds has great potential for all sorts of lighting applications where energy wasting fluorescent lights and even incandescent lamps are long overdue for replacement by a smarter, more durable light source. The Rebel has its roots in earlier Luxeon technology. Standard Luxeon These devices can be classified by: 1. Power: • 1 watts • 3 watts • (5 watts) 2. Colour: • red • orange/red • amber • green • cyan • blue • royal blue 3. Radiation pattern: • Lambertian • bat wing • side emitter 'Binning': fine tuning the device selection Within the constraints for colour, pow- er and radiation pattern, LEDs are se- lected in a high-speed automated in- dustrial process. The selection is on • amount of light produced (‘flux’), ex- pressed in lumen (lm) or milliwatts (mW). Advanced radiometric measu- rement is applied. • wavelength (actually, dominant wavelength) • forward voltage The selection employs ‘bins’ and the process is called ‘binning’ (nothing to do with rubbish, hopefully). A selection example for bin code R2H Flux (green) lower (lm) upper [lm] ^dom 1 (green) lower [nm] upper [nm] V f (green) [V] [V] Q 30.6 39.8 1 520 525 H 3.03 3.27 R 39.87 51.7 2 525 530 J 3.27 3.51 S 67.2 87.4 3 530 535 K 3.51 3.75 T 87.4 1 13.6 4 535 540 L 3.75 3.99 5 540 545 M 6 545 550 N 1 Dominant wavelength (A, dom ) is determined for a colour using its coordinates in an x-y colour plane. The classification is meaningful for any primary colour except white. 68 elektor - 2/2008 LEDs on a board Luxeon LEDs can be supplied pre- mounted on boards with several shapes. The individual LEDs are ca- refully selected for equal colour and brightness. Surprising applications include open top deepfreeze cabinets in supermarkets and beverage ven- ding machines. In both cases the co- lour has to be controlled accurately for the best appearance of the foodstuffs and drinks on display. For sure, the co- lour produced by the LED lighting was adjusted from sales results based on Luxeon DCC Star questionnaires and interviews with unsuspecting clients! Luxeon K2 TTFC and K2 Prime TTFC These two members of the Luxeon family are marked by • availability as a Lambertian radiator only • highly suitable for higher currents and temperatures • suitability for reflow soldering (as op- posed to standard Luxeon devices) The basic K2 LED (Luxeon K2 TFFC, thin film flip chip) sustains a current of 1.5 amps! Luxeon Flash products These are white LEDs invariably. They come in two main versions: 1. mounted on a carrier = PWF (F = flash) 2. integrated with a lens = PWM (M = module) The next generation: LEDs on ceramics The ‘Luxeon Rebel’ LED from Philips Lumileds is an unusual member of the Luxeon family in that it is produced on a ceramic die. Ceramics have a long history at Philips, and the relevant manufacturing technologies have been well documented as a result of exten- sive research over many years. Certain ceramics have good heat conducting properties, which helps to prevent the LED die from dying (pun intended) ow- ing to overheating. Heat, by the way, is the main problem LED manufacturers are contending with. It’s kind of obvi- ous since thermal instability and runa- way not only affect important device parameters like forward voltage and life expectancy, but also the colour pro- duced by the LED (however slightly). For further reading Philips Product Datasheet # DS25 on the Luxeon LED and the associated Reliability Datasheet # RD25 delve deep in the technology of Luxeon LED production and application. You can find the documents as free downloads on the web page for this article at www.elektor.com, courtesy of Philips Lumileds Lighting Systems. Further interesting documents may be found at these urls. 1. General information on Lumileds: www.lumileds.com/ 2. Luxeon K2: www. lumileds. co m/p rod u cts/ line.cfm?lineld= 1 8 3. Luxeon Rebel: www.lumileds.com/products/ line.cfm?lineld = 1 9 ( 070906 - 1 ) 2/2008 - elektor 69 TECHNOLOGY LIVINGCOLORS Philips LivingColo Luc Lemmens Strange people they are, the editors and technicians at Elektor. And I count myself among them. They generally show greater enthusiasm for disassembling things than for assembling them. It is therefore not surprising that I counted five colleagues around the table at my request to attack a Philips LivingColors unit with a screwdriver. It must be in our DNA. At first glance the LivingColors — a bit of an unusual name for a lamp — looks more like a set of speakers from Harman Kardon for a Mac. A handsome, transparent, spherical hou- sing which contains a goblet shaped interior that looks more like a speaker than a heatsink. The lamp, on command, con- jures up colours on a light wall and colours the room to your taste. A little bit' to your taste, because to fully appreciate the effect of this lamp all the other lights in the room have to be turned right down. To conjure up all the colours of the rainbow, the lamp is pro- vided with a number of coloured LEDs (2 x red, 1 x green and 1 x blue) which, when combined in various intensities generate the desired colour. It is a very effective demonstra- tion of chromatics from physics class. Philips has been very fond of LEDs recently and has produced various household devices to add colour to your life. The 'singing LED candles' (because the LED is driven by a music chip) from Philips are a great success and this LED application is also certain to find its way to the consumer. Unpacking and disassembling In addition to the lamp the LivingColors box also produces a remote control, a few batteries and, of course, the manual. The goal of the assembled Elektor posse is to disassemble the thing in the shortest possible time. The RF boys rip into the remote con- trol with military precision and the others realise quite quickly that brute, yet gradual force is best for removing the front panel of the lamp. In less than a minute we reach the PCB that also contains the four LEDs. These LEDs generate quite a bit of heat so their bottom side is mounted on the goblet shaped fin in the lamp which acts as the heatsink. An amazing amount of electronics appears to be necessary to get the whole thing to go. There is obviously the RF section for the communication link with the remote control, there are four separate control circuits for driving the LEDs and then a further circuit that drives these four circuits. At the heart of this control circuits sits - surprisingly - an MSP430 processor from Texas Instruments. 70 elektor - 2/2008 Operation The remote control uses a radio link and makes the lamp a very unusual toy. Completely in the style of ' everyth ing-with-an- i-in-front' it has a kind of colour circle on the front. You would expect that this allows you to move continuously through all the colours, but that appears not to be so. It all works with ca- pacitive sensors and you really have to place your fingers in a particular location to get the desired colour. The RF spectrum analyser should have given us an indication regarding the sig- nal from the remote control, but no matter how hard we look- ed, there was only noise. Not that strange: after some detec- tive work, i.e. looking very hard at what is written on the tiny 1C, we learned that the remote control operates at 2.4 GHz. Quick googling of the part number CC2500 shows that it is a 2.4-GHz transceiver from (again!) Texas Instruments. The accompanying antenna is a c osed ] /2 X folded dipole formed with a copper trace on the PCB — says Jan. The remote control also has the ability to activate a few special functions. According to the manual we have to hold the remote control close to the logo on the lamp to make controlling several lamps possible and the same trick can be used to start the demo program. Because there are no sensors that allow the position of the remote control to be determined, we concluded that it works by signal strength detection in the receiver. By holding the remo- te control close the receiver an RSSI-ish control circuit produces a signal that's used to activate the special functions. Everything revolves of course around the LEDs. These are from the Luxeon K2 series from Lumileds. On the circuit board, under- neath the LEDs, there are a large number of vias (plated through holes), which conduct the heat to the surface on the back of the PCB that in turn is in contact with the 'cooling tower'. Thermal conducting paste has been used very sparingly though... Hacked & Cracked Up to now this whole exercise has been more of a 'crack' instead of a 'hack'. Intriguing is the JTAG connection, the foo- tprint for an SMD connector is on the board but the connector itself is not fitted. Through this we would have direct access to the contents of the processor and be able to do nice things ourselves, but in all likelihood Philips will have blown the JTAG fuse in this 1C so that the interface is no longer usable (?). So off the cuff, could the LivingColors lamp be changed into a kind of Ambilight? Perhaps it is possible to drive the remote control separately and obtain other visual effects. Could we use the remote control for other things? Do you have any other ideas or suggestions? The LivingColors lamp is currently heavily discounted. If you want more colour, you can use it to brighten up your home nicely and there are certainly other decorating applications to be found. In any case, we were quite surprised at the quality of the construction — real design, we could say. Now the only thing left is to collect all the loose parts and see if we can put the lamp back together gain. ( 070956 - 1 ) 2/2008 - elektor 71 TECHNOLOGY LABTALK Vista versus LPT Deathblow for the printer port? Paul Goossens Last month in this column we described the problems in our lab con- cerning the use of Vista. The biggest stumbling block appeared to be the parallel printer port. This port is eminently suitable when desig- ning cheap programmers, JTAG-interfaces and the like. With Vista, the new operating system from Microsoft, it appears to be very diffi- cult for electronics enthusiasts to use this very useful interface. That the parallel printer port has been slowly disappearing as a standard interface is clear. Many new computers are no longer fit- ted with a Centronics interface. This port was originally intended to control printers. A long time later, affordable scanners appeared for home use, which also used this parallel port. These days it is common for such devices to be fitted with a USB connection. So it appears logical that the user will not miss the pa- rallel port. Internal debate The debate during an editorial meeting became heated after I sug- gested this topic for this month's Labtalk. Many of those present considered the parallel port a relic from another era. Comments such as "All peripherals have USB!" and "The parallel port is out of date!" were used as counterargument. But for an electronics designer this port is darn handy. (Ab?)use Electronics engineers have received the parallel port enthusiastically. The reason was that there now existed a standard interface, which could be used as a simple l/O-interface. With this interface you could use a number of status lines and 8 data lines as digital outputs. In addition there are a few lines available that can be used as digital inputs. Obviously, the parallel port was not originally invented for this purpose, but that does not mean that you cannot ab(?)use it for your own purposes. During the nineties the parallel port was developed further, resulting in the EPP/ECP-port. The big step forward was that the data lines could now be switched between input or outputs as required. This was very interesting for a number of manufacturers of scanners and other external devices (such as ZIP-drives), because they were now able to send data at a much greater speed. Of course, this also in- creased the usefulness of this port to electronics engineers. Applications Many programmers and JTAG interfaces still make use of the paral- lel port. In many cases you can make a nice programmer with a few standard ICs that is directly connected to the parallel port. The de- velopment of a programmer or JTAG -interface with a USB interface requires considerably more time and especially knowledge. Here at Elektor as well, we have often used the parallel port to drive programmers and the like. It would be a shame if these could no longer be used with Vista. Driver As described in last month's article, we encountered some problems when installing a parallel port PCI expansion card. Our usual programmer that uses this port to program an innumerable range of devices could not cope with this port. The Quartus FPGA software and Altium Designer refused to work as well. No parallel port found, was the message — despite the fact that the driver was installed correctly, according to Windows. After some investigation on the Internet it appeared that the driver is solely intended to control printers, not to use the parallel port as digital I/O. People who bought a PC with a parallel port on the motherboard do not appear to have these problems. Apparently, Microsoft Vista only supports the parallel port on this type of PC. Strategy Microsoft will (just like the motherboard manufacturers) in the fore- seeable future cease to support the old interfaces such as the serial port, parallel port and similar. This is also apparent from two docu- ments on their website, where they outline their strategy to banish this old technology to the museum. Microsoft have chosen for the intermediate solution of continuing to support the parallel port only if it is integrated on the motherboard. Solution It makes absolutely no difference to the processor whether the LPT-port is on an expansion card or whether it is integrated on the mother- board. So perhaps it is nevertheless possible to use our expansion board? The answer appears to be 'YES'. The solution is to force Windows to use the file parport.sys (by de- fault this can be found in the Windows folder) as the driver when installing the expansion board. After this installation, the problems with Quartus and Altium Designer were gone. In all likelihood this trick will also work with all kinds of other software (for example for programming or debugging of con- trollers) when used with Windows Vista. I do have to note that the base address of this LPT port is rather unu- sual, namely EF00-EF07. It is possible that some programs require that the LPT-port has a standard address. If that is not the case then you can just continue to use your parallel port with Vista! ( 070854 - 1 ) Web Links http://download.microsoft.eom/download/l/6/l/161ba512-40e2-4cc9-843a-923143f3456c/ ISAW2.doc www.microsoft.com/whdc/archive/legacylO.mspx 72 elektor - 2/2008 DESIGN TIPS 1 MHz frequency counter using AT89C2051 A +5V © !=□ 10n ^ DO V£L \D2_ \ D3 ^ D4 D5 11 20 © RST P3.0 IC1 P1.0 P3.1 P1.1 P3.2 PI .2 P3.3 PI .3 P3.4 PI .4 P3.5 PI .5 AT89C2051 PI .6 P3.7 PI .7 XI X2 -L I I 33p 24MHz 33p ^ ^ ^ ^ ^ ^ T6 T5 T4 T3 T2 T1 *€) ^ ^ ^ 12 13 b 14 c 15 d 16 e 17 18 y 19 330 Q 3300 3300 3300 3300 3300 3300 BC557 CA :0 ’LL g dp BC557 CA :0 ’LL g dp BC557 CA :0 ’LL g dp BC557 CA :0 ’LL g dp BC557 CA :0 ’LL g dp 10 V A 1 10jaH X h 4700 r Jl_ 220 680n <5> h- 470n XJr. 2x Schottky 2SC945 BC557 CA :0 ’LL g dp 060028-11 Sagjad Mosavi Here's a very simple circuit ca- pable of measuring frequency up to 1 MHz at 1 Hz accuracy without an additional divider or prescaler circuit. The circuit em- ploys an Atmel microcontroller type AT89C2051-24XX as the main part. The input signal should be a square wave with maximum and minimum level of +5 V and 0 V respectively. If you want to apply non-TLL waveforms you may use the level converter around T 7 — it will convert your signal into to a TTL square wave as well as protect the counter from excessive signals swings. To be able to measure higher frequencies, divider (prescal- er) ICs like the SAB6456 or SP8704 may be used. If so, the frequency appearing on display should be multiplied by the divi- sion ratio to obtain the exact frequency in hertz. If you're not into gigahertz'ing then TTL dividers like those good old 74LS93 and 74LS90 with divide ratios like 2, 4, 5, 8 or 10 are a good choice. Such dividers can be cascaded to ob- tain higher ratios but the input frequency must not exceed the maximum stated for the part in its datasheets. The Atmel AT89C2051 is a 20- pin 8-bit microcontroller with 2 k flash memory, 128 bytes RAM and two 1 6-bit timer/ counter blocks. It is used here because of its price/ perfor- mance tradeoff, compatibility with MCS-51 products, low pin count and last but not least... the author being familiar with its programming language! The frequency is measured by counting the number of rising edges of the input clock pulse in one second. The program uses timer/counterO in 1 6-bit counter mode for counting the number of input pulses, and timer/ counterl in 1 6-bit timer mode to set up the one-second gate interval. The routine calculating the frequency stores its result in register bank 0 from R2 to R7. The display routine then shows the results on the 7-segment common-anode displays. To suppress trailing zeroes the pro- gram tests registers for 'zero' content before displaying. For the frequency display, each of the six digits (displays) in the readout is turned on individually and all others will be off while the desired number for that digit is output on the microcontroller's PI port for a short time. The microcontroller then switches on the relevant digit, which shows the number. This action is so fast that you can't see any display flicker. The displays are bussed on the P3 port, with 4.7 kQ resistors at the base of each pnp driver transistor to limit the current. Note that you should use AT89C205 1-24XX in this circuit because a 24 MHZ crystal is used. The AT89C2051 program that's available for free downloading with this article (ref. 060028- 1 1 .zip) may be assembled us- ing any 8051 family assembler likeASM51 assembler and the OHS51 linker. The output will be a .hex file and can be pro- grammed on the microcontroller using a suitable programmer. When building the counter, the display circuitry is best built on a separate board for convenient panel mounting. The regulated +5 V supply volt- age may be provided by a type 7805 regulator. ( 060028 - 1 ) 2/2008 - elektor 73 PROJECTS MINIPROJECT Frost Detector Above or below zero, that's the question Ton Giesberts In rooms without adequate heating but containing sensitive equipment it would be nice to obtain at least an indication as to whether the temperature has dropped below freezing. You then know that the heating is inadequate and that the equipment has to be moved somewhere else. This detector, thanks to its battery powered supply, can be used anywhere in the home. To know whether it is freezing you only need to measure the temperature. This has to be done accurately, of course, and therefore we need to choose a tem- perature sensor that we have some confidence in. The choice has again been made for a type that we have already used in many previous Elektor circuits, the LM35CZ (-40 to 110 °C). This sensor is not expensive and generates an output voltage that is proportional to the temperature in degrees Celsius (10 mV/°C). Sensor An LM35 is normally powered from a single-ended power supply and 0 °C corresponds to an output voltage of 0 V. It is therefore not possible to measure negative temperatures with an LM35 in the standard application circuit. It is however possible to measure negative temperatures if its output is connected to a negative supply voltage via a re- sistor. There needs to be a current of 50 /jA through this resistor (R2 in the schematic). We only need to detect the freezing point with this circuit. That is why the- re is a comparator after the temperatu- re sensor, which turns an LED on if the temperature has dropped below 0 °C during the course of the night. To ensu- re that the comparator operates proper- ly it is necessary that the measurement value can become slightly more nega- tive with respect to the input. To sol- ve this problem, a diode (Dl) has been connected in series with the ground connection of the LM35. The voltage drop across Dl (because of the small current through the LM35 this is only 0.47 V) acts as 'negative' power supply. Since the non-inverting input of com- parator IC2 is connected via R3 to the anode of Dl it functions as the 0°C -re- ference level for the comparator. Comparator The comparator is a standard opamp type TLC271, which we configured for minimal current consumption by connecting the bias -select input (pin 8) to the power supply voltage. There is no need for the detector to be fast and it will therefore work well with the opamp operating in its most economi- cal mode. LED D3 provides the frost indication. It is the intention that the LED stays on once the temperature in the room drops below freezing or when it has been below freezing. To realise this, an asymmetric hysteresis is created with the aid of R3, R4 and D2. The instant that the output goes high, the non-in- +6V © ± BT1 6V s IC1 CO © Cl lOOn LM35CZ R3 100k R2 1N4148 R1 Dl ™N4148 ir> TLC271CP rn C2 lOOn 070785- 11 Figure 1. The frost detector circuit consists of a temperature sensor and comparator with LED indicator. 74 elektor - 2/2008 verting input goes more positive via D2 and R4, and the output therefore stays high. The temperature would now have to increase to more than about 30° be- fore the LED will go out by itself. In practice this probably means that it is summer and that it is not likely to freeze anyway. If need be, the hystere- sis can be increased by increasing the value of R3. Capacitor C2 is added to make sure that the LED remains off (the circuit is reset) when the power supply is connected. The non-inverting input of the opamp is briefly connected to ground and the output is therefore low. R1 and SI are only required if the cir- cuit needs to be reset when the battery is connected. Instead of SI you could also use a power supply switch or even just simply disconnect the battery for a moment. Thrifty Power supply Since the circuit is assumed to be powered from a battery there was a conscious effort to minimise the power consumption. The current consumption of the prototype, at a power supply vol- tage ranging from 6 to 9 V, was less than 120 /JA . When the LED is on, the current consumption rises to only 1 mA at 6V and 1.8 mA at 9V, because a low- current LED is used. In our prototype we used a green, low-current LED. If four AA penlight batteries (with a ca- pacity of about 2 Ah) are used, then the circuit will run for about two years in standby mode. When the LED is on this is considerably shorter, of course (about two months, this is easily long enough to run through a severe winter period). A standard 9-V battery will also last a single winter, provided you frequently check whether the LED is on. Finally, a comment about the TLC- 271CP used here. The version with the C -suffix is specified for an operating range from 0 to 70 °C, but will continue to work at lower temperatures, parti- cularly considering that the IC is not Figure 2. The prototype built on a piece of perforated prototype board. used in a linear application. If in doubt you can always try to get your hands on a version with the I-suffix (that is, TLC271IP: -40 to 125°C). But that is only necessary if you expect it to be real cold in the monitored room... Quick assembly The circuit contains very few parts and can therefore be easily built on a small piece of prototyping board. There is no need to calibrate anything, once built it is ready to go. ( 070785 - 1 ) 2/2008 - elektor 75 INFOTAINMENT PUZZLE Puzzle with an electronics touch Are you bothered by spring depressions? Then hopefully a few hours of puzzle solving will cheer you up. Elektor's Hexadoku is great medication, free but admittedly slightly addictive. Solving a Hexadoku is harder than a Sudoku and should take much longer. Correct answers again enter a prize draw for one of the prizes: an E-blocks Starter Kit Professional and three Elektor Shop vouchers. The instructions for this puzzle are straightforward. In the diagram composed of 1 6 x 1 6 boxes, enter numbers such that all hexadecimal numbers 0 through F (that's 0-9 and A-F) occur once only in each row, once in each column and in each of the 4x4 boxes (marked by the thicker black lines). A number of clues are given in the puzzle and these determine the start situation. All correct entries received for each month's puzzle go into a draw for a main prize and three lesser prizes. All you need to do is send us the numbers in the grey boxes. The puzzle is also available as a free download from our website. SOLVE HEXADOKU AND WIN! Correct solutions received enter a prize draw for an E-blocks Starter Kit Professional worth £248.55 and three Elektor SHOP Vouchers worth £35.00 each. We believe these prizes should encourage all our readers to participate! The competition is not open to employees of Elektor International Media b.v., its business partners and/or associated publishing houses. PARTICIPATE! Please send your solution (the numbers in the grey boxes) by email to: editor@elektor.com - Subject: hexadoku 2-2008 (please copy exactly). Alternatively, by fax or post to: Elektor Hexadoku Regus Brentford - 1000 Great West Road - Brentford TW8 9HH United Kingdom - Fax (+44) 208 2614447 The closing date is 1 March 2008. PRIZE WINNERS The solution of the December 2007 puzzle is: 97C65. The E-blocks Starter Kit Professional goes to: Tim Eames (UK). An Elektor SHOP voucher worth £35.00 goes to: Kjell A. Lover (N); Terje Daleng (N) and Charles Metcalfe (SA). Congratulations everybody! D B 9 5 E 8 1 C 9 7 1 C 8 B A 4 6 4 0 8 7 1 3 5 9 C 8 7 F A 2 4 B D 7 4 1 5 4 2 0 B A C 1 8 6 A F 5 2 9 D C 2 8 1 7 9 A 3 E 5 B 0 8 E B C 9 6 1 A 3 D 5 0 A E 6 1 A F 5 D C 2 8 5 8 3 C 6 4 1 A D 1 E 6 5 4 2 7 3 D 0 8 F B 3 8 1 4 6 7 2 4 0 D 1 6 F 8 3 (c) PZZL.com 5 7 D B E 6 0 F 4 A 1 8 9 2 C 3 3 4 8 A 2 9 B D 5 C 0 F 1 E 6 7 0 C F 2 5 1 7 3 6 E D 9 8 B A 4 6 9 E 1 4 A C 8 3 7 2 B 0 D F 5 1 0 2 E F 8 4 B D 9 7 C 6 5 3 A A 3 5 8 C 0 E 1 F 4 B 6 D 7 2 9 C F 7 D 9 5 3 6 E 8 A 2 B 4 0 1 9 6 B 4 D 2 A 7 0 3 5 1 F C E 8 F 1 4 3 7 B D 0 A 6 E 5 2 8 9 C 8 E 0 C 3 F 5 2 9 1 4 D 7 A B 6 7 B A 5 6 4 8 9 C 2 3 0 E 1 D F 2 D 6 9 A C 1 E 8 B F 7 5 3 4 0 4 A 9 F B 7 6 5 1 D C E 3 0 8 2 B 5 C 7 0 E 9 A 2 F 8 3 4 6 1 D E 8 3 6 1 D 2 C 7 0 9 4 A F 5 B D 2 1 0 8 3 F 4 B 5 6 A C 9 7 E 76 elektor - 2/2008 RETRONICS INFOTAINMENT Programmable disco lights array (1984) Jan Buiting Some time during the ear- ly 1980s, a trend grew to add light effects and someone called 'disc jockey' to parties originally about drinking, socializing and getting your ears slammed with loud music. 'Disco' was born and what a hype it was — not just pounding electronic drums and synthesizers but also glam- orous matching attire for all & sundry under 20 or so. The drinks and music were hand- ed down by the 70's scene but the lights were relatively new. The best disco was one with several dark nooks and crannies, badly lit bars, a very loud PA, a disc jockey with a not too small ego and, most importantly, a brutally illuminated dance floor for eve- ryone to show off nimbleness or, like Mr Bean, make a complete fool of himself. Elektor in 1984 saw a niche for a disco lights controller that was unusual and novel in not being limited to dull, fixed light pat- terns. In other words, the keen user of the ambitious project printed in the February 1984 is- sue of Elektor could really make the crowd go bezerk with light effects far more 'groovy' than those of a simple light organ, a couple of coloured floodlights and of course the corny globes on the ceiling. The Elektor project offered no fewer than 32 programs in mem- ory to control up to 30 lights in- dividually. The associated triac driver unit was a separate unit described in, you guessed it, the March 1 984 issue. The disco lights controller used four 2 k x 8 static RAMs type 6116 or 5517 for its memory. The light patterns were 'pro- grammed' using flip switches and LEDs on the front panel. A couple of 7-segment LED dis- plays were provided to act as readouts for addresses, banks and programmes. Funny to think that all three terms have survived right into the microcontroller and FPGA era we're enjoying right now. A clever speed control ('clock') was added to the circuit, helping the DJ or MC to link the speed of the light effects to the bpm (beats per minute) of the music played. Patterns could be 'stepped' too, and there was even a repeat timer with a range of 1 / 8th to 16 minutes. How primitive it looks now compared with auto- bpm-locking sound and light equipment available today. To make sure the many hours of meticulous programming of light patterns into all four banks were not a waste a time when the unit was switched off, a mem- ory backup battery was provid- ed on the CMOS RAM supply. It consisted of three AA Nicads or 1.5 V alkalines in a plastic holder mounted off the board (good! no risk of corroding the board). If dry cells were used, a resistor had to be cut to prevent charging. The prototype of the Elektor Dis- colights unit I rescued from our old offices in Beek, Holland, measures 48x17x8.5 cms in a clear attempt at making it 19- inch rack compatible. The unit was impeccably built by Jan Viss- er who's still on our lab staff. At Jan's advice I removed 3 Nicads from the battery holder and found that they were certainly beyond rescue after a good 25 years. A large sub-D connector is avail- able at the rear side to hook up the triac power controller. The large blue circuit board is typi- cally 'Elektor', single-sided (!) and stuffed with components like 0.25 watt carbon resistors, high 1C sockets, blue electrolyt- ics, wire links, solder pins and of course those horrible 'na- ked' grey&silver MKT capacitors. These parts now strike me as 'bulky' but then that's no more than a heavily SMD-affected perception. With 3 kilowatts or so flashing under triac control the complete discolights kit must have been a regular EMC nightmare but then nobody cared about such EU regulations any more than be- ing home in bed after the disco closed! ( 070856 - 1 ) Retronics is a monthly column covering vintage electronics including legendary Elektor designs. Contributions, suggestions and requests are welcomed; please send an email to editor@elektor.com 2/2008 - elektor 77 ELEKTOR SHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1 932 564999 ATC SEMITEC LTD www. atcse m itec . co . u k Thermal and current-sensitive components for temperature control and circuit protection; • NTC Thermistors • Current Diodes • Thermostats • Re-settable Fuses • Thermal Fuses • Temperature Sensors Call today for free samples and pricing Tel: 01 606 871 680 Fax: 01 606 872938 AVIT RESEARCH www.avitresearch.co.uk USB has never been so simple... with our USB to Microcontroller Interface cable. Appears just like a serial port to both PC and Microcontroller, for really easy USB connection to your projects, or replacement of existing RS232 interfaces. See our webpage for more details. From £10.00. BETA LAYOUT www.pcb-pool.com Beta layout Ltd Award- winning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer’s prices. Fj 43 B0W00D ELECTRONICS LTD www. bowood-electronics.co.uk Suppliers of Electronic Components • Semiconductors • Opto Electronics • Passives • Enclosures • Switches • Stripboard • PCB Materials • Popular Special Offer Packs Online Store, all major cards Same day despatch upto 3.00pm Personal Service sales@bowood-electronics.co.uk BYVAC ELECTRONICS www.byvac.co.uk 32Bit ARM Microcontroller, USB, built in RTC with itis own operating system, no complex tools, just a terminal emulator, start writing programs in 20 minutes. Complete with CD-ROM, Software and 100 Page Foundation book DECIBIT CO.LTD. www.decibit.com Smallest 2.4 GHz ISM band MCU embedded transceiver modules. Complete tiny solution, ready to transmit RF data by only attaching as example a CR2032 coin cell to it. DESIGNER SYSTEMS http://www.designersystems.co.uk Professional product development services. • Marine (Security, Tracking, Monitoring & control) • Automotive (AV, Tracking, Gadget, Monitoring & control) • Industrial (Safety systems, Monitoring over Ethernet) • Telecoms (PSTN handsets, GSM/GPRS) • Audiovisual ((HD)DVD accessories & controllers) Tel: +44 (0)1872 223306 EasyDAQ www.easydaq.biz We design & supply low cost USB/RS232 based data acquisition, automation & control products: • USB connected & powered, 8 opto isolated voltage inputs chans, 4DI0 & 4 onboard relays capable of switching 240V@10A. With Labview, VC & VB examples - £60 EASYSYNC http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multi- port USB to RS232/RS422 and RS485 converters at competitive prices. ELNEC www.elnec.com • device programmer manufacturer • selling through contracted distributors all over the world • universal and dedicated device programmers • excellent support and after sale support • free SW updates • reliable HW • once a months new SW release • three years warranty for most programmers YOUR ELECTRONICS OPEN SOURCE http://dev.emcelettronica.com Website full of Projects and Resources for Electronics Engineers and DIY. • Tutorial • Hardware (Schematic & Gerber) • Firmware (Asm & C) • Reference Design Everyone can submit a story as a useful source! 'Share for life' FIRST TECHNOLOGY TRANSFER LTD. http://www.ftt.co.uk/PICProTrng.html Microchip Professional C — ^ and Assembly f^^eTwpjw Programming Courses. Transfer Lw. The future is embedded. Microchip Consultant /Training Partner developed courses: • Distance learning / instructor led • Assembly / C-Programming of PIC1 6, PIC1 8, PIC24, dsPIC microcontrollers • Foundation / Intermediate FLEXIPANEL LTD www.flexipanel.com TEAclippers - the smallest PIC programmers in the world, from £20 each: • Per-copy firmware sales • Firmware programming & archiving • In-the-field firmware updates • Protection from design theft by subcontractors FUTURE TECHNOLOGY DEVICES http://www.ftdichip.com FTDI designs and sells USB-UART and USB-FIFO interface i.c.’s. Complete with PC drivers, these devices simplify the task of designing or upgrading peripherals to USB FUTURLEC http://www.futurlec.com Save up to 60% on • Electronic Components • Microcontrollers, PIC, Atmel • Development Boards, Programmers Huge range of products available on-line for immediate delivery, at very competitive prices. ILP ELECTRONICS LTD www.ilpelectronics.com Tel +441233750481 Fax +441 233750578 ILP have been manufacturing audio modules since 1 971 and apart from our standard range we also offer a custom design service for the OEM market. LONDON ELECTRONICS COLLEGE http://www.lec.org.uk Vocational training and education for national qualifications in Electronics Engineering and Information Technology (BTEC First National, Higher National NVQs, GCSEs and Advanced Qualifications). Also Technical Management and Languages. 78 elektor - 2/2008 products and services directory MARCHAND ELECTRONICS INC. www.marchandelec.com • power amplifier modules • electronic crossovers solid state / valve / passive • valve amplifiers • phono preamps • handheld sinewave generator • kits or assembled • software electronic instruments • custom design services MQP ELECTRONICS www.mqp.com • Low cost USB Bus Analysers • High, Full or Low speed captures • Graphical analysis and filtering • Automatic speed detection • Bus powered from high speed PC • Capture buttons and feature connector • Optional analysis classes NEW WAVE CONCEPTS www.new-wave-concepts.com Software for Hobbyists: • Livewire - circuit simulation software, only £34.99 • PCB Wizard - PCB design software, only £34.99 • Circuit Wizard - circuit, PCB and breadboard design software, only £59.99 Available from all Maplin Electronics stores and www.maplin.co.uk RADIOMETRIX www.radiometrix.com The leading global developer of ISM band, low power radio modules for wireless data transmission: • Transmitters • Receivers • Transceivers • RF modems • Evaluation Kits ROBOT ELECTRONICS http://www.robot-electronics.co.uk Advanced Sensors and Electronics for Robotics • Ultrasonic Range Finders • Compass modules • Infra-Red Thermal sensors • Motor Controllers • Vision Systems • Wireless Telemetry Links • Embedded Controllers ROBOTIQ http://www.robotiq.co.uk Build your own Robot! Fun for the whole family! • MeccanoTM Compatible • Computer Control • Radio Control • Tank Treads • Hydraulics Internet Technical Bookshop, 1-3 Fairlands House, North Street, Carshalton, Surrey SM5 2HW email: sales@robotiq.co.uk Tel: 020 8669 0769 COMPONENTBIN.COM www.componentbin.com Kickstart your development with modules and parts from componentbin.com • ARM7 modules • Ethernet modules • Superb Graphic LCD displays (all with example software) and much much more... Online ordering and great prices! ULTRALEDS ui trai * http://www.ultraleds.co.uk tel: 0871 7110413/01625 576778 Large range of low cost Ultra bright leds and Led related lighting products. Major credit cards taken online with same day depatch. USB INSTRUMENTS http://www.usb-instruments.com USB Instruments specialises in PC based instrumentation products and software such as Oscilloscopes, Data Loggers, Logic Analaysers which interface to your PC via USB. VIRTINS TECHNOLOGY www.virtins.com PC and Pocket PC based virtual instrument such as sound card real time oscilloscope, spectrum analyzer, signal generator, multimeter, sound meter, distortion analyzer, LCR meter. Free to download and try. SHOWCASE YOUR COMPANY HERE Elektor Electronics has a feature to help customers promote their business, Showcase - a permanent feature of the magazine where you will be able to showcase your products and services. For just £220 + VAT (£20 per issue for eleven issues) Elektor will publish your company name, website address and a 30-word description For £330 + VAT for the year (£30 per issue for eleven issues) we will publish the above plus run a 3cm deep full colour image - e.g. a product shot, a screen shot from your site, a company logo - your choice Places are limited and spaces will go on a strictly first come, first served basis. So-please fax back your order today! _ n I wish to promote my company, please book my space: • Text insertion only for £220 + VAT • Text and photo for £330 + VAT NAME: ORGANISATION: JOB TITLE: ADDRESS: TEL: PLEASE COMPLETE COUPON BELOW AND FAX BACK TO 00-44-(0)1932 564998 COMPANY NAME WEB ADDRESS 30- WORD DESCRIPTION 2/2008 - elektor 79 BOOKS, CD-ROMs, KITS & MODULES Going Strong A world of electronics frQiMrtigle shop! Detect stuffy air before you doze off C0 2 Measurement (January 2008) Carbon dioxide (C02) is not just a threat to the environment, it is also an important and often ignored factor in determining air quality in the office and at home. Too high a concentra- tion of C02 leads to feelings of tiredness, disturbs concentration, and causes headaches. The Elektor C02 meter makes it easy to determine the concentration of carbon dioxide in the air. A microcontroller monitors the measured value and can trigger an alarm or start up a ventilation system when a preset threshold is exceeded. Kit of parts, PCB, Sensor PCB, ATtiny26 and display Art.# 070802-71 • £107.50 • US$215.00 Reflow Solder Controller (December 2007) The Elektor lab needs to solder SMDs more often these days, something that undoubtedly also applies to many of our readers. In the January 2006 issue we described in some detail how you could build your own reflow oven using an in- expensive electric oven. That article result- ed in many comments from our readers, which confirmed to us that there was a lot of interest in such a project. We now present a completely new version of the control electronics for a DIY SMD oven. Populated PCB with enclosure Art. #060234-91 • £171.80 • USS 343.60 USB Flash Board (November 2007) Flash microcontrollers are easy to pro- gram. In the past, program code was usually downloaded via a serial inter- face, but nowadays many PCs (espe- cially laptops) only have USB ports. This versatile Flash Board provides a solu- tion to this problem. It is built around an AT89C5131A, which is an extend- ed 8051 -family microcontroller with an 80C52 core and a Full Speed USB port. As a sort of bonus, the 1C has a complete update interface for downloading new firmware. Atmel also provides suitable software in the form of its FLIP program, which is available free of charge. Construction kit including the PCB and all parts Art. #070125-71 • £36.20 • US$ 72.40 v y v y Prices and item descriptions subject to change. E. & O.E 80 elektor - 02/2008 All articles published in 2007 Elektor 2007 Year volume CD-ROMs are among the most popular items in Elektor's product range. This CD-ROM contains all edi- torial articles published in Elektor Vol- ume 2007. Using the supplied Acrobat Reader program, articles are presented in the same layout as originally found in the magazine. An extensive search ma- chine is available to locate keywords in any article. 978-90-5381-218-1 • £16.90 • US$33.80 PIC Microcontrollers W jVs.r.Tli A: - llr^jrcnm l Silent alarm, poetry box, night buzzer and more! PIC Microcontrollers This hands-on book covers a series of exciting and fun projects with PIC micro- controllers. You can built more than 50 projects for your own use. The clear ex- planations, schematics, and pictures of each project on a breadboard make this a fun activity. You can also use it as a study guide. The technical background infor- mation in each project explains why the project is set up the way it is, including the use of datasheets. This way you'll learn a lot about the project and the microcon- troller being used. Even after you've built all the projects it will still be a valuable ref- erence guide to keep next to your PC. 446 pages • ISBN 978-0-905705-70-5 £27.00 • US$ 54.00 More than 68,000 components Elektor's Components Database 4 The program package consists of eight databanks covering ICs, germanium and silicon transistors, FETs, diodes, thyristors, triacs and optocouplers. A further eleven applications cover the calculation of, for example, LED series droppers, zener diode series resistors, voltage regulators and AMVs. A col- our band decoder is included for de- termining resistor and inductor values. ECD 4 gives instant access to data on more than 68,000 components. All databank applications are fully in- teractive, allowing the user to add, edit and complete component data. This CD-ROM is a must-have for all elec- tronics enthusiasts. ISBN 978-90-5381-159-7 • £15.90 • US$31.80 v ' More information on the Elektor Website: www.elektor.com Elektor Regus Brentford 1 000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 20 8261 4509 Fax: +44 20 8261 4447 Email: sales@elektor.com r^llektor LT3shop 309 CIRCUITS r \ Fully elaborated electronics projects 309 Circuits The present tenth edition of the popular '30x Circuits' series of books once again contains a comprehensive variety of cir- cuits, sub-circuits, tips and tricks and de- sign ideas for electronics. Among many other inspiring topics, the following cate- gories are well presented in this book: test & measurement; RF (radio); com- puters and peripherals; audio & video; hobby and modelling; microcontrollers; home & garden; power supplies & bat- tery chargers; etcetera. 432 pages • ISBN 978-0-905705-69-9 £19.95 -US$39.95 for Electronics Engineering Applicant] b$ 5.0, 6.0, VBA, .NET, 2005 Visual Basic for Electronics Engineering Applications This book is targeted towards those peo- ple that want to control existing or self- built hardware from their computer. After familiarizing yourself with Visual Basic, its development environment and the tool- set it offers are discussed in detail. Each topic is accompanied by clear, ready to run code, and where necessary, sche- matics are provided that will get your projects up to speed in no time. 476 pages • ISBN 978-0-905705-68-2 £29.00 • US$ 58.00 v j 02/2008 - elektor 81 PRODUCT SHORTLIST, BESTSELLERS ~\ February 2008 (No. 374) LEDBUS System 070459-1 PCB, power module 070459-2 PCB, central 070459-41 ....Programmed microcontroller, power module 070459-42 .... Programmed microcontroller, central RGB LED Mood Lighting 070892-1 Printed circuit board 070892-2 Printed circuit board 070892-3 Printed circuit board 070892-41 ....Programmed microcontroller Surround Light for PC Monitor 070491 -1 Printed circuit board 070491 -2 Printed circuit board 070491 -91 .... PCB, partly populated with SMDs LED Ringflash 07061 2-1 Printed circuit board 07061 2-41 .... Programmed controller 070612-81 ....Software on CD-ROM TV Surround Light 070487-1 Printed circuit board 070487-41 ....Programmed microcontroller 070487-42 .... Programmed microcontroller 070487-81 ....Software on CD-ROM CAN Explorer 060201 -1 Printed circuit board, MCP251 5 and MCP2551 SN 060201 -W Testing & Error Sources Manual Thermometer / Thermostat 070852-11 ....Software £ US$ see www.elektor.com see www.elektor.com see www.elektor.com see www.elektor.com see www.elektor.com see www.elektor.com see www.elektor.com see www.elektor.com 21.50 43.00 5.00 10.00 see www.elektor.com www.thePCBshop.com 10.50 21.00 5.20 10.40 21.50 43.00 12.70 25.40 10.50 21.00 5.20 10.40 see www.elektor.com see www.elektor.com see www.elektor.com January 2008 (No. 373) C0 2 Measurement 070802-1 PCB, bare 070802-41 .... Programmed controller ATtiny26 070802-71 .... Kit of parts, PCB, Sensor PCB, ATtiny26 and display 070802-81 Software on CD-ROM Anti-Standby Switch 070797-1 PCB, bare 070797-41 .... ATtiny25, programmed Control for Energy-saving Lamps 070638-71 .... PCB, FAN771 ON and 2.5mH coil Versatile DC Power Meter 070559-1 PCB, bare 070559-41 .... Programmed controller ATmega8-l 6P December 2007 (No. 372) Reflow Solder Controller 060234-91 .... Populated PCB with enclosure AVR Web Server 060257-1 Printed circuit board 060257-41 .... ATmega644, programmed Craft Drill Controller 060291 -1 Printed circuit board Christmas Flasher 010032-91 ....Kit of parts LED's Dive! 07001 1 -1 Printed circuit board November 2007 (No. 371) USB Data Acquisition Card 070148-1 PCB, bare 070148-41 .... PIC1 8F4550 DIP40, programmed 070148-81 ....Software on CD-ROM Line Switcher 060288-1 PCB, bare Headphone Amp with 3D Sound 070393-1 PCB, bare ..14.40 28.80 ....7.20 14.40 107.50 215.00 ....5.20 10.40 ..14.40 28.80 ....5.20 10.40 ..14.40 28.80 ....9.30 18.60 ....9.00 18.00 171,80 343,60 9,60 19,20 13,80 27,60 www.thePCBshop.com 3,60 7,20 www.thePCBshop.com 9.50 19.00 15.50 31.00 5.20 10.40 www.thePCBshop.com www.thePCBshop.com / Prices and item descriptions subject to change. E. & O.E Bestsellers m r mi* \ Od 1 4 5 2 3 4 5 1 2 PIC Microcontrollers ISBN 978-0-905705-70-5 £27.00. USS 54.00 309 Circuits ISBN 978-0-905705-69-9E1 9.95 USS 39.95 Visual Basic for Electronics Engineering Applications ISBN 978-0-905705-68-2 £29.00 .....USS 58.00 Microcontroller Basics ISBN 978-0-905705-67-5 E19.50.....USS 39.00 PC Interfaces under Windows ISBN 978-0-905705-65-1 £27.25 .....USS 54.50 ECD4 ISBN 978-90-5381-159-7. £15.90. US$31.80 Ethernet Toolbox ISBN 978-90-5381-214-3 £1 8.90..... USS 37.90 Home Automation ISBN 978-90-5381-195-5 £13.90. USS 27.80 USB Toolbox ISBN 978-90-5381-2 1 2-9 £1 9.90 .....USS 39.80 Robotics ISBN 978-90-5381-179-5 £12.90. US$ 25.80 USB Flash Board Art. # 070125-71 £36.20 .....USS 72.40 Reflow Solder Controller Art. # 060234-91 E171.80...USS 343.60 C0 2 Measurement Art.# 070802-71 E107.50...USS 215.00 1 2 3 a Stand Alone OBD-2 Analyser k* ccc on i icc l Art. # 070038-72 E55.20...USS 1 10.40 USBprog Art. # 060224-71 £18.80 .....USS 37.60 Order quickly and safe through www.elektor.com/shop or use the Order Form near the end of the magazine! Elektor Regus Brentford 1000 Great West Road Brentford TW8 9HH * United Kingdom Tel. +44 20 8261 4509 Fax +44 20 8261 4447 Email: sales@elektor.com lektor SHOP 82 elektor - 02/2008 MAYIWE You save: Subscript." *> LUS e^q 00 1 0 magazines S’ 80 1 double issue (July/August) ; B s £47.20 your saving lektoi SeLSnicswoiMw" 1 ' Keep The Elektor PLUS subscription £ 47.2 in your pocket! 1 1 x Elektor PLUS Cheaper than 1 1 issues from the newsstand Subscribers get up to 40% discount on special Elektor products As a welcome gift you get a free 1 GB MP3 player worth £34.50 No queues, travelling, parking fees or “sold out” Elektor is supplied to your doorstep every month Always up to date - read your copy before everyone else www.elektor.com/subs Tel. +44 (0) 20 8261 4509 Or use the subscription order form near the end of the magazine. INFO & MARKET SNEAK PREVIEW Data logger with flash memory Sure, data loggers have been published before in Elektor, but this one's special with an LCD and a serial connection. The logger has four analogue inputs and a measurement range of 0 to 5 V. Data is stored in flash memory using an SD memory card fitted on the board. Five different logging modes are available: manual triggering, external trigger- ECIO PLC board Here's the first real-life application of ECIO modules introduced in the October 2007 issue of Elektor. An ECIO module acts as the brains of a PLC board that has relays, opto-isolators, CAN connectivity and an LCD. All this I/O capacity together with Flowcode allow the board to act as versatile, powerful PLC for quite complex control and automation projects. The LCD module is used to display ASCII characters to the user as a means of troubleshooting during the software development stage or for monitoring the system. I 2 C analyser The l 2 C or 'Inter-IC' bus has seen applications for many years already as 'glue' between complex ICs in electronic equipment. The simplicity of the l 2 C bus really calls for DIY ap- plications. Unfortunately, tracing error conditions on the l 2 C bus is not trivial and in fact requires special test equipment. Our l 2 C analyser is simple and easy to use. The compact circuit is hooked up to an l 2 C bus and displays received data on the PC via a USB connection. The PC does all the data dissecting using clever software. RESERVE YOUR COPY NOW! The March 2008 issue goes on sale on Thursday 28 February 2008 (UK distribution only). UK mainland subscribers will receive the magazine between 22 and 25 February 2008. Article titles and magazine contents subject to change, please check www.elektor.com. NEWSAGENTS ORDER FORM SHOP SAVE / HOME DELIVERY Please save / deliver one copy of Elektor magazine for me each month Name: Address: Post code: Telephone: Date: Signature: Please cut out or photocopy this form, complete details and hand to your newsagent. Elektor is published on the third Thursday of each month, except in July. Distribution S.O.R. by Seymour (NS). w.elektor.com www.elektor.com www.elektor.com www.elektor.com www.elektor. Elektor S3 the web All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable) can be instantly viewed to help you positively identify an article. Article related items are also shown, including software down- loads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. lektor. 3 Issues for only l*«l«ctrontci worldwide ^ J £7^95 * Horn. Now. Mjtgjiiinn Shop Sobwnbo now Forum Sorvtco loctronlcs worldwide In the Elektor Shop you'll find all other products sold by the publishers, like CD-ROMs, kits and books. A powerful search function allows you to search for items and references across the entire website. Also on the Elektor website: • Electronics news and Elektor announcements • Readers Forum • PCB, software and e-magazine downloads • Surveys and polls • FAQ, Author Guidelines and Contact 3 product* hr fcat CS 0.00 d m tpMUt CnrtfEmti a m ewwr 3 |i*