Elektor Electronics July
Transcription
www.elektor-electronics.co.uk JULY/AUGUST 2007 £ 5.65 platform voor elektronica DOUBLE SUMMER ISSUE Sensors Actuators Microcontrollers Power Supplies & Chargers Mechanics Communications Tips & Tricks Miscellaneous R34 = ( ; 10 ,44;; ===5?0 0;84006 81 /;48?2 09?29 2 00; - 3< 8 >; 84< 8 2 0;84064;81;3 / ;48 488<;4< 1 ; &%()$&!$'( 5.;;29B6A.?:=96362?!6A .0</ @".112?645 +<9A.426@=9.F!6A #79 71 < 1 2 5::7:8@?:894 <A<6<89?=@?87? ?8D<8??88B8=8?<778?9 D?:8=:87=8<<9 E82:=?A87?@@87=78? ::B8?<7B<< 78<A8?8@<?A@<7<D <@78. $?8@B?8<778?7 <<8<8?=8 G4?68?D? "#=% B8? @<D?8>@?87 (A2?2<+*.;1&2.8#2A2?!6A #@?8<D=?@7<?8A8 <<78@?8=@=?8?7<8A8< 2:@A8?D?8A87@8B8=8 6??:7<D<<8A8<7?88 ?8<=82:8?8?8@=68?97<D 8<876::8<:?8:<77<<8A8< <6?9?8:8=8?87;@6<8 @<87B:. $+ %7 <<8<8?=8 #@?DB:7$9? <6A87$ G 8<@787@8 )$ * :4 ,!=19; '948$.@ +3;2764; 2:8@8AD98:9:89@?:8< 7;@6<89?=98B=<<A<A8?A<D@<@ ?89@<9?==?:8<8<8A8< <9?= %<D8?8#:87:8=<98??@ <<@7879?=?@?8#:?888&/ <8?87=:A8?DA8?<8 =C8?:B<<8?89?= 4% <@78 . $B: A8?<D7 <<8<8? =8 <@A %?12?+.9B2 <@A %?12?+.9B2 H H H H H H H H H H H H H H #.ED2645A9/842.C62? =.?029@&%#6;6:B:<?12?H $<A2&?<1B0A@.?216@=.A05213?<:B@A?.96. @<9<0.90B@A<:@1BAF.;1A.E2@:.F.==9F <DA<<?12? &5<;2.99B@A?.96.;.@A2?;(A.;1.?1)6:2 #<;?6<; :.69A205@A<?27.F0.?2920A?<;60@0<B8 &<@A&%%-(69C2?D.A2?$(,B@A?.96. E=20A.F@<?6?=.?0291296C2?F +.?6./92<<@A!6A3<? )B?/<05.?42?@ #G?2>B2;0F#2A2?#!!6A 2:=<B,)E'?8>@8D,88? A<@6<89?8?A772:@?787 A8?98@?8@=79@)E )E,)E?()E7?8<8?<@78. $ B:A8?<D8<@?8+ %7<<8<8? =8 #79 G7?87+ % 71 < 1 2 G.?8<8?B: G?8<@=78 G.B8?876DC ###68?8 ?% <@ *FA8?D=<8?@B:<D98B =8=79D:89?D6<8A8<* B?6D8?8:86<9?=:8 ?F88=8=8=@8?7 =79D:87@DD<89:8<87< @<87:?9?=B:. $7A8?<D7 <<89878<8?=8 * :4 ,! =19;'948 & )@ (; ;;?9 3=8 &?<4?.::./92645;2?4F4;6A6<;(F@A2: 4;6A6<;(F@A2: 4;6A6<;<69?6C2? 2:7A877A8?<8D8=68@876:B9@??8882:8 D8=68@87=79D:89?D=?:869?7<8 D8=B:A?6<8=8<8?<?<78@<87B: . $7887<<8<8?=8 '8@?8<@78! %"818; G2=?8?77A8A8?B78?8 G1@6<89?<8<D8= G%B8<<7;@=8 G1<8?7@<=?8 G,C=0.,7;@=8 G-<8 G-<<7?A8? #77:<7?A8?:8 .??==6<8*1D8=7D@:A8=<88 7<8D8=:B<<?8?9?=?8 9@?8<@7)<<&9988?< 8??:8A<<9?=:8?F& 3 <@78. $B:A8?<D7<<8987=8 .;1<;A?<992? 2:+ %:7?<<8??8>@?877@?:8<8@ ?87@?8*<@:8=@768@87B:<8:8 888:8??@?873:)7 ?<<8?D@ 8<<:8<?=88?7<??=:8 7A8?8?7@?A8@<87B:<?88877=:878 . $+ %7<<8<8?=8 %4!4< %#84;48+?; 7 !;<08(2;@<? #77:D@? .??==6<8):&8?D*D8= 7:8@B<<@=<<D?8?7:8 =978887*78< 9?::8?9?=8??@:: 89@8<08>@?88?B:: :8<DA<6<89?==@ ?8D<8?@<87B:. $7<< 8<8?=8 "<4<;A< DDD7.F0.?2920A?<;60@0<B82928A<? 3<?F<B?'0.A.9<4B2 940 48@+; #<;1.F?61.FA<#)5<B?@<;9F <?A5<@2D5<D.;AA<D?6A2(69C2?D.A2?'1 (69C2?D.A2?$(,(F1;2F*()'" 9 ; 2 D D D 7 . F 0 . ? 2 9 2 0 A ? < ; 6 0 @ 0 < B elektor 8 electronics - 7-8/2007 2 %%#2!+&' !!+#2+&)2*!##&*&' '2+&22%#&2 %%#*2,*!%2!%,*+)02*+%) ')&*2&)2 2&%%+2%#&2!%',+* !/2!%#2*!##&*&' '+,)2%2!*'#02,'2+&22%#&2%22#&! %%#*2.!+ 2*&' !*+!+2)&**3+)!)* '+),$2%#01) %+)+2)#3+!$2*'+),$2%#01)2&)2 %#&2 %%#2.!+ 2&%,))%+2.-&)$2!*'#0 &!2%#01) 2#&!2/+)%#2)!)2%2*'!#2',)'&* !%',+*2+&2'+,)2!!+#2*!%#*2&.%2+&2% 2 %%#2!+&' &"+2%#01) !+&'2 2&+.)2&)2!%&.*2%2!%,/ & &&&& !& '&&& &"&&$ & & & & & & & & & $%& #& & &$%&"!&&&&& & & && & & & '& & $& "!& !& & & & & !& & & & & $ & & !"& & & & &"$& $&&&&&& & $& !& & & '& & & & "& & & &!&$&&#&&&&&&!& &$ &&&&&& &"&$& & & && & && ' &"&& &&& & & $&& & &&$& &#&&!&& &"&&$&"&&& &" & &&& $& +2&)) &)2%0+ !%2 2%2'+,)2,''&)+*2 #!-2+2)'#02%2!*'#02/'&)+ +.&)"!% #/!#2%+.&)"2&%%+!-!+02*,''&)+!%2 $,#+!3*&'2&')+!&%2)$&+2$&%!+&)!%2% +2(,!*!+!&% +2/'&)+ /'&)+2+2.!+ 2 2,*!%2'&)+#22!#*2&) ,*2#!))!*2+&2,!#2,*+&$2!+&'2*&#,+!&%* Summer Circuits 2007 Contents Colophon Alphanumski Puzzle Elektor SHOP Sneak Preview 6 140 145 148 SENSORS A/D Converter for Robots Bat’s Ear CMUCam1 Vision System CO Sensor Compass Sensor for Lego Mindstorms NXT From Cassette Recorder to Robot Propulsion An Inclinometer for your Robot 25 30 18 35 36 26 32 IR Close Object Detector Light Sensing with an LED Light-seeking Robot An Obstacle Detecting Robot Overheat Detector Alarm/Switch PIC or Basic Stamp IR Telemeter PIR Sensor Positioning with Photodiode Arrays A Robot that won’t lose its bearings Sensor for Line Following Robots Simple D/A Converter for Robots Sound Activated Switch Stereo Robot Ears* Ultrasonic Distant Obstacle Detector Whiskers on Robots Wireless Pulse Sensor 27 38 29 10 21 21 28 33 24 20 17 23 13 37 34 12 ACTUATORS 12 V Bidirectional Motor Control 3 Amp PWM DC Motor Controller* Catapult for Robots… or Other Uses Complete Stepper Motor Driver Controlling Servos Driving Higher Power Motors Driving Stepper Motors Driving Stepper Motors: KISS MotoBox* PIC 12C508 Stepper Motor Controller PIC Indicator Relay Robot Footballer Servo to Motor Conversion zBot: 10-A Power Stage for DC Motor 44 50 56 46 47 51 59 53 40 48 55 54 58 45 MICROCONTROLLERS Low2 Cost USB Demo Board LPC900 Programmer* 75 72 Optimised STK200/300 Programmer Propeller Prototyping Board for BoeBot* 77 69 CONTENTS Satnav for Robots Serial Interface for the Propeller* Servo Control from a PC ‘Teaclipper’ Postage-Stamp Programmer Which Brain for my Robot? 78 81 68 71 62 POWER SUPPLIES & CHARGERS 3-A Wide-input Adjustable Switching Regulator Deep Discharge Protection for Rechargeable Cells Dual Battery* Fast Charger for NiMH Batteries* LDO Regulator with Soft Start or Tracking Lithium Charger* Mini Power Inverter Multi-purpose NiCd & NiMH Charger 84 94 90 93 95 88 87 91 Volume 33 July/August 2007 no. 367 COMMUNICATIONS 2.4 GHz Antenna for Robotics Vehicles IR Communications using a UART IR Remote Control with the R8C Radio Remote Control for PDAs and Smartphones Receiver for RC5 Remote Controls Removed Pulse Detector Robot Voice zBot: Wireless Link 110 113 115 115 112 114 117 114 TIPS & TRICKS Balancing Robot DIY Wheels R8C Measures Negative Voltages 118 120 121 MISCELLANEOUS Paralleling LiPo Batteries PWM Voltage Dropper Switch-Mode 555 Supply USB Converter* Voltage Stabiliser zBot: Solar/Battery Power Supply Chaotic Fireflies Clap Controlled Switcher Colour Tamer Football with Robots Formula Flowcode Buggy KiCAD: a high-level tool New Lego Mindstorms NXT Motor Block Philips ME Construction Kits 126 132 126 138 122 134 133 130 A Robot with an Elephant’s Memory Stepped Volume Control Walking Works! 131 127 128 85 89 86 82 86 83 MECHANICS Antieu-robot Babybot Bolo Hunter Minimalist Motor Robot MOPS Torque is Cheap Trembly Tribot 99 100 98 104 102 107 101 104 103 * PCB design included Subscriptions: Elektor Electronics (Publishing), Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 Internet: www.elektor-electronics.co.uk Email: [email protected] Rates and terms are given on the Subscription Order Form Volume 33, Number 367/368, July/August 2007 ISSN 0268/4519 Elektor Electronics aims at inspiring people to master electronics at any personal level by presenting construction projects and spotting developments in electronics and information technology. Publishers: Elektor Electronics (Publishing), Regus Brentford, 1000 Great West Road, Brentford TW8 9HH, England. Tel. (+44) 208 261 4509, fax: (+44) 208 261 4447 www.elektor-electronics.co.uk The magazine is available from newsagents, bookshops and electronics retail outlets, or on subscription. Elektor Electronics is published 11 times a year with a double issue for July & August. Under the name Elektor and Elektuur, the magazine is also published in French, Spanish, German and Dutch. Together with franchised editions the magazine is on circulation in more than 50 countries. Head Office: Segment b.v. P.O. Box 75 NL-6190-AB Beek Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161 The Netherlands Distribution: Seymour, 2 East Poultry Street, London EC1A, England Telephone:+44 207 429 4073 UK Advertising: Huson International Media, Cambridge House, Gogmore Lane, Chertsey, Surrey KT16 9AP, England. Telephone: +44 1932 564999, Fax: +44 1932 564998 Email: [email protected] Internet: www.husonmedia.com Advertising rates and terms available on request. International Editor: Mat Heffels ([email protected]), Wisse Hettinga ([email protected]) International Advertising: Frank van de Raadt, address as Head Office Email: [email protected] Advertising rates and terms available on request. Editor: Jan Buiting ([email protected]) Copyright Notice International editorial staff: Harry Baggen, Thijs Beckers, Ernst Krempelsauer, Jens Nickel, Guy Raedersdorf. Design staff: Antoine Authier, Ton Giesberts, Paul Goossens, Luc Lemmens, Jan Visser, Christian Vossen Editorial secretariat: Hedwig Hennekens ([email protected]) Graphic design / DTP: Giel Dols, Mart Schroijen The circuits described in this magazine are for domestic use only. All drawings, photographs, printed circuit board layouts, programmed integrated circuits, disks, CD-ROMs, software carriers and article texts published in our books and magazines (other than third-party advertisements) are copyright Segment. b.v. and may not be reproduced or transmitted in any form or by any means, including photocopying, scanning an recording, in whole or in part without prior written permission from the Publishers. Such written permission must also be obtained before any part of this publication is stored in a retrieval system of any nature. Patent protection may exist in respect of circuits, devices, components etc. described in this magazine. The Publisher does not accept responsibility for failing to identify such patent(s) or other protection. The submission of designs or articles implies permission to the Publishers to alter the text and design, and to use the contents in other Segment publications and activities. The Publishers cannot guarantee to return any material submitted to them. Managing Director / Publisher: Paul Snakkers Marketing: Carlo van Nistelrooy Customer Services: Margriet Debeij ([email protected]) Disclaimer Prices and descriptions of publication-related items subject to change. Errors and omissions excluded. © Segment b.v. 2007 Printed in the Netherlands Advertisement Our online store contains an ever expanding variety of products designed for engineers, hobbyists and students. These include: ͻZDĞǀĞůŽƉŵĞŶƚ^LJƐƚĞŵƐ ͻƚŚĞƌŶĞƚDŽĚƵůĞƐ ͻZ&DŽĚƵůĞƐ ͻ'ƌĂƉŚŝĐ>ŝƐƉůĂLJƐ;tŝƚŚĞdžĂŵƉůĞƐŽŌware!) ͻ,ŽŵĞƵƚŽŵĂƟon ͻWŽǁĞƌŽŶǀĞƌƐŝŽŶ ͻŽŵƉŽŶĞŶƚƐΘŽŶŶĞĐƚŽƌƐ ͻŶĚDƵĐŚDŽƌĞ͊ ͻĚƵĐĂƟŽŶĂůŝƐĐŽƵŶƚƐǀĂŝůĂďůĞ &Ƶůů ƉƌŽĚƵĐƚ ƐƵƉƉŽƌƚ ǁŝƚŚ ƌĞĨĞƌĞŶĐĞ soŌware and secure online ordering ƚŽŬŝĐŬƐ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Ý°V <HL@GD<EK=FI<C<:KIFE@:J;<M<CFGD<EK#KI8@E@E><OG<I@D<EK8K@FE GXckife`oC`d`k\[ Le`k*;fcg_`eCXe\#*,?`^_Jki\\k#Jflk_XdgkfeJF(+);= K\c\g_fe\1'/+,))-0+,(=XZj`d`c\1'/+,))-0+,) <dX`c1jXc\j7gXckife`o%ZfdN\Y1nnn%gXckife`o%Zfd 8ccdXafiZi\[`kXe[[\Y`kZXi[jXZZ\gk\[ mikroElektronika DEVELOPMENT TOOLS | COMPILERS | BOOKS (.<* ) : ' (-:6: '68 : )(. + ( . -$&' % - $ " # "$- &- - $" !& $% -!' & " -% & -!"& $ -% !" - " -& - & % - $ " # -!" & $ - )! % )&- &- $" - !")- %'#. %-&$"# -$" - -% !( -$#" ( - -$) - -" " - - -$" -$& ' #+&" $ &! #" ( .() +"'- &"- * '&- $" - -% "$ - -%"$ ."$# -% $ -!" -& -&%" - ."$ .( - $ ) ! " & ' % - # - ' ! & " ! - . %&$-"+!. - ) - & $" # -% .!'$ ! 9):'1 ."$- !; -247D ; - %&$"#'+C .!" &- $ % # ' - & ) $ " ! -'!& $") -& -&!$ # -! & -% &!#"( -&!"$( -'"+ -&%'I -! -"& -%) - -$ - + ! - % $ ' & - & - - $ ' " + - & ! # " ( - ' " + % F ! -%" !)& - $" -!&* $)" -+#%' -$ % & !)" - /$ # &) -% " $ ! =3 # . 2 -2;<58>3 -. -3 -&.52 $"&! -58 -? % - 7 +$" -? ; -! 2 -! -% # * ! ; @; -! - -$ - '! -! -& - &%+ '" F -! %" -!)& -! $&* -)" +#%' &'$ %- & - - +"'$- ( "# !&- - %+ *#"$- !) - %=3 - -% -&) D- @ -.3 -! .$#* -! % & ( " - $ ! :6'8 -, ! & -" ! % + -$" # & -!" $ ) - -&! #" ( -% & + -!" -& -&$ -& -3 +% -% $" 2 -.3 7 % &$"# ' - + C $ # - % & $" -% ' ) ! - 7.- !- 3.- #!- - $" !&$" $%- &- " %- )&- & -;6752 C -&! -! ' -! -&% -#+&" $ -!#"( -%# * -! '&6.( -! &% - . - 7 .() -&'$ .! % + ( ( -' ! $ (" # & ) - $ &"(1 . ) : ' ' $- ! % 6)8 : ' -% - - &%+ -!% -$" -! "$& -$&%'! % & + .() ;4 &'$ .! .( &" %" -! ' + & & (.:< * -C % & + $"# ' ! .35 7 -% # -& -% -$ ( -&) -& ;325 % .!" $ - &$" :.(54 -&! #" $ % -%)" $ &! - $ &! ) - * % & '$ -"$ ! # -% ( C &! " $ $" -% &! # $ ". -! - -+$" -%$ - *- - -&$"# -473 -A; .!" - $ " 5 > 7 A & !; -% +! . .() !.$ ' &- ' $ ! 3- ' $- ! % $" - 25&<* &$(1 . ; 4 -"& #' %+$ 7 ! ) - + % & - + ! - $ & % ' ! - % ! - C - $ & ' - & % -#+&" $ % ! ' ( - $ "#!&- -% - - &%+ -!% -$" -! "$& -$&%'! % & + .() )& &#% -32 @ - $ " &! - - $# 'I -&! -! -!# % -+$ !" & - $ % "# - & %" -$&%'! -% ! -!" -& -9 &%+ -$'& # %$ " &! - % $ & ! ' " - % $ & - ; + % & - % - + ! - % $ ' & ! -$'"+ -&! #" ( +% -! -" -& -% -$".! - -$"# -&) -&"' -&%) -!)& 1!'$H -! ."$#H 1! $ -" % # * ! -& $" ! - &'$ .! .( ( -!)" & . $ & " ! - " - % -& # $ . % "$- - < $" " %- + ( . : - $ & ' - & % - - $ " # %$ " &! - -!' & " % $ - !" -& % $ " # "! &- $&-% -&) -& "$ ! " ) - % ' # " $ &% - " $ - % -% !( - $#" ( - $) -" -" - % - -$" .$' -$& #+ " ! ( .() -"& ' * $ - % " - -%"$ -% $" # -!" & "%&- % - $" !&$" $ # -% ' ( $ ) -! -!"& ' %$ . -+$" ! - ) - & ."$# - $ % ! ' .$ -& !" % + # ( - ! .7 &% - " ! % &- &'.,( - &%+ $"# ' -&% .35 -! #.7 - %$ " &! -& % -$ ( & ) -47 2 +! - " % & -+ $ . ! " - & % $ + " - % ' & ! $ # * -$" # ! ( $ + - ! & - ' ! - ! - % & $ - # $ " & + - ( " # ! -%# * ! -& $" -' ! $ (" # & ) - % - $ " - ) ! - % $ ' & - $ " &- - % $ # .() -&'$ .! % ( - '&6.( -! 95 '.,& -% -;& -D ; -&!#"( &%+ -' ! $ (" # & ) 59 ) : ' &,. :6'8 ! -, - &52+ -%; -% -! - - ."$# -$ " -& ; + " #% L - $ " ! & $ " $ % D + %&- ! + " -$" -& -! - $" # - - & % - # ; - $ " ! & % - ' " F - & -& - $ " # - ) -&L!%" -%' -&" $" -$" +! -$ % +) - " . $ # -! C -"); +$ -! - -%!# -$ - ( "& -'"+ % - ) ( & %& . " $ & - % & - - ;- #$" $- "$- +"'$ -$'&%I"# !) '+" -%! $ -# % ! ; - % ( " $ # & ! - % -+)"!'$%&# , ! $ - $ & ' - & % - - $ " # "$- &- ;& - 742- $" !. &$" $%E!- "! & - &" ( -"$ # !& %+ " %- !- A.F C- #$". - $ - ! E - ' # - ! G -&"% -& -%" - $!%& - $ " # -' F -! -$ " ! "#& !- G- %"&- '%- "$ - ( " ' - # $ " ' & " ! - " ! + - ! - " &- - % & " # - " . ! " -!& "$#247 - & ."$ -$ " &! -% -( -! -2 .!" - $ " & ! - C - " $ # 2 4 7 - ! " % - $" # & % -, ! : $ %$ " &! 59 &<* D ; -& %'."+ -! '&6.( -! .! -!"$& -%$'& ! -(& # " -&! #" ( .%+ -% & E $ ( - '" % & # $ - " ! -$' .%& - %$ "& ' - &! $ ' " - . % ($ -C -+! # " -% -! - " -&! '% " -!" -& - .!" $ -%$ " & -! -& -$& + # -$!& - " -#"$ +! # " E -C -&%+ %-&$"#' -!#.35 -! -!#.2 -D ; .!"$ -%$"& -% $(72;<C -&)!" K=2 -+! -+$ - -%# * - &!$ ' -'% -%' " &- %+&- D ) % + ! "$ &' ; < -$'"+ -&! #" ( - +% '" F -! -%" -! )& - $" @ -$& %"#' -D ;< - +#%' -$)" !&* -% ) #<$ - @ (6<* ) : ' :6'8 :6'8 -$ -"% -! - " -&! '% " -! -& -$& -+&$ # -$!& # - " " ! ' & " $ % - % ! - - ! - - " - " ! % ' & - " - #% -%!"$& + # ; ) ' -$ =" !# % $#+ & 6 + / ,< 6&8 0 : < + < 7 , . < 6 ( 2 : 2 < & 6=:1<* 7 A N D -% $ " # C - ! " & ' ) ( + $ % -%!"& # - &% -!" & - %+ 9 -$'& # .!" &$"%-'! -! -C &%+ . " -& ) # 478C ; -&)%"$! C- %+ & - %'#. %-&$"# -! " -%$ " &! -& -% " -&) -376 F - $# 'I &! -! # -% +$ - !" -& $" -C ."$# - ! &%+ - #" ( '. - $ % ( " # & ! - + % . $ " # -! $ " # .& ' $ (6<* $ $ ."$ -% ! S O F T W A R E %-&$"#' + C -52;<C&!%"$#'I)- % -+$ !" & - $ % "# - & %" -$&%'! -% ! -!" -& -9 &%+ -$'& # %$ " &! - & $% "'!-&! #" ( $ . %+ - -$ " # % - %# * ! $'"+ & ( -' $ (" # & ) - $ & !$<* ) : ' : 8 .( - $'& % + ! #" (-:6: '68 : )(. :6'8 . - ! . $ ' % " -% +! (., ' ) : :6'8 59 ) : ' &< * - ; . " $' % & # - 9 1 (-:6: '68 : )(. 25&<* ) : ' (-:6:'8 : )(. C- %+ & - %'#. %-&$"# -.35 -.7 ! 45(. : ) ' -C &%+ $"# ' .72 - ! .3 - # %$ " &! -% " -&) -& -23 % -$! -%"#$' .!" $ -$"& ) ! ;-&.2 -%$'& -& - -$'"+ -&! #" ( - +% -+! - " % & -+$ % # * -! ; @ -! ' ! - & ! $ ' - ' % - % ' - " &- - & % + - C - $ & ' - & % . ! " "$- #$" $- !-%! +$( & -! ' &% -#+ " $ . ( ! &$(1 . ) : ' -! $&' -% - . $" # -$ -$" -& -3 - % -% ; -)! -% (@ &) & - $ " - ! " ) - % ' # " $ &% -$#"( !% )$- " - "- % $" & ' . # -#+& ! " ( .() +"'- &"- * '&-% "$ - -%"$ ."$# $ %- "!- &- "%&- 3% - $" !&$" - ! -)( -$ ( -%'( # '!&"!- %&$ -+$" -! - ) -& $" # % ! ' % (-:6 : '6 8 : )(. &"(1 . -! % -52 % &'#! - ) %$#'" & -! 52 -%+$ #' -"& -! +%& $ ' - ! C & % -#+&" $ % ! ' ( - $ -&!#" - -+$ -% %-& -!)" -$"&%( -%" -& -& -$#% -! ! *"-!E%& -0 +&%' ! "$( , 6).38 (.:< * ) ' (-:6:'8 : )(. + ( . 1 (-:6: '68 : )(. H A R D W A R E S O L U T I O N S F O R E M B E D D E D W O R L D elektor electronics - 7-8/2007 ( % ' & 6 % '( $ # $ #$ $ # ! 7 2 2# $# ( % ' # ! # ! # * & 6 .A# !A# # - # #A $ @$ 9 A $ #A # '42 & , 8 & : # # ? ! # A & '. 3( A #A& # # # !7 )7 # $ #6'2 # !# > #6'2 # # ('. +.'( # > !7 +.'( % 6 7 # 25 & " 4-; 1 ('. 6 # ) ) 8 1 42 '8 # $ +.'( 6 !7 6 % 6 #- A 4 ! $ ! ' : #" -30 A 1 #A@ # #! > 27 7 % # #- A : ( : " * 0 3 A 1 @A # ! > 5 25 6 6 6 ' #A $ # A# @A $ # $ # # ; #! # ! # $ 3 & 6 & ,' #- A -3 # A 4-; 1 @A -3 # # ! > 6 & % 6 & - 8 # # $ # # A # $ A # ) # A $ # $ !? # # !? 5 3 1 #A8 )7 6 #A # # !# : # &$* &# $&# *$&# *$ # #$ # ? ? 6 7 & 3 , ( % #A $ $ # # $ " # & 6 % 6 #A- ( " 0# 3 A 1 @A# : : ( " * 0# 3 A 1 @A# : !# ! # > : # # $ & # ! # $ # A#- : > #+ #$ A . #-2 , $A " & # # #& #$ & $" # A # # !# # ? @ -27 ?,# # 72-# #A # # $" # # # &4697. #&-4 1 3/ #/- # #& ! # - 3 #& # $ $ #& #" #A? #'7 #& # # #& $ # # &# & 2-& 72& 9(&- 5&;,& 9*) 6< & # 4 $ #& 7<4&# ,' )7 % 6 #- A #"* -30 - #3 A @A # ! ) 6 , - 8 6 /' 3" # #A $ 2 ' 6 # " 72 # 41 B # # & $ , 6 # # ! 9( $ ! ! 4-; # 4 # 7-4 $ 3 & 0 3 6 # 6 6 3 - A *" 03A 4-; 1 #A@ #! > - 3- A 4-; 1 @A #;-4 ! 27 6 % 4? - 5 #?! #! #27 $ # # 4-; ! # 27 $ #, ! 27 # B # /' # # $ # # & # # A A -7 % 6 #A- & , ( % & ' , ( % & 6 6 # : # #A # #? # A /' & , & ! 6 A 7 # # ! #A # ! ? = ! # # # -27 6 # # $ +.'( +.'( & 0 % 6 # % A # # # $ $ A# A# $ # # # $ # /12 ' % 30 $ )) 21/ A # # # $ A $ # $ % 6 3 # 6 % # $ # # $ & ! # # $ # $ # # $ #$ $ # $ A ! & ' 6 B ,( & 23 6 .A2 ,# ? # # # A@ 27 ! - ('. # ) #? '42 # ? # ? #? ! # ; - 4 ) # 32 6 9$ ' % 0 #$ $ $ # $ % (' ! # # # $ ! " $ # ' *)25 #% A ! # - & # $ # # 7 # # #-27 #;-4 A# # # A # 7 & #A # # " 72-# ?7# # 72# A# # #" # # $7. #&469 #1 /3 # &-4 # /- # & ! # # # # -3 #& $ # &# " #A? # #'7 & # # # &# # & & 2-& 72& 9(& - 5& ;,& 9*) 6< & # 4 $ #& & 7<4&# : A " # ! # #A #2 5 #&- ! 2 # # ?# # 7A# # "# # $ : # #-? # #-27 #A # # $" # # # . 7964& #&-4 1 3/ #/- # #& ! # # - 3 #& # $ $ #& #" #A? #'7 #& # # # #& $ # # &# & 2-& 72& 9(& - 5& ;,& $#< 6 )*9 & 4 #& # $ &# 7<4 : # #. # + #% A ! #$ A . #-2 , $A " & # # #& #$ & # #A # $" #! ?@ #(-27 #' #( # -27 #,? ( ' -27 # #-27 # #A $ # # #" # .7964&# /3 1# 4-&# # # #/- & ! $ # -3 $ # & " # ?A# # 7' &# # # $ & & # & 2-& 72&# 9( & - 5& 9*) 6< & 4 & & 7<4&# 7-8/2007 - elektor electronics A N D : # ! # A " # #A #2 5 #&- ! 2 # # ?# # #A7 # " # # $ : # #-? # '(-27 #( # #-27 # A # # " /3 1 .7964&# # 4 -&# & ! # # - 3 #& # $ $ #& #" #A? #'7 #& # # # #& $ # # &# & 2-& 72& 9( & - 5& ;,& 9 #)* # #< 6 $ #& #4 $ #& & 7<4&# : # # # # -/ #. #+ #$ A . #-2 , $A " & # # #& #$ & # A # $ " # # !# # ? @ 9 ?,# # 72-# #A # # $" # # # . 7964& #&-4 1 3/ #/- # #& ! # # - 3 #& # $ $ #& #" #A? #'7 #& # # # #& $ # # &# & 2-& 72& 9( & - 5& ;,& 9* )# # 6< # & 4 & & 7<4&# #% A ! # - & # $ # # 7 # #9 ;-4 # # # # #A #7 $ # & # # A $ " 9 4 - ; #7? # #9 #A # # $" # # # . 7964& #&-4 1 3/ #/- # #& ! # # - 3 #& # $ $ #& #" #A? #'7 #& # # # #& $ # # &# & 2-& 72& 9( & - 5& ;,& 9* )# # 6< # & 4 & & 7<4&# # A # S O F T W A R E & - & # $ # # 7 # #(-27 #' #( # -27 4-; A # # # $ A# 7 #& # A " #(-27 #' #( # -27 #- # #A $ "# # .7964&# /3 1# 44-' -/ & ! # # - 3 #& & " # ?A# # 7' &# # # $ # & & 2-& 72&# 9( & - 5& 9*) 6< & 4 & & 7<4&# : # # $ # A # '- #- $* # ) ( #- A A ! @A 2 $ # H A R D W A R E S O L U T I O N S F O R E M B E D D E D W O R L D 9 An Obstacle Detecting Robot >OLU MPYZ[ [Y`PUN V\Y OHUK H[ YVIV[PJZ ^L»YLNLULYHSS`PUHO\YY`[VI\PSKHTVIPSL YVIV[[OH[OHZHKLNYLLVMH\[VUVT`0[»Z ^P[O[OPZHPTPUTPUK[OH[^L»]LWYVK\JLK [OPZHY[PJSL[VLUHISL`V\PUYLJVYK[PTL [VI\PSKHTVIPSLYVIV[JHWHISLVMKL[LJ[PUN HUK H]VPKPUN VIZ[HJSLZ 6M JV\YZL NP]LU[OLYLSH[P]LZPTWSPJP[`VM[OLZVS\[PVUZLTWSV`LKP[^PSSILMHPYS`LHZ`[V JH[JOP[V\[I\[HZS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^L»]LQ\Z[NP]LUZV[OH[[OL`KVPUKLLK WYVK\JL[OLTV]LTLU[ZPU[LUKLK @V\ TPNO[ HSZV ULLK [V [^LHR [OL MPYZ[ WHYHTL[LYVM[OL]HYPV\Z7>4PUZ[Y\J[PVUZ >LL_WSHPULK[OLYLHZVUMVY[OPZHIV]LMVY Z[VWI\[[OLZHTL[OPUNOHWWLUZMVYYV[H- 7-8/2007 - elektor electronics Full source listing for obstacle-detecting robot management program ‘ Obstacle avoider robot on a Rogue Blue base Const Device = CB220 Dim Obstacle As Byte Input 0 Input 1 Low 5 Low 6 Delay 1000 ‘ Right whisker input ‘ Left whisker input ‘ P5 output for PWM ‘ P6 output for PWM Do If In(0)=1 Or In(1)=1 Then ‘ Whisker activated? Pwm 1,3410,32768 ‘ Servos stopped Pwm 0,3410,32768 Pause 800 If In(0) = 1 Then ‘ Right whisker? Obstacle = 1 Else Obstacle = 2 ‘ Left whisker! End If If In(0) = 1 And In(1)= 1 Then ‘ Right and left whiskers? Obstacle =3 End if Pwm 1,3590,32768 ‘ Backward Pwm 0,3195,32768 Pause 1500 Else Obstacle = 0 ‘ No whisker activated End If ‘ Obstacle variable analysis Select Case Obstacle Case 0 Pwm 0,3590,32768 Pwm 1,3195,32768 Case 1 Pwm 0,3600,32768 Pwm 1,3600,32768 Pause 1000 Case 2 Pwm 1,3180,32768 Pwm 0,3180,32768 Pause 1000 Case 3 Pwm 0,3750,32768 Pwm 1,3750,32768 Pause 1500 End Select Loop ‘ No obstacle ‘ Forward ‘ Obstacle on the right side ‘ Slight turn to the left ‘ Obstacle on the left side ‘ Slight turn to the right ‘ Head-on obstacle ‘ Full half turn 11 [PVUVM[OLZLY]VZH[M\SSZWLLKPUVULKPYLJ[PVUVY[OLV[OLY0M`V\YYVIV[MHPSZ[V[YH]LS PUHZ[YHPNO[SPUL^OLUY\UUPUNMVY^HYKZVY IHJR^HYKZP[»ZQ\Z[ILJH\ZL[OLZLY]VZHYL UV[[\YUPUNH[[OLZHTL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HKHYRYLZPZ[HUJLVMHYV\UK 4æHUKHIYPNO[3,++;OL3,+ T\Z[OH]LHUV\[W\[VMH[SLHZ[TJK 8 P1 R1 220 7 For robots and other control applications P2 100k LED2 P3 BD139 BC547 10k 30 ... 40 kHz C4 21 mm C TSOP1136 B IC3 6 TR 2 1 5 C3 C2 10n 1n IR 1 TSOP1136 12 R8 THR CV LED1 070006 - 12 HZSPNO[MYVTP[T\Z[WHZZ[OYV\NO[OLÄUNLY HUKPSS\TPUH[L[OL3+95V^^OLU[OL OLHY[W\TWZHW\SZLVMISVVK[OYV\NO[OL ISVVK]LZZLSZ[OLÄUNLYILJVTLZZSPNO[S` TVYLVWHX\LHUKZVSLZZSPNO[YLHJOLZ[OL 3+9;OPZJHUILJVU]LY[LKPU[VHULSLJ[YPJHSW\SZL >P[O LHJO W\SZL [OL YLZPZ[HUJL VM [OL 3+9HUKOLUJL[OL]VS[HNLH[[OLPUW\[ [V VWHTW 0*( JOHUNLZ ;OL NHPU VM [OLVWHTWPZZL[I`WV[LU[PVTL[LY7PU [OLMLLKIHJRWH[O;OLZLUZP[P]P[`VM[OL JPYJ\P[JHUILHKQ\Z[LK\ZPUNWV[LU[PVTL[LY7H[[OLPUW\[[VJVTWHYH[VY0*) ;MVYTZHUV\[W\[KYP]LY[OH[UV[VUS` SPNO[Z3,++[VNP]LHSVJHSPUKPJH[PVUVM OUT NE555 3 heat shrink sleeve 3 BC547 2 LED 7 IC2 R11 3 100 7 2 R10 1k8 100n 1 T2 C C5 Ø 22 mm E 4 R DIS E B 22k 8 LDR plastic tube R9 100n +5V 6k8 15mm [OLKL[LJ[LKW\SZLI\[HSZVWV^LYZ\WH Z[HUKHYKZX\HYL^H]LVZJPSSH[VYJPYJ\P[I\PS[ HYV\UK0*H[PTLY([P[ZV\[W\[[OPZ WYVK\JLZHZPNUHSTVK\SH[LKI`[OLW\SZL ^P[O H MYLX\LUJ` [OH[ JHU IL ZL[ MYVT R/a[VR/a\ZPUNWV[LU[PVTL[LY7 (KYP]LYZ[HNLPU[LYMHJLZ[OLV\[W\[VM[OL [VHU09LTP[[LYKPVKL^OPJOJHUZLUK [OLTVK\SH[LKZPNUHS[V09YLJLP]LYTVK\SL 0*;OLTVYLWV^LY\ZLK[VKYP]L[OL09 3,+[OLNYLH[LY[OLYHUNLVM[OLSPUR!9 JHUILHS[LYLK[VHJOPL]L[OLKLZPYLK3,+ J\YYLU[;OLKLTVK\SH[LKV\[W\[VM[OL YLJLP]LYTVK\SLJHUILMLKKPYLJ[S`[VH TPJYVJVU[YVSSLY;OLJLU[YLMYLX\LUJ`VM [OLYLJLP]LYTVK\SL\ZLK^PSSKL[LYTPUL 070006 - 11 [OLJVYYLJ[ZL[[PUNVM7 (W\SZLZLUZVYJHUILTHKLMYVTHZPTWSLTTSLUN[OVMWSHZ[PJ[\ILJSVZLK H[VULLUKJOVZLU[VÄ[ZU\NS`V]LY[OL ÄUNLY[PW/VSLZ[VTV\U[[OL3,+HUK3+9 HYLTHKLTTMYVT[OLJSVZLKLUKHUK [OLJVTWVULU[ZHYLNS\LKZ\P[HIS`PU[V[OL OVSLZZV[OH[[OL`MHJL[V^HYKZ[OLJLU[YLVM[OL[\IL;OLJVUULJ[PUN^PYLZHYL PZVSH[LKMYVTVULHUV[OLYHUK[OL^OVSL ZLUZVYLUJSVZLKPUHSLUN[OVMOLH[ZOYPUR [\IPUN[VL_JS\KLL_[LYUHSSPNO[MYVT[OL 3+90M[OPZJVUZ[Y\J[PVUZLLTZHIP[I\SR` P[PZWVZZPISL[VYL\ZLHJSPWMYVTHJVTTLYJPHSOLHY[YH[LTVUP[VY (070006-I) elektor electronics - 7-8/2007 Stereo Robot Ears Get your robot to home-in on a sound source Claude Baumann & Laurent Kneip Service robots of the future will most likely need to act on spoken commands and be able to recognise voices. This article takes a look at one aspect of this behaviour namely locating the position of a sound source using the crosscorrelation function. A technique is developed which drastically cuts down on the number crunching so that even a basic microcontroller fitted with binaural sensors can pinpoint a continuous audio signal with an accuracy of just 10 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Y\KLHUHSVN`MYVTLUNPULLYPUNZ`Z[LTZ^LJV\SKZH`[OH[[OLWYVJLZZ VMOLHYPUN\ZLZHU\TILYVMZ\IZ`Z[LTZ 4VZ[VI]PV\ZS`^LHSVUN^P[OHSSV[OLY JYLH[\YLZL_JS\KPUNTHU[PKZHWWHYLU[S` HYLLX\PWWLK^P[O[^VLHYZOLUJLºIPUH\YHS»^OPJOPUJVUQ\UJ[PVU^P[OKLKPJH[LK YLNPVUZVM[OLIYHPU^L\ZL[VPKLU[PM`[OL KPYLJ[PVUVMHZV\UKZV\YJL\ZPUNZL]LYHS KPMMLYLU[TL[OVKZ! I0U[LYH\YHS;PTL+PMMLYLUJL·0;+ >P[OHZV\UKVYPNPUH[PUNMYVTVULZPKL[OL WYLZZ\YL^H]LZHYYP]LH[[OLLHYZ^P[OH ZSPNO[[PTLKPMMLYLUJL;OLIYHPUPU[LYWYL[Z [OL[^VZPNUHSZHWWS`PUNH[`WLVMUL\YHS JYVZZJVYYLSH[PVUM\UJ[PVU;OLWOHZLZOPM[ IL[^LLU[OL[^VZPNUHSZNP]LZ[OLHUNSLVM [OLZV\UKZV\YJL[OLHaPT\[OA 0[JHUILZLLUMYVT-PN\YL[OH[ZV\UK LTHUH[PUNMYVTHU`VM[OLWVPU[ZMuv S`PUN VU [OL O`WLYIVSH NP]LU I` [OL LX\H[PVUZ ua¶vb$ a$$x b$k¶a ^OLYLkPZ[OLOHSMKPZ[HUJLIL[^LLU[OL LHYZ ;OLZL WVPU[Z WYVK\JL L_HJ[S` [OL ZHTL[PTLKPMMLYLUJLH[[OLLHYZ;OL[LYT $xPZ[OLKPZ[HUJL[OLZV\UK[YH]LSZPU[OL [PTL $t ^P[O $x$Jô$t ;OL ZWLLK VM ZV\UKcLX\HSZTZH[* ;OLO`WLYIVSHHWWYVHJOLZ[OLHZ`TW[V[L NP]LUI`! v$baôu Sound source 060040 - 13 Figure 1. The head acts as a low-pass filter attenuating frequencies above 1 kHz. The ear nearest the sound source will hear the s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Z [OL IYHPU \ZLZ [V YLZVS]L[OLSLM[YPNO[KPYLJ[PVUWYVISLTP[PZ PU[LYLZ[PUN[VWS\NZVTL]HS\LZPU[V[OLMVYT\SHMVYHZV\UKZV\YJLWVZP[PVULKPUMYVU[ HUK[V[OLYPNO[VM[OLOLHK([HILHYPUN A$HUKHZZ\TPUNHULHYZLWHYH[PVUVM JTH[PTLKPMMLYLUJLVMZ^PSSIL HWWHYLU[H[[OLLHYZ([HUHaPT\[OVMQ\Z[ [OL[PTLKPMMLYLUJL^PSSVUS`ILZ0[ PZKPMÄJ\S[[VPTHNPULOV^[OLIYHPU^P[O HUL\YVUZ^P[JOPUN[PTLPU[OLTPSSPZLJVUK YHUNLJHUYLZVS]LZ\JOZOVY[[PTLKPMMLYLUJLZHUKNP]LZ\ZZVTLPUZPNO[PU[V[OL JVTWSL_WYVJLZZLZP[PZJHWHISLVM ;OLSPTP[ZVM0;+MVYSVJHSPZPUNHJVU[PU\V\Z [VUL HYL JSLHY" H ZV\UK ^H]L ^PSS Figure 2. A sound pressure wave from the side will not arrive at both ears at the same time. Points in space where a sound source produces identical delays at the ears are on a hyperbola (red) approaching the asymptote (white). The brain cannot identify the position but only approximate the direction of a sound source anywhere along this line. +5V +5V 1 R7 3 1μ 16V 10k VREF R20 C8 100n 6 2k2 MICR R19 IC1.B 14 7 R9 5 R6 4 17 18 R17 +5V 8 13 2k2 1μ 16V 10k MICL VREF R14 IC1.D 12 R13 RB7 14 IC2 RA0 RB5 RA1 RB4 RA2 PIC16F88 RA3 RA4/T0CKI JP2 RELATIVE C4 IC1.C 10 JP1 HOLD 9 100k RB3 RB2 RB1 RB0/INT OSC2 13 12 K3 11 TX 10 9 8 7 K4 6 RX OSC1 15 16 5 X1 K5 R16 C10 10k 22k 1k 3 100k 47k 1μ 16V 2 R15 R12 C3 R11 1 SENSITIVITY IC1 = LM324N MCLR RB6 VREF R10 Digital C2 IC1.A 10k 2 R18 22p VREF +5V C9 20MHz 22p PWM/Servo 1k 1μ 16V 100k 10k 22k 47k C1 R4 K2 R8 10k R5 10k R3 060040 - 11 47k R1 C6 C7 4 IC1 100μ 16V 100n 11 VREF R2 33k K1 POWER C5 22μ 16V Figure 3. The circuit has two audio channels each with an electret microphone and two-stage amplifier. The two amplifier outputs are connected to the two A/D converter inputs on the microcontroller. 14 elektor electronics - 7-8/2007 [HRLHYV\UKZ[V[YH]LS[OLKPZ[HUJL IL[^LLU[OLLHYZ^OPJOLX\H[LZ[VHOHSM J`JSLVYHWOHZLZOPM[IL[^LLU[OL [^VZPNUHSZ([MYLX\LUJPLZVMR/aHUK HIV]LP[PZUVSVUNLYJSLHYPM[OLZPNUHSPU VULLHYSLHKZVYSHNZ[OLV[OLYLHY J;OL7YLJLKLUJLLMMLJ[ :[YVUN YLMSLJ[PVUZ HUK Z[HUKPUN ^H]LZ WYVK\JL SVJHSPZLK OPNOZ HUK SV^Z PU ZV\UKWYLZZ\YL^OLUHJVU[PU\V\Z[VUL PZYLWYVK\JLKPUHUHJV\Z[PJHSS`YLÅLJ[P]L LUJSVZLKZWHJLTHRPUNP[HSTVZ[PTWVZZPISL[VWPUWVPU[[OLZV\UKZV\YJL>OLU [OLZV\UKZV\YJLPZKPZJVU[PU\V\ZOV^L]LY P[OHZILLUZOV^U[OH[[OLIYHPUPZHISL [VPKLU[PM`[OLZV\YJL\ZPUNHTVKPÄLK 0;+TLHZ\YLTLU[P[NP]LZWYLJLKLUJL[V [OLHYYP]HSVM[OLÄYZ[ZV\UKWYLZZ\YL^H]L H[[OLLHYZHUKHWWLHYZ[VVWLUHºUL\YHS [PTL^PUKV^»VMHYV\UKTZMVY[OPZW\YWVZLPNUVYPUNHU`Z\IZLX\LU[LJOVLZ;OL WOHZLKPMMLYLUJLVM[OL[^VZPNUHSZNP]LZ [OLHaPT\[OILHYPUNVM[OLZV\UKZV\YJL ;OL3,.6YVIV[.(:;65\ZLZ[OPZ[LJOUPX\LI\[P[PZUV[VMT\JO\ZLMVYJVU[PU\V\ZZV\U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 C1 R17 r otkelE )c( 060040-1 1-040060 (c) Elekto r Figure 4. Component layout of the binaural sensor PCB. The PCB files can be downloaded from [3]. Components list Semiconductors Resistors R1,R5,R12 = 47k7 R2 = 33k7 R3,R10 = 22k7 R4,R11 = 1k7 R6,R9,R13,R16,R18,R19,R20 = 10k7 R7, R14 = 2k72 R8, R15 = 100k7 R17 = 100k7 preset Rx = 100k7 Capacitors C1,C2,C3,C4 = 1μF 16 V C5 = 22μF 16 V C6 = 100μF 16 V C7,C8 = 100nF C9,C10 = 22pF IC1 = LM324 IC2 = PIC16F88, programmed, order code 060040-41 from Elektor SHOP Miscellaneous Q1 = 20MHz quartz crystal DIL14 socket DIL18 socket SL1,SL2,(SL4),SL5,SL6,SL7 = 2-way SIL pinheader (SL4 bridged with a 100k resistor, see text) SL3 = 6-way SIL pinheader JP1,JP2 = jumper MicR, MicL = CZ034 electret microphone insert PCB, ref. 060040-1, free artwork download from Elektor website Figure 5. Resolution of the sound source bearing is a function of its azimuth. The average value is approximately 9°. >OLU[OLZV\UKZV\YJLPZH[[OLL_[YLTL YPNO[VYSLM[VM[OLÄLSKHaPT\[OA$o H[PTLKPMMLYLUJLVMoZHTWSLZ^PSSIL TLHZ\YLK(TPUPT\TVMJHSJ\SH[PVUZ HYLTHKLMVY[OLJVYYLSH[PVUJHSJ\SH[PVU >OLU[OLTPJYVWOVULZHYLTV\U[LKVU LP[OLYZPKLVMHZVSPKOLHK[OPZOHZ[OL LMMLJ[VMPUJYLHZPUN[OLTPJYVWOVULZWHJPUN[OLWYLZZ\YL^H]LMYVTVULZPKLULLKZ [V [YH]LS HYV\UK [OL J\Y]L VM [OL OLHK ILMVYLP[YLHJOLZ[OLZLJVUKTPJYVWOVUL (ZZ\TPUN H ZWOLYL ^P[O TPJYVWOVULZ TV\U[LKHSVUNHUH_PZ[OLHYJSLUN[OPZ rô^OLYLrPZ[OLYHKP\ZVM[OLOLHKHUK ZOV\SKILJOVZLUZV[OH[[OLHYJSLUN[OPZ UV[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K1 U out R2 10k *VUZ[Y\J[PVUHUK;LZ[ 1 3 ( WPJ[\YL VM [OL WYV[V[`WL PZ ZOV^U PU -PN\YL:OPLSKLKJHISLT\Z[IL\ZLK[V JVUULJ[[OL[^VTPJYVWOVULZ[V[OLJVU[YVSSLY IVHYK [V OLSW YLK\JL WPJR\W VM LSLJ[YPJHSUVPZL 20k >LISPURZ [1] www.convict.lu/Jeunes/RoboticsIntro.htm [2] www.ultimaterobolab.com [3] www.elektor-electronics.co.uk R4 5 Bit Digital IN 10k K2 +5V R5 20k R6 8 10k ;OLJ\YYLU[JVUZ\TW[PVUVMQ\Z[T(JHU ILZ\WWSPLKI`HSTVZ[HU`=Z[HIPSPZLK WV^LY\UP[;OLTPJYVWOVULZHYLTV\U[LK JTHWHY[WVPU[PUNMVY^HYKZ(/a [VULPZHUPKLHSZV\UKZV\YJLMVY[LZ[W\YWVZLZI\[]VPJLT\ZPJMYVTHYHKPVPZHSZV Z\P[HISL;\YUPUN[OLZLUZP[P]P[`WYLZL[[V[OL SLM[^PSSPUJYLHZL[OLZLUZVYZLUZP[P]P[` ( ZPTWSL +* V\[W\[ SL]LS JHU HSZV IL HJOPL]LK I` JVUULJ[PUN H RR YLZPZ[VY UL[^VYR[V[OLIP[+PNP[HSV\[W\[-PN\YL;OLYLZ\S[HU[+*V\[W\[SL]LSPZ I\MMLYLKI`0*( (060040-I) IC1 = LM358N R3 IC1 4 R7 R8 10k 20k R9 6 R10 20k 20k IC1.B 7 5 060040 - 12 Figure 7. The resistor network functions as a simple D/A converter. Sensor output values: Sound direction (s+2) 8-bit-Integer (TX) PWM/Servo (s+6) 5-bit-Integer (Digital) Extreme right Central 22 2 ms 26 12 1.5 ms Extreme left 16 2 1 ms 6 Simple D/A Converter for Robots Tilo Gockel :VTL[PTLZP[»ZULJLZZHY`[VHKKH+ (JVU]LY[LY[VHTPJYVJVU[YVSSLYMVYH ZWLJPÄJHWWSPJH[PVU;OPZJHUILMHPYS` ZPTWS` HJJVTWSPZ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[ZV\UKSPRLT\JO I\[[OLO\THULHYOHZP[ZV^UOPNOMYL- (U` Z[HUKHYK VWLYH[PVUHS HTWSPMPLY MVY L_HTWSL [OL ;3 JHU IL \ZLK PU[OPZHWWSPJH[PVU3V^LYMYLX\LUJ` ZPNUHSZHSS[OL^H`KV^U[V+*JHU HSZVILOHUKSLKI`[OPZJPYJ\P[HUKPU [OPZJHZL[OLSV^WHZZÄS[LYJVYULYMYLX\LUJ`JHUILYLK\JLKM\Y[OLY^OPJO ^PSSNP]LIL[[LYH[[LU\H[PVUVM[OL7>4 M\UKHTLU[HSHUKYLK\JLYPWWSLVU+* V\[W\[ZPNUHSZ6UL[`WPJHSHWWSPJH[PVU VM[OLJPYJ\P[PZZWLLKJVU[YVSVMH+* TV[VYPUHJJVYKHUJL^P[O[OLPUK\Z[Y` Z[HUKHYK=;OLJPYJ\P[^PSSJVUULJ[[V [OLTV[VY]PHHZ\P[HISLWV^LYKYP]LYZ[HNL 0U[OPZJHZL[OLLSLJ[YVTLJOHUPJHSWYVWLY[PLZVM[OLTV[VYP[ZLSM^PSSHJ[HZHSV^ WHZZÄS[LY (070133-I) Web link [1] http://ww1.microchip.com/downloads/ en/AppNotes/00538c.pdf 17 CMUCam1 Vision System Seattle Robotics give BoeBot (and other robots) vision! Ken Gracey (Parallax, Inc.) )VL)V[PZHSP[[SLYVIV[]LOPJSLKLZPNULK HUKTHYRL[LKI`7HYHSSH_0UJBD)VL)V[»ZPU[LSSPNLUJLJVTLZMYVTHUV[OLY 7HYHSSH_WYVK\J[[OL)VHYKVM,K\JH[PVU)V,^OPJOPU[\YUPZIHZLK VU[OLPYYLUV^ULK)(:0*:[HTW)V[O [OLYVIV[WYVWLYHUK[OL)V,OH]LILLU NYHJLKI`THU`W\ISPJH[PVUZPU[OLLSLJ[YVUPJZWYLZZHUKVU[OL0U[LYUL[9PNO[S` ZV HZ HWHY[ MYVT [OLPY SV^ JVZ[ [OL WYVQLJ[ZJVTL^P[OIHJR\WVMH]VS\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[OL3,+ZHZ [OLKLTVWYVNYHTZY\UZOV^PUN^OLYL[OL *4<JHTPZZLLPUN[OL[YHJRLK[HYNL[ 0UKPJH[L[OLJVSV\YVMVIQLJ[ZP[ZLLZI` PSS\TPUH[PUN[OLJVYYLZWVUKPUN3,+LN YLK3,+MVYHYLKVIQLJ[ >P[OZVTLJSL]LYJPYJ\P[Y`VU[OL(WW4VK IVHYK[OL[^VI\[[VUZLPNO[3,+ZHUKVUL WPLaVZWLHRLYVUS`YLX\PYLMV\Y06WPUZVU `V\Y)HZPJ:[HTW[OLYLI`JVUZLY]PUN06 WPUZMVYV[OLY\ZLZ (UM\UJ[PVUKLTV >P[O[OL*4<JHT(WW4VK=PZPVU:`Z[LT WS\NNLK PU[V [OL )VL)V[ (WW4VK JVUULJ[VY[OLUL_[Z[LWPZ[VWYVNYHT[OL THPUKLTVJVKLMYVT[OL*+964[V[OL )HZPJ:[HTW;OLKLTVJVKLOHZLPNO[ M\UJ[PVUZLHJOVM^OPJOKLTVUZ[YH[PUNH Table 1. Basic command set Command Parameter(s) Description 1 \r none The ‘Enter’ or ‘Return’ key. Set the camera board into an idle state. GM none (\r) Get the Mean colour value in the current image. L1 value \r Control the green LED tracking Light. MM mode \r Controls the Middle Mass mode which adds the centroid coordinates to the normal tracking data. NF active \r Controls the Noise Filter setting. It accepts a Boolean value 1 (default) or 0. A value of 1 engages the mode while a value of 0 deactivates it. PM mode \r Puts the board into Poll Mode. Setting the mode parameter to 1 engages poll mode while 0 (default) turns it off. RS none (\r) ReSets the vision board. Note, on reset the first character is a /r. SW [x y x2 y2] \r Sets the Window size of the camera. It accepts the x and y Cartesian coordinates of the upper left corner followed by the lower right of the window you wish to set. TC [R min R max Gmin Gmax B min B max]\r Track a Colour. Accepts the minimum and maximum RGB (CrYCb) values and outputs a type M or C data packet (set by the MM command). TW none (\r) Track the colour found in the central region of the current Window. 1 Complete descriptions may be found in the user manual. 18 elektor electronics - 7-8/2007 Table 2. Advanced commands Command Parameter(s) Description 1 CR [ reg1 value1 [reg2 value2 ... reg16 value16] ]\r Sets the Camera’s internal Register values directly. The register locations and possible settings can be found in the Omnivision documentation. DF none (\r) Dump a Frame out the serial port to a computer. DM value \r sets the Delay before packets that are transmitted over the serial port. GV none (\r) Gets the current Version of the firmware from the camera. HM active \r puts the camera into Half-horizontal resolution Mode for the DF command and the LM command when dumping a bitmap image. I1 none (\r) Uses the servo port as a digital Input. LM active \r Turns on Line Mode which uses the time between each frame to transmit more detailed data about the image. RM bit_flags \r Engage the Raw serial transfer Mode. It reads the bit values of the first 3 (lsb) bits to configure settings. S1 position \r Lets you Set the position of servo 1. 0 turns the servo off and holds the line low. 1-127 will set the servo to that position while it is tracking or getting mean data. SM value \r Used to enable the Switching Mode of colour tracking. 1 Complete descriptions may be found in the user manual. JHWHIPSP[`VM[OL*4<JHT >OLU`V\ÄYZ[[\YUVU[OL)VL)V[[OLLPNO[ 3,+ZVU[OL(WW4VKPU[LYMHJLIVHYK^PSS ÅHZOZL]LYHS[PTLZ[OLU[OLWPLaVZWLHRLY ^PSSILLWPUKPJH[PUNP[PZYLHK`,HJOM\UJ[PVUZ[HY[Z^P[OVULH\KPISLILLWHUKZ[VWZ ^P[O [^V ILLWZ ;OL 3,+Z MSHZO K\YPUN LHJOM\UJ[PVUPUKPMMLYLU[WH[[LYUZ[VSL[ `V\RUV^OV^[OH[M\UJ[PVUPZVWLYH[PUN ;OL LPNO[ M\UJ [PVUZ VM [ OL KLTV JVTWYPZL! *HSPIYH[L3PNO[PUN¶HIV\[ZLJVUKZ HYLULLKLK[VHSSV^*4<JHT[VJHSPIYH[L [V[OLHTIPLU[SPNO[PUNJVUKP[PVUZ :HTWSL HUK :H]L *VSV\Y ¶ P[ [HRLZ HIV\[HZLJVUK[VSVJRVU[V[OLJVSV\Y VMHUVIQLJ[OLSKPUMYVU[VM[OLJHT"[OL 3,+Z^PSSÅHZOHUK[OLZWLHRLY^PSSILLW [^PJL^OLUKVUL;OLJVSV\Y]HS\LZHYL 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VISPURP[ZNYLLU3,+ +PZWSH` *4<JHT [YHJRPUN KH[H VU KLI\NZJYLLU;OLÄYZ[KH[HWHJRL[KPZWSH`LKI`[OL+LI\NZJYLLUPZ[OLº:»:[H[PZ[PJZWHJRL[^OPJO[LSSZ`V\[OLJVSV\YVM [OLVIQLJ[P[PZ[YHJRPUN;OPZ^PSSSL[`V\ L]HS\H[L[OLHIPSP[`VM`V\YJHTLYH[V[YHJR Web references [1] www.parallax.com [2] www.stampsinclass.com [3] www.seattlerobotics.com [4] www.cs.cmu.edu/~cmucam [5] www.milinst.com [6] www.ubicom.com/processors/sx/ sx_family.html [7] www.ovt.com [8] www.seattlerobotics.com/video.htm Sensor for Line Following Robots David Gustafik +5V 20 R3 R1 100k 10k R2 1k 6ULVM[OL[YHKP[PVUHSºKPZJPWSPULZ»PU^OPJO YVIV[ZHYLZ\WWVZLK[VJVTWL[LPZ[OL3PUL -VSSV^LY*VTWL[P[PVU9VIV[ZNVHSVUNH WYLKYH^UISHJRSPUL\Z\HSS`K\J[[HWLVUH ^OP[LPZOZ\YMHJL\Z\HSS`WHWLYJHYKIVHYK VYWSHZ[PJ ;OPZ KPZJPWSPUL YLX\PYLZ ZWLJPHS ZLUZVYZ <Z\HSS`[OLZLHYLTHKLV\[VMYLÅLJ[P]L VW[VZLUZVYZ Z\JO HZ *5@ 3;/ ;OPZZLUZVYJVU[HPUZHWOV[V[YHUZPZ[VYHUK HUPUMYHYLK3,+;OLZLZLUZVYZHYLWVPU[LK H[[OLZ\YMHJLVU^OPJO[OLYVIV[PZZ\WWVZLK[VZOV^VMMP[ZZWLLKHUKHNPSP[`;OL 3,+LTP[ZPUMYHYLKSPNO[VU[OLZ\YMHJLHUK [OLWOV[V[YHUZPZ[VYHJ[ZHZHYLJLP]LY;OL ISHJRJVSV\YLKSPUL[VMVSSV^YLÅLJ[ZMHYSLZZ SPNO[[OHU[OL^OP[LZ\YMHJLP[PZHMÄ_LKVU ;OLJ\YYLU[[OH[ÅV^Z[OY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[OLLTP[[LYVM;;7:PTPSHYS` YLWSHJPUN[OLWPLaVZV\UKLY^P[OHZ\P[HISLYLSH`HSSV^ZZ^P[JOPUNVMOPNOWV^LY ÅHZOLYZZPYLUZVYOVYUZ^VYRPUNVU[OL(* THPUZZ\WWS` (060349-I) PIC or Basic Stamp IR Telemeter with a PIC or a Basic Stamp 1 VCC 3 VCC C. Tavernier Regulator (S[OV\NOP[PZZ[PSSWVZZPISL[VJVUZ[Y\J[H [LSLTL[LY\ZPUNZ[HUKHYKYLZV\YJLZ[OLZL KH`ZP[»ZUV[YLHSS`^VY[O^OPSLILJH\ZLVM [OLH]HPSHIPSP[`VMYLHK`[V\ZLPU[LNYH[LK 7-8/2007 - elektor electronics Reflective object VCC Signal processing circuit Control circuit 12k (S[OV\NO[OLZPTWSLZ[YVIV[ZTH`ILJVU[LU[[VZPTWS`KL[LJ[PUNVIZ[HJSLZTHU` YVIV[Z[OH[YLX\PYLWYLJPZPVUPU[OLPYWVZP[PVUPUNULLK[VILHISL[VTLHZ\YLKPZ[HUJLZ HJJ\YH[LS` ;V HJOPL]L [OPZ P[ PZ ULJLZZHY`[V\ZLH[LSLTL[LY^OPJOJHU ILPUMYHYLKVY\S[YHZVUPJ09PZ]LY`Z\P[HISLMVYTLHZ\YPUNZOVY[KPZ[HUJLZHML^ JLU[PTL[YLZ\W[VHML^[LUZVMJLU[PTL[YLZ^OPSL\S[YHZV\UKPZTVYLZ\P[HISLMVY KPZ[HUJLZMYVTHML^[LUZVMJLU[PTL[YLZ[V ZL]LYHSTL[YLZ 4 VOUT 2 VIN (Control signal input) Light detector (PSD) LED drive circuit IR LED VCC 1 GND TVK\SLZ[OH[HYLHSSYLSH[P]LS`HJJ\YH[L JOLHWHUKJVTWHJ[;HRPUNHSVVRH[09 [LSLTL[LYZ[OL:OHYWYHUNLPZJ\YYLU[S`[OL SHYNLZ[HUKTVZ[YLHKPS`H]HPSHISLPUZVMHY 070235 - 11 HZ^L^PZO[VZ[PJR^P[OWYVK\J[ZH[WYPJLZ JVTWH[PISL^P[OHUºHTH[L\Y»YVIV[ ;OPZYHUNL^OVZLWHY[U\TILYZHSSILNPU ^P[O.7¯PUJS\KLZ[LSLTL[LYZ[OH[WYV- 21 Listing 1. Use of GP2Dxx with a Basic Stamp. Vin Vout Measr Measr = Read: Vin = 0 Wait: IF Vout SHIFTIN Vin = 1 Pause = con con var 0 0 1 Byte ‘ Definition of control input ‘ Definition of data output ‘ Allocation of one byte for the result ‘ Initialization of variable « Measr » ‘ Validation of telemeter = 0 THEN Wait ‘ Wait until result is available Vout, Vin, 2, [Measr] ‘ Put telemeter to sleep 1 ‘ Pause as a precaution ‘ The result of the measurement is available in the variable ‘Measr’ ]PKLVUVMMV\[W\[Z[OV\NO[OLZLHYLU»[ YLHSS`[LSLTL[LYZHZZ\JOPUMVYTH[PVUPU HUHSVN\LMVYTHUKPUMVYTH[PVUPUKPNP[HS MVYT;OV\NO[OL]LYZPVUZWYV]PKPUNHUHSVN\LPUMVYTH[PVU^V\SKHWWLHY[VIL[OL LHZPLZ[[V\ZLP[»ZHIZ\YK[V\ZL[OLTPUH YVIV[KYP]LUI`HTPJYVJVU[YVSSLY^OPJO ^PSS PTTLKPH[LS` JVU]LY[ [OPZ HUHSVN\L ]VS[HNLPU[VHKPNP[HSZPNUHS]PHP[ZI\PS[PU JVU]LY[LYZVHZ[VILHISL[VTHRL\ZLVM P[:VP[PZIL[[LY[VOH]LKPNP[HSPUMVYTH[PVUH]HPSHISLYPNO[MYVT[OLV\[ZL[L]LUPM P[TPNO[ZLLTHSP[[SLOHYKLY[VYLHKH[[OL [LSLTL[LYV\[W\[ LX\HSS`HWWSPJHISL[VIV[OVM[OLT ;OLWYPUJPWSLVMHU09[LSLTL[LYPZYLSH[P]LS` ZPTWSL!HU3,+LTP[ZHU09ILHT[OH[PM P[LUJV\U[LYZHUVIQLJ[PZYLÅLJ[LKIHJR [V^HYKZHWOV[VKPVKL3LM[H[[OH[Z\JOH Z`Z[LTPZHUVU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[WV^LY JVUZ\TW[PVU0U[OLV[OLY[LSLTL[LYZP[»Z VUHSS[OL[PTL ;OL**+ZLUZVYPZMVSSV^LKI`HZPNUHS WYVJLZZPUNJPYJ\P[[OH[HSSV^ZHUV\[W\[[V ILNLULYH[LKHZLP[OLYHUVUVMM[`WLZPNUHS MVY[OLZPTWSLZ[[LSLTL[LYZHUHUHSVN\L ZPNUHSVYSHZ[S`IP[KPNP[HSPUMVYTH[PVU HZPU[OLTVKLSZ[OH[PU[LYLZ[\Z :VHZ[VILJVTWH[PISL^P[OHTH_PT\T U\TILYVMYVIV[PJZZVS\[PVUZ^L»]LVW[LK [V ZOV^ `V\ OV^ [V \ZL Z\JO H [LSLTL[LY^P[OLP[OLYH)HZPJ:[HTWVYH70* TPJYVJVU[YVSSLYWYVNYHTTLKPU)HZPJVY THJOPULJVKL Listing 2. Use of GP2Dxx with a PIC controller. Read BCF NOP Wait BTFSS GOTO BSF CLRF MOVLW MOVWF BCF NOP Readbit BCF NOP NOP RLF BTFSC BSF BSF NOP NOP GOTO PortA.0 ‘ Validation of telemeter PortA,1 Wait PortA,0 Measr 8 Count Status,C ‘ Wait until result is available ‘ Vin goes High ‘ Initialization of the variable ‘Measr’ ‘ Get ready to read 8 bits Porta.0 ‘ Make clock Low Measr,f PortA.1 Measr,0 PortA.0 ‘ Rotation of preceding bit ‘ Read data bit DECFSZ Count,f Readbit ‘ Zero the carry ‘ Make clock High ‘ Count down number of bits to read ‘The result of the measure is available in the variable ‘Measr’ 22 elektor electronics - 7-8/2007 3 2 70 ms or more PIC or Basic Stamp Connector GP2Dxx 1.5 ms or more 0.2 ms or less +5V 1.5 ms or more 1 ms or more Power OFF VIN 1 D1 2 3 RA0 (PIC) or P0 (Stamp) 1N4148 4 RA1 (PIC) or P1 (Stamp) Output MSB LSB Example of distance measuring output (8-bit) 070235 - 12 Distance measuring output (DEC) )HZPJMVY[OL)HZPJ:[HTWHUK70*ZWYV;OL [LSLTL[LY HWWSPJH[PVU JPYJ\P[ JHU NYHTTLKPU)HZPJVYPU70*HZZLTISLYMVY IL Z\TTLK \W HZ ZOV^U PU -PN\YL [OVZLVM`V\^OVWYLMLYTHJOPULJVKL ^OL[OLYP[»Z^P[OH70*VYH)HZPJ:[HTW ;OL.7+VY.7+KL[LJ[VYPZ WV^LYLKHSS[OL[PTLI\[ILJH\ZLP[ OHZHJVU[YVSPUW\[P[JVUZ\TLZ]PY[\4 220 White paper: KODAK made gray chart R-27 HSS`UV[OPUN^OLU[OLYLPZUVTLHZ\Ywhite surface (reflectivity: 90%) 200 PUN[HRPUNWSHJL(NSHUJLH[[OL[PTPUN Gray paper: KODAK made gray chart R-27 gray surface (reflectivity: 18%) KPHNYHTPU-PN\YLZOV^Z\Z[OH[[OPZ 180 PUW\[PZ\ZLKUV[Q\Z[MVY]HSPKH[PUN[OL 160 TLHZ\YLTLU[I\[HSZVHZHJSVJRMVY White 140 [YHUZMLYYPUN[OLYLHKPUN[V[OL=V\[[LYTPUHS/LUJLP[ULLKZ[VILJVU[YVSSLK 120 I`[OLHZZVJPH[LKTPJYVJVU[YVSSLYI\[ 100 HZP[T\Z[UV[ILZ\IQLJ[LK[VH]VS[HNL 80 HIV]L=KPVKL+PZVSH[LZP[MYVT 60 [OLTPJYVJVU[YVSSLYV\[W\[^OLU[OL Gray SH[[LYPZOPNO 40 ;OL[PTPUNKPHNYHTPU-PN\YLZOV\SK LUHISL`V\[VLHZPS`MVSSV^[OLSPZ[PUNZ VM[OL]LY`ZOVY[WYVNYHTZ^L»]L^YP[[LUMVY\ZPUN[OPZZLUZVY^OL[OLYPU 20 0 0 20 40 60 80 100 120 Distance to reflective object L (cm) 140 070235 - 14 LSB 070235 - 13 (ZMHYHZ[OL)HZPJ:[HTWPZJVUJLYULK Q\Z[[OLPUZ[Y\J[PVU:/0-;05PZHSSP[[HRLZ [VYLHK[OLYLZ\S[VM[OLZLUZVY»ZTLHZ\YLTLU[-VY[OL70*[OLYL^PSSVI]PV\ZS` ULLK[VILHML^TV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YLZPZ[VYZ^OPJOKVULLK[VILÄ[[LKHZ[OL`HYL UV[I\PS[PU[VLP[OLY[OL*47TVK\SL VY[OLTPJYVJVU[YVSSLY^OPJOL]LY[`WLP[ PZ0M`V\HYL\ZPUNH70*WYVNYHTTLKPU )HZPJ`V\HSZVULLK[VLUZ\YL`V\JVYYLJ[S`JOVVZL[OLWVY[ZPU[LUKLK[VOHUKSL [OL:+(HUK:*3ZPNUHSZVM[OL0*I\Z HZJLY[HPU)HZPJJVTWPSLYZPTWVZLYLZ[YPJ[PVUZOLYL ;VILPUHWVZP[PVU[V^YP[L[OLJVYYLZWVUKPUNWYVNYHTHSS`V\[OLUULLK[VRUV^PZ [OH[[OL0*HKKYLZZVM[OL*47TVK\SLPZ*HUK[OH[MV\YTHPUYLNPZ[LYZHYL HJJLZZPISL[V\Z[OYV\NO[OPZHKKYLZZ! •YLNPZ[LYJVU[HPUZ[OLTVK\SL»ZZVM[^HYL ]LYZPVUU\TILY" •YLNPZ[LYJVU[HPUZ[OLHUNSLJVKLKPU VULI`[L/LUJL[OPZ]HS\LJOHUNLZMYVT ¶ JVYYLZWVUKPUN [V H JPYJSL MYVT ¶" •YLNPZ[LYZ HUK JVU[HPU [OL HUNSL elektor electronics - 7-8/2007 +U 21 1 2 3 SOUT VIN R2 1 SIN ATN RES 22 2 3 IC1 5 6 7 8 9 I2CSTART Temp = I2CWRITE (&HC0) Temp = I2CWRITE(0) I2CSTART Temp = I2CWRITE(&HC1) Version = I2CREAD(0) Temp = I2CWRITE(&HC1) Position8 = I2CREAD(0) Temp = I2CWRITE(&HC1) P o s i t i o n 1 6. b y t e 1 I2CREAD(0) Temp = I2CWRITE(&HC1) P o s i t i o n 1 6. b y t e 0 I2CREAD(0) R1 24 4k7 -YVT[OH[WVPU[VUYLHKPUN[OPZ PUMVYTH[PVU ]PH HU 0 * I\Z PZ X\P[LZ[YHPNO[MVY^HYKHZZOV^U PU[OL]LY`ZOVY[SPZ[PUNILSV^ ^YP[[LUMVY[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UN[OL ZVM[^HYL]LYZPVUU\TILYH]HPSHISLPU[OL]HYPHISLVersion [OLIP[JVKLKHUNSLPU[OL]HYPHISLPosition8HUK[OL IP[HUNSLPU[OLIP[]HYPHISL Pin 9 - 0V GND Web Links Pin 8 - No Connect Devantech Pin 7 - 50/60 Hz Pin 5 - No Connect http://www.robot-electronics.co.uk/shop/Compass_ CMPS032004.htm Pin 4 - PWM A little background reading: Pin 3 - SDA http://zedomax.com/blog/zedomax-diy-hack-lets-make-a-digitalcompass/ Pin 6 - Calibrate Pin 2 - SCL Pin 1 - +5V http://zedomax.com/ blog/2006/08/16/digital-compassusing-cmps03/ 070304 - 13 A/D Converter for Robots Tilo Gockel ;OL;3* *7HUHSVN\L[VKPNP[HSJVU]LY[LY(+MYVT;L_HZ0UZ[Y\TLU[ZPZH NVVKJOVPJLMVYHWWSPJH[PVUZPU[OLÄLSKVM YVIV[PJZLZWLJPHSS`[OVZL\ZPUNJVTWH[PISLTPJYVJVU[YVSSLYZ;OLZLWHY[PJ\SHY JVU]LY[LYZHYLYLHKPS`H]HPSHISLSV^JVZ[ HUKLHZ`[V\ZL ( X\PJR SVVR H[ [OL ;3* KH[H ZOLL[ PUKPJH[LZ[OL[PTPUN^H]LMVYTZMVY[OL0 6*SVJR+(;(6<;HUK*:ZPNUHSZ-PN\YL(JPYJ\P[[V[LZ[[OLJVU]LY[LY^HZ X\PJRS`JVUZ[Y\J[LK\ZPUNH]HYPHISLYLZPZ[VYHZHWV[LU[PHSKP]PKLY-PN\YLZOV^Z [OLZPTWSLPU[LYMHJLIL[^LLUH;3* *7 HUKHJVTWH[PISLTPJYVJVU[YVSSLY ( ZOVY[ M\UJ[PVU ^OPJO YLHKZ [OL ZLYPHS 7-8/2007 - elektor electronics operating sequence 1 2 3 4 5 6 7 8 8 Don’t I/O CLOCK Access Cycle B tsu(CS) 1 3 Access Cycle C tconv (see Note A) Sample Cycle B 2 4 5 6 7 Care Sample Cycle C tsu(CS) CS twH(CS) DATA OUT Hi-Z State Hi-Z State A7 A6 A5 A4 A3 A2 A1 A0 B7 B6 B5 B4 B3 B2 B1 B0 B7 A7 Previous Conversion Data A MSB LSB (see Note B) ten Conversion Data B MSB MSB LSB MSB ten NOTES: A. The conversion cycle, which requires 36 internal system clock periods (17 Ms maximum), is initiated with the eighth I/O clock pulse trailing edge after CS goes low for the channel whose address exists in memory at the time. B. The most significant bit (A7) is automatically placed on the DATA OUT bus after CS is brought low. The remaining seven bits (A6–A0) are clocked out on the first seven I/O clock falling edges. B7–B0 follows in the same manner. 25 unsigned char count; unsigned char addat = 0; P1_B2 = 0; // clk P3_B0 = 0; // Chip Select P3_B0 = 1; // //_wait(); // > 20 usek (50kHz) P3_B0 = 0; for(count = 0; count < 8; count++){ addat = addat << 1; if (P1_B3 == 1) ++addat; P1_B2 = 1; //_wait(); P1_B2 = 0; } return addat; } +5VDC MC51 1 REF+ VCC 8 TLC549 7 I/O CLOCK 2 DATA OUT ANALOG Px.x 6 A7 A6 A5 A4 A3 A2 A1 Px.x A0 5 Px.x 10k 3 REF- GND 4 070134 - 12 KH[H MYVT [OL ;3* HUK YL[\YUZ [OL ]HS\LHKKH[PZNP]LUILSV^;LZ[Z^P[OHU (; :*VU[YVSSLY)VHYK[OL,SLR[VY ,SLJ[YVUPJZ+LJLTILY-SHZO4PJYV )VHYKPUKPJH[LK[OH[[OLF^HP[JHUIL VTP[[LKILJH\ZL[OLJVU[YVSSLYY\UZZSV^S` LUV\NOUV[[VULLKP[MHZ[LYWYVJLZZVYZ TH`YLX\PYLP[I\[P[OHZILLUºJVTTLU[LK V\[» PU [OPZ SPZ[PUN ;OL HJ[\HS M\UJ[PVU ^YP[[LUPU*PZ! unsigned char ReadADC1() { (ZHUL_HTWSL[^V;3* (+JVU]LY[LYZJHUIL^PYLK[VHTPJYVJVU[YVSSLY[V TLHZ\YL[OLHTV\U[VMSPNO[MHSSPUNVU[V [^V3PNO[+LWLUKHU[9LZPZ[VYZ3+9;OPZ HWWSPJH[PVU^PS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[OL UH[\YHS JOVPJL LZWLJPHSS` ZPUJLJLY[HPUºNLHYIV_»RP[ZHYLZVSK^P[O Z\JOTV[VYZ:VHSS[OH[YLTHPUZPZ[VKYP]L [OLTJVYYLJ[S` (S[OV\NO JVU]LU[PVUHS [YHUZPZ[VYIHZLK JPYJ\P[ZHYLZ[PSS\ZHISL[OLYLPZHSZVVUL ]LY` ZPTWSL ZVS\[PVU KPYLJ[S` PUZWPYLK I`[OLVSKJHZZL[[LYLJVYKLYZPU^OPJO +*TV[VYZ^LYL^PKLS`\ZLK0[PU]VS]LZ \ZPUNHU3)0*THKLI`:HU`V^OPJO JHUILJHUUPIHSPaLKMYVTTHU`JHZZL[[L YLJVYKLYZ[OH[OH]LILLU[OYV^UV\[VY LSZLIV\NO[UL^MYVT3L_[YVUPJMVYL_HTWSL^^^SL_[YVUPJMY (]HPSHISL PU HU WPU +07 WHJRHNL [OL elektor electronics - 7-8/2007 3) PZ YPKPJ\SV\ZS` ZPTWS` [V Truth table \ZLHZZOV^UPU-PN\YL0UMHJ[ for LB1630 motor control IC. HSSP[ULLKZ[VILHISL[V^VYRPZ IN1 IN2 OUT1 OUT2 Motor VULL_[LYUHSKLJV\WSPUNJHWHJP[VY H L H L Forward run 0[»ZJVU[YVSSLKI`[^VSVNPJZPNUHSZ ^OPJO HYL ;;3JVTWH[PISL ^OLU L H L H Reverse run [OLJPYJ\P[PZWV^LYLKMYVTH]VS[H H HiZ HiZ Stop HNLVM[OLVYKLYVM=;OLZ\WWS` L L HiZ HiZ Stop T\Z[ILIL[^LLUHUK=HUK T\Z[UV[\UKLYHU`JPYJ\TZ[HUJLZ L_JLLK=H[YPZRVMKLZ[YV`PUN[OL 2 21 0* +6V ;OL J\YYLU[ KYH^U I` [OL TV[VY 1 24 SOUT VIN ILPUNKYP]LUJHUIL\W[VT( 2 SIN C1 3 22 TH_PT\T[OV\NOWLHRZ\W[V( ATN RES 10M IC2 HYLHSSV^LKI\[VUS`PU[OLMVYT 16V 20 5 P15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 VWLYH[PUN [OLZL [^V 3+9Z T\Z[ IL TV\U[LK WVPU[PUN MVY^HYKZ ZLWHYH[LK MYVTLHJOV[OLYI`HZTHSSWPLJLVMJHYKIVHYKVYVWHX\L7*)PUZ\JOH^H`[OL` JHU»[IV[OYLJLP]L[OLZHTLPSS\TPUH[PVU ;OL HZZLTIS` JHU IL WV^LYLK I` MV\Y = IH[[LYPLZ ;OPZ ]VS[HNL PZ HWWSPLK KPYLJ[S`[V[OLZLY]VZHUK[V[OL\UYLN\SH[LK 7>9 PUW\[ VM [OL )HZPJ :[HTW0 >H[JOV\[<UKLYUVJPYJ\TZ[HUJLZJVUULJ[ [OL ZLY]V Z\WWSPLZ MYVT [OL )HZPJ :[HTW0»Z=V\[W\[¶P[ZI\PS[PU= YLN\SH[VY^V\SKU»[HWWYLJPH[LP[ ;OLZVM[^HYLWHY[VMV\YYVIV[PZH[SLHZ[ HZZPTWSLHZ[OLOHYK^HYLWHY[HZ`V\JHU Q\KNLMYVT[OLSPZ[PUNILSV^! 3PZ[PUN PINS = 0 DIRS = %00001111 SYMBOL RightStop = 150 SYMBOL LeftSTop = 150 SYMBOL Move = 30 SYMBOL LightDif = b2 SYMBOL RightLDR = b6 SYMBOL LeftLDR = b7 Main : POT 7, 128, LeftLDR POT 6, 128, RightLDR LightDif = RightLDR – LeftLDR b0 = RightSto p + Move - LightDif b1 = LeftStop - Move + LightDif PULSOUT 0, b0 PULSOUT 1, b1 GOTO Main ;OPZSPZ[PUNPZ]LY`LHZ`[VHUHS`ZL(M[LYHU PUP[PHSWOHZL[VKLÄUL[OLSHILSZ\ZLKHUK [OLYLZLY]H[PVUVM[OL9(4PU[OL)HZPJ :[HTW0^LNVVU[VTLHZ\YL[OLSPNO[\ZPUN [OLPUZ[Y\J[PVUPOT;OPZPUZ[Y\J[PVUYL[\YUZ PU[OL]HYPHISLLeftLDRVYRightLDRH U\TILYYLWYLZLU[PUN[OLYLZPZ[HUJLVM[OL 3+9ZJVUULJ[LK[V7HU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PZLX\HS[V[OL[PTL [V[OLJPYJ\P[HYLH=Z\W[V[OLYLÅLJ[PVUPUTPSSPZLJVUKZT\S[PWSPLK WS` HUK NYV\UK H JVU[YVS I`-VYL_HTWSLH[PTLVMTZMVY[ ZPNUHSMVY[OL[YHUZTP[[LYHUK JVYYLZWVUKZ[VHKPZ[HUJLVMJT [OLHUHSVN\LLU]LSVWLZPNUHSYL[\YULKI`[OLYLJLP]LY 0M HU VIQLJ[ PZ ]LY` ULHY [OL YLMSLJ[LK [V[OLWYVJLZZPUNOHYK^HYL ZV\UK^PSSIL]LY`SV\KHUKILYLJLP]LK P[PZZ[YHPNO[MVY^HYK[V^PYL HM[LYH]LY`ZOVY[[PTLWVZZPIS`^OPSL[OL \WMV\YJVWPLZVM[OLJPYJ\P[ W\SZLPZZ[PSSILPUN[YHUZTP[[LK-PN\YL 4 TV\U[LKH[YPNO[HUNSLZ[V 0U[OPZJHZLP[PZILZ[[VTLHZ\YL[OL[PTL VUL HUV[OLY 0U H YVIV[[HRLUMVY[OLYLJLP]LKZPNUHS[VYLHJOOHSM PJZ HWWSPJH[PVU [OPZ ^V\SK P[Z TH_PT\T HTWSP[\KL MYVT ^OLU [OL NP]L[OLYVIV[[OLHIPSP[`[V VZJPSSH[VYPZZ^P[JOLKVU;OPZ[PTLJHU KL[LJ[VIQLJ[ZPUHU`WVZP[OLUIL\ZLK[VMVYTHULZ[PTH[LMVY[OL [PVUYLSH[P]L[VP[ZLSM KPZ[HUJL[V[OLVIQLJ[ 11 r1 STI 1 +5V 2 3 GND 4 CONTROL C6 R6 10p 100k 13 9 IC2.C 10 8 14 IC2.D D1 12 180k LL4448 6 IC2.B 7 5 180k 22k R10 C9 100n 070281 - 11 control input analogue output t1 t2 time 070281 - 12 control input strong refection t1 analogue output t2 time 070281 - 13 control input t1 1st maximum analogue output 1rd maximum 2nd maximum (070281-I) 0M[OLYLPZHU\TILYVMYLÅLJ[PUNVIQLJ[Z H[KPMMLYLU[KPZ[HUJLZ[OL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2 C3 ;PS[$HYJZPU(? (? WYVWVY[PVUHS [V [OL 8 19 47n 47n HJJLSLYH[PVU 6MJV\YZL[OL\ZLYPZ HUK 070305 - 12 X\P[L \UH^HYL VM HSS [OPZNVPUNVUI\[OHZ 9VSS$HYJZPU(Y(@ 32 elektor electronics - 7-8/2007 220k 47 7 Q\Z[[^VPUZ[Y\J[PVUZ[V ^OLYL( ?HUK(YHYL 3 HJJLZZ [OL [PS[ VY YVSS [OLHUHSVN\L]VS[HNLZ R2 PUMVYTH[PVU Z\WWSPLKI`[OLHJJLS:V MVY L_HTWSL `V\ LYVTL[LY ^OLU P[ PZ ^V\SK^YP[L PUJSPULKHUK( ?HUK 21 (@[OL]VS[HNLZZ\W+6V...+12V C4 C1 1 24 SOUT VIN WSPLK ^OLU P[ PZ WLYtilt = Adin(0) 2 10n 100n SIN tilt = tilt – 512 MLJ[S`OVYPaVU[HS 8 2 3 22 8 ATN RES 1 ( Z ZOV^U PU -PN‘ adjust accordVDD IC3 IC2.A 2 7 3 5 20 ing to the voltage \YL[OLHJJLSLYVTBIAS XOUT P0 P15 R1 6 19 IC1 P1 P14 L[LYHWWSPJH[PVUJPYJ\P[ output 4 5 7 18 NC NC P2 P13 IC2 = OP284 KVLZU»[ HTV\U[ [V ‘ when the incli8 17 ADXL311 P3 P12 ]LY`T\JO;OLVUS` n o m ete r is 1 6 5 9 16 ST YOUT P4 P11 7 10 CB220 15 PTWVY[HU[ LSLTLU[Z horizontal P5 P10 COM IC2.B 6 11 14 3 P6 P9 HYLPUMHJ[JHWHJP[VYZ 12 13 4 P7 P8 *HUK*^OPJOÄS[VYLJV]LY[OL[PS[PUMVYC2 C3 [LY[OLHJJLSLYVTL[LY TH[PVU\ZPUNH*\ISVJ 4 23 47n 47n V\[W\[]VS[HNL0[HJ[\*) HSS`OHZHWHZZIHUKVM >OPSL`V\TPNO[^YP[L 070305 - 13 ZL]LYHSR/aHUKJHU MVYL_HTWSL [OLYLMVYLYLHJ[[V]LY` MHZ[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 OSC2 10 K2 C1– 13 12 16 IC1 C4 19 1M 25V 3307 R1 9 25V 2 RA2/AN2/VREF- 3 IC2 C3 1M RA5/AN4/SS/LVDIN C9 15p 15p 4.9152MHz 070314 - 11 Photodiode Array properties Array MLX90255 TLS1301 TLS1401 TLS208R Pixel (* see text): 128 (+ 4*) 102 128 512 Pitch (DPI): 385 300 400 200 Weighting: Cosine Equal Equal Equal Length x width (μm): 200 x 66 85 x 77 63,5 x 55,5 120 x 70 Output (V): 0.125 - 2.4 0 - 2.0 0 - 2.0 0 - 2.0 ;OLJPYJ\P[KPHNYHTZOV^UOLYLJVUZPZ[ZVM [OLWOV[VKPVKLHYYH`[VNL[OLY^P[OHIHZPJ 70*TPJYVJVU[YVSSLYHUKHKYP]LYJOPWMVY HU9:ZLYPHSPU[LYMHJLJVUULJ[PVU;OL H\[OVYOHZWYVK\JLKHWYVNYHT^YP[[LUPU *^OPJOJHUIL\ZLKPU[OLJVU[YVSSLY;OL ZV\YJLÄSLZaPWHYLH]HPSHISL [VKV^USVHKMYLLVMJOHYNLMYVT[OLEleR[VY,SLJ[YVUPJZ^LIZP[L(ZJHUJ`JSLPZ PUP[PH[LK\ZPUNH[LYTPUHSWYVNYHTI`LU[LYPUNº:[YN:»;OL]HS\LZHYLZLWHYH[LK^P[O ZLTPJVSVUZZV[OL`JHUILLHZPS`\ZLKPU HU,_JLS[HISL 7OV[VKPVKLHYYH`ZJHUIL\ZLKPUYVIV[PJZMVYPTHNPUNIHZLKVU[OLWPUOVSLJHTLYHWYPUJPWSL[OL`OH]LHSZVILLU\ZLK PUSPULMVSSV^PUNHWWSPJH[PVUZ^OLYL[OL` VMMLYNVVKYLZVS\[PVUHUKJHUILTV\U[LK YLSH[P]LS`MHYH^H`MYVT[OLÅVVY;VNL[OLY ^P[OHWYPZTVYVW[PJHSNYH[PUN[OLHYYH` JHUIL\ZLK[VWLYMVYTZPTWSL`L[WYLJPZL JVSV\YYLJVNUP[PVU (070314-I) Whiskers on Robots Alexander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LUKVM[OLIYHZZ [\ILHUKHUV[OLY^PYL[V[OLLUKVM[OL N\P[HYZ[YPUN0UZ\SH[L[OLQVPU[VU[OLN\P[HY Z[YPUN\ZPUNOLH[ZOYPUR[\IPUN :SPKL[OLZ[YPUNPU[V[OL[\ILZV[OH[VUS` HIV\[[OLÄYZ[TTMYVT[OLLUKVM[OL [\ILPZPUZ\SH[LK-P_[OLZ[YPUNJLU[YHSS` ^P[OPU[OL[\IL\ZPUNOV[TLS[NS\L)L JHYLM\SUV[[VHSSV^[VVT\JONS\L[VY\U KV^UPUZPKL[OL[\IL D Q SENSOR INPUT 5 IC1.A 3 C Q 6 R 1 RESET ;OLYLZ\S[ZOV\SKSVVRSPRL-PN\YL6M JV\YZL`V\HYLMYLL[VL_WLYPTLU[^P[O ]HYPH[PVUZVU[OPZJVUZ[Y\J[PVU (Z^LOH]LKLZJYPILKP[[OPZYVIV[^OPZRLY PZLZZLU[PHSS`Q\Z[HZPTWSLZ^P[JOJVU[HJ[ ;VLUZ\YL[OH[L]LU[OLNLU[SLZ[JVSSPZPVU KVLZUV[WHZZ\UUV[PJLK^LYLJVTTLUK [OH[`V\\ZL[OL^OPZRLY[V[YPNNLYHÅPWÅVW 070282 - 11 HZZOV^UPU-PN\YL;OLTPJYVJVU[YVSSLY PU[OLYVIV[JHU[OLUYLHK[OLZ[H[LVM[OL ÅPWÅVWH[P[ZSLPZ\YLHUK[OLUYLZL[P[ (070282-I) CO Sensor Active charcoal filter Gas inlet Cap / Working electrode terminal Gas inlet Backing Layer Catalyst Layer Gasket Gas diffusion control film Separator (immersed by liquid alkaline electrolyte) Gas sensing layer Washer Water Can / Counterelectrode terminal C1 070187 - 12 22M R2 100k Figure 1. Internal structure of the sensor. IC1 2 working AD708 1 Uout 7-8/2007 - elektor electronics MYPLUKS`HUK[OLOV\ZPUNPZSLHRWYVVM;OL ZLUZVYJHUTLHZ\YL*6JVUJLU[YH[PVU\W [VHUKP[OHZH[LTWLYH[\YLYHUNLVM¶ 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[PVUHSP[` VM [OL ISVJRZPZÄ_LK 5V[,_HJ[*5?*PZHWYVNYHTTPUNSHUN\HNLMVY[OL5?;[OH[OHZHZ[YVUNYLZLTISHUJL[V*;OPZWLYTP[ZHT\JONYLH[LY ÅL_PIPSP[`^OLUWYVNYHTTPUN0UWHY[PJ\SHY^OLUP[JVUJLYUZOHYK^HYL[OH[PZUV[ VMÄJPHSS`Z\WWVY[LKI`3LNVZ\JOHZ[OPZ JVTWHZZZLUZVY ;OL JVTWPSLY )YPJ? BD JHU IL KV^USVHKLKMYLLPZZPTWSL[V\ZLHUKVMMLYZ THU`VW[PVUZMVYWYVNYHTTPUN[OL5?; ;OLWYVNYHTJVTWHZZU_J^OPJOJHUIL KV^USVHKLKMYLLMYVT[OL,SLR[VY,SLJ[YVUPJZ^LIZP[LHZÄSLU\TILYaPW JVU[PU\HSS`YLHKZ[OLJVTWHZZZLUZVY;OL TLHZ\YLK]HS\LZHYL[OLUWYVJLZZLKI` [OLYVIV[^OV^PSSZLX\LU[PHSS`ºWVPU[»[V 5VY[O:V\[O,HZ[HUK>LZ[;OL]HS\LZ TLHZ\YLKI`[OLLSLJ[YVUPJJVTWHZZJHU HSZVILYLHKMYVT[OLKPZWSH`VU[OL5?; IYPJR (070156-I) References [1] Compass sensor for Lego RCX, Elektor Electronics July/August 2002 [2] Devantec: http://www.robot-electronics. co.uk/shop/Compass_CMPS032004.htm [3] BricX: http://bricxcc.sourceforge.net/ elektor electronics - 7-8/2007 Ultrasonic Distant Obstacle Detector 1 +5V...+12V 7-8/2007 - elektor electronics R5 330 7 1k lin. R7 14 C4 C5 10k P1 IC1 10n 100M 15V 7 IC1 = 74HC14 IC1.A IC1.B 4k7 R1 1 C1 22n C2 R2 470k -VYJSVZLVY]LY`JSVZLVIZ[HJSLZYLÅLJ[P]L 09ZLUZVYZHYLTVZ[VM[LU\ZLKHUL_HTWSL VMZ\JOHWYVQLJ[HWWLHYZLSZL^OLYLPU[OPZ PZZ\L;OLZLZLUZVY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S\WYLZPZ[VYPZKPZJVUULJ[LKHUK [OL[PTLPZTLHZ\YLK\U[PS[OLPUW\[]VS[HNL Listing SL]LSMHSSZILSV^[OLSV^LYPUW\[[OYLZOVSK SL]LS-PN\YL ;OL,_HTWSLWYVNYHTPZHSPZ[PUNMVYHU ([TLS (=9 WYVJLZZVY ^OPJO TLHZ\YLZ SPNO[PU[LUZP[`;OLWYVNYHT[VNNSLZHSS[OL V\[W\[IP[ZMYVTWVY[(HM[LYLHJOJ`JSL ZV[OH[P[WYVK\JLZHUV\[W\[ZX\HYL^H]L ^P[OHWWYV_PTH[LS`K\[`J`JSLH[H MYLX\LUJ`WYVWVY[PVUHS[V[OLTLHZ\YLK PSS\TPUH[PVU;OLMYLX\LUJ`]HYPLZMYVT TPSSPOLY[aPUHKHYRLULKYVVT\W[VZL]LYHSO\UKYLKRPSVOLY[a^OLUSPNO[ZOPULZ KPYLJ[S`VU[V[OL3,+;OPZTLHZ\YLTLU[ YHUNL^V\SKILKPMÄJ\S[[VHJOPL]L\ZPUN HU(+JVU]LY[LY5HYYV^ILHT3,+ZOH]L HJVYYLZWVUKPUNUHYYV^ºKL[LJ[PVUHUNSL» THRPUN[OLTTVYLKPYLJ[PVUHS^OPJOTH` ILILULÄJPHSPUZVTLHWWSPJH[PVUZ+PMMLYLU[3,+ZHYLZLUZP[P]L[VZWLJPÄJJVSV\YZ ^OPJOJHUHSZVIL\ZLM\SPUZVTLYVIV[PJ HWWSPJH[PVUZ (070356-I) Web link [1] www.merl.com/publications/TR2003-035/ Example program: #include <avr/io.h> #include <avr/interrupt.h> 2 #define LEDPIN 0x40 // LED on PB6 I photo 070356 - 12 int main() { unsigned char cr=0,cb=0; DDRB = 0x00; // PORTB input DDRA = 0xff; // PORTA output for display LEDs PORTA = 0; // off PORTB = LEDPIN; // PB6 hi 3 sei(); VCC while(1) { if((PINB & LEDPIN) == 0) // discharge complete { PORTB = LEDPIN; // PB6 hi // multiple times to get enough charging time DDRB |= LEDPIN; // PB6 output and DDRB |= LEDPIN; // PB6 output and DDRB |= LEDPIN; // PB6 output and DDRB |= LEDPIN; // PB6 output and 070356 - 13 4 hi, hi, hi, hi, charges charges charges charges LED LED LED LED DDRB &= ~LEDPIN; // PB6 input, still charging w/ pullup PORTB = 0; // switch off pullup PORTA ^= LEDPIN; // toggle PORTA for display LEDs IN } } return(0); 070356 - 14 38 } elektor electronics - 7-8/2007 7-8/2007 - elektor electronics 39 MotoBox Drives stepper, DC and servo motors Joseph Zamnit (MCAST, Malta) Before a robot moves, no matter if that’s walking, swimming, cruising a maze or tearing up asphalt, you need to address the interfacing and driving of different types of motors. Developing the relevant algorithms will increase project development time as tweaks and adaptations seem to be necessary for each new application. This project solves these issues by presenting a generic motor driver board that can drive three different types of motors, stepper, DC and servo, without having to program the algorithm for each motor. MotoBox is ideal for newcomers to robotics as well as for old hands who can use the board for prototyping and development. The board can also be used with two different types of motors simultaneously! ;OLIVHYKPZWYVNYHTTLKI`^H`VMHU 9:PU[LYMHJL;OPZPZHJVTTVUWYV[VJVSMV\UKPUTHU`TPJYVJVU[YVSSLYZ0[JHU ILKYP]LUMYVT[OLZLYPHSWVY[VMHJVTW\[LYVY]PHHUV[OLYTPJYVJVU[YVSSLY;OL ZJYPW[\ZLK[VJVU[YVS[OLTV[VYZPZH]LY` LHZ`JOHYHJ[LYJVTTHUKZL[0[OHZILLU RLW[[OPZ^H`PUVYKLY[VOH]LH]LY`\ZLY MYPLUKS`PU[LYMHJL;OLZJYPW[HSZVHSSV^Z [OLZ[H[LVM[OLIVHYK[VILYLHKIHJR[V [OL\ZLY(KKP[PVUHSS`[OLIVHYKTVUP[VYZ [OLJ\YYLU[[HRLUI`LHJOTV[VYKYP]LYHUK Z^P[JOLZVMM[OLKYP]LYPMHZOVY[JPYJ\P[ PZKL[LJ[LK ;OLH\[OVYPZHWYVMLZZPVUHSLUNPULLY ^P[OTHU``LHYZL_WLYPLUJLPZKLZPNUPUN HUKJVUZ[Y\J[PUNLSLJ[YVUPJJPYJ\P[Z/PZ ZWLJPHSPZH[PVUPZWSHUHYHU[LUUHKLZPNUHUK J\YYLU[S`OLPZH;LSLJVTT\UPJH[PVUZSLJ[\YLYH[4*(:;4HS[H *PYJ\P[KLZJYPW[PVU 9LMLYYPUN[V[OLZJOLTH[PJPU-PN\YL [OLOLHY[VM[OLJPYJ\P[PZH70*-( ^OPJO JVU[YVSZHUKTVUP[VYZ[OLTV[VY KYP]LYZ ;OL TPJYVJVU[YVSSLY PZ JVUMPN\YLK [V \ZL P[Z PU[LYUHS 4/aVZJPSSH[VY[O\ZMYLLPUN [OL WPUZ HZZVJPH[LK ^P[O [OL s n catio fi i JY`Z[HS[VIL\ZLKHZ[OLZLYPHS c e p S x o B PU[LYMHJL 769;) PZ \ZLK HZ o Mot rs: to o HUV\[W\[[VKYP]L[OLTV[VY m f es o rs s 3 typ JVU[YVSSLYZ^OPSL769;(PZ r moto e p • Drive p lar ste \ZLK MVY ]HYPV\Z M\UJ[PVUZ • bipo rs oto • DC m [V YLHK [OL ]HS\L VM [OL ,1 600,N motors ort @ 9 p l • servo J\YYLU[ JVU[YVS [OL KYP]a ri e sing s ated u LYZHUKJVU[YVS[OLKYP]LY tu c a r otors • Moto 3,+»Z ;OL 4*39 WPU PZ ly for m p p u s 13.8V to p OLSK /PNO I` TLHUZ VM r) t U e • and s o moto d serv comm n e a 9 HUK + (U 0*:7 s u C D to 2A( • Easy g, up to WYVNYHTTPUNJVUULJ[VY n ri o it n otor) ent mo PZHSZVPUJS\KLKPUVYKLY • Curr (stepper m r’ o red ‘err or 4 A ’, k [V WYVNYHT [OL KL]PJL ‘o reen bridge ator: g driver ic r d PUWSHJL;OL7.*HUK to in o • LED each m trol of 7.+SPULZHYLKLJV\n o c l idua • Indiv WSLKI`HU-JHWHJP[VY 40 ;OLTVK\SLPZWV^LYLKI`H=Z\WWS` ^OPJOPZYLN\SH[LKKV^U[V=I`TLHUZ VMHU37V^LY6UZ[H[\ZPZZOV^UI` [OLNYLLU3,++;OLTVK\SLOHZILLU KLZPNULK[VVWLYH[LMYVTHTH_PT\TVM =MYVTHMYLZOS`JOHYNLKSLHKHJPK IH[[LY`HUKKV^U[V=0[PZPTWVY[HU[MVY [OLTVK\SLUV[[VZOHYL[OLWV^LYZV\YJL \ZLK[VKYP]L[OLTV[VYILJH\ZLVM[OLJ\YYLU[Z\YNLZZWPRLZHUKUVPZLPUK\JLKI` [OLTV[VY (4(?PZ\ZLK[VPU[LYMHJL[OLTVK\SL [V[OLZLYPHSWVY[VMHKLZR[VWJVTW\[LYVY SHW[VW0[PZPTWLYH[P]L[OH[[OL4(? ILPUJS\KLKPU[OLJPYJ\P[VYLSZLTHRLZ\YL [OH[9(YLJLP]LWPUPZOLSK3V^^OLU UV[\ZLK(ÅVH[PUNPUW\[^PSSJH\ZL[OL TPJYVJVU[YVSSLY[VPU[LYWYL[UVPZLHZKH[H HUKTH`YLZ\S[PULYYVULV\ZVWLYH[PVU;OL TVK\SLJHUHSZVILJVU[YVSSLKI`HUV[OLY TPJYVJVU[YVSSLYI`\ZPUNJVUULJ[VY2 ;OLTV[VYZHYLKYP]LUI`[OLWV^LYZ[HNLZ WYV]PKLKI`[OL3 LHJOKYP]PUNHZPUNSL elektor electronics - 7-8/2007 Vsup +5V Vsup C17 C19 100n 100n 3 1 2 470 R14 K1 C1 C2 C5 C20 100n 47u 25V 8 C21 100n D14 4 4 VCC2 L298KV 10k D16 IC4 10 2A1 12 2A2 11 2EN R1 IC6C 100u 100n 63V VCC1 5 1A1 7 1A2 6 1EN +5V D3 D2 D4 6 K6 2 1Y1 3 1Y2 1 1E 5 4 K7 3 13 2Y1 14 2Y2 15 2E GND L78L05CZ IC2 D1 GND 2 K8 D5 1 D6 6x 1N5400 8 Vsup 9 GND R11 330 IC6 = LM358AJG GND C12 +5V R5 220n R4 10k 5k6 R16 4k7 GND 3 1 1k5 C4 100n C2- 5 D Connector 9 330 6 7 8 9 10 11 12 13 C6 1u 25V 1u GND 9 VCC2 IC5 GND R2 D9 D8 D10 6 K5 2 1Y1 3 1Y2 1 1E 5 4 K10 3 13 10 2A1 L298KV 2Y1 12 14 2A2 2Y2 15 11 2EN 2E 10k 25V D7 GND 4 VCC1 5 1A1 7 1A2 6 1EN C8 GND 100n 100n GND D15 2 K9 D11 1 D12 6x 1N5400 K4 K2 D13 GND C14 GND 4k7 1N4148 C11 C10 100n 100n R15 R8 220n R7 10k 4k7 GND 3 11 10 12 9 4 1u 25V RB0/INT RA0/AN0 RB1/RX/DT RA1/AN1 IC1 RB2/TX/CK RA2/AN2/VREF RA3/AN3/CMP1 PIC16F628-04/P RB3/CCP1 RB4/PGM RA4/T0CKI/CMP2 RA5/MCLR/VPP RB5 RB6/T1OSO/T1CKI/PGC RA6/OSC2/CLKOUT RA7/OSC1/CLKIN RB7/T1OSI/PGD GND +5V 5 7 IC6B 6 10k R6 R10 C15 0R22 MAX232CPE 17 18 1 2 3 4 15 16 C7 8 15 C1T1IN T2IN R1OUT R2OUT C2+ 1 Vsup C18 GND T1OUT 7 T2OUT 13 R1IN 8 R2IN C1+ VSS IC3 100n 14 VEE 10 10u 25V VCC 6 11 1 6 2 7 3 8 4 9 5 C3 C16 5 16 C22 VDD 2 25V GND +5V Vsup R13 VDD GND 14 470 C9 5W 100n R12 +5V R9 C13 10k +5V +5V GND K3 2 R3 100n 1u IC6A 0R22 R17 C23 5W 100n 070129 - 11 GND Figure 1. Circuit diagram of Motobox, the ‘one size fits all’ controller for motors typically used in robots. TV[VY;OL3 PZHK\HSOHSMIYPKNLKYP]LY JHWHISL VM ( WLY JOHUULS ^P[O ZLWHYH[LLUHISPUNHUKJ\YYLU[ZLUZPUNMVYLHJO IYPKNL0[PZZ\P[LK[VKYP]PUNKPMMLYLU[[`WLZ VMTV[VYZ0U[OPZWYVQLJ[[OL3 PZLUHISLKI`[OLTPJYVJVU[YVSSLYHUK[OL,UHISL SPULPZW\SSLK3V^VUWV^LY\W[VLUZ\YL [OH[[OL0*PZKPZHISLK+LJV\WSPUNJHWHJP[VYZU-LHJOHYLWSHJLKULHY[OL0* (+*HTWSPÄLYPZI\PS[HYV\UK[OL34 ^OPJOZLUZLZ[OL]VS[HNLHJYVZZ[OLZLUZL YLZPZ[VY 0[ PZ MVSSV^LK I` H SV^WHZZ MPS[LY HUK H I\MMLY HTWSPMPLY ^OVZL NHPU KLJYLHZLZ^P[OMYLX\LUJ`ÄS[LYZHU`UVPZL +*TV[VYZNLULYH[LZWPRLZ^OLU[OLHYTH[\YLTHRLZJVU[HJ[^P[O[OLJVTT\[H[VY ^OPJOPZYLÅLJ[LKHZHJ\YYLU[ZWPRLHUK HWWLHYZ HJYVZZ [OL ZLUZL YLZPZ[VY *\YYLU[ZWPRLZTH`JH\ZL[OLTPJYVJVU[YVSSLY[VKL[LJ[HZOVY[JPYJ\P[HUK[O\ZZ[VW [OLTV[VY;OLÄS[LY^PSSZTVV[OV\[HU` ]VS[HNLZWPRLZ0UHKKP[PVUHUHSNVYP[OT PZ PTWSLTLU[LK PU [OL TPJYVJVU[YVSSLY ÄYT^HYL[OH[KL[LJ[ZHUV]LYJ\YYLU[JVU- 7-8/2007 - elektor electronics KP[PVUMVYHZWLJPÄLK[PTLILMVYLZ^P[JOPUN VMM[OLHMMLJ[LKJOHUULS L_V[PJ JVTWVULU[Z [V ZV\YJL ^P[O [OL WVZZPISLL_JLW[PVUVM[OLJSPWVUOLH[ZPUR ·I\[[OLU[OH[»ZH]HPSHISLMYVT4V\ZLY ;OYV\NOOVSLJVTWVULU[ZHYL\ZLKPU[OL WYVQLJ[ [V ZPTWSPM` JVUZ[Y\J[PVU HUK HSS JVTWVULU[ZHYLLHZ`[VVI[HPUHZ^LSSHZ *VUZ[Y\J[PVU .VVK UL^Z! [OL WYVQLJ[ KVLZ UV[ OH]L Table 1. Driver options chart Motor header function Output Motor 1 μC Pin Header pin Motor 2 RB3 RB2 RB1 RB0 RB7 RB6 RB5 RB4 2 3 4 5 2 3 4 5 Mode Each output drives a motor phase Stepper driver DC motor driver (1) Servo driver (2) (3) P(4) P(4) Each output drives a motor phase (3) (3) P(4) P(4) (3) (1) Differential drive (2) Use the ground pin on the connectors for the servo (3) Allows 2 servos to driven simultaneously with the same signal (4) Used to power servo motor 41 C13 R14 C2 K1 IC5 15 D9 C19 D12 D3 1 C1 C17 IC4 C16 15 IC2 C5 D15 R13 R10 R5 R1 C18 R9 D6 1 C20 C14 R2 R11 D14 6UJL[OLJPYJ\P[OHZILLUJVUZ[Y\J[LKP[ ZOV\SK IL [LZ[LK MVY JVYYLJ[ VWLYH[PVU 7V^LY \W [OL JPYJ\P[ ^P[O UVUL VM [OL 0*ZPUZLY[LK+ZOV\SKSPNO[\W*OLJR PM[OLYLPZ=VU[OLYLSL]HU[ZVJRL[WPUZ MVY0*0*0*0*HUK0*;OLZ\WWS` ]VS[HNLZOV\SKHSZVILWYLZLU[VU0*HUK 0*ZVJRL[WPU0M[OPZPZJVYYLJ[Z^P[JO VMMHUKPUZLY[[OLWYVNYHTTLKTPJYVJVU[YVSSLYHUK[OLYLZ[VM[OL0*Z;OLTPJYVJVU[YVSSLYJHUILWYVNYHTTLKPUJPYJ\P[ \ZPUNJVUULJ[VY2 0M [OL IVHYK PZ [V IL JVU[YVSSLK MYVT HUV[OLYTPJYVJVU[YVSSLYJVUULJ[VY2TH` IL\ZLK;OPZPZHZ[YHPNO[[OYV\NOJVUULJ[VYHUK[OL;YHUZTP[9LJLP]LZPNUHSZT\Z[ ILJYVZZLKILMVYLILPUNJVUULJ[LK[V[OL IVHYK0M[OLMLTHSLZ\I+JVUULJ[VYPZ NVPUN[VIL\ZLK[OLZPNUHSZHYLJYVZZLK V]LYVU[OLIVHYKP[ZLSM R7 R8 C23 C8 C21 C4 IC1 IC3 C6 +Y`[LZ[PUN D16 C15 R6 IC6 R12 R15 D13 C22 C3 C9 C7 R4 R3 C12 C10 5 K3 1 K2 K4 9 C11 6 R16 R17 TV\U[VU[OL7*)VM^OPJO[OLJVTWVULU[V]LYSH`PZZOV^UPU-PN\YL ;OLYL»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YHJ[LYº(»PUKPJH[PUN[OH[YLJLW[PVU PZHJRUV^SLKNLKHUK[OLHJ[\HSJVTTHUK PZLJOVLK;OPZPZ]LY`\ZLM\S^OLU[OL IVHYKPZ\ZLK^P[OHK\TI[LYTPUHS0M [OLJVTTHUKOHZILLUZLU[PUJVYYLJ[S` [OLSL[[LYº,»^PSSILZLU[IHJRPUKPJH[PUN 42 Figure 2. Component mounting plan of the PCB designed for Motobox. The copper track layout is a free download from the Elektor website. HULYYVULV\ZJVTTHUK;OLJVTTHUK I\MMLYPZJSLHYLKHUK[OLIVHYK^HP[ZMVY HUL^JVTTHUK;OL3,+Z^PSS[\YUSPNO[ \W^OLU[OLZ`Z[LTPZ^VYRPUNJVYYLJ[S` HUKYLK^OLU[OLTV[VYKYP]LYOHZILLU [\YULKVMM Table 2. Command syntax Command Command Description 1 ST1FOR Stepper 1 cw 2 ST1BAK Stepper 1 ccw 3 ST2FOR Stepper 2 cw 4 ST2BAK Stepper 2 ccw 5 STBFOR Both steppers cw — simultaneously 6 STBBAK Both steppers ccw — simultaneously 7 STSYNC Get both steppers in same position in case of slip 8 AMSTOP Emergency stop. Stop All motors — e.g. overcurrent 9 ST1FXX Turn stepper 1 xx (999 steps max) positions cw 10 ST1BXX Turn stepper 1 xx (999 steps max) positions ccw 11 ST2FXX Turn stepper 2 xx (999 steps max) positions cw 12 ST2BXX Turn stepper 2 xx (999 steps max) positions ccw 13 DC2FOR DC motor 2 ON/cw 14 DC2BAK DC motor 2 ON/ccw 15 DC2OFF DC motor 2 OFF 16 DC1FOR DC motor 1 ON/cw 17 DC1BAK DC motor 1 ON/ccw elektor electronics - 7-8/2007 ,]LUPMZ[LWZSLZZ[OHU^PSSILKVUL[OL SLHKPUNaLYVT\Z[ILWYV]PKLK ;OL+*ZLY]VTV[VYHUKZ[H[\ZJVTTHUKZ HYLL_LJ\[LKPTTLKPH[LS`I\[[OLZ[LWWLY TV[VYJVTTHUKZHYLZ\IQLJ[[VHKLSH` KLMH\S[T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OR DC both motors cw 20 DCBBAK DC both motors ccw Semiconductors 21 DCBOFF DC both motor OFF 22 SV2FOR Servo 1 cw Servo 1 ccw D1-D12 = 1N5400 D13 = 1N4148 D14,D15 = bicolour LED, 5mm, 2 terminals D16 = LED, 5mm IC1 = PIC16F628-04/P, programmed, order code 070129-41 IC2 = 78L05 IC3 = MAX232 IC4,IC5 = L298N with heatsink for Multiwatt15 case (mouser.com) IC6 = LM358 K1,K5-K10 = 2-way PCB terminal block, lead pitch 5mm K2 = 3-way SIL pinheader K3 = 9-way sub-D socket (female), angled pins, PCB mount K4 = 4- way SIL pinheader PCB, ref. 070129-1 PIC source & hex code files, free download # 070129-11.zip from Elektor website. 23 SV2BAK 24 SV2MID Servo 1 centre position 25 SV2HLD Servo 1 hold 26 SV1FOR Servo 2 cw 27 SV1BAK Servo 2 ccw 28 SV1MID Servo 2 centre position 29 SV1HLD Servo 2 hold 30 MTYPEX Return motor type 31 STDELX Configure stepper motor delay 32 ECHOST Configure echo. Default = ON 33 AMONXX All motors ON 34 MONOFF Do not monitor current consumption 35 CMONON Monitor current consumption 36 RESUME Enable Motors after overcurrent condition 7-8/2007 - elektor electronics 43 Power supply Power supply Power supply 2 3 2 3 1 Serial input 2 Serial input Motor Board Serial input Motor Board M Motor Board M 4 4 5 5 6 M 3 070129 - 12 Figure 3. How to connect up your motors. VMM Z^P[JOPUN VM +* TV[VYZ ^PSS JH\ZL SHYNL J\YYLU[ ZWPRLZ ^OPJO TH` JH\ZL [OLJVU[YVSSLY[VZO\[KV^U[OLWHY[PJ\SHYTV[VYKYP]LY@V\JHUKPZHISL[OL J\YYLU[ TVUP[VYPUN I\[ [OPZ PZ UV[ YLJVTTLUKLK6]LYJ\YYLU[JHUJH\ZL[OL 3 [VV]LYOLH[HUKNL[KLZ[YV`LK( º9,:<4,»JVTTHUKOHZ[VILZLU[HM[LY [OLTV[VYKYP]LYOHZILLUZ^P[JOLKVMM[V YLZ\TLTV[VYVWLYH[PVUZ(NYHJLWLYPVK PZNP]LU[VLUHISLHUV[OLYJVTTHUK[V ILZLU[HUK[Y`[VNL[[OLTV[VY\UZ[\JR MYVTP[ZJ\YYLU[WVZP[PVU Author’s websites and email address http://telecomms.no-ip.org www.mcast.edu.mt :VM[^HYL [email protected] ;OL ZV\YJL JVKL HUK OL_ JVKL MVY [OL 70*-(PZH]HPSHISLHZHMYLLKV^USVHKMYVT[OL,SLR[VY,SLJ[YVUPJZ^LIZP[L ;OL MPSL U\TILY PZ aPW 1\S` (\N\Z[ Web links www.microchip.com www.st.com/stonline/products/literature/ ds/1773.pdf (070129-I) 12 V Bidirectional Motor Control Stefan Brandstetter 44 TR1 R1 D2 R3 T2 150 7 T1 150 7 D1 R9 1k C2 D4 D3 1M 4x 1N5401 BC327 1000M 40V T5 2k2 D5 1W R5 BC327 T6 D6 2k2 150 7 T3 T4 BAT42 R4 BAT42 T1, T2 = BDW93C; BD901; BD679 T3, T4 = BDW94C; BD902; BD680 ;; HUK;;;YHUZPZ[VYZ; HUK; [VNL[OLY^P[OYLZPZ[VYZ9HUK9WYV]PKL 1W R6 150 7 R2 P1.B R8 0747 R7 150 7 P1.A C1 0747 18V 1A5 150 7 ;OPZ ZPTWSL JPYJ\P[ KYP]LZ +* TV[VYZ^P[OHTH_PT\TJ\YYLU[ VM ( HUK JHU IL I\PS[ ^P[O YLHKPS`H]HPSHISLJVTWVULU[Z 230V ;OLV\[W\[]VS[HNLPZHKQ\Z[HISL IL[^LLU HUK = HUK [OL WVSHYP[` JHU IL JOHUNLK ZV [OH[UV[VUS`TV[VYZWLLKI\[ HSZVYV[H[PVUKPYLJ[PVUJHUIL HKQ\Z[LK I` [\YUPUN H RUVI ;OL JPYJ\P[ PZ HSZV PKLHS HZ H JVU[YVSSLY MVY H +* TVKLS YHPS^H` VY ZTHSS SV^]VS[HNL OVII`[VVS 7V^LYMVY[OLJPYJ\P[PZZ\WWSPLK I` H = THPUZ [YHUZMVYTLY YH[LKH[(+PVKLZ+[V+ YLJ[PM`[OL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^OPSL[OLV[OLY KLJYLHZLZHUK]PJL]LYZH0U[OLTPK^H` WVZP[PVUIV[OKP]PKLYZHYLH[[OLZHTL]VS- (070104-I) zBot: 10-A Power Stage for DC Motor HIV\[ T£ VUS` :\JO H MH[HS LYYVY ^V\SK KLZ[YV` [OL 46:-,;Z ;OL SVNPJ M\UJ[PVUZJVUÄN\YLKOLYLLMMLJ[P]LS`H]VPK PSSLNHSZ[H[LZ ;VJVU[YVS[OL+*TV[VY[OYLLZPNUHSZHYL ULLKLK!+097>4HUK:;67+09JVU[YVSZ[OLKPYLJ[PVUVM[OLTV[VYYL]VS\[PVU 7>4 [OL ZWLLK HUK :;67 IYHRLZ [OL TV[VY ;OLZVM[^HYLTVK\SLMVY[OL+*TV[VYPZ JHSSLKdcm.c 0U JHZL VM H ZVM[^HYL JYHZO P[ JV\SKOHWWLU[OH[[^VVYL TVYL46:-,;ZHYL Z^P[JOLKVU PUJVY- (070172-I) Jens Altenburg YLJ[S` MVYL_HTWSL;HUK;0U[OH[JHZL[OL J\YYLU[[OYV\NO[OL[YHUZPZ[VYZPZSPTP[LK I`[OLPU[LYUHSYLZPZ[VYZVM[OL46:-,;Z [1] The complete document called Zbot — the Robot Experimental Platform is available for free downloading from the Elektor Electronics website. The file number is 070172-11.zip (July/August 2007). U+ 7-8/2007 - elektor electronics C11 IC7 IC8 7 7 R18 RFP30P06 T4 IC7.A STOP 1 2 3 & RFP30P06 D2 D1 T5 T3 R15 10k IC7 = 74HCT00 IC8 = 74HCT125 R17 10k 14 10k 14 IC7.D T6 1N4001 R18 10k 1N4001 BC337 12 11 & 13 BC337 M BUK101 IC8 T7 D5 D6 T8 BUK101 3 EN 1 IC8 6 R14 1N4001 1N4001 5 EN R21 10k 2 10k 0M`V\SVVRH[[OLJOHZZPZVM[OLa)V[]LOPJSL`V\»SSÄUK[^VWHY[ZYLX\PYPUNPU[LSSPNLU[JVU[YVS![OLZ[LLYPUNZLY]VHUK[OL +*TV[VY ;OLZVJHSSLK/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SL[LZWPUKSLYL]VS\[PVU ;OPZ WYVWLY[` HSZV KL[LYTPULK [OL Z[LW HUNSLHZZOV^UPU;HISL -VYL_HTWSLMVYHTV[VYZWLJPÄLKHZOH]PUNHKLNYLLHUNSL$ W\SZLZMVYHJVTWSL[LZWPUKSLYL]VS\[PVU ;^VW\SZPUNZJOLTLZHYLH]HPSHISL[VKYP]L [OLTV[VY!ºM\SSZ[LW»VYºOHSMZ[LW»;OL[^V TVKLZ HYL Z\TTHYPaLK PU ;HISL HUK ;HISLYLZWLJ[P]LS` (WWS`PUNOHSMZ[LWW\SZLZ[V[OLTV[VY^PSS PUJYLHZL[OLHJJ\YHJ`H[^OPJO[OLZWPU- Table 2. Full-step mode. Rotation to the right (cw) § Step Winding A Winding B Winding C Winding D 1 1 0 0 0 2 0 1 0 0 3 0 0 1 0 4 0 0 0 1 Step Winding A Winding B Winding C Winding D 1 1 0 0 0 2 1 1 0 0 3 0 1 0 0 4 0 1 1 0 5 0 0 1 0 6 0 0 1 1 7 0 0 0 1 8 1 0 0 1 Rotation to the left (ccw) £ Table 3. Half-step mode. Rotation to the right (cw) § 46 Rotation to the left (ccw) £ elektor electronics - 7-8/2007 WPUZVU[OL<35;OL<35JHU Z\WWS`\W[VT(VULHJOV\[W\[WPU 5V[L[OH[H=Z[LWWLYTV[VYPZ\ZLKPU [OPZJPYJ\P[ ;OLZV\YJLJVKLÄSLHUK[OLÄYT^HYLOL_ MPSL MVY [OL (; TPJYV TH` IL KV^USVHKLK MYLL VM JOHYNL MYVT [OL ,SLR[VY ^LIZP[LHZHYJOP]L aPW (M[LYJVUZ[Y\J[PUN`V\YJPYJ\P[WV^LYP[ \W7YLZZ[OL-\SS:[LWVY/HSM:[LWI\[[VU ;OLUWYLZZ3LM[VY9PNO[HUK`V\^PSSZLL `V\YTV[VYZ[HY[[VYV[H[L\ZPUN[OLTVKL ZLSLJ[LK@V\JHUJOHUNLIL[^LLUM\SSHUK OHSMZ[LWH[HU`[PTL (SS[OPZPZ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]LY`ZPTWSL HZZOV^UPU-PN\YL;OLVUS`WVPU[[V ^H[JOV\[MVYPZ[OLZLY]VWV^LYZ\WWS` .P]LU[OLYLSH[P]LS`OPNOJ\YYLU[KYH^UI` [OLZLY]V^OLUP[[\YUZP[»ZILZ[[VZ\WWS`P[VMMHZLWHYH[L]VS[HNLYHPSMYVT[OL TPJYVJVU[YVSSLY>OLYL[OPZPZUV[WVZZPISL `V\ULLK[VLUZ\YLL_JLSSLU[KLJV\WSPUN IL[^LLU[OLT·MVYL_HTWSLI`Z\WWS`PUN[OLZLY]VHUK[OLTPJYVJVU[YVSSLY]PH [^VZLWHYH[LYLN\SH[VYZ (ZMHYHZ[OLZVM[^HYLPZJVUJLYULKJVU[YVSSPUNHZLY]V\ZPUNH)HZPJ:[HTWVYH 70*WYVNYHTTLKPU)HZPJYLX\PYLZVUS`H ]LY`ML^SPULZVMWYVNYHT0UMHJ[HSS[OH[»Z ULLKLKPZ[VJHSS\W[OL[^VPUZ[Y\J[PVUZ 7<3:6<;HUK7(<:, /LYLI`^H`VMHUL_HTWSLPZHWYVNYHT [OH[ THRLZ H ZLY]V [\YU ZSV^S` MYVT P[Z L_[YLTLWVZP[PVUVUVULZPKL[VP[ZL_[YLTL WVZP[PVUVU[OLV[OLYZPKLHUKZVVU0U Listing 2 ‘ Cubloc Version Const Device = CB220 Dim Position As Integer Low 5 ‘ Servo is connected to port P5 Do For Position = 2300 to Position = 4300 Step 20 Pwm 0, Position, 32768 Delay 100 Next Loop [OPZ^H`P[JHUMVYL_HTWSLTV]LHZLUZVYPUVULWSHULV]LYH[V[HSHTWSP[\KLVM ZLL3PZ[PUN ;OLPUZ[Y\J[PVU7<3:6<;NLULYH[LZW\SZLZ ^P[OH]HYPHISLK\YH[PVUMYVTôZ [VôZKLWLUKPUNVU[OLJOHUNPUN]HS\LVM[OLSVVW]HYPHISLI^OPSL [OLZWHJPUNIL[^LLU[OLZLW\SZLZPZZL[H[ TZI`TLHUZVM[OLPUZ[Y\J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 R4 Ä_LKI\[ZPUJL^LHYLNP]PUN`V\ 1k GP5 [OL ZV\YJL SPZ[PUN VM [OL ZVM[^HYL D5 T1 BD679 \ZLK MVY [OPZ HWWSPJH[PVU P[»Z ]LY` LHZ` MVY `V\ [V TVKPM` [OPZ PM P[ KVLZU»[Z\P[`V\VYPUKLLKL]LU[V PUJS\KL [OL WVZZPIPSP[` VM L_[LYUHS 070302 - 12 HKQ\Z[TLU[PMULJLZZHY` ;OLJPYJ\P[VM[OLºPU[LSSPNLU[»WHY[VM V\YJVU[YVSSLYPZZOV^UPU-PN\YLHZ`V\ JHUZLLP[\ZLZH70**TPJYVJVU[YVSTable 1. Programming step duration SLYMYVT4PJYVJOPW<ZLKOLYLPUPU[LYUHS by modifying a constant used in the program. JSVJRHUKYLZL[JPYJ\P[TVKLP[ULLKZUV L_[LYUHSJVTWVULU[ZMVY[OLZLM\UJ[PVUZ Binary Step duration ZVHSSP[ZWVY[SPULZHYLH]HPSHISL constant 7HYHSSLSWVY[Z.7HUK.7HYL\ZLKHZ 10010010 1 ms PUW\[ZHUKHZ.7KVLZUV[OH]LHUPU[LY10010011 2 ms UHSW\SS\WYLZPZ[VY[OPZPZWLYMVYTLKI` 9 7HYHSSLS WVY[Z .7 .7 .7 HUK 10010100 4 ms .7HYL\ZLKHZV\[W\[ZMVYNLULYH[PUN 10010101 8 ms [OLW\SZLZMVY[OLTV[VY^PUKPUNZ;OLZL 10010110 16 ms JHUILHTWSPÄLKI`[^V[`WLZVMWV^LY Z[HNLZKLWLUKPUNVU[OL[`WLHUKU\TILY 10010111 32 ms VMTV[VYZ[VILKYP]LU"^L»SS[HRLHSVVRH[ [OVZLJPYJ\P[ZPUHTVTLU[ ;OL*ULLKZ[VILWV^LYLK MYVT=KLYP]LKMYVT[OLTV[VY 3 +U Z\WWS`I`TLHUZVMHJVU]LU[PVUHS [LYTPUHS]VS[HNLYLN\SH[VY0* 0M[OLJVU[YVSSLYPZVUS`PU[LUKLK MVYHZPUNSLTV[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LTISLY OLYLHYL[OLKL[HPSZ`V\»SSULLKMVY [OL TVZ[ PTWVY[HU[ TVKPMPJH[PVU `V\TPNO[^HU[[VTHRL!JOHUNPUN [OLZWLLKVM[OLJVU[YVSW\SZLZ[V [OLTV[VYZHUK[O\Z[OLPYZWLLK VMYV[H[PVU;OLJVU[YVS^VYKTH` ILMV\UKPU;HISL ;V KV [OPZ HSS `V\ OH]L [V KV PZ TVKPM`[OLIPUHY`JVUZ[HU[VU[OL SPUL! MOVLW B’10010101’ Q\Z[ HIV]L [OL SPUL JVU[HPUPUN 67;065PU[OLZV\YJLSPZ[PUN>P[O [OLVYPNPUHS]HS\L[OLK\YH[PVUVM VUL Z[LW PZ TZ I\[ [OL [HISL HIV]LPUKPJH[LZ^OH[JVUZ[HU[[V \ZLHJJVYKPUN[V[OLZ[LWK\YH[PVU [OH[`V\TH`^HU[ (070302-I) 49 3 Amp PWM DC Motor Controller Rajkumar Sharma VCC2 18k VREF K1 100n 6 B GND 4 7 SD GND GND VCC1 0 100u 63V C9 100n 100n 18k R7 K3 C6 S1 0 D1 100u 63V C7 100n 1k5 C5 330 3 C8 VCC2 R2 2 R5 D2 o nuou s PU[LYUHS VWLUJVSSLJ[VY [YHUZPZ[VY MVY;;3SL]LS7>4V\[W\[ 4V]PUNVU[V[OL34+ZSPKLZ^P[JO :VUOLHKLY:NV]LYUZ[OL+PYLJ[PVU JVU[YVSPUW\[WPU[VJOHUNL[OLKPYLJ[PVUVM[OLTV[VYMYVTJ^[VJJ^VY]PJL ]LYZH9PZJVUULJ[LK[V[OLYTHSÅHNWPU ;WPU ^OPJOPZUV[\ZLKOLYL;OLM\UJ[PVUTH`IL\ZLK[VÅHNH^HYUPUN^OLU IC2 C2 1 C1 C4 11 R4 R2 P2 IC1 P1 060339 - 11 GND GND 1 K1 R7 C7 K3 R5 S1 GND R6 C6 D1 D2 R1 C9 C5 K2 1 3 2 ti KHz • Moto p s co n to 35.1 to 3 a m .16 kHz 1 p u m o rs fr e s ta ble • Deliv y ad ju ot q uenc e fr le by p b M • PW ad ju s ta ly s u o u conti n • PWM % to 10 0 0 cycle h • Duty y switc ntrol b tion co c e ir n D • ctio d prote ed loa • S hort tdown a l s hu • Therm ents m po n M D co • No S r ntrolle icroco • No m 50 2 OUT1 10 OUT2 IC2 C2 1 3 C4 DIR LMD18200 8 11 BS2 CS R6 100n IC3 L7805ACV VCC1 K2 ly r supp BS1 18n 1 C es Featur voltage 12 V to 30 V D utput GND VS 9 T 5 PWM 10 C3 100n 11 OUT A 14 OUT B IN+ INCMPEN DISC SG3525AN 8 CT SS GND 100k 10k IC1 2 1 9 7 5 P2 13 VC 4 OSC OUT 12 P1 3 SYNC 6 RT C1 R4 2k7 R3 2k2 VCC2 R1 10k VCC 15 VCC1 16 ;OPZJPYJ\P[PZPU[LUKLKMVYTV[PVUJVU[YVS HWWSPJH[PVUZ H JVTTVU VJJ\YYLUJL PU YVIV[PJZ;OPZHMMVYKHISL7>4+*4V[VY JVU[YVSSLYJHUJVU[YVSHU`74+*TV[VY ZWLJPÄLKH[=[V=HUK(TWZTH_ 4V[VYKPYLJ[PVUPZJVU[YVSSLK^P[OHZSPKL Z^P[JOHUKTV[VYZWLLK^P[OHUVYKPUHY` WV[LU[PVTL[LY ;OL JPYJ\P[ KPHNYHT PU -PN\YL ZOV^Z 0*Z[`WL34+HUK:.H[[OL OLHY[ VM [OL JPYJ\P[ ;OL :. PZ H W\SZL^PK[OTVK\SH[VYJVU[YVSJPYJ\P[HUK [OL34+HU/)YPKNL[VLUHISL[OL TV[VY[VILY\UPUIV[OKPYLJ[PVUZ ;OL :. HMMVYKZ MYLX\LUJ` JVU[YVS HUKK\[`J`JSLJVU[YVS;OLVZJPSSH[VYMYLX\LUJ`PZKL[LYTPULKI`[OLJVTWVULU[Z H[[HJOLK[VWPUZHUK7YLZL[7ZLY]LZ [VHKQ\Z[[OLMYLX\LUJ`IL[^LLUR/a HUKR/a(S[OV\NOP[PZNLULYHSS`YLJVTTLUKLK[VZ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V[VY PZ ZWLJPMPLK H[ = [OLU 9 ZOV\SK IL R£HUKPMP[PZ=[OLUR£ZOV\SK ILÄ[[LK0M`V\^HU[[V\ZLHOLH]`K\[` TV[VYJVUZ\TPUNTVYL[OHUHIV\[(P[ TH`IL^VY[O^OPSL[VZ[YLUN[OLU[OLJVWWLY[YHJRZ[VMYVT22^P[OSLUN[OZVM TT2ZVSPKJVWWLY^PYL COMPONENTS LIST C3 = 18nF C6,C8 = 100μF 63V Resistors Semiconductors R1 = 10k7 R2,R4 = 18k7 R3 = 2k72 R5 = 3307 R6 = 2k77 R7 = 1k75 P1 = 10k7 potentiometer P2 = 100k7 preset D1,D2 = LED IC1 = SG3525AN IC2 = LMD18200 IC3 = L7805ACV Miscellaneous K1,K2,K3 = 2-way PCB terminal block, lead pitch 5mm S1 = slide switch PCB, ref. 060339-1 from www.thepcbshop.com Capacitors C1,C2,C4,C5,C7, C9, = 100nF YLX\PYLHTV[VYVMZVTLRPUK;OLIVHYK OHZILLUKLZPNULKMVYJVTWHJ[ULZZ^OPZ[ \ZPUN SLHKLK JVTWVULU[Z VUS` PL UV :4+ZPUZPNO[OLYL;OLJVWWLY[YHJRSH`V\[ HUK JVTWVULU[ TV\U[PUN WSHU HYL JVU[HPULKPUMYLLKV^USVHKUV aPWMYVTV\Y^LIZP[L 0M`V\^HU[[VPU[LYMHJL[OLKYP]LY^P[OH ZV\YJL Z\WWS`PUN = ZPTWS` YLTV]L WV[LU[PVTL[LY7HUKHWWS`[OLHUHSVN\L ]VS[HNL[VWPUVM0* -PN\YLZOV^Z[OL7*)KLZPNULKMVY[OL KYP]LY ^OPJO ZOV\SK MP[ THU` HWWSPJH[PVUZH[JY\JPHSSVJH[PVUZPUHYVIV[(M[LY HSSTVZ[MVYTZVMTV[PVUVMHYVIV[^PSS (060339-I) Driving Higher Power DC Motors 1 2 control control 2 1 +VS OUT 1 OUT 2 2 3 OUT 3 OUT 4 100n 4 13 14 +VSS 9 Vref A +U M B 100n RE2 1 RE1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Z[OL3 MYVT:;4PJYVLSLJ[YVUPJZ(ZP[ZPU[LYUHSISVJRKPHNYHT 6 4 +U L +U L +U M +U M C2 D3 C2 C1 D4 100n 4 M1 100n 100n 9 +VSS +VS L298 M IN1 D1 OUT1 5 D2 D1 ... D2 = BY252; 1N5402 2 1 6 IN2 OUT2 7 OUT 1(3) OUT 2(4) +VSS 10 +VS IN1(3) IN1(3) /2 L298 13 3 EN IN2(4) 1 11 C1 12 14 4 ENA(B) ENA(B) 3 2 100n GND GND 8 15 1 IN2(4) R1 Rs 070317 - 14 070317 - 16 5 Table 1. D1 R1 10k EnA(B) In1(3) In2(4) M1 M2 /4 L298 H H H Braked Running H L L Running Braked L X X Freewheel stop Freewheel stop 1N4148 1 C1 In x Out x 1n5 070317 - 15 52 elektor electronics - 7-8/2007 HYLYLJVTTLUKLK[VWYV[LJ[[OL0*HNHPUZ[ WVZZPISLZOVY[ZVMP[ZV\[W\[Z[VLHY[O^OPJO HYL[OLTVZ[SPRLS`[VVJJ\YPUHYVIV[H TV[VY[LYTPUHS[V\JOPUN[OLTL[HSJOHZZPZ MVYL_HTWSL0U[OPZJHZL:;4PJYVLSLJ[YVUPJZYLJVTTLUKZ[OLJPYJ\P[PU-PN\YL ;OPZJPYJ\P[[YPWZPUMZHUKYLZL[ZI`P[ZLSM ^OLU[OLZOVY[KPZHWWLHYZ ;OL 3 PZ JHWHISL VM ^P[OZ[HUKPUN H TH_PT\TZ\WWS`]VS[HNLVM=HUKLHJO VMP[ZWV^LYHTWSPÄLYZJHUZ\WWS`HJ\YYLU[ VM(HSYLHK`HTVYL[OHUJVTMVY[HISL ]HS\LL]LUMVYHYLSH[P]LS`OLH]`TVIPSL YVIV[0M[OH[PZU»[LUV\NOMVY`V\P[PZHSZV WVZZPISL[VJVUULJ[[OLWV^LYHTWSPÄLYZ JHUIL\ZLKMVYKYP]PUNOPNOLYWV^LY+* TV[VYZ MVY YVIV[PJZ HWWSPJH[PVUZ 4VYL YLJLU[HUKVYOPN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 1 x 0 1 0 0 0 X 0 1 1 0 1 1 0 X 0 0 1 0 1 1 1 0 X 1 1 0 1 1 Qo Qo X X X Qn 070299 - 12 Table Step number 1 2 3 4 Winding 1 1 1 0 0 Winding 2 0 0 1 1 Winding 3 1 0 0 1 Winding 4 0 1 1 0 :[PSSVU[OLZ\IQLJ[VM[OLTV[VYZ\WWS` ]VS[HNLUV[L[OH[P[JHUIL\W[V=PM ULJLZZHY`(ZSVUNHZ[OLJ\YYLU[KYH^UI` [OLTV[VYKVLZU»[L_JLLK([OL[YHUZPZ[VYZKVU»[ULLKHOLH[ZPURI\[VULPZHK]PZHISLHIV]L[OH[0[ULLKVUS`ILHML^JT2 ZPUJL[OL[YHUZPZ[VYZHYLVWLYH[PUNOLYLPU Z^P[JOPUNTVKLHUKZVKPZZPWH[LYLSH[P]LS` SP[[SLWV^LY (070299-I) Web Link L293 spec. sheet http://www.st.com/stonline/books/pdf/ docs/1328.pdf Robot Footballer by Julian Straub @V\ ^PSS KV KV\I[ OH]L ZLLU WPJ[\YLZ MYVTº9VIV*\W»ZOV^PUNYVIV[ZIVV[PUN MVV[IHSSZMYVTVULLUKVM[OLWP[JO[V[OL V[OLY)\PSKPUNHULSLJ[YVTLJOHUPJHSYVIV[ SPRL[OPZPZLU[PYLS`^P[OPU[OLJHWHIPSP[`VM [OLOVII`PZ[^P[O[OLOLSWVMHML^JOLHW L]LY`KH`P[LTZ 0UVYKLY[VNP]L[OL 1 IHSS H NVVK RPJR iron core [OLYVIV[»ZMLL[HYL WV^LYLKI`SPULHY ZVSLUVPKZ(JJLSLYH[PVUPZTVYLPTWVYspring [HU[ [OHU MVYJL OV^L]LY HUK ZV ^LLZJOL^YLHKPS` 54 H]HPSHISLZVSLUVPKZ^OPJONLULYHSS`VWLYH[L VU=VY=HUK^OPJOHS[OV\NOWV^LYM\SHYLT\JO[VVZSV^MVYV\YW\YWVZLZ ;OLPU[LNYHSVMMVYJLV]LY[PTLVYPTW\SZL WYVK\JLKI`HJVPS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LK PU[VH[\YULKWPU+07ZVJRL[ ;OLZLY]VTV[VYJVUULJ[VYJHUILTHKL \ZPUN[OYLLZLJ[PVUZHTTSLUN[OVM TT¹WP[JO:03WPUOLHKLYZ[YPW curved slots ;OLWP]V[MVY[OLSL]LYPZZSPNO[S`MVY^HYK VM[OLZLY]VTV[VYZOHM[0UT`V^UJHZL0 THKL[OPZSL]LYV\[VMTTZX\HYLIYHZZ [\IL;OPZOVSSV^ZLJ[PVUHSSV^Z[OLSP[[SLJH[JO[VOVVRPU[V[OLSL]LYVUJLP[PZ YLHYTLK;OPZJH[JOPZVWLYH[LKI`[OL ZVSLUVPK]PHHZTHSSJVUULJ[PUNYVK;OL ZVSLUVPKPZH=[`WLTV\U[LK\UKLY[OL OVYPaVU[HSWSHULVMV\YHS\TPUP\THUNSL ;OLWVZP[PVUPUNVM[OLTPJYVZ^P[JOLZPZ PTWVY[HU[WHY[PJ\SHYS`[OH[VM:^^OVZL WVZP[PVUPZZL[VUJL[OLVW[PT\TYLHYTPUN WVZP[PVU OHZ ILLU ZL[ ;OPZ ZL[[PUN JHU VUS` IL KVUL VUJL [OL LSLJ[YVUPJZ KLZJYPILKHIV]LOH]LILLUI\PS[:^PZ TV\U[LKVU[V[OLHUNSLI`^H`VMHZTHSS Sw1 square stock sectional steel/iron electromagnet spring connecting rod catch Figure 3. Mechanical construction details. 7-8/2007 - elektor electronics Sw2 070210 - 13 IYHJRL[^P[O[^VVISVUNZÄ_PUNZSV[Z[V HSSV^[OLTPJYVZ^P[JO[VILWVZP[PVULK -VY:^[^VJ\Y]LKZSV[Z^PSSULLK[VIL THKLPU[OL]LY[PJHSWSHUL^OLYL[OLZLY]VTV[VYPZTV\U[LKZVHZ[VILHISL[V HKQ\Z[[OLÄYPUNYHUNLPUJVUQ\UJ[PVU^P[O WYLZL[7 6UJL [OL TLJOHUPJZ OH]L ILLU JVTWSL[LS`ÄUPZOLK[OLSL]LYZOV\SKILW\[ PU[V[OLSV^LZ[WVZP[PVU^O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UNZOHZ[VIL YLN\SHYS`PU]LY[LKZSPNO[S`JVTWSPJH[PUN[OL JPYJ\P[Y`[OH[»ZYLX\PYLK ;HISLPUKPJH[LZ[OLVYKLYPU^OPJOHZPUNSLWVSLTV[VY»Z^PUKPUNZT\Z[ILWV^LYLK[VTHRLP[[\YU.VPUN[OYV\NO[OL JVS\TUZVM[OPZ[HISLMYVT[V[OLTV[VY [\YUZJSVJR^PZL^OPSLYL]LYZPUN[OLVYKLY JOHUNLZ [OL KPYLJ[PVU VM YV[H[PVU ,HJO JVS\TUVM[OPZ[HISLJVYYLZWVUKZ[VVUL TLJOHUPJHSZ[LWVM[OLTV[VY·YLTLTILY[OH[»ZIL[^LLUHUKKLNYLLZ KLWLUKPUNVU[`WL ;OLYL HYL U\TLYV\Z ZWLJPHSPZ[ 0*Z VU [OL THYRL[ MVY KYP]PUN Z[LWWLY TV[VYZ HUK]HYPV\ZZVS\[PVUZHYLVUVMMLYPU[OPZ PZZ\LVM,SLR[VYI\[PM`V\YYVIV[\ZLZH )HZPJ:[HTWVYH70*TPJYVJVU[YVSSLYWYVNYHTTLKPU)HZPJ[OLYLPZHUL_[YLTLS` ZPTWSLHUKJOLHWZVS\[PVUMVYTHRPUNP[ KYP]L[OPZ[`WLVMTV[VY (SS^LHJ[\HSS`ULLK[VKVPZ\ZLHWLYMLJ[S` VYKPUHY` <35 VY <35 ‘ Control of a unipolar stepper motor ‘ The step number is put in w1 ‘ The rotation direction is defined by b0 ‘ Variable’s definition Symbol Symbol Symbol Symbol direction = b0 incr = w1 index = w2 delay = b6 ‘ Initialization dirs = %00000011 pins = %00000001 b1 = %00000001 ‘ Here the application program must initialize ‘ incr, direction and delay with the required values if direction = 0 then incrincr b1 = b1 ^ %00000011 incrincr: for index = 1 to incr pins = pins ^ b1 b1 = b1 ^ %00000011 pause delay next 59 respectively seven-way or eight-way integrated power Darlingtons normally used to drive relay coils. The required software is very simple, thanks to a couple of tips suggested by Parallax (the manufacturer of the Basic Stamp). The first is to note that the status of windings 1 and 2 on the one hand, and windings 3 and 4 on the other, is always opposite, as indicated in the attached table. Because of this, the motor can be driven using just two of the Basic Stamp outputs, as shown in the very simple circuit we are suggesting. Windings 1 and 3 are driven from two lines of the Basic Stamp port, after amplification by the ULN2003 (or 2803). Windings 2 and 4 receive these signals after inversion, performed using two of the spare amplifiers in the ULN2003 (or 2803), which is overkill but perfectly practical. Note the presence of the two essential 1 k pull-up resistors, connected to the outputs of the amplifiers in the ULN2003 (or 2803), as the Darlingtons are only open-collector. The second tip suggested by Parallax consists of directly calculating the sequence of signals to be applied to the Basic Stamp’s P0 and P1 outputs, rather than getting these data from a table. All that’s actually 60 needed is a simple XOR logic function, as shown in the program listing. This short example of code may be included as is into a more complete application. As can be seen, it makes the stepper motor connected as shown in the figure turn through the number of steps previously loaded into w1. The direction of rotation is determined by the contents of b0. If b0 is anything other than 0, the motor turns one way; if not, it turns the other way. This program also lets us define the wait time between each step, by means of the data used in the PAUSE instruction; the only proviso is not to reduce this delay too much, taking into account the motor being used and the load it is driving. To be as general as possible, note that this example of code has been written in Basic Stamp I language. So it is fully transposable, without restriction, to any other type of Basic Stamp, as well, of course, as to any PIC programmed in Basic, since the majority of Basic compilers for PICs are compatible with the Basic Stamp I language. It can likewise be easily migrated to a PicBasic or a Cubloc from Comfile Technology. (070237-I) elektor electronics - 7-8/2007 # ! " % + 6 (+,').5:.5;. "## " " @+ /= & 7A18 ? 7?8 & * > 7B(8 $ ? < '5.5! !)5'544. 4 9!'. '* .*.? >> / 5% " ( ( $ $ $ % 1 (+,'!5'54 ' . 4 9!'. !*: .*.? >> / 5% (+,'4!5'54 ,. . . 4 9!'. !*: .*.? >> / 5% (+,!5'54 ! ! 4*. 4 9!'. !*: .*.? >> / 5% (+,')!5'554 ' !) 4 9!'. '* .*.? >> / 5% (+,!5'554 '*: ' ' 4 9!'. '*) .*.? >> % (+,':!5'554 . 44. 4 9!'. '*' .*.? >> / 5% (+,'!5'554 ! ! *. 4 9!'. '*. .*.? >> / 5% (+,';!5'554 ! ! 4 9!'. '*4 .*.? >> / 5% ! " # $%&' $() * ## (+,'-. * $$$ #!"! !" " & " +/(" +/( & / 0$1 * 1 # * 2 ', & /* 1 #* 3!4.35!*, 7-8/2007 - elektor electronics 61 Which Brain for my Robot? A mini practical guide C. Tavernier www.tavernier-c.com More than any other electronics project, these days a robot can virtually not manage without at least one microcontroller to run it. So of course this raises the question of how best to select one, and this article is here to help you in this delicate task. Although the simplest robots can get by with virtually any type of microcontroller programmed in the language of your choice, as the complexity of the robot increases, it becomes clear that certain ICs are more suitable than others for a purely robotic application. :V HM[LY IYPLMS` KPZJ\ZZPUN [OL ZWLJPHS YLX\PYLTLU[Z[`WPJHSVMYVIV[Z^L»YLNVPUN [VWYLZLU[HJLY[HPUU\TILYVMTPJYVJVU[YVSSLYZHUK[Y`[VOPNOSPNO[[OLPYZ[YLUN[OZ PUHYVIV[PJZJVU[L_[ ;OLULLKJYLH[LZ[OLZ`Z[LT *VTWHYLK [V H JVU]LU[PVUHS LSLJ[YVUPJ WYVQLJ[HYVIV[WVZZLZZLZJLY[HPUWHY[PJ\SHYMLH[\YLZ[OH[OH]LHKPYLJ[PUÅ\LUJLVU [OLJOVPJLVM^OPJOTPJYVJVU[YVSSLY[VÄ[ P[^P[O:V^OL[OLYP[PZÄ_LKVYTVIPSL ·HUK[OLÄYZ[YVIV[ZHTH[L\YZI\PSKHYL ]LY`VM[LUTVIPSLHZ[OLZLHYLHKTP[[LKS` [OLTVZ[ZWLJ[HJ\SHY·HYVIV[HS^H`Z PUJS\KLZVULVYTVYLTV[VYZ(Z`V\»]L ILLU HISL [V KPZJV]LY [OYV\NOV\[ [OPZ PZZ\LVM,SLR[VY[OLZLTH`[HRL[OLMVYT VMYHKPVJVU[YVSZLY]VZZ[LWWLYTV[VYZVY +*TV[VYZ5VULVM[OLZLHYLJVU[YVSSLK PUL_HJ[S`[OLZHTL^H`I\[HSSVM[OLT YLX\PYL[OLTPJYVJVU[YVSSLY[VRUV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V^IV[O[OLWO`ZPJHSHWWLHY- 7-8/2007 - elektor electronics Table 1: Pinout for the Basic Stamp 2 in the 24-pin package, adopted by many of its competitors (Basic Atom 24, Cubloc CB220, Javelin Stamp, among others). Name Pin no. Function SOUT 1 Programming output (PC serial port) S IN 2 Programming input (PC serial port) ATN 3 Programming input (PC serial port) VSS 4 et 23 Ground P0 à P15 5 à 20 Input/output ports VDD 21 5 V stabilized output (input if VIN is too low) RST 22 Manual external reset input (if required) VIN 24 Unstabilized positive supply from 5–15 V (12 V for 2E, 2SX, and 2P24) HUJLVM[OL):HUKP[ZWPUV\[^OPSL[OL M\UJ[PVUZVM[OL]HYPV\ZZPNUHSZH]HPSHISL HYLSPZ[LKPU;HISL3PRLHSSP[ZZ\JJLZZVYZ [OL)HZPJ:[HTWPZUV[Hº[Y\L»PU[LNYH[LK JPYJ\P[I\[H[PU`7*)[OLZPaLVMH WPU+030*Ä[[LK^P[OHU\TILYVM:4+ JVTWVULU[ZPUJS\KPUNHTPJYVJVU[YVSSLY P[ZJSVJRHUKYLZL[JPYJ\P[Y`HU,,7964 TLTVY`MVYZ[VYPUN[OLWYVNYHTHUKH= YLN\SH[VY[VWV^LYP[ )HZLKVUHUºVSK»70**H[4/a [OL):PZWYVNYHTTLKKPYLJ[S`PU)HZPJ ZVTL[PTLZJHSSLK7)HZPJHUKPZJHWHISL VML_LJ\[PUNHYV\UKPUZ[Y\J[PVUZWLY ZLJVUK^OPSLP[ZTLTVY`JHUZ[VYLHYV\UK SPULZVMWYVNYHT0[ZWSHUL[HY`Z\JJLZZ HUK[OL^VYKPZUV[[VVZ[YVUNOHZW\ZOLK 7HYHSSH_[VW\[VU[V[OLTHYRL[V[OLY):Z ^OVZLZ[YVUNWVPU[ZHYLZ\TTLK\WOLYL YHWPKS` ;OLÄYZ[L]VS\[PVU[VOH]LZLLU[OLSPNO[VM KH`[OL)HZPJ:[HTW:?VY)::?PZPU MHJ[HZPNUPÄJHU[S`MHZ[LY]LYZPVUVM[OL): 0[L_LJ\[LZVUH]LYHNLPUZ[Y\J[PVUZ WLYZLJVUKI`YLWSHJPUN[OL):»ZTPJYVJVU[YVSSLY^P[OH:?MYVT<IPJVT;OL WYVNYHTTLTVY`PZHSZVSHYNLYHJJLW[PUN HYV\UKSPULZVMWYVNYHT(SS[OPZPZ VMJV\YZL[YHUZWHYLU[MVY[OL\ZLYHUK[OL )::?PUZ[Y\J[PVUZL[PZPKLU[PJHS[OL):»Z HWHY[MYVT[OYLLUL^PUZ[Y\J[PVUZ[VTHUHNL[OPZL_[YHTLTVY` ;OL)::?HUKP[ZYLSH[P]LS`SHYNLWYVNYHT Figure 1. The physical appearance, dimensions, and pinout of the Basic Stamp 2 have been taken up by many of its competitors: Basic Atom 24, Javelin Stamp, Cubloc CB220 amongst others. TLTVY`JYLH[LKHKLTHUKHTVUNJLY[HPU )HZPJ:[HTW\ZLYZ^HU[PUN[VILULÄ[MYVT [OPZT\JOSHYNLYTLTVY`I\[UV[ULLKPUN [OLZWLLKHUKOLUJL[OLWYPJL[HNVM[OL )::?:V7HYHSSH_OHZVMMLYLK[OLT[OL )HZPJ:[HTW,·ZPTWS`HºKLNYHKLK»]LY- Photo 1. Though it’s been a bit left behind now, here’s the father of all the Basic Stamps, the Basic Stamp 1. 63 Table 2: Principal characteristics of the various Basic Stamps and the Javelin Stamp. Parameter Basic Stamp 2 Basic Stamp 2SX Basic Stamp 2E Basic Stamp 2P24 Basic Stamp 2P40 Javelin Stamp Microcontroller PIC16C57 SX28 SX28 SX48 SX48 SX48 Clock frequency 20 MHz 50 MHz 20 MHz 20 MHz 20 MHz 25 MHz Program memory (bytes) 2K 8x2K 8x2K 8x2K 8x2K 32 K Program memory (instructions) 500 4 000 4 000 4 000 4 000 – Working memory (bytes) 32 32 32 38 38 32 K Scratch memory (bytes) – 64 64 128 128 – Speed (inst./sec.) 4 000 10 000 4 000 12 000 12 000 8 500 Number of Basic instructions 36 39 39 55 55 0 (Java) Parallel inputs/outputs 16 16 16 16 32 16 Max. source/sink current per output 20/25 mA 30/30 mA 30/30 mA 30/30 mA 30/30 mA 30/30 mA Max. source/sink current per chip / per group of 8 inputs/outputs 40/50 60/60 60/60 60/60 60/60 60/60 Programming interface PC serial port 9,600 baud PC serial port 9,600 baud PC serial port 9,600 baud PC serial port 9,600 baud PC serial port 9,600 baud PC serial port 28,800 baud Supply voltage 5 - 15 V 5 - 12 V 5 - 12 V 5 - 12 V 5 - 12 V 5 - 24 V Operating current 8 mA 60 mA 20 mA 40 mA 40 mA 80 mA Stand-by current 100 μA 200 μA 100 μA 400 μA 400 μA stand-by mode ZPVUPU[LYTZVMZWLLKVUS`VM[OL)::? :V[OL)HZPJ:[HTW,OHZHSS[OLJOHYHJ[LYPZ[PJZVM[OL)::?I\[VMMLYZ[OLZHTL WYVNYHTL_LJ\[PVUZWLLKHZ[OL): ;OL)HZPJ:[HTW7ZHUK7ZVMMLY TVYLPUUV]H[PVUZI\[JHUILWYLZLU[LK [VNL[OLYHZ[OLPYJOHYHJ[LYPZ[PJZHYLPKLU[PJHS L_JLW[ MVY VUL KL[HPS ^L»SS SVVR H[ PU H TVTLU[ (WHY[ MYVT ILPUN MHZ[LY [OHU [OL HSYLHK` MHZ[ )::? HJOPL]PUN PUZ[Y\J[PVUZWLYZLJVUK[OL`HSZV OH]LHUL_[LUKLKPUZ[Y\J[PVUZL[;OL VY PUZ[Y\J[PVUZ VM [OL ): VY )::? PUJYLHZL [V PU[YVK\JPUN ZVTL ]LY` WV^LYM\SHUKL_[YLTLS`OHUK`PUZ[Y\J[PVUZ JHWHISLVMKPYLJ[S`KYP]PUNHU3*+HSWOHU\TLYPJKPZWSH`[HSRPUN[VWLYPWOLYHSZV]LY [OL02*I\ZVYKYP]PUN0*Z^P[OH+HSSHZº >PYL»I\Z;OPZL]VS\[PVUPZKVULJSL]LYS` OV^L]LYHUK[OLZHTL):PUZ[Y\J[PVUZ HYLPUJS\KLK^P[OPU[OLPUZ[Y\J[PVUZVM [OL):7HUK):7;OL):7\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[PSSYLHZVUHISLJVTWHYLK^P[O [OLV[OLYWYVK\J[ZPU[OPZZ\Y]L` Figure 2. Internal architecture of the Cubloc CB220. (UKÄUHSS` ZVTL[Y\LT\S[P[HZRPUN 9LZ[HZZ\YLK,SLR[VYYLHKLYZ^LOH]LUV[ ILLUWHPK[V^YP[L[OPZHY[PJSLI`7HYHSSH_ L]LU[OV\NOP[»ZHUV[OLYVM[OPZJVTWHU`»Z WYVK\J[Z^L»YLNVPUN[VIL[HSRPUNHIV\[ UL_[![OL7YVWLSSLY>LOH]L[VHKTP[[OH[ L]LYZPUJL[OLÄYZ[)HZPJ:[HTWJHTLV\[ HSTVZ[`LHYZHNV7HYHSSH_OHZU»[ILLU YLZ[PUNVUP[ZSH\YLSZ)\[^OPSL[OLWYL]PV\ZWYVK\J[Z^LYLIHZLKVUL_PZ[PUNWYVJLZZVYZ[OL7YVWLSSLYPZHYLHSºJOPW»KL]LSVWLKI`7HYHSSH_ Photo 3. The PicBasic (right) marked Comfile Technology’s entry into the world of these special microcontrollers. It wasn’t yet pin-compatible with the Basic Stamp 2 (left). Figure 3. Internal architecture of the Propeller – impressive, and allowing true multitasking. 66 (Z-PN\YLZOV^ZL]LUH[ÄYZ[NSHUJLP[»Z HUPTWYLZZP]LWYVK\J[JVUZPZ[PUNVMUVSLZZ [OHULPNO[PUKLWLUKLU[M\UJ[PVUHSISVJRZ [OL*VNZLHJOJVTWYPZPUNP[ZV^UWYVJLZZVYHUKZVTL9(4;OLZL*VNZHYLSPURLK ]PHHI\ZTHUHNLKI`H/\I[OH[[HRLZ JHYL VM Z`UJOYVUPaPUN [OLPY L_JOHUNLZ ;OL`HSSZOHYL[OLWYVK\J[»Z\UJVTTP[[LKPUW\[V\[W\[SPULZ =LY`ML^ZWLJPHSPaLKWLYPWOLYHSZHYLI\PS[ PU[V[OL7YVWLSSLYI\[[OPZPZU»[HWYVISLTNP]LU[OH[P[ZWYVNYHTTPUNSHUN\HNL JHSSLK:WPUPZPUMHJ[HUVIQLJ[VYPLU[LK SHUN\HNL:VPM`V\ULLKMVYL_HTWSLHU 9:ZLYPHSWVY[`V\VUS`ULLK[VKLS]L PU[V[OL]VS\TPUV\ZVIQLJ[SPIYHY`THKL H]HPSHISL[V`V\I`7HYHSSH_[VÄUK^OH[ `V\»YLSVVRPUNMVY[OLYL@V\JHUKV[OL ZHTLMVYNLULYH[PUN7>4ZPNUHSZKYP]PUN HU02*I\ZHU3*+KPZWSH`L[J .P]LU[OH[[OLYLHYLLPNO[*VNZH]HPSHISL P[»ZWVZZPISL[VY\U\W[VLPNO[KPMMLYLU[ HWWSPJH[PVUZZPT\S[HULV\ZS`:VHYVIV[Ä[[LK^P[O[OPZZVY[VMWYVJLZZVYOHZUVKPMÄJ\S[`PUTHUHNPUNP[Z^OLLSTV[VYZ^OPSL HUHS`ZPUN[OLKH[HMYVTZL]LYHSZLUZVYZHUK [HRPUN[OLYLSL]HU[KLJPZPVUZ 6M JV\YZL :WPU PZ H SP[[SL KH\U[PUN HUK ^YP[PUN`V\YÄYZ[PUZ[Y\J[PVUZPZHIP[VMH WHPUMVYHU`VUL^OV»ZUL]LYWYVNYHTTLK ILMVYL·I\[P[»Z^LSS^VY[OHSS[OLLMMVY[ >OH[»ZTVYL7HYHSSH_WSHJLZH[`V\YKPZWVZHSHMVY\THUKHIV]LHSSHZWHJLVU P[Z^LIZP[L^OLYLHU`VULJHU\WSVHK[OL ]HYPV\ZVIQLJ[TVK\SLZ[OL`OH]LKL]LSVWLKMVY[OL7YVWLSSLY;OPZWHY[PJPWH[VY` SPIYHY`J\YYLU[S`OHZV]LYVIQLJ[TVK\SLZJV]LYPUN[OLTVZ[KP]LYZLÄLSKZHUK elektor electronics - 7-8/2007 Table 3: Principal characteristics of the various Cublocs. Parameter CB220 CB280 CB290 CB405 Microcontroller ATmega128 ATmega128 ATmega128 ATmega2560 Clock frequency 18.432 MHz 18.432 MHz 18.432 MHz 18.432 MHz Program memory 80 K 80 K 80 K 200 K Dynamic memory (RAM) 2 K (Basic) 1 K (Ladder) 2 K (Basic) 1 K (Ladder) 24 K (Basic) 4 K (Ladder) 51 K (Basic) 4 K (Ladder) 55 K (pile) Data EEPROM 4K 4K 4K 4K Speed (instr./s) 36,000 36,000 36,000 36,000 Inputs/outputs 16 49 91 (33 entrées, 32 sorties et 26 entrées/sorties) 64 Serial ports 1 RS-232 1 TTL 1 RS-232 1 TTL 1 RS-232 1 TTL 4 RS-232 ADC (10-bit) 8 channel 8 channel 8 channel 16 channel DAC (16-bit, PWM) 3 channel 6 channel 6 channel 12 channel External interrupts – 4 4 4 Fast counters 2 x 32 bits 2 x 32 bits 2 x 32 bits 2 x 32 bits Real-time clock – – Oui – Supply voltage 5 - 12 V 5V 5V 5V Operating current 40 mA 40 mA 70 mA 50 mA Package 24-pin DIL (BS2 compatible) 64-pin module 108-pin module 80-pin module PZJVU[PU\HSS`NYV^PUN :VPM`V\^HU[[VI\PSKHYVIV[[OH[YLX\PYLZ [Y\LT\S[P[HZRPUN[OL7YVWLSSLYPZJ\YYLU[S` VULVM[OLILZ[ZVS\[PVUZ[OLYLPZHSS[OL TVYLZVILJH\ZL[OLWYPJLPZVUS`HX\HY[LY VM[OH[VMH)HZPJ:[HTWH*\ISVJ*) VYZPTPSHYWYVK\J[ (UVKKT\S[P[HZRPUN70* >LJV\SKU»[LUK[OPZYL]PL^VMZWLJPHSWYVJLZZVYZ MVY YVIV[Z ^P[OV\[ TLU[PVUPUN HU 0*[OH[»ZYLSH[P]LS`\URUV^UVU[OPZZPKLVM [OL^VYSKKLZWP[LP[Z\UKLUPHISLPU[LYLZ[! [OL667PJ(ZP[ZUHTLTPNO[SLHKZ\Z[V Z\WWVZL[OPZ0*PZUVULV[OLY[OHUH70* TPJYVJVU[YVSSLY[OH[JHUILWYVNYHTTLKPU VIQLJ[VYPLU[LKSHUN\HNL·º66»Z[HUKPUN MVYºOIQLJ[OYPLU[LK»·I\[[OH[»ZUV[HSS¯ ;OL667PJPZPULMMLJ[H70*[OH[`V\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[\YLPL[VUV SVUNLYKVT\S[P[HZRPUNI\[T\S[PWYVJLZZVY VWLYH[PVU6ULWYVJLZZVYSVVRZHM[LY[OL THUHNLTLU[VM[OLWYVW\SZPVUHUV[OLY [OPZVY[OH[[`WLVMZLUZVYHUKZVVU^OPSL HºJLU[YHS»WYVJLZZVYUV^VUS`OHZ[VSVVR HM[LYKLJPZPVUTHRPUNVU[OLIHZPZVM[OL PUMVYTH[PVUZLU[[VP[ 6MJV\YZLPTWSLTLU[PUNZ\JOHUHYJOP[LJ[\YLPZUVSVUNLY^P[OPU[OLNYHZWVMH YVIV[PJZUV]PJLI\[HM[LYZ[HY[PUNV\[^P[O H)HZPJ:[HTWVYH*\ISVJMVYL_HTWSLP[ PZZ[PSSHJJLZZPISL[VHU`VUL^OVJHYLZ[V [HRL[OL[YV\ISLLZWLJPHSS`ZPUJLP[ULLKZ UVZWLJPHSPU]LZ[TLU[ZPUJL[OL667PJ PZ WYVNYHTTLK PU [OL SHUN\HNL VM `V\Y JOVPJL HUK [OL VIQLJ[Z HYL H]HPSHISL [V `V\MYLLHUKWYVNYHTTPUNPZKVUL\ZPUN Photo 4. The Cubloc CB220 (right) is directly interchangeable with the Basic Stamp 2 (left). 67 Photo 5. The development tools for Basic Stamp and Cubloc include a very useful editing terminal. Photo 6. The Propeller development tool showing an example of Spin — not exactly a barrel of laughs, but the results are worth the effort! Photo 7. The OOPic development tool allows graphical interaction with the objects used by the program. HZPTWSLJHISLJVUULJ[LK[V[OLWHYHSSLS WVY[VMHU`7* Addresses URL Company Comments *VUJS\ZPVU www.atmel.com Atmel Manufacturer of AVR microcontrollers ;OPZV]LY]PL^PZVMULJLZZP[`PUJVTWSL[L LZWLJPHSS`^OLU`V\[OPUR[OH[[OLWYVNYHTTPUNTHU\HSVMQ\Z[VULVM[OL0*Z WYLZLU[LKOLYLY\UZ[VH[SLHZ[HO\UKYLK VYZVWHNLZ)\[^LOVWL[OH[^LOH]L OLSWLK`V\KPZJV]LYVYYLKPZJV]LYZVTL VM[OLWYVJLZZVYZ[OH[HYLWHY[PJ\SHYS`^LSS Z\P[LK[VYVIV[PJZHUK^OPJO^OPSLILPUN ZPTWSL[VPTWSLTLU[KVUV[PUHU`^H` ZHJYPÄJLWLYMVYTHUJL www.basicmicro Basic Micro Manufacturer of Basic Atom www.comfile.co.kr/english2/ ‘PicBasic’ website Manufacturer of PicBasic www.comfiletech.com Comfile Technology General site Manufacturer of Cubloc www.microchip.com Microchip Manufacturer of PIC microcontrollers www.oopic.com Savage Innovations Manufacturer of OOPic www.parallax.com Parallax Manufacturer of: Basic Stamp, Javelin Stamp, Propeller www.tavernier-c.com – Author’s website (070319-I) Servo Control from a PC Bas Lijten +YP]PUNT\S[PWSLZLY]VZ]PHHTPJYVJVU[YVSSLYJHUILX\P[LHWYVISLTMVYTHU` WLVWSL-VY[\UH[LS`HZLY]VJVU[YVSSLYPZ H]HPSHISL^OPJOJHUILJVU[YVSSLKMYVTH 7*![OL::* ;OL::*PZHUVWLUZV\YJLJVU[YVSSLY ^OPJOPZJVUULJ[LK[V[OLZLYPHSWVY[0[ OHZV\[W\[Z^OPJOTHRLZP[WVZZPISL[V JVU[YVSZLY]VZZPT\S[HULV\ZS`,HJOV\[W\[JHUHSZVIL\ZLKHZHNLULYHSW\YWVZL V\[W\[^P[O;;3SL]LSZ0UHKKP[PVU[OL TPJYVJVU[YVSSLY OHZ MV\Y KPNP[HS PUW\[Z HUK[OLYLPZHUL_[YHZVJRL[MVYÄ[[PUNHU ,,7964;OPZ^HZUV[ILPUN\ZLKH[[OL [PTLVM^YP[PUNI\[P[PZSPRLS`[OH[P[^PSSIL \ZLKPUM\[\YL\WKH[LZVM[OLÄYT^HYL ;OL ZLY]VZ [OH[ HYL JVUULJ[LK [V [OL JVU[YVSSLYJHUILJVU[YVSSLKPUH]LY`ZPTWSL^H`6US`[OLU\TILYZVM[OLZLY]VZ [VILJVU[YVSSLK[OLW\SZL^PK[OWVZP[PVU HUK[OLZWLLKVY[PTLULLK[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P[»ZQ\Z[HX\LZ[PVUVMZPTWS`WSHJPUN H UL^ JOPW PU[V H ZVJRL[ HM[LY MPYZ[ ÄUKPUNV\[^OH[JH\ZLK[OLWYVISLTZVM JV\YZL ;OLZLJVTWVULU[ZVI]PV\ZS`[HRL\WTVYL YVVTVM[OL)VL)V[MYHTL[OHU[OLPYZ\YMHJL TV\U[ JV\U[LYWHY[Z ;OL +03 ]LYZPVUVM[OLWYVJLZZVYPUWHY[PJ\SHYPZT\JO SHYNLY[OHUP[ZSP[[SLIYV[OLYPUH38-7WHJRHNL)LJH\ZLVM[OPZ^LOH]LSLM[V\[HML^ MLH[\YLZ[OH[^LYLWYLZLU[VU[OL7HYHSSH_ IVHYKZ\JOHZ[OLJVTIPULK=.(RL`IVHYK HUK TV\ZL JVUULJ[VY ZPUJL ^L MLS[[OH[[OL`»YL\USPRLS`[VILTPZZLKPUH C5 GND 30 XI 9 VSS 29 VSS RX TX RESn 10 BOE 31 XO 1 2 3 4 5 6 7 8 13 14 15 16 17 18 19 20 32 11 100n K2 3V3 GND 5MHz +5V +5V GND GND +5V +5V GND GND 070275 - 11 GND Figure 1: The circuit diagram of the Propeller prototyping board. [OH[PZTHKL[VTLHZ\YLMVY[OL)VL)V[ MYHTL 0[ PZ UV[PJLHISL [OH[ WHY[ VM [OPZ IVHYKUV^OHZHUVYKPUHY`WYV[V[`WPUN HYLHMVY[OLHKKP[PVUVML_[YHLSLJ[YVUPJZ ^OLYLHZ[OLºVSK»)HZPJ:[HTWIVHYKJHTL LX\PWWLK^P[OHTPUPIYLHKIVHYK6U[OL 7YVWLSSLYIVHYK^L[OLYLMVYLOH]L[VZVSKLY HU`L_[YHJVTWVULU[Z^OPJOPZHIP[TVYL Components list Resistors K1 R1 = 2707 R2 = 10k7 P16 P17 P18 P19 P20 P21 P22 P23 Capacitors Semiconductors IC1 = LM2937ES-5.0 IC2 = LM2937ES-3.3 IC3 = 24LC256 IC4 = Propeller chip P8X32A-D40 (Parallax) Miscelllaneous X1 = 5MHz quartz crystal K2 = 5-way SIL pinheader K3 = 4-way SIL pinheader S1 = on/off switch S2 = 1 make contact 4 pcs 3-way SIL pinheader PCB, order code 070275-1 from Elektor SHOP 70 IC4 X1 C1,C2 = 10MF 16V radial C3,C4,C5 = 100nF P15 P14 P13 P12 P11 P10 P9 P8 S2 C4 P7 P6 P5 P4 P3 P2 P1 P0 P24 P25 P26 P27 P28 P29 P30 P31 IC3 R2 K3 K2 S1 C3 C2 C1 R1 D1 C5 Figure 2: The board layout is single-sided. If you expect to use the prototyping area a lot then a double-sided through-hole plated version would be preferable. elektor electronics - 7-8/2007 TVIPSLYVIV[ *PYJ\P[KPHNYHT ;OL JPYJ\P[ KPHNYHT ZOV^U PU -PN\YL PZJVUZWPJ\V\ZI`P[ZZPTWSPJP[`;^VSV^ KYVWV\[]VS[HNLYLN\SH[VYZWYV]PKL=MVY [OLWYVJLZZVYHUK[OL,,7964HUK= MVYWLYPWOLYHSKL]PJLZ[OH[YLX\PYLHOPNOLY ]VS[HNLZ\JOHZ[OLTVKPÄLKZLY]VTV[VYZ [OH[ WYVWLS [OL )VL)V[ 9LTLTILY [OH[ [OLPUW\[WPUZVM[OL7YVWLSSLYJHU»[^P[OZ[HUK=5L_[[V:[OLWV^LYZ^P[JOPZH NYV\WVMMV\Y[OYLLWVSL:03JVUULJ[VYZMVY [OLJVUULJ[PVUVMZLY]VZHUKV[OLYWLYPWOLYHSZ[OH[YLX\PYLH=Z\WWS` (WV^LYZV\YJL^P[OH]VS[HNLIL[^LLU= [V=ZOV\SKILJVUULJ[LK[V2I\[^L ^V\SKHK]PZLHNHPUZ[\ZPUN[VVOPNOH]VS[HNL ILJH\ZLVM[OLOLH[KPZZPWH[PVUPU0* ;OLYLHYL[^VKPMMLYLU[^H`ZVMPTWSLTLU[PUN[OLWYVNYHTTPUNPU[LYMHJL[VH7*!2 PZ[OLJVUULJ[VYMVY\ZL^P[O[OL7YVWLSSLY 7S\NI`7HYHSSH_^OPJO\ZLZH<:)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KL^OPJOIYPUNZ THU`HK]HU[HNLZ6ULPTWVY[HU[WVPU[ [VUV[LPU[OPZYLNHYKPZ[OHUVUYLZL[[OL WVY[ZHYLZL[[V*46:PUW\[TVKLHUK T\Z[PMULJLZZHY`ILZ\P[HIS`PUP[PHSPZLK ILMVYL\ZL 6[OLY^PZL[OL37* PZ]LY`LHZ`[V\ZL ;OLKH[HZOLL[PZYLUKLYLKHSTVZ[Z\WLY- M S \ V \ Z I ` [OL MYLL º*VKL (YJOP[LJ[» ZVM[^HYL I` ,TILKKLK:`Z[LTZ(JHKLT`BD;OPZ[VVS PZJHWHISLVMJYLH[PUNZUPWWL[ZVM*ZV\YJL JVKLKPYLJ[S`ZLL-PN\YL 3VHKPUNJVKLPU[V[OL37* TPJYVJVU- uPU[LYUHSWYLJPZPVU4/a9*VZJPSSH[VYPKLHSMVYIH\KYH[LNLULYH[PVU\W[V RIH\K^P[OV\[HUL_[LYUHSJY`Z[HS" u*7<ZH]HPSHISLPU+03HZ^LSSHZ[PU` :4+;::67WHJRHNLZ" COMPONENTS LIST uH TPUPT\T Z`Z[LT YLX\PYLZ H ZPUNSL JHWHJP[VY HZ [OL VUS` L_[LYUHS JVTWVULU[" R1 = 2407 SMD (0805) R2 = 3907 SMD (0805) R3,R4,R7,R9,R11,R12,R13 = 1k7 SMD (0805) R5,R6,R8,R10 = 220k7 SMD (0805) T1 = BC857 SMD (SOT23) LED1,LED2 = LED, red, SMD (0805) IC1 = LM317 SMD (SO8) IC2 = 74HCT00 SMD (SO14) IC3 = MAX3232 (SO16) Capacitors Miscellaneous u^ PKL YHUNL VM VUJOPW WLYPWOLYHSZ! IYV^UV\[ KL[LJ[VY ^H[JOKVN [PTLY JVTWHYH[VYZ(+JVU]LY[LY" uVWLYH[PUN]VS[HNL=[V= ;OLVUS`ZPNUPÄJHU[KPMMLYLUJLMYVT[OL Z[HUKHYKPZ[OLPTWYV]LK06Z[Y\J[\YL![OL`JHUUV^HSZV^VYRPUH*46: 72 Resistors C1 = 4μF7 25V SMD (1206 or 1210) C2 = 10μF 6V SMD (1206 or 1210) C3 = 100nF SMD (0805) C4,C5,C6,C7,C8 = 1μF SMD (0805) Semiconductors D1 = GF1M K1 = mains adaptor socket for PCB mounting K2 = 9-way sub-D socket, angled, PCB mount K3 = 5-way SIL pinheader PCB, ref. 070084-1, from www.thepcbshop. com elektor electronics - 7-8/2007 [YVSSLYWYVJLLKZ^P[OHTPUPT\TVMM\ZZ >OLU[OL*7<YLJLP]LZHZLYPLZVM[OYLL W\SZLZVUP[ZYLZL[WPU^P[OPUHZWLJPÄLK [PTL^PUKV^VMILPUNWV^LYLK\W[OL *7<Q\TWZ[VHIVV[SVHKLY^OPJO[OLU WYVJLLKZ[VJVTT\UPJH[L\ZPUN[OL9?+ HUK;?+ZPNUHSZ(M[LYJVKLPZKV^USVHKLK [OLZL[OYLLZPNUHSZHYLVMJV\YZLH]HPSHISL MVY[OLPYUVYTHS\ZL(Ä]L^H`JHISLPZ YLX\PYLKMVYKV^USVHK ;OLOHYK^HYLYLX\PYLKPZTPUPTHSHZ[OL JPYJ\P[PU-PN\YLZOV^Z;OPZJPYJ\P[PZ JHWHISLVMZ\WWS`PUN[OL37*^P[OWV^LY HUK HSZV WYV]PKLZ HU 9: PU[LYMHJL PKLHS MVY \ZL ^P[O H [LYTPUHS WYVNYHT ;OLWYPU[LKJPYJ\P[IVHYKMVY[OLKLZPNUPZ ZOV^UPU-PN\YL R5 K2 V- R8 K1 1u 11 T1IN 12 R1OUT 7 T2OUT 8 R2IN 10 T2IN 9 R2OUT IC2 = 74HCT00 K1 1 GND +3V3_ISP R11 1k 4 5 1 2 IC2B & & 9 10 6 IC2A 3 IC2C & C1 R13 4u7 25V R2 390R IC1 CPU_VCC CPU_RXD CPU_TXD CPU_RES CPU_GND R12 1k 8 ISP connector R4 1k T1 +3V3 +3V3_ISP 3V3 switched 2 IN OUT 3 IC1 6 LM317 7 ADJ R1 240R K3 R9 1k BC857 R3 R7 14 4 C2 C3 C7 14 T1OUT 13 R1IN R10 220k 1N4001 T1 R 3 IC3 LED2 1u 4 C2+ 5 C2- IC3 MAX3232 1u C6 1 C1+ 3 C1- VCC 15 11 1 6 2 7 3 8 4 9 5 V+ IC2 C2 10u 6V LED1 7 C3 R13 LED2 1k 2 C8 R1 R2 LED1 R7 R9 R 11 R12 K3 1u +3V3 C 1 D1 IC2 C4 C7 C5 1u 6 D1 R4 R6 R8 C 6 (c) Elektor 070084-1 5 C5 C8 & C4 R6 220k R5 1 11 9 R 10 K2 IC2D 1k 12 13 1k +3V3 16 +3V3 10 6 [OLR)JVKLZPaLSPTP[I\[[OPZPZHSYLHK` LUV\NO[V^YP[L]LY`JVTWSL_HWWSPJH[PVUZ MVYHUJVTWH[PISLTPJYVJVU[YVSSLY MHTPS`KL]PJLZ[OLMYLLKLTVUZ[YH[PVU]LYZPVUVM[OLJVTWPSLYPZLU[PYLS`HKLX\H[L ;OLVUS`YLZ[YPJ[PVUVM[OLMYLL]LYZPVUPZ 220k (UVW[PTPZPUN*JVTWPSLYPZHSZVULLKLK [V^YP[LWYVNYHTZMVY[OL37* MHTPS` ;OLYLHYL]HYPV\ZJVTTLYJPHSWYVK\J[Z H]HPSHISL"OLYL^L^PSSIYPLÅ`KPZJ\ZZOV^ [V\ZL*BD-VYWYHJ[PJHSS`HSS37* Figure 1. ‘Code Architect’ is a free tool that makes using the LPC900 microcontroller very straightforward. 220k 6WLYH[PVU PZ Z[YHPNO[MVY^HYK ;OL *7< JHUILWV^LYLK\WHUKKV^U\ZPUN[OL +;9ZPNUHS;OL9;:ZPNUHSM\UJ[PVUZHZH Z^P[JO!PM9;:PZHJ[P]L[OLUZPNUHSZMYVT 9?+HYLHSZVWYLZLU[LK[V[OLYLZL[WPU VM[OL*7<HUKJHU[O\ZIL\ZLK[VHJ[P]H[L[OLIVV[SVHKLY5V[L[OH[9 LUZ\YLZ[OH[[OLZ\WWS`]VS[HNL[V [OL[HYNL[OHYK^HYLKYVWZYHWPKS` ^OLUP[PZZ^P[JOLKVMM0[PZHK]PZHISL[VSPTP[[OLJHWHJP[HUJLVU[OL =YHPSPU[OL[HYNL[OHYK^HYL[V HWWYV_PTH[LS` - ZPUJL V[OLY^PZL[OLTPJYVJVU[YVSSLYILPUNWYVNYHTTLKTPNO[UV[JVYYLJ[S`L_LJ\[L HWV^LYVUYLZL[ ;OLMYLLWYVNYHTº-SHZO4HNPJ»HSZVMYVT ,TILKKLK :`Z[LTZ (JHKLT` JHU IL \ZLK[VZPTWSPM`WYVNYHTTPUN[OLKL]PJLZ ;OPZ^PSSILMHTPSPHY[V,SLR[VY,SLJ[YVUPJZ YLHKLYZMYVT[OL9-0+YLHKLYWYVQLJ[BD ;OPZ[VVSHSZVPUJS\KLZHZ\P[HISL[LYTPUHS WYVNYHT 100n LPC900 P ROGR AMME R 070084 - 11 Figure 3. Layout and component mounting plan for the printed circuit board. 7-8/2007 - elektor electronics Figure 2. Circuit of the LPC900 programmer. 73 ILJH\ZL[OLJVTWPSLYWYVK\JLZ]LY`JVTWHJ[JVKL0UWHY[PJ\SHY[OLJVTWPSLYPZ ]LY`WHYZPTVUPV\Z^P[O[OLSPTP[LKPU[LYUHS9(4PU[OLTPJYVJVU[YVSSLY\ZPUNH NYHWOIHZLK VW[PTPZH[PVU HSNVYP[OT [V LUHISLT\S[PWSLYL\ZLVMTLTVY`HYLHZ -VYL_HTWSLL]LU^P[O[OPZ]LY`[PU`*7< ^LOH]LHM\SS`MLH[\YLKºWYPU[M»M\UJ[PVU JHSS;OLZ`Z[LTHSZVPUJS\KLZHYLSPHISL HUKJVTWYLOLUZP]LÅVH[PUNWVPU[SPIYHY` ;OL * Z`Z[LT ^HZ KL]LSVWLK HZ H [VVSMVY[OLJVTWHU`.LV7YLJPZPVUBD HUKOHZILLU\ZLKHUKTHPU[HPULK[OLYL MVY`LHYZ ;OLZVM[^HYL[VVSZ^VYR]LY`^LSS[VNL[OLY HUKTHRLKL]LSVWTLU[]LY`X\PJR![OLYL HYLQ\Z[[OYLLZ[LWZMYVTZV\YJLJVKL[V ^VYRPUNWYVNYHT Figure 4. Initialisation specific to the LPC900 requires just five instructions. -VYKLTVUZ[YH[PVUW\YWVZLZ^L\ZLKHU 37* ^P[OHU3,+JVUULJ[LK[VWVY[ WPU7;OLSPZ[PUNZOV^U-PN\YLPZ HUL_HTWSLWYVQLJ[PUJS\KLK^P[O* ZPUJL]LYZPVU(ZJHUILZLLUMYVT -PN\YL[OLJVTWPSLY\ZLZH^LSSZ[Y\J[\YLKJSHZZPJHSºTHRL»Z`Z[LT+V^USVHKPUNHWYVNYHT[V[OLTPJYVJVU[YVSSLYPZHU PU[\P[P]LVWLYH[PVU-PN\YL0[PZYLJVTTLUKLK[OH[`V\JVUÄN\YL[OL[LYTPUHS WYVNYHTLTILKKLK^P[OPUº-SHZO4HNPJ» ZV [OH[ P[ PZ SH\UJOLK PTTLKPH[LS` [OL HWWSPJH[PVUPZZ[HY[LKVU[OL37*5V[L PUWHY[PJ\SHY[OH[[OL9;:HUK+;9ZPNUHSZ T\Z[ILJVYYLJ[S`JVUÄN\YLKIV[OHJ[P]L! ZLL-PN\YL (070084-I) References and links [1] http://www.standardics.nxp.com/products/lpc900 (NXP, manufacturer of the LPC900 family). Figure 5. The μC/51 compiler uses a well-structured classical ‘make’ system. [2] http://www.esacademy.com (Embedded Systems Academy: Flash Magic, Code Architect). [3] ELEKTOR RFID Reader (using an LPC936), Elektor Electronics, September 2006, p. 26. [4] http://www.wickenhaeuser.de (μC/51 compiler, demonstration version). [5] http://www.geo-precision.com (geotechnical research and development). Figure 6. Flash Magic is a free tool for programming LPC microcontrollers. 74 Figure 7. Settings for the RTS and DTR signals in the Flash Magic terminal program. elektor electronics - 7-8/2007 Low2 Cost USB Demo Board C your way through USB VDD R6 100n R2 1 470 7 3 P1 C3 4 5 100n 10k 6 7 8 VDD 9 10 USB Qu RB5/PGM RA1/AN1 RB4/AN11 RA2/AN2 RB3/AN9 RA3/AN3 RB2/AN8 RA4/T0CKI RA5/AN4 •2 uts (1 ue inp analog on pot) s) 17 GND USB-B 2 3 4 3PRL [OPZ! H ZPUNSL IVHYK JVUULJ[LK \W [V[OL7*]PHH<:)SPURHUKZWVY[PUNHU HK]HUJLK70*TPJYVJVU[YVSSLY(KKZVTL ZVM[^HYLHUK[OLYL»Z`V\Y<:)KLTVIVHYK KV\ISPUNHZHKL]LSVWTLU[Z`Z[LT[VOLSW `V\KPZJV]LYOV^<:)PZPTWSLTLU[LKVU HTPJYVJVU[YVSSLYWYVNYHTTLK[VOHUKSL HUHSVN\L HUK KPNP[HS 06 MVY YLHS ^VYSK HWWSPJH[PVUZ 38 37 36 R5 470 7 D5 R4 470 7 35 PWR S2 S3 34 33 RE1/AN6 RE2/AN7 R10 10 7 10 7 R11 17 23 24 25 26 18 RC0/T1OSO RD7/SPP7 RC1/T1OSI RD6/SPP6 RC2/CCP1 RD5/SPP5 RC4/D- RD4/SPP4 RC5/V+ RD3/SPP3 RC6/TX RD2/SPP2 RC7/RX RD1/SPP1 VUSB RD0/SPP0 Ds) uts (LE ilable 0 (ava 18F455 IC P : e) IC d) • 1 (on programme ks g bloc readybuildin re a w ft so uite of +6 • Full s der C+ for Buil re a w ct soft /D nnel A • Proje r 2-cha on PC fo m ra ut o prog reado • Dem raph/meter g with RB0/AN12 39 RE0/AN5 tp ital ou • 4 dig D– D+ witche puts (s ital in • 2 dig 16 1 RB1/AN10 IC1 40 PIC18F4550 15 K1 +5V RB7/PGD RA0/AN0 R8 asy ick & E 32 RB6/PGC 2 470 7 S1 MCLR/VPP JP1 R3 R16 100n 11 Slick graphics, reading analogue values and making them appear in graphs, cockpit-style meters and dials, all on USB… How do they do it? R7 330 7 Martin Valle C2 10k 10k C1 10k R1 OSC1 12 OSC2 13 14 30 29 R15 27 22 R14 D4 RD2 D3 330 7 21 20 19 R13 RD1 D2 330 7 R12 31 RD3 330 7 28 RD0 D1 330 7 R9 10M JP2 X1 C6 100n C4 C5 20MHz 22p 22p 060342 - 11 Figure 1. Schematic of the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L SVJH[LKPU! *!C4*/7-:<:)CM^C/PKFV\[W\[ 50*(74OL_ ;OLUY\U[OLWYVNYHT @V\JHUY\U[OL7*HWWSPJH[PVUKPYLJ[S` ^P[OV\[*)\PSKLYPUZ[HSSLKPU[OLJVTW\[LYI`\ZPUN[OLZ[\MMPU[OLHYJOP]LÄSL JHSSLK!^P[OV\[I\PSKLYaPW6I]PV\ZS`[OL TPJYVJVU[YVSSLYT\Z[ILJVUULJ[LK[V[OL OVZ[HUKY\UUPUN[OL50*(74ÄYT^HYL ;OL ^PUKV^ VM [OL KLTV HWWSPJH[PVU ZOV\SKSVVRSPRL-PN\YLZOV^PUN[OLZPNUHSZVM*OHUULS(5WPUHUK*OHUULS(5WPU;OLYL»ZHSZV[OLHYJOP]L ÄSLJHSSLKWYVQLJ[aPWPM`V\^HU[[VTVKPM` ZVTL[OPUNPU[OL7*WYVQLJ[ Figure 5. Two ADC Channels and USB of the PIC in action. Listing 1. 0M`V\^HU[[VTHRLHUL^)\PSKLYWYVQLJ[ `V\VUS`OH]L[VSVVRHM[LY[^V[OPUNZ! /** D E F I N I T I O N S *****************************************/ #define EP0_BUFF_SIZE 8 // 8, 16, 32, or 64 #define MAX_NUM_INT 1 // For tracking Alternate Setting (KK[OLOPKSPIÄSLI`KVPUN! 7YVQLJ[(KK[VWYVQLJ[OPKSPI /* Parameter definitions are defined in usbdrv.h */ #define MODE_PP _PPBM0 #define UCFG_VAL _PUEN|_TRINT|_FS|MODE_PP *OHUNL[OL+H[HHSPNUTLU[MYVT8\HK ^VYK[VI`[LI`KVPUN! 7YVQLJ[6W[PVUZ(K]HUJLK 6W[PVUZ+H[HHSPNUTLU[ //#define USE_SELF_POWER_SENSE_IO //#define USE_USB_BUS_SENSE_IO (060342-I) Optimised STK200/300 Programmer for AVR Micros 26 1 20 14 IC1 2 10 7-8/2007 - elektor electronics C1 100n 15 27 GND 3 16 4 17 5 IC1 19 EN2 1 6 19 7 20 8 21 22 10 23 2 4 16 6 14 8 12 11 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VJVU[YVSSLYWYVNYHTTLYZVM[^HYLMVY L_HTWSL)(:*64HUK*VKL=PZPVU (060374-I) 77 Satnav for Robots GPS guidance for autonomous vehicles Ulli Sommer A (frequently unfulfilled) ambition of every robot builder is to make their machine capable of autonomous navigation. This is an ideal application for a GPS receiver module: these have recently become very cheap to buy. Our GPS-based navigation system is built around an ATmega32, programmed using BASCOM BASIC. It communicates with the outside world using an I2C bus. (U` YVIV[PJZ OVII`PZ[ ^V\SK KYLHT VM ILPUNHISL[VI\PSKHYVIV[^OPJOSPRL[OL MHTV\Z4HYZ:VQV\YULY9V]LYJHUH\[VUVTV\ZS`ULNV[PH[L\URUV^U[LYYHPU0KLHSS`VUL^V\SKQ\Z[WYVNYHTPU[OLJVVYKPUH[LZVM[OLKLZPYLKKLZ[PUH[PVUHUK[OL SP[[SLJOHW^V\SKTHRLOPZV^U^H`[OLYL H\[VTH[PJHSS`(S[OV\NOM\SS`H\[VUVTV\Z YVIV[ZT\Z[YLTHPUHWPWLKYLHTMVYUV^ HZVS\[PVUPZH]HPSHISL[V[OLUH]PNH[PVU WYVISLT HZ ^L KLTVUZ[YH[L OLYL ^P[O HJPYJ\P[IVHYKKLZPNULK[VILHKKLK[V HKVTLZ[PJZ\Y]LPSSHUJLYVIV[ZLLSHYNL WOV[VNYHWO 9H[OLY[OHUKL]LSVWHUH]PNH[PVUZ`Z[LT MYVT ZJYH[JO V\YZLS]LZ ^L THRL \ZL VM SV^JVZ[ YLJLP]LY TVK\SLZ [OH[ YLJLP]L HUKWYVJLZZZPNUHSZMYVT[OL.7:ZH[LSSP[L WVZP[PVUPUNZ`Z[LT;V[OPZ^LHKKHTVKLYH[LS`WV^LYM\STPJYVJVU[YVSSLY[OH[JHU ILWYVNYHTTLK\ZPUNMYLLZVM[^HYL (;TLNHH[[OLOLST 6\Y .7:IHZLK UH]PNH[PVU Z`Z[LT PZ I\PS[HYV\UKHU([TLS(;TLNH^OPJO HWWLHYZ H[ [OL OLHY[ IV[O VM [OL JPYJ\P[ KPHNYHT-PN\YLHUKVM[OLWYV[V[`WL WYPU[LKJPYJ\P[IVHYK-PN\YL;OLTPJYVJVU[YVSSLYPZWYVNYHTTLKPUHKPHSLJ[VM )(:0*\ZPUN[OL)(:*64KL]LSVWTLU[ Z`Z[LT^OPJOPZ^PKLS`\ZLKHUKH]HPSH- ISLMVYMYLLMVY[OLKLTVUZ[YH[PVU]LYZPVU H[SLHZ[KV^USVHKMYVT[OLTHU\MHJ[\YLY BD(SZV[OLZV\YJLHUKVIQLJ[ÄSLZMVY [OLUH]PNH[PVUWYVNYHTHYLH]HPSHISLMVY MYLLKV^USVHKMYVT[OL,SLR[VY,SLJ[YVUPJZ^LIZP[L;OLÄSLYLMLYLUJLPZ aPW (U 0:7 JHISL PZ HSZV YLX\PYLK VI[HPUHISLMVYL_HTWSLMYVTBD (U` JVTTLYJPHS .7: ºTV\ZL» YLJLP]LY JHUIL\ZLKHZSVUNHZP[OHZHU9: PU[LYMHJL0M[OLPU[LYMHJL\ZLZ;;3ZPNUHS SL]LSZP[JHUILJVUULJ[LKKPYLJ[S`[VV\Y WYPU[LKJPYJ\P[IVHYK"PMVU[OLV[OLYOHUK P[\ZLZZ[HUKHYK9:SL]LSZ\W[V= H4(?SL]LSZOPM[LYT\Z[ILJVUULJ[LK How to program track points You should see a welcome message (which indicates how to get help) and a prompt on the terminal. Before attempting any autonomous journeys we must program a series of set coordinates (‘track points’) into the navigation system. The following commands are also available: ‘Data’ lists the stored The first step is to replace the GPS mouse with a (null modem) data GPS data; ‘Input’ allows the GPS data to be edited; and ‘Reset’ cable, connected to a PC. On the PC, start up a terminal emula- restarts the navigation system. tor program such as Hyperterminal. A terminal emulator is also included in the BASCOM package. The coordinates of the track points can be determined using a separate GPS system; alternatively, the robot can be moved manually The interface parameters must be set as for the mouse (i.e., to to each track point in turn and the coordinates read off the LCD. 4800 baud). When connection has been set up, press the reset and 78 programming buttons simultaneously. Then first release the reset With the track point data programmed in, the robot can be left to button and then the programming button around a second later. its own devices! elektor electronics - 7-8/2007 R13 R12 R11 I 2C - Bus to main controller trackpoint assignment +5V 4k7 4k7 R6 R10 4k7 4k7 R7 4k7 R9 30 AVCC 4k7 10 VCC 4k7 32 AREF 9 4k7 R24 10k 10k R23 R8 +5V 16 K4 RST IC1 1 K1 2 10 9 MISO 3 8 7 SCK 4 6 5 RST 5 4 3 2 1 6 MOSI 7 8 ISP +5V PB0(XCK/T0) (ADC0)PA0 PB1(T1) (ADC1)PA1 PB2(INT2/AIN0) (ADC2)PA2 PB3(OC0/AIN1) (ADC3)PA3 PB4(SS) (ADC4)PA4 PB5(MOSI) (ADC5)PA5 PB6(MISO) (ADC6)PA6 PB7(SCK) (ADC7)PA7 40 4 39 5 38 6 37 7 36 9 35 10 34 11 33 12 P1 SCL IC2 P2 P3 INT 15 SDA 14 SCL 13 GND +5V PCF8574 P4 P5 A0 P6 A1 P7 A2 R5 1 10k 2 R4 10k 3 R3 10k able 19 20 21 R22 (TOSC1)PC6 PD2(INT0) (TDI)PC5 PD3(INT1) (TDO)PC4 PD4(OC1B) (TMS)PC3 PD5(OC1A) (TCK)PC2 PD6(ICP1) (SDA)PC1 PD7(OC2) (SCL)PC0 GND 470 7 R18 470 7 470 7 R17 (TOSC2)PC7 PD1(TXD) XTAL1 11 XTAL2 GND 12 31 13 29 28 8 27 25 K5 I 2C - Bus 24 +5V 23 SDA 22 SCL S2 D6 D5 R1 2k2 RESET PRG DRIVE SIGNAL SYSTEM RUN R2 GND compass I 2C LCD 16 x 4 IC3 D1 +5V 7805 R19 D3 10k 10k R16 S3 K6 2k2 X1 R15 ADR +5V 26 C2 C1 22p 22p 16MHz K7 1N4001 C4 C5 C6 C7 47M 100n 100n 1M +8V ... +15V READOUT 470 7 18 PD0(RXD) JP3 15 JP2 14 TXD JP1 RXD 17 10k SDA ATmega32 16 R14 P0 D2 POWER I 2C Figure 1. The ATmega32 communicates with the compass and the LCD over an bus; the GPS mouse is connected via RS-232. The PCF8574 I2C interface chip takes on the task of accepting a control byte and making it available on pins 33 to 40 of the ATmega. TVK\SLPZMVYL_HTWSL[OL+L]HU[LJO PUIL[^LLU6M[LUHYVIV[»ZTHPUJPYJ\P[ LU[H[PVU^L^PSSHSZVULLKHU3*+TVK\SL *47:H]HPSHISLMYVTBD;OPZJVTWHZZ IVHYK^PSSHSYLHK`OH]LHZ\P[HISLSL]LS ;OLTPJYVJVU[YVSSLYPZYH[OLYSHJRPUNPU06 PZJVUULJ[LK[V[OL02*WVY[VUV\YWYPU[LK ZOPM[LY0*VUP[ WVY[WPUZHUKZV[OLTVZ[WYHJ[PJHSZVS\[PVU ;OL.7:TV\ZLNP]LZ[OLL_HJ[NLVNYHWOPJ PZ[VKYP]L[OLKPZWSH`HSZV]PH[OL02*I\Z JPYJ\P[IVHYK JVVYKPUH[LZSH[P[\KLHUKSVUNP[\KLPUH 0M^L^HU[[VKPZWSH`[OLWVZP[PVUHUKVYP;OLYLKVL_PZ[3*+TVK\SLZ^P[OI\PS[PU KLMPULK MVY0 2 * PU[ L YTH[!ZLL[L_[ MHJLZI\[HU IV_ 0[ JHU HS[LYUH[P]L HSZV KL[LYPZ[V\ZLHU T P U L [ O L 02*PU[LYMHJL JVTWHZZ JOPWZ\JOHZ KPYLJ[PVU VM [OL7*- TV]LTLU[ BDZLL-PN PM P[Z ZWLLK \YL >L PZTVYL[OHU ^ P S S Z L L HIV\[RT HUV[OLY O [V RT \ZL VM [OPZ O : P U J L K L ]PJ L PU ^L ^PZO [V V\Y JPYJ\P[ KL[LYTPUL SH[LYVU VYPLU[H[PVU L]LU ^OLU 4V[VY Z[H[PVUHY` JVU[YVS ^L YLX\PYL HUHKKP[PVUHS 6M JV\YZL ºLSLJ[YVUPJ ^L KV UV[ JVTWHZZ» Q\ Z [ ^ H U [ ZLL ISVJR V\Y YV I V[ KPHNYHT PU [V KPZWSH` -PN\YL ^OLYL P[ PZ" ( Z\P[ HISL ^L ^HU[ P[ Figure 2. Prototype navigation system printed circuit board for autonomous robots. JVTWHZZ [V THRL P[Z 7-8/2007 - elektor electronics 79 GND SCL SDA +5V I 2C compass K8 I 2C LEFT track point assignment RIGHT 3 2 1 A1 A0 A2 13 14 INT SDA 7 14 P3 6 13 P2 5 P1 4 12 P0 8 11 12 9 P7 P6 11 8 P5 9 P4 IC4 PCF8574 10 RS232 16 7 GPS go left go right target OK PRG 6 GPS-BOT-DRIVE SCL 15 +5V RST 10k D7 D6 D5 5 4 3 2 10 D4 D3 D2 D1 D0 E R/W RS VO VDD VSS Figure 3. Simplified block diagram of the navigation system. The buttons are used when programming. Commands for the motors are output on two port pins. 1 070350 - 13 LC DISPLAY 16 x 4 ^H`[VV\YKLZPYLKKLZ[PUH[PVU0UKVPUN [OPZ[OLUH]PNH[PVUZ`Z[LTV\[W\[ZKPYLJ[PVU JVU[YVSPUMVYTH[PVUVU[^VWPUZ6\[W\[ WPUZ4V[VYFSHUK4V[VYFYJVTIPULKNP]L [OLKLZPYLKKPYLJ[PVUVM[YH]LSHZMVSSV^Z! Motor_l Motor_r 0 0 Function STOP 1 1 straight on 1 0 turn left 0 1 turn right 5V^^LULLKH^H`[V[LSS[OLYVIV[UH]PNH[PVUZ`Z[LT^OLYL^L^HU[P[[VNV;V KV[OPZ^LÄYZ[ULLK[VWYVNYHTHZLYPLZ VMZL[JVVYKPUH[LZº[YHJRWVPU[Z»PU[V[OL \UP[^OPJOPZKVUL\ZPUN[OLJHISLILMVYL H[[LTW[PUNHU`H\[VUVTV\ZQV\YUL`ZZLL [L_[IV_0UUVYTHSVWLYH[PVU[OLUH]PNH[PVUZ`Z[LT[OLUVUS`ULLKZ[VIL[VSK ^OPJO[YHJRWVPU[P[ZOV\SK[Y`[V]PZP[UL_[ ^OPJOJHUMVYL_HTWSLILKVULI`[OL YVIV[»ZTHPUWYVJLZZVY ;OPZ ZLJVUK JVTT\UPJH[PVUZ JOHSSLUNL PZHSZVZVS]LK\ZPUN[OL02*I\Z^OPJOPZ LHZ`[V\ZLMYVT^P[OPU)(:*64)(:0* (7*-02*PU[LYMHJLJOPW[HRLZVU[OL [HZRVMHJJLW[PUNHJVU[YVSI`[LHUKTHRPUN P[H]HPSHISLVUWPUZ[VVM[OL(;TLNH ZLL-PN\YL;OLZVM[^HYLJVUÄN\YLZ[OL KL]PJL[VY\UPUPUW\[TVKL-VYHZPTWSLY OHYK^HYLKLZPNUP[PZVMJV\YZLWVZZPISL[V KPZWLUZL^P[O[OLPU[LYMHJLJOPWHUKKYP]L [OLWVY[WPUZVM[OL(;TLNHOPNOHUK SV^KPYLJ[S`HUKPUWHYHSSLS ;VZLSLJ[MVYL_HTWSL[YHJRWVPU[\ZPUN [OL02*PU[LYMHJL^LT\Z[ZLUK[OLU\TILY º»[V[OL7*-0U)(:*64)(:0*[OPZ TPNO[ILKVULHZMVSSV^Z I2cstart I2cwbyte &H7A (address of PCF8574: see data sheet for addressing scheme) I2cwbyte 1 (track point number) I2cstop >OLU[OL[YHJRWVPU[ZLSLJ[PVUI`[LOHZ ILLUZLU[[OLUH]PNH[PVUZ`Z[LTKL[LYTPULZ [OL KPYLJ[PVU [V [OL KLZ[PUH[PVU ;OPZ JHSJ\SH[LK KPYLJ[PVU PZ [OLU JVTWHYLK [V [OL J\YYLU[ VYPLU[H[PVU VM [OL YVIV[VI[HPULKMYVT[OLJVTWHZZ0U[OPZ JHSJ\SH[PVU^LPNUVYL[OLJ\Y]H[\YLVM[OL LHY[OZPUJL^LKVUV[L_WLJ[V\YYVIV[[V LTIHYRVUSVUNKPZ[HUJLQV\YUL`Z 070350 - 12 Figure 4. The LCD is driven over an I2C bus, the PCF8574 interface chip making a second appearance in the circuit (see Figure 1). UH]PNH[PVUZ`Z[LTZ^PUNZPU[VHJ[PVUHUK IYPUNZP[IHJRVUJV\YZL0M[OLX\HSP[`VM [OL.7:ZPNUHSPZ[VVWVVYVY[VVML^ZH[LSSP[LZHYL]PZPISL[OLYVIV[^PSS^HP[\U[PSHU HKLX\H[LZPNUHSPZH]HPSHISL[VYLJHSJ\SH[L [OLKLZPYLKJV\YZL >OLU[OLKLZ[PUH[PVUPZYLHJOLK[OLYVIV[ Z[VWZHUK[HRLZ[OLWPU+LZ[FVROPNO;OPZ ZPNUHS JHU IL \ZLK I` [OL YVIV[»Z THPU WYVJLZZVYMVYL_HTWSL[VSVHK\W[OLUL_[ [YHJRWVPU[ZV[OH[[OLTHJOPUL[YHJLZV\[ HWYLKL[LYTPULKJV\YZL (070350-I) Web links [1] http://www.mcselec.com [2] http://www.elektor-electronics.co.uk [3] http://www.kanda.com 0M[OLKLZPYLKHUKHJ[\HSKPYLJ[PVUZHYLPU HNYLLTLU[[OLYVIV[HK]HUJLZPUHZ[YHPNO[ SPUL0MHZP[TV]LZ[OLYVIV[ZOV\SKKL]PH[LMYVT[OLSPUL[V[OLKLZ[PUH[PVU[OL [4] http://www.robot-electronics.co.uk [5] http://www.nxp. com/cgi-bin/pldb/pip/pcf8574 GPS mouse data A typical data packet received from a GPS mouse using the simple $GPGGA protocol might appear as follows. $GPGGA,191410,5212.9324,N,00007.5930,E,1,04,4.4,11.5,M,48.0,M,,*73 Protocol Latitude Time Longitude no. of visible satellites measurement quality (0=insufficient, 1=ok) Here ‘$GPGGA’ is the protocol type, ‘191410’ the time, ‘5212.9324,N’ the latitude, ‘00007.5930,E’ the longitude, ‘1’ indicates that the reading is valid and ‘04’ is the number of satellites in view. As you can see, this covers all the information we need. All we need to do is switch the GPS mouse to the $GPGGA protocol and set the communication speed to 4800 baud. Other protocols should be disabled, and the reporting interval set to approximately 1 s. The settings are made using the software provided with the GPS mouse. 80 elektor electronics - 7-8/2007 Serial Interface for the Propeller Simple and inexpensive Luc Lemmens 3V3 4k7 R3 T2 10k R5 10k K2 R6 1k +3V3 RX (P31) TX (P30) RESn GND BC560B 10k 1 6 2 7 3 8 4 9 5 R4 C1 T1 R1 10k R2 10n 10k 10 BC547 T3 K1 11 R7 BC547 D Connector 9 070276 - 11 GND Semiconductors T1 T1,T2 = BC547 T3 = BC557 5 R2 Resistors (070276-I) 7-8/2007 - elektor electronics 9 R4 R5 1 K1 R3 C1 = 10nF K1 = 9-way sub-D socket (female), angled pins, PCB mount K2 = 5-way SIL socket PCB, ref. 070276-1 from www.thepcbshop. com R7 Capacitors Miscellaneous 6 R1,R2,R4,R5,R7 = 10k£ R3 = 4k£7 R6 = 1k£ K2 R1 R6 C1 T2 COMPONENTS LIST `V\KVU»[OH]L[V^VYY`HIV\[JVUÄN\YPUNHSSZVY[ZVMZL[[PUNZIH\KYH[LU\TILY VMIP[ZHUKZVVU·[OL7YVWLSSLY;VVS KL]LSVWTLU[ZVM[^HYLKVLZHSS[OPZMVY`V\ <ZLH[VJHISLMVY[OLZLYPHSSPURUV[H JYVZZV]LYJHISLVYU\SSTVKLTJHISL >L OH]L KLZPNULK H ZTHSS 7*) MVY [OPZ JPYJ\P[I\[VMJV\YZLP[»ZUVWYVISLT[V I\PSKP[VUWPLJLVMWLYMVYH[LKWYV[V[`WPUN IVHYKPUZ[LHK>P[OHIP[VMLMMVY[`V\JHU WYVIHIS`L]LUTHRLP[ZVJVTWHJ[[OH[[OL LU[PYLJPYJ\P[Ä[ZPUHWS\NOV\ZPUNMVYH ^H`9:JVUULJ[VY -VY[\UH[LS`^OLU`V\\ZL[OPZPU[LYMHJL T3 ;OL7YVWLSSLYWYV[V[`WPUNIVHYKKLZJYPILK LSZL^OLYLPU[OPZPZZ\LULLKZHWYVNYHTTPUNPU[LYMHJLQ\Z[SPRL[OLIVHYKH]HPSHISL MYVT7HYHSSH_;OLTHU\MHJ[\YLYVMMLYZ[OL 7YVWLSSLY7S\NHUK[OL7YVWLSSLY*SPWMVY[OPZ W\YWVZL;OL`JHUIL\ZLK[VSPUR[OLIVHYK [VH7*]PHH<:)WVY[;OLZLTPUPIVHYKZ HYLÄ[[LK^P[OHU-;+0-;0*^OPJOOHZ HWWLHYLKX\P[LYLN\SHYS`PU[OLTHNHaPUL ;OLKPMMLYLUJLIL[^LLU[OL7S\NHUK[OL *SPWPZPUOV^[OL`JVUULJ[[V[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JLIVHYK^P[O[OL 7HYHSSH_IVHYKHZ^LSS/V^L]LYPU[OH[ JHZLHZTHSSTVKPÄJH[PVUPZULJLZZHY`MVY [OLZ\WWS`]VS[HNLJVUULJ[PVU 81 USB Converter Jörg Schnyder 82 1 PU[OLJPYJ\P[IVHYKMVY[OPZW\YWVZL (Z^LOH]LU»[ILLUHISL[VPU]LU[HKL]PJL [OH[WYVK\JLZTVYLLULYN`[OHUP[JVUZ\TLZ`V\ZOV\SKILHYPUTPUK[OH[[OL PUW\[J\YYLU[VM[OLJPYJ\P[PZOPNOLY[OHU [OLV\[W\[J\YYLU[(ZHNLULYHSY\SL`V\ JHUHZZ\TL[OH[[OLPUW\[J\YYLU[PZLX\HS [V[OLWYVK\J[VM[OLV\[W\[J\YYLU[HUK [OLV\[W\[]VS[HNLKP]PKLKI`[OLPUW\[ R5 and R6 for other output voltages: L2 L1 47MH 820MH 6V: R5 = 47k, R6 = 9,1k 12V: R5 = 110k, R6 = 10k 15V: R5 = 130k, R6 = 9,1k 8 +5V D– D+ GND R4 1 2 1 C3 3 C2 4 22p 2n2 C 6 IC1 2 3 USB D1 UIN -IN I LIM +IN LM3578AM E OSC R5 SK34SMD 7 K1 82k K2 220k 5 4 C5 100n 47M 16V 47M 16V 1n5 R2 R3 R6 C11 C8 C7 C6 C4 68M 20V 68M 20V 68M 20V 68M 20V 100n 10k C10 17 C9 17 R1 C1 17 +VLZ[OPZZV\UKMHTPSPHY!`V\I\`HZTHSS WPLJLVMLX\PWTLU[Z\JOHZHWYVNYHTTPUN KLI\NNPUNPU[LYMHJLMVYHTPJYVJVU[YVSSLYHUK`V\OH]L[V\ZLHJS\UR`(*^HSS HKHW[LY[VZ\WWS`P[^P[OWV^LY&0[»ZL]LU ^VYZL^OLU`V\»YL[YH]LSSPUNHUK[OLYL»ZUV THPUZZVJRL[HU`^OLYLPUZPNO[6MJV\YZL `V\ JHU \ZL [OL <:) I\Z KPYLJ[S` HZ H WV^LYZV\YJLPM[OLZ\WWS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ductors R1,R2,R3 = 17 R4 = 220k7 R5 = 82k7 R6 = 10k7 L1 = 820μH (SMD CD105) L2 = 47μH (SMD 2220) Semiconductors Capacitors D1 = SK34SMD (Schottky) (SMD 1206) C1 = 100nF C2 = 2nF2 C3 = 22pF C4 = 100nF C5 = 1nF5 (tantalum SMD 7343) C6 = 68μF 20V C7 = 68μF 20V C8 = 68μF 20V C9 = 47μF 16V IC1 = LM3578AM (SMD SO8) Miscellaneous K1 = 2-way PCB terminal block, lead pitch 5mm (optional) K2 = USB-B connector PCB layout, free download from Elektor website, 070119-1.pdf zBot: Solar/Battery Power Supply Jens Altenburg 6ULVM[OLTVZ[PTWVY[HU[WYVISLTZVM TVIPSLYVIV[WSH[MVYTZPZHZZVJPH[LK^P[O [OLWV^LYZ\WWS`>P[OL_JLW[PVUVMZVTL ZWLJPHSZ`Z[LTZIH[[LYPLZKY`VYYLJOHYNL- POWER D7 Solar Panel T9 IC5 RFP30P06 7805 +5V 1N4001 JP6 POWER ON 10k R30 T10 R31 C13 C14 10M 25V 10M 25V 47k BC337 GND R26 071 F1 R24 071 10A T R27 82k 2k R22 2k R29 BATT 7 VCC V BATT 1N5408 7-8/2007 - elektor elector 1 RG2 RG1 IC6 N.C. SIGN MAX472 SHDN OUT GND R28 18k HISLHYL[OLTVZ[JVTTVUS`ZLLUZV\YJLZ VMLSLJ[YPJHSWV^LYPUYVIV[Z ;OLWV^LYZ\WWS`Z`Z[LTVMa)V[JVUZPZ[Z VM[^VWHY[Z[OLTHPUHJJ\T\SH[VYHUK[OL H\_PSPHY`IH[[LY`;OLTHPUWV^LYZV\YJL ^HZYLHSPZLK^P[OH5P*KVY5P4/IH[[LY`WHJR0[ZZPaL^HZHKHW[LK[VÄ[[OL IH[[LY`OVSKLYVM[OL;HT`HJOHZZPZZP_ =T(O*JLSSZ;OLTHPUWV^LY PZHJ[P]H[LKMVY+*TV[VYKYP]PUNHUKMVY [OLZLY]VZ ;OLH\_PSPHY`Z`Z[LT[^V(SRHSP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SVYKPZJOHYNPUNVM[OLIH[[LY`WHJR ;OLH\_PSSPHY`WV^LYPZZOV^UPU[OL*7< \UP[;OL[^VHSRHSPULIH[[LYPLZZ\WWVY[[OL *7<[OL^PYLSLZZYHKPVTVKLTHUK[OL UH]PNH[PVUZ`Z[LTJVTWHZZVUS` ;OLYLHZVUMVY[OLKP]PZPVUVM[OLWV^LY Z\WWS`PZZPTWSL>P[O[OLOLSWVM[OLH\_- (070171-I) [1] The complete document called Zbot — the Robot Experimental Platform is available for free downloading from the Elektor Electronics website. The file number is 070172-11.zip (July/August 2007). 3-A Wide-input Adjustable Switching Regulator Luc Lemmens ;OL 7;5 PZ H ZLYPLZ VM OPNOLMMPJPLUJ`I\JRIVVZ[PU[LNYH[LKZ^P[JOPUN YLN\SH[VYZ0:9MYVTNVVKVSK;L_HZ0UZ[Y\TLU[Z;0 ;OLJHZLSLZZKV\ISLZPKLKWHJRHNLOHZ L_JLSSLU[[OLYTHSJOHYHJ[LYPZ[PJZHUKPZ 9V/ZJVTWSPHU[ ;OL 7;5 KL]PJLZ VWLYH[L MYVT H YLTHYRHIS`^PKLPUW\[]VS[HNLYHUNL! Device Vin Vout PTN78060Wa(x) 7 to 36 V 2.5 to 12.6 V PTN78060HA(x) 15 to 36 V 11.85 to 22.0 V PTN78060AA(x) 9 to 29 V –15 to –3V 5V[L[OH[[OL¶(]LYZPVUZ\WWSPLZHULNH[P]LV\[W\[]VS[HNL ;OLKL]PJLZWYV]PKLOPNOLMÄJPLUJ`Z[LW KV^U]VS[HNLJVU]LYZPVUMVYSVHKZVM\W [V( ;OLV\[W\[]VS[HNL=6JHUILZL[[VHU` ]HS\LV]LYH^PKLHKQ\Z[TLU[YHUNL\ZPUN HZPUNSLL_[LYUHSYLZPZ[VY9 :,;\ZPUN[OL LX\H[PVU 9:,;$ R£ô==6 ¶=405¶9p 84 GND 2 VI GND 7 VO 6 PTN78060 UI VO VO INH ADJ SNS 3 4 UO 5 UO Sense INH C1 R SET C2 0W05 1% 100 M RL 070115 - 11 Device PTN780x0W PTN780x0H ;OL 7;5 KL]PJLZ HYL Z\P[LK [V H ^PKL]HYPL[`VMNLULYHSW\YWVZLHWWSPJH[PVUZ[OH[VWLYH[LVMM==VY[PNO[S` YLN\SH[LK=KJWV^LYOLUJLHYLPKLHS MVYY\UUPUNSV^]VS[HNLLSLJ[YVUPJZMYVTH ]LY`OPNOWV^LY=IH[[LY`\UP[ZHS]HNLK MYVTHULSLJ[YPJ^OLLSJOHPYHUKTPNYH[LK PU[VHYVIV[ 1 VO (desired) (V) RSET (standard value) (k7) VO (actual) (V) VI range (V) 2.5 Open 2.5 7 to 25 3.3 78.7 3.306 7 to 33 5.0 21.0 4.996 7 to 36 12.0 0.732 12.002 14.5 to 36 12.0 383 12.000 15 to 36 15.0 15.0 14.994 18 to 36 18.0 4.42 18.023 21 to 36 22.0 95.3 21.998 26 to 36 0M WPU PZ SLM[ VWLU [OL V\[W\[ ]VS[HNL KLMH\S[Z[V[OLSV^LZ[]HS\L3PTP[PUNV\YZLS]LZ[V[OL[^VWVZP[P]LV\[W\[YLN\SH[VYZMVY[OL>]LYZPVU=405HUK9pHYL =HUK R£YLZWLJ[P]LS`"MVY[OL/ KL]PJL[OL]HS\LZ=HUKR£ ZOV\SKIL\ZLK -VY[OLV\[W\[[VYLTHPUPUYLN\SH[PVU[OL PUW\[]VS[HNLT\Z[L_JLLK[OLV\[W\[I` HTPUPT\TKPMMLYLU[PHS]VS[HNL(UV[OLY JVUZPKLYH[PVUPZ[OLW\SZL^PK[OTVK\SH[PVU7>4YHUNLVM[OLYLN\SH[VY»ZPU[LYUHSJVU[YVSJPYJ\P[-VYZ[HISLVWLYH[PVUP[Z VWLYH[PUNK\[`J`JSLZOV\SKUV[ILSV^LY [OHUHJLY[HPUTPUPT\TWLYJLU[HNL;OPZ KLMPULZ [OL TH_PT\T HK]PZHISL YH[PV IL[^LLU[OLYLN\SH[VYPUW\[HUKV\[W\[ ]VS[HNLTHNUP[\KLZ -VYZH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PNOLY WV^LY KPZZPWH[PVU ^OPJO PUJYLHZLZ P[Z [LTWLYH[\YL0M[OL[LTWLYH[\YLPUJYLHZL PZL_JLZZP]L[OLTVK\SLV]LY[LTWLYH[\YL WYV[LJ[PVUILNPUZ[VWLYPVKPJHSS`[\YU[OL V\[W\[]VS[HNLVMM ;OLPUOPIP[MLH[\YLJHUIL\ZLK^OLYL]LY [OLYLPZHYLX\PYLTLU[MVY[OLV\[W\[]VS[HNL[VIL[\YULKVMM;OLWV^LYTVK\SL Z^P[JOLZVMM[OLV\[W\[]VS[HNL^OLU[OL 0UOPIP[JVU[YVSWPUPZW\SSLK[VNYV\UK MVYL_HTWSLI`HZ^P[JOPUN-,; -PUHSS`NVVKH[[LU[PVUZOV\SKILWHPK[V [OLX\HSP[`VM[OLJHWHJP[VYZVU=0HUK=6 HZ[OL`KL[LYTPUL[OLYLN\SH[VYZ[HIPSP[` HUKV]LYHSSWLYMVYTHUJL[VHZ\IZ[HU[PHS KLNYLL:\TTHYPaPUN[OLL_[LUZP]LPUMVYTH[PVUVUJHWHJP[VYZLSLJ[PVUMV\UKPU[OL KH[HZOLL[Z[OLTPUPT\TYLX\PYLTLU[MVY *PZ-^VY[OVMJLYHTPJJHWHJP[VYZ MVY [OL ¶> KL]PJL HUK - MVY[OL/KL]PJL;HU[HS\TJHWZHYLUV[ YLJVTTLUKLK :PTPSHYS` H[ [OL YLN\SH[VY V\[W\[ * ZOV\SKILH[SLHZ[-^VY[OVMSV^ ,:9LSLJ[YVS`[PJZ (070115-I) Datasheets http://focus.ti.com/docs/prod/folders/print/ ptn78060h.html http://focus.ti.com/docs/prod/folders/print/ ptn78060w.html http://focus.ti.com/docs/prod/folders/print/ ptn78060a.html Paralleling LiPo Batteries Paul Goossens 3P7V3P[OP\T7VS`TLYIH[[LYPLZOH]LHU\TILYVMHK]HU[HNLZJVTWHYLK[V5P*KHUK5P4/ IH[[LYPLZ0UHKKP[PVU[VOH]PUNHSV^LY ^LPNO[MVY[OLZHT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PUNS` .LYILYÄSLZMVY[OLWYV[V[`WLWYPU[LKJPYJ\P[ IVHYKHYLH]HPSHISLMVYMYLLKV^USVHKMYVT [OL,SLR[VY^LIZP[LYLMaPW;OL :4+JVTWVULU[Z\ZLKOH]L[OLMVSSV^PUN V\[SPULZ!9999**HUK*! "*!"0*!::67";!:6 (SS[OL:4+JHWHJP[VYZHYLJLYHTPJHUK LSLJ[YVS`[PJZ*HUK*T\Z[OH]LHSV^ ,:99PZHTæ:4+YLZPZ[VYYH[LK H[> (070280-I) Mini Power Inverter Alexander Wiedekind-Klein 7-8/2007 - elektor elector +5V R1 C4 07 ,]LUYVIV[Z`Z[LTZVJJHZPVUHSS` ULLK H ULNH[P]L Z\WWS` ]VS[HNL MVY ZVTL W\YWVZLVYV[OLYHUKPU [OPZRPUKVMHWWSPJH[PVUPU WHY[PJ\SHY[OLYLPZHULLK MVYHULMMLJ[P]LJPYJ\P[[OH[ KVLZ UV[ THRL NYLH[LY KLTHUKZ [OLU ULJLZZHY` PU [LYTZ VM J\YYLU[ VYZWHJL0MHSV^J\YYLU[ =Z\WWS`PZULLKLKHUK VUS` = PZ H]HPSHISL H UH[\YHS THU\MHJ[\YLY [V [\YU [V PZ 4H_PT HUK PUKLLK PU [OPZ JHZL [OL` KVUV[SL[\ZKV^U 100n 8 1 2 LV FC IC1 OSC C+ 6 7 C2 MAX660 100M 16V 4 C– OUT STI 5 1 3 2 C1 C3 100n 4M7 25V 3 C5 100M 16V L1 10MH –5V 070279 - 11 ;OLILZ[RUV^U PU[L NYH[L K JPYJ\P[ THKLI`[OPZJVTWHU`PZ [OL 4(? H SL]LS ZOPM[LY MVY ZLYPHS WVY[Z^P[OHUPU[LNYH[LKJOHYNLW\TW [OH[KVLZUV[ULLKHUL_[LYUHSPUK\J[VY (SVUN[OLZHTLSPULZHS[OV\NO^P[OH TVYLZ[HISLV\[W\[]VS[HNLHUKOPNOLY LMÄJPLUJ`PZ[OL4(?;OLKL]PJL JHUºTPYYVY»HU`P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[OL\ZLVMHKV\ISLZPKLK7*) [OLJVUZ[Y\J[PVUVM[OPZJPYJ\P[PZ]LY`ZPTWSL(SSJVTWVULU[ZHYLTV\U[LKVU[OL [VWZPKLVM[OLIVHYK>OLUZVSKLYPUN[OL elektor elector - 7-8/2007 COMPONENTS LIST Semiconductors D1 = BAT54 (SOT-23) D2,D3 = MBRS540T3G (SMC), e.g. Digikey MBRS540T3GOSCT-ND IC1 = MAX745 T1 = FDS6911 (SOIC12), e.g. Digikey FDS6911CT-ND Resistors R1,R2,R6 = 10k7 (SMD 0805) R3,R4 = 100k7 1% (SMD 0805) R5 = 0.187 0.25W (SMD 1210), e.g. Digikey P.18SCT-ND Miscellaneous Capacitors L1 = 22μH (JW-MILLER PM2110-220K-RC), e.g. Digikey M8760-ND JP1,JP2 = jumper with 2-way SIL pinheader PCB, order code 070273-1 from Elektor SHOP) C1,C2 = 10MF 25V (SMD 12010) C3,C4.C5 = 100nF (SMD 0805) C6 = 47nF (SMD 0805) JVPSP[TH`ILULJLZZHY`[VSL[[OLZVSKLYPUNPYVUOLH[\WHIP[TVYLÄYZ[;OLJVUULJ[PUNSLHKZHYLX\P[LJO\UR`HUK[OL` YLX\PYLHMHPYHTV\U[VMOLH[[VYHPZL[OLT [V[OLJVYYLJ[[LTWLYH[\YL >OLUHSSWHY[ZOH]LILLUZVSKLYLKHUK[OL JPYJ\P[OHZILLUJOLJRLK`V\JHUWV^LY [OLJPYJ\P[]PH2^P[OH+*]VS[HNLVMUV TVYL[OHU=@V\ZOV\SKHS^H`ZKV\ISL JOLJR[OH[`V\OH]LZL[[OLQ\TWLYZMVY[OL JVYYLJ[U\TILYVMJLSSZILMVYLJVUULJ[PUN [OL3P7VVY3P0VUIH[[LY`>P[OHJOHYNPUN J\YYLU[VMCHULTW[`JLSSZOV\SKILM\SS` JOHYNLKPUHIV\[HUOV\YHUKHX\HY[LY (070273-I) PWM Voltage Dropper Von Stefan Brandstetter 7-8/2007 - elektor elector 24V DC C4 R5 1k5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Y`(PZ[VVSV^ [OLV\[W\[VM0*H^PSSHS^H`ZILOPNO(Z HJVUZLX\LUJLIH[[LY`)^PSSILHJ[P]L ;OLZHTL[OPUNHWWSPLZPUYL]LYZL[V[OL V\[W\[VM0*K >OLUIV[OIH[[LYPLZHYLKPZJOHYNLK[OL` ^PSSIV[OWV^LY[OLJPYJ\P[PURLLWPUN^P[O [OLTV[[VºIL[[LYHSP[[SLIP[VMQ\PJL[OHUUV Q\PJLH[HSS» *VTWVULU[Z + 9 HUK * WYV]PKL :PTWSL ;OL VWLYH[PUN WYPUJPWSL PZ ZPTWSL! 0* TLHZ\YLZ[OL[LYTPUHS]VS[HNLVMIH[[LY`( 0MP[KYVWZILSV^=[OL9,:,;V\[W\[ NVLZSV^HUKV[OLY^PZLP[YLTHPUZOPNO Vbat D1 IN BAT A T3 C1 * 100n FDV301N T2B T4 D3 BAT54 R3 ENABLE_A IC1D 11 & 13 12 IC1B 4 & IC1A 5 6 3 & 1 2 Aok Vcc 2 RST GND R8 10k GND C3 100n GND IC2 3 LM809M3-4.38 R2 100k FDV301N 1M Vbat 3 1 2 100k 1k D5 6 5 4 1 R1 R10 K2 8 7 T1A BAT54 K1 GND D2 POWER OUT T2A C2 * 100n FDV301N 2 10 T6 R6 100k IC3D 8 9 D4 FDV301N R7 1M ENABLE_B IC1C 10 & 3 & IC3B 1 2 R9 10k 4 GND & GND 5 6 GND & Vcc 13 12 2 RST Bok GND GND Vbat 8 9 C4 100n IC3A 11 LM809M3-4.38 BAT54 GND 90 & Vbat S1 ON T1, T2 = IRF7329 IC1, IC3 = 4093 C5 GND GND 1 IC3C R5 T5 IC4 3 1 10k D6 8 7 4 R11 100k 1k 3 IN BAT B K3 6 5 T1B BAT54 R4 100n GND 14 14 IC1E IC3E 7 7 C7 100n 070343 - 11 elektor elector - 7-8/2007 LZZHY`(KPZHK]HU[HNLVMH46:-,;PZ[OH[ P[HS^H`ZOHZHUPU[YPUZPJKPVKL;OPZKPVKL PZX\P[LHUUV`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H[[LY`[VLHJOVM[OLIH[[LY`PUW\[Z2HUK2;OLUJVUULJ[V\[W\[2[V[OLJPYJ\P[[VILWV^LYLK :^P[JOVU[OLZ\WWS`]VS[HNL^P[OZ^P[JO :;OL3,+ZUV^PUKPJH[L^OPJOIH[[LY` PZ PU \ZL 0M [OPUNZ L]LY` NL[ ZV MHY [OH[ IV[OIH[[LYPLZILJVTLKLLWS`KPZJOHYNLK /LH]LUMVYIPK[OPZJHUILYLJVNUPZLKI` [OLMHJ[[OH[IV[O3,+ZHYLSP[ Semiconductors D1-D4 = BAT54 (SOT-23) D5,D6 = LED rood (SMD 1206) IC1,IC3 = 4093 (SOIC-14) IC2,IC4 = LM809M3-4.38 (SOT-23) T1,T2 = IRF7329 (SOIC-8) T3-T6 = FDV301N (SOT-23) Miscellaneous Connecting wires PCB no. 070343-1 (see www.elektorelectronics.co.uk) (070343-I) Multi-purpose NiCd & NiMH Charger C. Tavernier www.tavernier-c.com <USLZZ`V\YYVIV[PZMY\NHSLUV\NO[VTHRL KV^P[OWYPTHY`JLSSZ^P[OV\[IYLHRPUN[OL IHURVYPZLU]PYVUTLU[HSS`MYPLUKS`HUK Y\UZVMMZVSHYWHULSZP[^PSSWYVIHIS`ULLK [V\ZLYLJOHYNLHISLIH[[LYPLZHZP[ZLULYN` ZV\YJL (S[OV\NO ]LY` THU` JOHYNLYZ HYL J\YYLU[S`H]HPSHISL[OL`»YLUV[HS^H`ZZ\P[HISLMVYV\YULLKZPU[LYTZVM[OL[`WLZ HUKU\TILYVMIH[[LYPLZ[OL`JHUOHUKSL >OH[»ZTVYLJLY[HPUVM[OLTKVUV[[HRL ]LY`NVVKJHYLVM[OLIH[[LYPLZLU[Y\Z[LK [V[OLT^OPJOJHUZLYPV\ZS`ZOVY[LU[OLPY SPML :V[OPZHY[PJSLWYVWVZLZI\PSKPUN`V\YV^U [HPSVYTHKL JOHYNLY \ZPUN HU 0* [OH[»Z HSYLHK`VSKI\[Z[PSS]LY`T\JOJ\YYLU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[OL4(?P[PZLZZLU[PHS[VTHRL[OLJVUULJ[PVUZ[V7.4[V 7.4ILMVYLHWWS`PUNWV^LY[V[OLJPYJ\P[V[OLY^PZL[OL`TH`UV[IL[HRLUPU[V HJJV\U[JVYYLJ[S`;OPZPZUVWYVISLTMVY HOHYK^PYLKJPYJ\P[I\[PM`V\YJOHYNLY \ZLZJVUÄN\YH[PVUZ^P[JOLZH[[OPZWVPU[ `V\»SSULLK[VWV^LYKV^UHUKWV^LY\W HNHPU[VJVUÄYTHU`JVUÄN\YH[PVUJOHUNLZ THKL]PH[OLZLZ^P[JOLZ ;OL3,+SPNO[Z^OLU[OLJOHYNLYPZPUMHZ[ JOHYNLTVKLH[[OLJ\YYLU[IMHZ[KL[LYTPULK HIV]L0[NVLZV\[^OLUMHZ[JOHYNPUNPZ V]LYHUK[OLJOHYNLYNVLZPU[VÅVH[JOHYNL TVKL;OLJ\YYLU[NLULYH[LKPU[OPZTVKL PZZ\MÄJPLU[S`SV^[OH[[OLIH[[LY`TH`IL SLM[JVUULJ[LK[V[OLJOHYNLYPUKLÄUP[LS` PMULJLZZHY` ;VTHRLZ\YLV\YL_WSHUH[PVUPZJY`Z[HS JSLHYOLYLI`^H`VML_HTWSLHYL[OLJHSJ\SH[PVUZMVYHJOHYNLYMVYHWHJRVMMV\Y =5P4/IH[[LYPLZ^P[OHJHWHJP[`VM Table 2. Programming number of cells via PGM0 & PGM1. Number of cells Table 1. Programming charge time via PGM2 & PGM3. Maximum charge time (min) PGM2 22 V+ REF 33 V+ BATT– 45 92 PGM3 O/C REF 66 O/C BATT– 90 REF REF 132 REF BATT– 180 BATT– REF 264 BATT– BATT– PGM1 PGM0 1 V+ V+ 2 O/C V+ 3 REF V+ 4 BATT– V+ 5 V+ O/C 6 O/C O/C 7 REF O/C 8 BATT– O/C 9 V+ REF 10 O/C REF 11 REF REF 12 BATT– REF 13 V+ BATT– 14 O/C BATT– 15 REF BATT– 16 BATT– BATT– elektor elector - 7-8/2007 T(O[OH[^L^HU[[VYLJOHYNLPU [^VOV\YZ •*HSJ\SH[L I MHZ[ ! I MHZ[ $ Ct PL $ (VY T( •7.4HUK7.4JVUULJ[PVUZ! 7.4[PLK[V)(;;¶HUK7.4[PLK[V 9,-HZ^L^HU[HJOHYNL[PTLVMOV\YZ PLTPU\[LZPUMHJ[^L»SSNL[HTH_PT\TVMTPU\[LZ •7.4HUK7.4JVUULJ[PVUZ! 7.4[V=HUK7.4[V)(;;¶ZPUJL V\YIH[[LY`JVTWYPZLZMV\YJLSSZ •+L[LYTPUL V( ! V( $ = TPUPT\T >L»SSJOVVZL =[VVI]PH[LHU`WYVISLTZ ^P[OWVZZPISLZ\WWS`]VS[HNL]HYPH[PVUZ •7V^LYKPZZPWH[LKPU;!PD$ ¶ PL>:V^L»SSJOVVZLMVYL_HTWSLH ;07(NP]PUN\ZHUL_JLSSLU[ZHML[`THYNPUP+TH_$> M\SS`KPZJOHYNLKIH[[LY`]VS[HNLLZ[PTH[LK H[= •*HSJ\SH[L9!9$ ¶$æ >L»SS\ZL[OLJSVZLZ[WYLMLYYLK]HS\LPL æ !HJ\YYLU[VMT(^HZJOVZLU •*HSJ\SH[L9!9$ $æ •*HSJ\SH[L [OL WV^LY PU 9! P 9 $ ô $>:VH>[`WLPZ NVPUN[VILÄUL (Z`V\JHUZLLP[»Z[HRLU\ZHSSVMÄ]LTPU\[LZ[VWYVK\JLHJOHYNLY[HPSVYLKWLYMLJ[S` [VV\YULLKZ5V^P[»Z`V\Y[\YU (070301-I) Web Links MAX713 spec. sheet: www.maxim-ic.com/quick_view2. cfm/qv_pk/1666 Fast Charger for NiMH Batteries Antoine Authier & Karel Walraven ([[OL[PTLVM^YP[PUN[OLSH[LZ[((5P4/ 5PJRLSTL[HS/`KYPKLIH[[LYPLZOH]LH JHWHJP[` VM \W [V T(O <ZPUN HU VYPNPUHS[`WLJVU]LU[PVUHSIH[[LY`JOHYNLY Z\WWS`PUNT([OLJOHYNPUN[PTL^PSS ILL_[YLTLS`S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4WPUZ •6U[OPZZL[\W[OL[LTWLYH[\YLJVU[YVS JPYJ\P[MVY[OLIH[[LYPLZPZKLHJ[P]H[LK ([[OLLUKVM[OLMHZ[JOHYNL[OLJPYJ\P[ ^PSS WV^LY [OL IH[[LYPLZ ^P[O H THPU[LUHUJLJOHYNL[YPJRSL3L[»ZL_HTPUL[OL JPYJ\P[»ZLSLJ[YVUPJZ;PZ\ZLZHZHJ\YYLU[ZV\YJLZ\WWS`PUN[OLT(ULJLZZHY` [VWV^LY[OL4(?+LUZ\YLZ[OH[[OL IH[[LY`KVLZUV[KPZJOHYNLPU[V[OLJPYJ\P[ PUJHZLP[PZUV[WV^LYLK ;OL3,++SPNO[Z\W^OLU[OLJPYJ\P[PZ PUMHZ[JOHYNLTVKL;TH`ILTV\U[LK 93 C7 10u 63V 10u 63V BF245C D1 16 1 MAX712 C1 = 220pF C2 = 100nF C3,C4,C6,C7 = 10MF 63V radial C5 = 1μF 25V radial BAT- VLIM 100n CC PBYR745 D2 K5 BC557B 12 C3 C4 +BATT. 10u 63V 10u 63V -BATT. 11 C1 13 6 7 TEMP R3 TLO 220p R1 BAT- V+ PGMx BAT- REF 070213 - 11 GND Semiconductors Capacitors T4 REF Components list R1 = 0.227 5W R2 = 68k7 R3 = 22k7 R4 = 1k7 R5 = 4k77 PBYR745 0R22 K4 V+ PGM3 REF PGM3 BAT- 15 5 REF R2 68k 1u 25V THI 8 3 PGM0 FCHG 4 14 DRV PGM1 9 PGM2 IC1 10 2 PGM3 BAT+ PGM0 PGM1 PGM2 PGM3 C2 D3 R4 K2 V+ PGM2 REF PGM2 BAT- BC547B C5 V+ K3 T3 220uH GND V+ PGM1 REF PGM1 BAT- T2 L1 PGMx V+ PGM0 REF PGM0 BAT- BC547B (070213-I) Resistors R5 T1 C6 K1 4k7 +8V...+15V 1A3 T5 IRF9520 3 1 2 1k K6 22k VUOLH[ZPURPMULJLZZHY`;OLJOHYHJ[LYPZ[PJZVMJVPS3HYLUV[JYP[PJHS"H[YHKP[PVUHS M/(Z\WWYLZZVYJOVRL^PSS^VYR ÄUL;OLZHTLOVSKZ[Y\LMVYKPVKLZ+ +HUK[OL46:-,;[YHUZPZ[VY;"[OL`[VV HYLUV[JYP[PJHSPU[OPZHWWSPJH[PVU@V\JHU \ZLHU`:JOV[[R`KPVKL[OH[JHU^P[OZ[HUK HTWZHUKPUJS\KLHU`46:-,;^P[OH SV^LYKYHPUYLZPZ[HUJL (JVTWHJ[7*)^HZKLZPNULKMVY[OLJPYJ\P[4V\U[PUN[OLJVTWVULU[ZZOV\SKIL HSSWSHPUZHPSPUNI\[KVUV[MVYNL[[OL[^V ^PYLSPURZVU[OLIVHYK0UK\J[VY3PZH [VYVPKºZ\WWYLZZVYJOVRL»^P[OHNVVKZPaL *VUULJ[VYZ22HSSV^KPMMLYLU[JOHYNPUN WHYHTL[LYZ[VILZL[\W :PUJL[OLJHSJ\SH[PVUWYPUJPWSLPZ[OLZHTL HZMVY[OL5P*KJOHYNLYPU[OL4(?PU [OLV[OLYHY[PJSL^LYLMLY`V\[V[OLJHSJ\SH[PVUL_HTWSLWYVWVZLK[OLYL<ZL[OL ZHTL[HISLZ[VZL[[OLWHYHTL[LYZVM[OPZ JPYJ\P[HZ[OLVULZNP]LUPU[OH[HY[PJSL D1 = LED D2,D3 = PBYR745 T1 = BF245B or -C T2,T3 = BC547B T4 = BC557B T5 = IRF9520 IC1 = MAX712CPE Miscellaneous K1-K4 = 5-way SIL pinheader K5 = 2-way PCB terminal block, lead pitch 5mm K6 = DC supply jack, PCB mount PCB no. 070213-1, see Elektor SHOP Inductor L1 = 220MH suppressor choke Deep Discharge Protection for Rechargeable Cells Tilman Küpper >P[O [OPZ JPYJ\P[ I\PS[ PU[V [OL WV^LYZ\WWS`VMHIH[[LY`WV^LYLK KL]PJLP[^PSSWYL]LU[[OLYLJOHYNLHISLJLSSZMYVTILPUNJVTWSL[LS` KYHPULK ^OLU `V\ MVYNL[ [V [\YU [OLLX\PWTLU[VMM>OLU[O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 7*) SH`V\[ \ZLZ :4+JVTWVULU[ZZV[OLÄUPZOLK JPYJ\P[[HRLZ\W]LY`SP[[SLZWHJL ^OLUPUZ[HSSLKPU[OLLX\PWTLU[( ÄUL[PWWLKZVSKLYPUNPYVUZOV\SKIL HKLX\H[L[VTV\U[[OLJVTWVULU[Z HUK[OLYLZOV\SKU»[ILHU`WYVISLTZ WYV]PKLK`V\KVUV[JOVVZL[V\ZL ]LY`ZTHSSYLZPZ[VYWHJRHNLZ6UJL [OLJPYJ\P[OHZILLU[LZ[LK[OLLU[PYL 7*)JHUILWYV[LJ[LKI`LUJHWZ\SH[PUNP[^P[OHZOVY[SLUN[OVMOLH[ ZOYPURZSLL]PUN T1 IRLML6402 4 Data sheet IRLML6402: www.irf. com/product-info/datasheets/data/ irlml6402.pdf 070087 - 11 LDO Regulator with Soft Start or Tracking Dirk Gehrke U IN ;OLKL]PJLZKLZJYPILKOLYLHYL[HPSVYLK[V Ä[[OLULLKZVMTVKLYU+:7ZWYVJLZZVYZ HUK-7.(Z[OH[YLX\PYLSV^Z\WWS`]VS[HNLZH[YLSH[P]LS`OPNOJ\YYLU[ZWS\Z[OL JHWHIPSP[`VMZ\WWS`]VS[HNLYHTW\WHUK ZLX\LUJPUNPUHKLÄULKTHUULY;OLSH[[LY[^VYLX\PYLTLU[ZHYLUV[LHZPS`ZVS]LK \ZPUNKPZJYL[LJVTWVULU[Z;OL;7:_ MHTPS`Ä[Z[OLIPSS 7 U BIAS 1 7-8/2007 - elektor elector OUT EN R1 BIAS TPS74201 TPS74401 SS FB 2 C3 C4 1M 4M7 * R2 4 4k99 C1 U OUT 3 GND C2 1M * see text 5 7 U BIAS 6 R3 1 4k99 IN R4 C1 C3 1M 4M7 * IC1 IN OUT U OUT 3 EN R1 2k49 U IN TRACK -PN\YLZOV^ZHZPTWSPÄLKJVUULJ[PVU KPHNYHTMVY[OL[OYLLKL]PJLZ;OLZLYLN\SH[VYZYLX\PYLHSV^WV^LYIPHZ]VS[HNL =)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YVT [OLLX\H[PVUZPU[OLKH[HZOLL[HZZ\TPUN HUL_[LYUHS=YHTWZPNUHSPZHWWSPLK 95 a different soft-start time. Changing resistor R4 to a value of 1.78 k results in the TPS74301 output voltage reaching its regulated voltage at the same time the externally applied tracking signal reaches its maximum voltage (e.g., 3.3 V). This is called Ratiometric Sequencing (Figure 3). Although the external ramp signal and the TPS74301 will have different rates of rise, they will have the same soft-start time. Figure 2. Tracking LDO TPS74301 with simultaneous startup (R4 = 10k). Timebase: 2 mV/div. Figure 4. Soft-Start LDO TPS74201 and TPS74401 with 1ms soft startup (C4 = 1nF). Timebase: 2 mV/div. For the TPS74201 and TPS74401 the capacitor value can be used to program the soft-start ramp. In this example, values of 1 nF and 10 nF for C4 were used to realize ramps with 1 ms and 10 ms rise time respectively (Figures 4 and 5 respectively). With no capacitor attached to this pin the default soft-start time will be 500 μs. This 500-μs start up time is also valid for the TPS74301 when applying a voltage greater than 800 mV to the TRACK pin. Figure 3. Tracking LDO TPS74301with ratiometric startup (R4 = 1.78k). Timebase: 2 mV/div. (070231-I) to the TRACK IN pin. When the value of R4 selected to be 10 k in this particular example, the output of the TPS74301 will follow the external ramp signal within a few millivolts until the TPS74301 reaches its regulated voltage. This is called Simultaneous Sequencing (Figure 2). The TPS74301 output voltage will have the same rate of rise (dv/dt) as the external ramp signal but Literature TPS74401 3.0A Ultra-Low Dropout Linear Regulator, Texas Instruments Literature # SBVS066C. TPS74301 1.5A Ultra-Low Dropout Linear Regulator with Programmable Sequencing, Texas Instruments Literature # SBVS065C. Figure 5. Soft-Start LDO TPS74201 and TPS74401 with 10ms soft startup (C4 = 10nF). Timebase: 2 mV/div. TPS74201 1.5A LDO with Programmable SoftStart, Texas Instruments Literature # SBVS064C TPS74x01EVM-118 User’s Guide, Texas Instruments Literature # SLVU143. Sequencing Power Supplies in Multiple Voltage Rail Environments by David Daniels, Dirk Gehrke and Mike Segal, Texas Instruments Literature # SLUP228 or http://focus.ti.com/lit/ ml/slup228/slup228.pdf NEW # "! ! "!!! " $ " !# $ *),!('$() *)%'"",&)#)+ % ( 96 elektor elector - 7-8/2007 Quasar Electronics Limited PO Box 6935, Bishops Stortford CM23 4WP, United Kingdom Tel: 0870 246 1826 Fax: 0870 460 1045 E-mail: [email protected] Web: www.QuasarElectronics.com 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) !Order online for reduced price UK Postage! :HDFFHSWDOOPDMRUFUHGLWGHELWFDUGV0DNHFKHTXHV32¶VSD\DEOH to Quasar Electronics. Prices include 17.5% VAT. Call now for our FREE CATALOGUE with details of over 300 kits, projects, modules and publications. Discounts for bulk quantities. Credit Card Sales 7KH(OHFWURQLF6SHFLDOLVWV6LQFH 7KH(OHFWURQLF6SHFLDOLVWV6LQFH Motor Drivers/Controllers Controllers & Loggers Here are just a few of our controller and GULYHUPRGXOHVIRU$&'&8QLSRODU%LSRODU stepper motors and servo motors. See website for full details. Here are just a few of the controller and data acquisition and control units we have. See website for full details. Suitable PSU for all units: Order Code PSU445 £8.95 NEW! PC / Standalone Unipolar Stepper Motor Driver 'ULYHVDQ\RUOHDG unipolar stepper motor rated up to 6 Amps max. Provides speed and direction control. Operates in stand-alone or PCcontrolled mode. Up to six 3179 driver boards can be connected to a single parallel port. Supply: 9Vdc. PCB: 80x50mm. Kit Order Code: 3179KT - £11.95 Assembled Order Code: AS3179 - £18.95 Serial Isolated I/O Relay Module Computer controlled 8channel relay board. 5A mains rated relay outputs. 4 isolated digital inputs. Useful in a variety of control and sensing applications. Controlled via serial port for programming (using our new Windows interface, terminal emulator or batch files). Includes plastic case 130x100x30mm. Power Supply: 12Vdc/500mA. Kit Order Code: 3108KT - £54.95 Assembled Order Code: AS3108 - £64.95 NEW! Bi-Polar Stepper Motor Driver 'ULYHDQ\ELSRODUVWHSSHU motor using externally supplied 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 NEW! Bidirectional DC Motor Controller Controls the speed of PRVWFRPPRQ'& motors (rated up to 16Vdc/5A) in both the forward and reverse direction. The range RIFRQWUROLVIURPIXOO\2))WRIXOO\21LQERWK directions. The direction and speed are controlled using a single potentiometer. Screw terminal block for connections. Kit Order Code: 3166KT - £16.95 Assembled Order Code: AS3166 - £25.95 DC Motor Speed Controller (100V/7.5A) Control the speed of almost any common '&PRWRUUDWHGXSWR 100V/7.5A. Pulse width modulation output for maximum motor torque at all speeds. Supply: 5-15Vdc. Box supplied. 'LPHQVLRQVPP:[/[+ Kit Order Code: 3067KT - £13.95 Assembled Order Code: AS3067 - £21.95 Most items are available in kit form (KT suffix) or assembled and ready for use (AS prefix). Computer Temperature Data Logger 4-channel temperature logger for serial port. °C or °F. Continuously logs up to 4 separate sensors located 200m+ from board. Wide range of free software applications for storing/using data. PCB just 38x38mm. Powered by PC. Includes one '6VHQVRUDQGIRXUKHDGHUFDEOHV Kit Order Code: 3145KT - £18.95 Assembled Order Code: AS3145 - £25.95 $GGLWLRQDO'66HQVRUV£3.95 each Rolling Code 4-Channel UHF Remote State-of-the-Art. High security. 4 channels. Momentary or latching relay output. Range XSWRP8SWR7[¶VFDQ be learnt by one Rx (kit includes one Tx but more availDEOHVHSDUDWHO\LQGLFDWRU/('¶V5[3&% 77x85mm, 12Vdc/6mA (standby). 7ZRDQG 7HQFKDQQHOYHUVLRQVDOVRDYDLODEOH Kit Order Code: 3180KT - £44.95 Assembled Order Code: AS3180 - £51.95 NEW! DTMF Telephone Relay Switcher Call your phone number XVLQJD'70)SKRQHIURP anywhere in the world and remotely turn on/off any of the 4 relays as desired. User settable Security Password, AntiTamper, Rings to Answer, Auto Hang-up and /RFNRXW,QFOXGHVSODVWLFFDVH1RW%7DS proved. 130x110x30mm. Power: 12Vdc. Kit Order Code: 3140KT - £54.95 Assembled Order Code: AS3140 - £69.95 Infrared RC Relay Board Individually control 12 onboard 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 & ATMEL Programmers We have a wide range of low cost PIC and $70(/3URJUDPPHUV&RPSOHWHUDQJHDQG documentation available from our web site. Programmer Accessories: 40-pin Wide ZIF socket (ZIF40W) £15.00 18Vdc Power supply (PSU010) £19.95 Leads: Parallel (LDC136) £4.95 / Serial (LDC441) £4.95 / USB (LDC644) £2.95 NEW! USB & Serial Port PIC Programmer USB/Serial connection. Header cable for ICSP. Free Windows XP software. Wide range of supported PICs - see website for complete listing. ZIF Socket/USB lead not included. Supply: 16-18Vdc. Kit Order Code: 3149EKT - £37.95 Assembled Order Code: AS3149E - £49.95 NEW! USB 'All-Flash' PIC Programmer USB PIC programmer for all µ)ODVK¶GHYLFHV1RH[WHUQDO 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 ³3,&$//´3,&3URJUDPPHU ³3,&$//´ZLOOSURJUDPYLUWX ally all 8 to 40 pin VHULDO PRGH$1'SDUDOOHOPRGH (PIC16C5x family) programmed PIC micro controllers. Free fully functional software. Blank chip auto detect for super fast bulk programming. Parallel port connection. Supply: 16-18Vdc. Assembled Order Code: AS3117 - £24.95 ATMEL 89xxxx Programmer Uses serial port and any standard terminal comms program. Program/ Read/ 9HULI\&RGH'DWD:ULWH )XVH/RFN%LWV(UDVHDQG %ODQN&KHFN/('¶VGLVSOD\WKHVWDWXV=,) sockets not included. Supply: 16-18Vdc. Kit Order Code: 3123KT - £24.95 Assembled Order Code: AS3123 - £34.95 Secure Online Ordering Facilities Ɣ Full Product Listing, Descriptions & Photos Ɣ Kit Documentation & Software Downloads 7-8/2007 - elektor electronics 97 Bolo Abraham Vreugdenhil )VSVPZHSPNO[ZLLRPUNYVIV[I\PS[PU[VH WSHZ[PJIHSS;OLHK]HU[HNLVMHIHSSPZ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VOHZH WPU0*ZVJRL[HUKH^H`+Z\IJVU ULJ[VY(SSVM[OPZJHUILHZZLTISLKVUH WPLJLVMWLYMVYH[LKWYV[V[`WPUNIVHYK;OL H\[OVYHSZVHKKLKH[YHUZPZ[VYHUKHU3,+ [VPUKPJH[L^OLUKH[HPZILPUN^YP[[LU[V [OLTPJYVJVU[YVSSLY;OLZJOLTH[PJKPHNYHT MVY[OL)SV^0[WYVNYHTTLYHUKHKKP[PVUHS PUMVYTH[PVUHYLH]HPSHISLVU[OL0U[LYUL[ ;OPZWYVNYHTTLYJHULHZPS`ILKYP]LUI` )(:*64VY)(:*643; 23 10 BC547 22 9 21 20 8 1 2 R4 10k 3 6 7 8 9 11 5 4 RST P3.0 19 P1.7 IC1 18 P1.6 P3.1 P1.5 P3.2 P1.4 P3.3 P1.3 P3.4 P1.2 P3.5 P1.1 P3.7 P1.0 17 16 15 14 13 12 AT89C2051 20 7 19 6 18 5 17 4 16 3 XL1 15 XL2 2 T2 14 10 R3 1 10k BC547 DB25M R5 ;OLZVM[^HYLMVY)VSVJHUILKV^USVHKLK MYLLVMJOHYNLMYVT[OL,SLR[VY,SLJ[YVUPJZ ^LIZP[LHZÄSLUV070295-11 1k (070295-1) C1 1n Web links 070295 - 12 Z\JOHZZPNO[ZLLRPUNSPNO[H]VPKPUNVY YHUKVT ;OLYL HYL THU` JVUJLP]HISL ILOH]PV\YWH[[LYUZMVYYVIV[Z;OLJVT WPSLY\ZLKMVY[OLTPJYVJVU[YVSSLYPU[OPZ [1] www.geocities.com/dinceraydin/8051/ index.html Het programma voor Bolo is gratis te downloaden van de Elektuur-website (EPS 070295-11). Antieu-robot Abraham Vreugdenhil ;OLUHTLVM[OPZYVIV[PZHJ[\HSS`HIP[ HTIPN\V\Z;OLO`WOLUPU[OLUHTLJHU HSZVILWSHJLKPUHKPMMLYLU[WVZP[PVUNP] PUN[OLUHTLºHU[P,\YVIV[»;OPZYLMLYZ[V [OL^OLLSZ^OPJOOH]LILLUTHKLMY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HZ[VILJVU[YVS SLKMYVT[OLV\[ZPKLHUKKVLZ UV[ OH]L HU` V[OLY HY[PMPJPHS PU[LSSPNLUJL I\[ [OL TL[OVK VMTV[PVUPZX\P[L\U\Z\HSHUK ^P[OHSP[[SLTVKPÄJH[PVUJV\SK HSZVWYV]L\ZLM\SPUV[OLYWYVQLJ[Z )HI`)V[^HSRZ^P[O[OLHPKVMMV\YZTHSS 7*) YLSH`Z ^OPJO OH]L ILLU ZWLJPHSS` TVKPMPLK MVY [OPZ W\YWVZL ;OL JV]LYZ OH]L ILLU YLTV]LK HUK [OL SLNZ OH]L 100 (070278-I) ILLUZVSKLYLKKPYLJ[S`[V[OLZ^P[JOPUN JVU[HJ[Z0[^PSSILJSLHY[OH[[OLZ[LWZPaL VM[OLSLN^PSSILTPUPTHS(M[LYHSS[OL ºZ[YVRL» [OH[ [OL Z^P[JOPUN JVU[HJ[ JHU THRLPZ]LY`ZTHSS Video clip of the walking mini robot: http://www.xj3.nl/_dreijer/backsite/willem/ babybot.avi elektor electronics - 7-8/2007 Torque is Cheap Bernhard Spitzer >OPSLVU[OLSVVRV\[MVY SV^JVZ[KYP]LZVS\[PVUZ [OL H\[OVYºZ L`L MLSS \WVU H JOLHW IH[[LY` VWLYH[LKJVYKSLZZZJYL^ KYP]LYPUHULSLJ[YVUPJZ ZOVW -PN\YL ;OLZL HYL H]HPSHISL MVY Q\Z[ H ML^WV\UKZMVYL_HT WSL*VUYHKVYKLYJVKL HUK PUJS\KL H WV^LYM\S º» TV[VY HUK H T\S[PWSLZ[HNL WSHUL[HY` KYP]L ;OL JSHZZPÄJH[PVUVMTV[VYZ HZº»º»HUKZVVU MVSSV^Z[OLWHY[U\TILYZ PU [OL YHUNL WYVK\JLK I` 4HI\JOP 4V[VYZ 1 ( º» TV[VY JVYYL ZWVUKZ[V[OL4HI\JOP 9:HUKOHZHKPHTL[LYVM TTHUKH SLUN[OVMHWWYV_PTH[LS`TT;OLUVTP 35 20,3 15 8 11 30 >P[O[O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ZHUKHK]HUJL [OLTV[PVUVM[OL[^VYPNO[SLNZ >OLU[OLYVIV[PZ^HSRPUNHSSZ[LWZVM [OL^HSRPUNTV[PVUHYLHS^H`ZL_LJ\[LK ILMVYL[OLZLUZVYPUMVYTH[PVUPZL_HTPULK HNHPU^OPJOTLHUZHJVTWSL[LZ[LWWPUN TV[PVUVM[OLSLNZPZL_LJ\[LKLHJO[PTL ;OPZZPTWSPÄLZ[OLZ[Y\J[\YLVM[OLZVM[^HYL HUKLUZ\YLZ[OH[[OLSLNZHYLHS^H`ZPU[OL ZHTLZ[H[L^OLUHUL^KLJPZPVUYLNHYKPUN [OL^HSRPUNKPYLJ[PVUT\Z[IL[HRLU;OL MLLSLYZOH]LZ\MÄJPLU[YHUNLVMTV[PVU[OH[ [OLYVIV[JHUZ[PSSTHUHNL[VTV]LHM[LYH M\SSZ[LWOHZILLUJVTWSL[LK +7V2 S4 Eyes ;OLL`LZVM[OPZYVIV[KVUV[M\UJ[PVUHZ ZLUZVYZ;OL`HYLW\YLS`KLJVYH[P]L;OL L`LZJVUZPZ[VM[^VTTYLK3,+ZJVU ULJ[LKPUZLYPLZ;OL`HYLWV^LYLKMYVT [OL=Z\WWS`]PHH7J\YYLU[SPT P[PUNYLZPZ[VYHUK[OL`HYLJVUULJ[LK[V HUV\[W\[SPULVM[OLTPJYVJVU[YVSSLY;OL L`LZZ^P[JOMYVTVU[VVMMHM[LYLHJOZ[LW I\[[OL`YLTHPUPUHÄ_LKZ[H[L^OPSL[OL YVIV[ PZ TV]PUN IHJR^HYKZ VY [\YUPUN KLWLUKPUN VU [OL TV[PVU [OH[ PZ ILPUN WLYMVYTLK AT90S2313 pin assignments Pin Function Connection 2 PD0 Left front leg hip 3 PD1 Left front leg knee 6 PD2 Left rear leg hip 7 PD3 Left rear leg knee 8 PD4 Left feeler 9 PD5 Right feeler 11 PD6 Right eye 12 PB0 Right front leg hip 13 PB1 Right front leg knee 14 PB2 Right rear leg hip 15 PB3 Right rear leg knee 16 P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UN^P[O[OL3,+ *ILNPUZ[VKPZJOHYNL\U[PS[OLIHZLVM; PZSV^LUV\NO[VILNPUJVUK\J[PUNHNHPU ;Z^P[JOLZVU^OPJOYLPUMVYJLZ[OLSV^ IHZL]VS[HNLVU;]PH*HUK[OLJ`JSL JVU[PU\LZ ;OL3,+SPNO[ZV\YJLMVYVIZ[HJSLPSS\TP UH[PVUKVLZUV[ULLK[VÅHZOP[JHUILSP[ JVU[PU\V\ZS`I\[[OLYLHYL[^VYLHZVUZMVY [OLÅHZOPUN3,+!ÄYZ[S`P[JVUZLY]LZIH[[LY` WV^LYNP]PUN467:HSVUNLYYHUNLHUK ZLJVUKS`HUKTVYLPTWVY[HU[S`HÅHZOPUN SPNO[SVVRZT\JOTVYLPTWYLZZP]L[OHUH 1 IVYPUNVSKJVU[PU\V\ZSPNO[ZV\YJL >OLU YLMSLJ[LK SPNO[ MHSSZ VU [OL WOV [V[YHUZPZ[VY;HJ\YYLU[ÅV^Z[OYV\NO9 [VNYV\UK^OPJOWYVK\JLZH]VS[HNLH[[OL IHZLVM;[VTHRLP[JVUK\J[;OL]HS \LZVM97HUK9HMMLJ[[OLZ^P[JOPUN [OYLZOVSKZVHKQ\Z[TLU[VM7^PSSOLSW [VYLK\JLZW\YPV\ZKL[LJ[PVUZJH\ZLKI` L_[LYUHSSPNO[ZV\YJLZ;\YUPUN7HWYL ZL[JV\SKIL\ZLKOLYLPUZ[LHKZV[OH[P[ 2 S1 +4V5 100k R3 T1 D3 T3 D4 D1 RE1 BC557 R9 1807 1k8 C1 R5 4k7 R6 1807 R1 1N4148 M1 R2 M 1k8 1M 16V D2 T4 BC547 BC547 10k T5 R8 2k2 R7 1k 560k D3 1N4148 P1 R4 T3 T2 C2 plastic tube protects against ambient light M M2 BC547 070143 - 12 470M 16V 070143 - 11 7-8/2007 - elektor electronics 107 increases its resistance will make T4 more sensitive and vice versa. T4 conducts in synchronism with the flashing LED so capacitor C2 acts as a reservoir capacitor to ensure that once T4 begins to conduct, sufficient energy is stored in C2 to ensure that T5 remains conducting continuously until the obstacle is out of range and T4 switches off. It takes a few seconds for C2 to discharge and during this time MOPs is performing its avoidance manoeuvre. T5 switches a double pole relay which has the effect of performing this manoeuvre. In normal forward motion the relay switches the positive and negative supplies to both motors and diode D2 is conducting. When an obstacle is detected the relay switches and reverses the polarity of the motor connections. D2 now becomes reverse biased and no current can flow through motor M2 while M1 goes into reverse. This gives MOPS the reverse and turn response to obstacles. A few seconds after the obstacle is no longer detected the relay switches back and MOPS carries on as before but in a different direction. NEW Figure 2 shows a close up of MOPS’s eye mounted in a tube which helps to make obstacle detection more directional and reduces the effects of external light 3 UM1 UM2 070143 - 13 sources. With this set-up it was possible to detect obstacles at a distance of 10 cm. The range depends largely on the reflective properties of the obstacle so darker objects will only be seen at shorter ranges. The circuit can be modified to read microswitches connected to contact feelers mounted on the front of MOPS this will help avoid col- lisions with matt black objects. Figure 3 shows the layout of the two motor and gearbox assemblies. (070143-I) Web link www.elexs.de/robo1.htm ISBN 978-0-905705-69-9 Approx. 432 pages £19.95 / US$ 39.95 #$%!&&!&&"!"&#"#'$ *$'&%%$%"""%"!!"!&!% " #$!%(($&+"$'&%%'$'&% &#%!&$%!%!%"$&$"!% % $'&%"$$#$%!&&(!&"! Complete your 30x circuits series now! "#$%!&+&$"!% '$ *%$%!&'%%&%)!""'&!"))&&"*#& 8$$!")'%!&8$$"$ ! $'&%"!&!% !+'+"$&&$"!%#$"&% &$%:$(%%&"!!&%%%' !&"!&$$!' $"'%%"))&#"&!& 4&"$4&$"!%9'%! "$'%!+"'$")!$%$#$"&%!##&"!% '%3$!&"$ "! !+"&$!%#$!&"#%&"")!&"$%$) -5$&<%&" #$%!&!&%""&%& %'$ !&$"" #'&$% 3$!&"$<266 !#$#$%'"(""+! "! $""!&$"$% ;!&7!" " $!#")$%'##%&&$+$$%&&$ ,//.2.1-/0 108 elektor electronics - 7-8/2007 7-8/2007 - elektor electronics 109 2.4 GHz Antenna for Robotics Vehicles Ragnar Jensen 4 9HKPVLX\PWTLU[\ZPUN[OLSPJLUZLMYLL./a0:4PUK\Z[YPHSZJP LU[PÄJTLKPJHSIHUKPZHSZVYPMLHTVUNYVIV[PJZMHUZQ\Z[[OPURVM ^OH[`V\JHUKV^P[O)S\L[VV[O^PYLSLZZJHTLYHZYLTV[LJVU[YVS VYL]LUH>3(5JSPLU[VYHJJLZZWVPU[Ä[[LKVUHYVIV[]LOPJSL 7VPU[PZZ\JOOVTLIYL^HWWSPJH[PVUZ[`WPJHSS`YLX\PYLHUHU[LUUH [OH[»ZVTUPKPYLJ[PVUHSºZVY[VM»ÅL_PISLPU]PL^VM[OLKHTHNL HUKIHZOPUNP[TH`OH]L[V[HRLHUKSV^JVZ[ ;OLHU[LUUHZOV^UOLYLM\SÄSSZHSS[OYLLYLX\PYLTLU[ZIYPSSPHU[S` :LLMVY`V\YZLSM[OLWPJ[\YLZZH`TVYL[OHUR^VYKZ @V\^PSSULLK! • HZOVY[WPLJLVM£JVH_JHISLSPRL9.*<^P[OHJYPTWLK VU)5*WS\NºIVYYV^»HJHISLMYVT[OL0;KLW[" • HZOHYWOVII`RUPML" • H WVPU[LK [VVS SPRL H Z[YVUN ULLKSL VY H ^H[JOTHRLY»Z ZJYL^KYP]LY" • HY\SLY" • HZVSKLYPUNPYVUVW[PVUHS" • HOV[NS\LN\U" • JVTTVUZLUZLHUKHIV\[TPU\[LZVM`V\Y[PTL Using the pointed tool, carefully unweave the braid strands. 5 /LYLNVLZ 1 The raw material: a short piece of 50-7 coax cable. 2 Until your hairdressing looks something like this… 6 Cut off about 40 mm of the outer insulation. This will expose the braid that forms the cable shield. 3 Push down the braid to expose the inner insulation. 110 Distribute the strands into four equally sized and likewise spaced bundles (wow, tresses!) elektor electronics - 7-8/2007 7 8 Now bend them into a 45-degree angle with respect to the cable. This angle will result in an antenna impedance of about 50 7. 9 Cover the bundles with solder. Although this step is optional, it does enable the ground plane elements to hold their shape better, and prevents untwisting of the strands. 10 Done soldering! Apply a few drops of hot glue… 12 11 … will help keep the proper shape. Cut the radials and the radiator to a length of 30 mm (yes that’s 0.25 lambda). 13 And we are done! (070142-I) (reproduced with modifications and extensions from CQ-TV issue 217) 7-8/2007 - elektor electronics 111 Receiver for RC5 Remote Controls D30 1N4148 +5V IC4 +8V 78L05 R2 DATA 47k 100 7 R1 RESET CLK 100n 220n IC1.A 14 1 R 7 6 R 1D C1/ 1D 2 15 IC2.A 14 1 R 1D 7 6 R 1D 9 SRG4 10k 2 SRG4 11 12 13 10 3 4 SRG4 5 2 C3 100n SRG4 11 12 13 10 3 4 5 BC557B IC8.D D2 D1 D3 D4 D6 D7 D8 D9 D10 D11 R18 D12 D13 R16 D14 11 R19 1k R17 1k R15 1k R14 1k R13 1k R12 1k R11 1k 1k D5 R10 1k R9 1k R8 1k R7 1k 10k R5 1k R6 1k R4 1k R20 1k 1 TSOP1736 D15 R21 & 12 D16 100k R3 3 2 IC2.B 9 T1 IC3 1 15 C1/ IC1.B 1000M C2 100n C1 C1/ C6 C1/ C7 C4 C5 47M 470M 13 3 1 2 3 4 5 6 7 8 9 10 11 12 13 14 IC8.C 9 DATA & 8 10 +5V 1 4 C11 2 D18 4 16 0 100k 4 180k 7 CTR12 11 8 3 IC7 39k IC5 CT R27 P1 2 TR 6 THR 10k 1 2 CT=0 R DIS 7555 OUT 3 10 18kHz + 4 5 6 7 8 CV 5 C9 C10 150p 100n IC8.A 2 1 4040 9 10 1 11 & 3 IC9.C 9 7 5 6 8 8 5 D19 3 D20 2 D21 9 4 13 D22 12 D23 D S C R :VM[^HYL KLJVKPUN VM YLTV[L JVU[YVS ZPNUHSZ\ZPUN[OL9*WYV[VJVSKVLZUV[ WYLZLU[HZPNUPÄJHU[JOHSSLUNL[VHTVKLYU TPJYVJVU[YVSSLY^OPSLMVYHW\YLOHYK^HYL ZVS\[PVUZWLJPHSPZLK9*KLJVKLY0*ZHYL H]HPSHISL5L]LY[OLSLZZP[PZPU[LYLZ[PUN[V SVVRH[OV^^LTPNO[WY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SSLKrf433.c (070173-I) [1] The complete document called Zbot — the Robot Experimental Platform is available for free downloading from the Elektor Electronics website. The file number is 070172-11.zip (July/August 2007). Removed Pulse Detector Hesam Moshiri 1 VCC R 10k R1 8 4 R 7 DIS IC1 2 6 T1 OUT TR 3 LM555CN THR CV C 1 5 BC558 070099 - 11 114 2 (KL[LJ[VY[VÅHNTPZZ INPUT PUNW\SZLZPZHTVUN[OL TVYLPTWVY[HU[JPYJ\P[Z OUTPUT PUYVIV[PJZ>OLUW\SZLZ HYLHWWSPLK[V[OLJPYJ\P[ ZOV^U PU -PN\YL [OL V\[W\[ ZPNUHS ^PSS IL T$9* JVU[PU\V\ZS` /PNO PL ULHYS` =JJHZPSS\Z[YH[LKPU-PN\YL [HRPUNPU[VHJJV\U[[OH[ -VY[OLKL[LJ[VY[VVWLYH[LJLY [HPUJVUKP[PVUZPUYLZWLJ[ VM W\SZL [PTPUN T\Z[ 3 N ILTL[>P[OYLMLYLUJL [V [OL [PTPUN KPHNYHT INPUT Deleted Pulse ZOV^U PU -PN\YL [OL M ]HS\LZVMJVTWVULU[ZR OUTPUT HUKCPU[OLJPYJ\P[TH` ILJHSJ\SH[LKMYVT 070099 - 12 070099 - 13 elektor electronics - 7-8/2007 R£#R#4£HUKM#T#N >OLUHJVYYLJ[ZPNUHSPZILPUNHWWSPLK[V [OLPUW\[-PN\YL[OLJPYJ\P[^PSSIL[YPN NLYLKI`HUV[OLYW\SZLILMVYL[OLJVUZ[HU[ [PTLTL_WPYLZ;OLYLMVYL[OLV\[W\[ZPN UHSYLTHPUZ/PNO0MVULVYTVYLW\SZLZ HYLTPZZPUNMVYL_HTWSLV^PUN[VHMH\S[ HIHZOVU[OLOLHKMYVTYLMIV[4H[OPSKH VY ZPTWS` IHK YLJLW[PVU VU [OL YLTV[L JVU[YVSJOHUULS[OLV\[W\[ZPNUHSKYVWZ 3V^IYPLÅ`;OLYLZ\S[HU[ÅHNZPNUHSJHU ILZLUZLKI`HUV[OLYJPYJ\P[M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JHUJVTMVY[ HIS`Z^P[JOLUV\NOJ\YYLU[[VKYP]LWV^LY YLSH`Z*VTWSL[PUN[OLJPYJ\P[HYLH=]VS[ HNLYLN\SH[VY[`WL37 =HUKHU0:7 115 IC4 +3V K1 10M 10M R2 R3 4 3 6 5 7 VCC 1 D1 20 D2 PD3(INT1) 5 D3 6 SCK 19 18 MOSI 17 16 FB4 15 FB5 14 FB6 PB5(SCK) PC0(ADC0) PB4(MISO) PC1(ADC1) PB3(MOSI/OC2) PC2(ADC2) PB2(SS/OC1B) PC3(ADC3) PB1(OC1A) PC4(ADC4/SDA) PB0(ICP) PC5(ADC5/SCL) PD7(AIN1) 23 1 24 2 25 3 26 4 27 5 28 6 13 7 8 ATmega8L 12 PD5(T1) PD0(RXD) PD6(AIN0) PD1(TXD) GND XTAL1 8 S1 JP1 AREF PD2(INT0) 9 X1 JP2 C4 10 2 I6 I7 OUT4 14 O5 OUT5 13 O6 OUT6 12 O7 I8 OUT3 15 O4 ULN2803 OUT2 11 O8 VEE Reset Bluetooth 9 3 D4 R7 9 R5 10 11 12 13 22p 14 15 •>PUKV^Z4VIPSL7VJRL[7*HUK:THY[WOVUL!5,;*-] ^THYT]PJHI" •7VJRL[7*HUK:,!5,;*-]WWJHYT]JHI" •>PUKV^Z?7!UL[JMZL[\W]TZP I4 OUT1 16 O3 IC2 +3V 22 7,3728MHz R6 RX 1N4148 17 O2 I3 I5 18 O1 I2 XTAL2 AGND C5 22p +VS I1 21 220 7 4 11 RE1 10 IC1 MISO D6 AVCC PC6(RESET) 220 7 FB3 100n 1k 1 ISP FB2 C1 R1 2 PD4(XCK/TO) FB1 C2 220 7 R4 C3 1k VCC +3V +5V LP2950 3V 4k7 PUZ`Z[LTWYVNYHTTPUNJVUULJ [VY-V\Y3,+ZPUKPJH[L[OLZ[H[\ZVM [OLJVUULJ[PVU!3,+ZOV^Z^OLU [OLTPJYVJVU[YVSSLYOHZYLJLP]LK KH[HJVYYLJ[S`HUK3,+PUKPJH[LZ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[VHU:+JHYKMVY\ZL^P[OH:THY[WOVUL;OL[^V )S\L[VV[OKL]PJLZ[OL:THY[WOVULHUK[OLYLJLP]LYIVHYKUV^ ULLK[VILºWHPYLK»^OPJOVUS`ULLKZ[VILKVULVUJL;OLWYV NYHTJHUUV^ILZ[HY[LKHUK[OL*64WVY[ZL[^P[OHJSPJRVY[^V VM[OLTV\ZLVU[OL\W^HYKHUKKV^U^HYKWVPU[PUNHYYV^Z;OL JLU[YHSZX\HYLVWLUZ[OLPU[LYMHJLJYLH[PUNHJVUULJ[PVU^P[O[OL YLJLP]LY;OLHYYV^ZUV^HSSV^[OLV\[W\[ZVU[OLYLJLP]LYIVHYK [VILZ^P[JOLKVUHUKVMM"[OLZP_[OV\[W\[PZZ^P[JOLKI`WYLZZPUN [OLZWHJLRL` ;V^HYKZ[OL[VWVM[OLKPZWSH`[OLZP_ZLUZVYPUW\[ZHYLYLWYLZLU[LK HZ3,+Z0M`V\ZOV\SKTV]LV\[VMYHUNLVM[OLYLJLP]LY[OLZL 3,+Z^PSSILL_[PUN\PZOLKHUKH[PTLV\[IHY^PSSHWWLHY0M[OL [PTLV\[WLYPVKZOV\SKL_WPYL^P[OV\[H]HSPKZPNUHSILPUNYLJLP]LK [OLPU[LYMHJL^PSSILJSVZLK (070126-I) Web links Author’s website (in German): http://www.clipswitch.de/avrblueremote.html Bluetooth module information: http://www.amber-wireless.de/en/ produkte/bluetooth/default.php?fnum=109221360256 Bluetooth module manual: http://www.amber-wireless. de/pdf/OPC1601_MA.pdf LMX9820A datasheet: http://www.national.com/pf/LM/LMX9820A.html AVR programmer: http://www.atmel.com/dyn/products/tools_card. asp?tool_id=2726 AVR Studio: http://www.atmel.com/dyn/products/tools_card. asp?tool_id=2725 116 elektor electronics - 7-8/2007 Robot Voice ;OLTPUPT\TWSH`IHJRJPYJ\P[ZOV^UPU uZLZ[OL(7+*,HUK,64ZPNUHSZ PU[LYMHJLK[V[OLYVIV[TPJYVJVU[YVSSLY-VY IC2 +U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OH]L[VILYLHKJHSJ\SH[PVUZOH]L[VILJHYYPLKV\[HUK[OL HJ[\H[VYZMVY[OLYVIV[OH]L[VILKYP]LU ([[OLZHTL[PTLP[PZVM[LUHSZVKLZPYHISL [VJVTT\UPJH[L^P[OH7*MVY[OLW\YWVZL VMKH[HHJX\PZP[PVU-VYHSS[OPZP[JHUILH NVVKPKLHUV[[V\ZLVULYLSH[P]LS`WV^LYM\S WYVJLZZVY I\[ [V \ZL H U\TILY VM ZTHSSLYWYVJLZZVYZ^OPJOZLUK[OLPYKH[H [VVULJLU[YHSWYVJLZZVY0U[OPZ^H`[OL [PTPUNVMTLHZ\YPUNHUKJVU[YVSSPUNJHU T 2Q l g T period [s] g gravitational acceleration [m/s2] l length from pivot to centre of mass [m]] PWM k1 R k2 R k3 v R Angle of the robot [°] R Velocity at which the angle changes [°/s] PWM Drive for the motors 0-100% v Speed of the robot [m/s] k1...k3 Feedback factors, constant R B [ n] k4 R B [ n 1] k5 RG [ n] k6 R v [ n] RG [ n] Angular velocity measured by the gyroscope [°/s] R B [ n] Angle of the robot, calculated in measurement n [°] R v [ n] Angle of the robot, determined by accelerometer in measurement n [°] R B [ n 1] Angle of the robot, calculated in measurement n-1 [°] k4 ...k6 constants (YJOP[LJ[\YL 0U[OLJVU[YVSSVVW[OH[PZL_LJ\[LKI`[OL ZVM[^HYLPU[OLTPJYVJVU[YVSSLYHU\TILY 7-8/2007 - elektor electronics 119 ILKP]PKLK^OPJOTHRL[OLWYVNYHTTPUN [HZRHNYLH[KLHSLHZPLY :\TVMWHY[Z (IHSHUJPUNYVIV[JVUZPZ[ZVMHU\TILYVM WHY[Z[OH[[VNL[OLYOH]L[VOVSK[OLYVIV[ \WYPNO[!ZLUZVYZHU`ÄS[LYZHJVU[YVSSLY HUKKYP]LZ`Z[LTMVY[OLYVIV[7\[[PUNHSS [OPZ[VNL[OLYPUVULNVPZ]LY`HTIP[PV\Z HIL[[LYJOHUJLVMZ\JJLZZPZVI[HPULKI` ÄYZ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V[OLHYT [OLHUNSLHUKHUN\SHY]LSVJP[`JHUILLHZPS` KLYP]LK+\YPUN[OLJHSPIYH[PVU[OLKYP]L MVY[OLYVIV[JHUILZ^P[JOLKVMM)`TV]PUN[OLYVIV[IHJRHUKMVY[OI`OHUK[OL HUNSLHUKHUN\SHYZWLLKHYLJOHUNLKHUK [OLJHSPIYH[PVUJHUILWLYMVYTLK>OLU JHSPIYH[PUN[OLHJJLSLYVTL[LYP[PZPTWVY[HU[[VTV]L[OLYVIV[IHJRHUKMVY[O]LY` ZSV^S`ZV[OH[[OLK`UHTPJHJJLSLYH[PVUPZ HZZTHSSHZWVZZPISLHUKVUS`[OLHJJLSLYH- [PVUK\L[VNYH]P[`PZVIZLY]LK ([OPYKZ[LWPZ[OLJHSJ\SH[PVUVM[OLHUNSL HUKHUN\SHY]LSVJP[`![OLYLZ\S[ZMYVT[OL ZLUZVYZOH]L[VILJVTIPULKPUZ\JOH^H` [OH[[OLHUNSLVM[OLYVIV[HUK[OLZWLLK H[^OPJO[OPZHUNSLJOHUNLZPZVI[HPULK ;OLJHSJ\SH[PVU[OH[THRLZ[OPZWVZZPISL OHZILLUKLZJYPILKHIV]L;OL^LPNOPUN MHJ[VYZJHUILKL[LYTPULKI`TV]PUN[OL YVIV[MVYZVTL[PTLTPU\[LMVYL_HTWSLHUKYLHKPUN[OL]HS\LZMYVT[OLZLUZVYZHJJLSLYVTL[LYN`YVZJVWLHUKWV[LU[PVTL[LYVU[OLHYT(ZWYLHKZOLL[VU[OL 7*JHUZ\IZLX\LU[S`IL\ZLK[VHUHS`ZL [OL]HS\LZHUKKL[LYTPUL[OLJVYYLJ[]HS\LZMVY[OL^LPNOPUNMHJ[VYZ (070294-I) Web links [1] http://robotics.ee.uwa.edu.au/theses/2003-Balance-Ooi.pdf This document describes a final year project during which a balancing robot was built. The research is quite detailed with respect to the physical and mathematical modelling of the problem. [2] http://leiwww.epfl.ch/joe/ Polytechnic school of Lausanne. The website is in French but there are a number of nice movies. [3] http://www.geology.smu.edu/~dpawww/robo/nbot/ This is the website of D. Anderson who built the NBOT. [4] www.dena.demon.nl Dutch website on the construction of a balancing robot. [5] www.segway.com the Segway. Importer of [6] www.sparkfun.com DIY Wheels Marcus Bindhammer @V\KVU»[OH]L[VYLPU]LU[[OL^OLLSMVY `V\Y YVIV[ I\[ `V\ TH` OH]L [V THRL `V\YV^UZVTLOV^PM`V\JHU»[VYKVU»[ ^HU[[VI\`[OLTYLHK`THKL;OLOHUKPJYHM[ZHZWLJ[VMTHRPUN`V\YV^U^OLLSZ PZYLSH[P]LS`\UKLTHUKPUNHUKVULOHUK I\[UV[HSLM[OHUK¯PZLUV\NO <ZL H JVTWHZZ [V KYH^ JPYJSLZ ^P[O H KPHTL[LYVMTTVUHWPLJLVMTT WS`^VVKHUK[OLUJ\[VYZH^[OLKPZJZ V\[ +YPSS H TT OVSL PU [OL JLU[YL VM LHJOKPZJ box-column drill wooden block covered with sandpaper long M3 screw or threading washer ILÄ[[LKPU[OLOVSL5V^ZLJ\YL[OLZJYL^ \ZPUNH^HZOLYHUKU\[HUK[OLUJSHTWP[ PU[OLJO\JRVMHKYPSSWYLZZ<ZPUNHZTHSS ISVJRVM^VVK^YHWWLKPUZHUKWHWLY`V\ JHUX\PJRS`ZHUK[OLKPZJPU[VHUPJLJPYJ\SHYZOHWL -PUHSS`Ä[HSLUN[OVM[VV[OLKY\IILYILS[ HYV\UK[OLJPYJ\TMLYLUJLVMLHJOKPZJVSK ]PKLVYLJVYKLYZHYLHNVVKZV\YJLVYNS\L ÅH[LSHZ[PJIHUKZ[V[OLY\UUPUNZ\YMHJLZ (M[LY`V\YLTV]L[OLZJYL^ZHSS`V\OH]L [VKVPZÄ[[OL^OLLSZVU[OLH_SLZHUK ZLJ\YL[OLT^P[OHIP[VMZ\WLYNS\L (070145-1) (Z`V\JHUZLLMYVT[OLKYH^PUNHU4 ZJYL^^P[OHSLUN[OVMH[SLHZ[TTT\Z[ 120 070145 - 11 elektor electronics - 7-8/2007 R8C Measures Negative Voltages IC1 +2V5 LM317 +12V +2V5 R1 D1 100 7 J3 AN5 VSS VCC AN2 P17 AN1 P16 AN0 10 11 12 13 14 15 D2 27 11 26 12 25 13 24 14 23 15 22 16 D3 D4 –12V D5 D6 V WHEEL D7 21 P13 R5 20 P12 +12V 19 P11 P10 R7 R13 R9 R11 R19 R15 18 P32 16 13 17 P33 +2V5 SUB D37 VDD 2 8 EN S1 MUX S2 IC3 D S3 S4 IC2 –12V –12V LM337 –2V5 100 7 R2 15 16 1 ADG408 S5 A2 S6 A1 S7 A0 S8 VSS 3 4 5 6 7 12 11 10 9 R6 R8 R14 R10 R12 R20 R16 10k 9 –2V5 D1 10 10k 8 AN3 D0 10k 7 9 28 6 +2V5 8 29 10k –2V5 5 AN4 7 30 10k 4 31 E 47k R8C Module LIFT EN V LIFT R/W 39k 3 6 10k 2 32 56k 1 10k –2V5 100 7 R18 RS 5 J2 –8V VO 39k J1 +8V VDD 3 4 BC547A +12V 47k 100 7 VSS 2 +12V K1 LCD 1 39k +2V5 R3 39k 1N4001 T1 LC DISPLAY RE1 GND 14 100 7 R4 –12V 070010 - 11 Sven van Vaerenbergh UH Brussels, Radio Therapy Dept. ;OLH\[OVYOHK[VKLZPNUHTVUP[VYJPYJ\P[ MVY[OLZVJHSSLK/LYJ\SLZ;HISLHULSLJ[YPJHSS`TV]HISLWSH[MVYTH[[OL<UP]LYZP[` /VZWP[HSPU)Y\ZZLSZ[OH[^V\SK^H[JOZL]LYHSVWLYH[PUN]VS[HNLZHUKJV\SKZ[VW[OL [HISLPUJHZLVMLTLYNLUJ` ;OLTV]LTLU[VM[OLWSH[MVYT\WKV^U PZKVUL^P[OH+*]VS[HNLIL[^LLU= HUK¶=^OLYL[OLTHNUP[\KLVM[OL]VS[HNLKL[LYTPULZ[OLZWLLKHUK[OLWVSHYP[` KL[LYTPULZ[OLKPYLJ[PVU;OLYLHYLHSZVH U\TILYVMÄ_LK]VS[HNLZ[OH[ULLK[VIL TVUP[VY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HPSHISL >LJHUZLL[OH[[OLZJOLTH[PJHSZVJVU[HPUZHYLSH`[OH[JHUILZ^P[JOLKI`[OL 9*[VPTTLKPH[LS`Z[VW[OL[HISLTV]LTLU[;OPZPZVW[PVUHS 5V^^LOH]L[V[HRLZWLJPHSJHYL^OLU ^LOH]LULNH[P]L]VS[HNLZ;OLYLZVS\[PVU VM [OL IP[(+JVU]LY[LYPU[OL9* HTV\U[Z[V=$=WLYIP[ )LJH\ZLVM[OLZ`TTL[YPJHSWV^LYZ\WWS` [OLJVU]LY[LY^PSSNP]LHUV\[W\[]HS\LVM ^OLU[OLPUW\[]VS[HNLPZaLYV]VS[Z >LJHUKPZWSH`HTPU\ZZPNUVU[OL3*+ ^OLU[OL]HS\LPZZTHSSLY[OHU 0U*JVKLP[SVVRZSPRL[OPZ! if ( u < 512 ) 0, then minus sign { lcddata (45); } // less than >L HSZV OH]L [V HKQ\Z[ [OL ]VS[HNL SL]LSZPUZVM[^HYLILJH\ZL[OLZLOH]LILLU SV^LYLKI`[OL]VS[HNLKP]PKLYZ>LHSZV OH]L[VKYP]L[OLT\S[PWSL_LY0U*JVKLP[ SVVRZSPRL[OPZ! pd3 _ 3 = 1; //port 3.3 as output p3 _ 3 = 0; //port 3.3 => for channel selection via analogue MUX pd3 _ 2 = 1; p3 _ 2 = 0; //port 3.2 => for channel selection via analogue MUX ;OYLLJOHUULSZHYLKPYLJ[S`JVUULJ[LK[V [OL(+JVU]LY[LY6ULJOHUULSPZT\S[PWSL_LKMVY[OL]VS[HNLZVM=¶=HUK ¶= (070010-I) 121 Formula Flowcode Buggy A low-cost robot not just for schools & education Bart Huyskens, St Joseph’s institute (Schoten, Belgium) Out of Belgian schools has arrived an £ 85 (125 `) robot buggy that the designer hopes can reverse the decline in the study of electronics and technology across Europe and, potentially, wider. YLHSS`[LHJOHU`[OPUNHIV\[LSLJ[YVUPJZHUK`V\JHU»[YLHSS`ºNL[ \UKLY[OLOVVK»HUK\ZLP[HZHWSH[MVYTMVY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YVUPJZ JHUILTH[OLTH[PJHSWHY[ZVM[OLZ\IQLJ[ZHYLKPMÄJ\S[[V\UKLYZ[HUKHUKP[OHZH]LY`K\SSPTHNL(SSZVY[ZVMPKLHZOH]LILLU [YPLKHUKZVTLOH]LWHY[PHSS`^VYRLKI\[UV[[VV\YZH[PZMHJ[PVU ;OLYLPZVULL_JLW[PVU[OH[Z[HUKZV\[¶3LNV3LNV»Z5?;YVIV[ SVVRZJVVSPZJVVSHUKPZM\U[V\ZL)\[P[PZL_WLUZP]LKVLZUV[ -VYT\SH-SV^JVKLPZHJVTWSL[LOHYK^HYLHUKZVM[^HYLYVIV[PJZZVS\[PVUMVYSLHYUPUNHIV\[LSLJ[YVUPJZHUKWYVNYHTTPUN;OPZ HY[PJSLKLZJYPILZ^OH[-VYT\SH-SV^JVKLKVLZOV^P[^VYRZOV^ ^LOVWLP[JHUIL\ZLK[VSLHYUHSSHIV\[YVIV[PJZ 19 2 5 18 3 4 17 1 16 7 The brains of Formula Flowcode — a PIC18F4455 microcontroller 2. USB socket 3. Master reset switch 4. Programming LED 5. External 5V supply input 6. Power switch 7. Plastic chassis with battery compartment, motors with gearboxes, and 2 wheels. 8. Motor driver chip - a L293D 9. Microphone with sound level amplifier circuit 10. User definable press switches 13 6 8 1. 12 14 9 10 11 15 11. Distance sensor - right 12. Distance sensor - centre 13. Distance sensor - left 14. Light sensor 15. Line following circuit board 16. 8 user definable LEDs 17. Microphone volume control 18. Loudspeaker 19. E-blocks expansion socket Figure 1. Formula Flowcode functional parts. 122 elektor electronics - 7-8/2007 Figure 2. This diagram of the PIC18F4455 is purposely simplified, showing only the actually used functions of the pins of the PIC. D stands for ‘Digital I/O’ and A for ‘Analogue input’. (UKOLYLP[PZ -PN\YLZOV^ZHWPJ[\YLVM-VYT\SH-SV^JVKLHUKHSPZ[VM[OLJVTWVULU[ZHUKMLH[\YLZVU[OLI\NN`)\[OV^KVLZP[HSS^VYR&3L[»ZZ[HY[ H[[OLILNPUUPUN;OL^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LYJV\YZLZHYLQ\Z[ Figure 9. Typical line following exercise. Pit stop! How can you get involved? The Formula Flowcode robot buggy was purposely developed to motivate people to want to learn more about robotics and electronics – from 12 year old pupils who have a curiosity about the subject, right up to those enjoying retirement and still wanting to learn and keep mentally active. In the USA the First Robotics programme (www.usfirst.org) has been quite successful at stimulating engineers in industry to collaborate with young people to compete in robotic events. We hope to achieve something similar here; by providing a low cost hardware software robot, providing online support and quality curriculum. By running workshops and competitions we hope people will be captured by electronics. If you feel that our aims are worthwhile and achievable, if you want to take part in this programme, or if you are interested in the competitions and workshops then please let us know. If the level of interest is high then we can write more articles and issue special ‘courses’ for Elektor readers. The author and his colleagues can be contacted by email on [email protected], or through Elektor. You can purchase a Formula Flowcode buggy from the Elektor SHOP at a cost of £ 85 or ` 125 including VAT. MVYM\UVYPUKLW[OL_WSVYH[PVUVMWYVNYHTTPUNHUKOHYK^HYLMLH[\YLZ :\WWVY[MVYHSSVM[OPZ^PSSILH]HPSHISLVU 4H[YP_4\S[PTLKPH»Z^LIZP[LMVY\THJJLZZPISL ]PH ^^^TH[YP_T\S[PTLKPHJVT ^OLYL\ZLYZHZRLHJOV[OLYX\LZ[PVUZHUK Z^HWWYVNYHTZ>LHSZVWSHU[VY\U^VYRZOVWZVU-VYT\SH-SV^JVKL[VNL[`V\UN WLVWSL\WHUKY\UUPUNHUKPU[LYLZ[LKPU [LJOUVSVN` 0UHKKP[PVU[V[OPZ,SLR[VY^PSSILW\ISPZOPUNHIVVR^OPJO^PSS[HRL\ZLYZ[OYV\NO [OLWYVJLZZVMKL]LSVWPUNWYVNYHTZHUK HKKP[PVUHSJPYJ\P[Y`MVY[OLI\NN`;OPZ^PSS MVYTHJVTWSL[LZ\P[LVM[\[VYPHSZ^OPJO ^PSS[LHJO[LJOUVSVN`[VI\KKPUNLSLJ[YVUPJZLU[O\ZPHZ[Z\W[V`LHYZVMHNL (070323-I) Figure 10. Solving a simple ‘left’ maze. 7-8/2007 - elektor electronics 125 Colour Tamer U+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[LKZ\WWS`VYHIH[[LY`HUK^PSSJVUZ\TLHML^TPSSPHTWZVUS` IC2.A 1 8 8 RESET IC2 = 4066 070034 - 11 :^P[JO:HSSV^Z[OLJV\U[LY[VILYLZL[ Z^P[JOPUNHSSZ^P[JOLZ[VVMMPL[OL OPNOLZ[H[[LU\H[PVU^PSSL_PZ[PU[OLH\KPV WH[OHZPU[OH[JHZLUVULVM[OLR£YLZPZ- 127 [VYZHYLZOVY[LKV\[ ;VJHSPIYH[L[OLJPYJ\P[KPZJVUULJ[[OL JSVJRPUW\[WPUMYVT[OL^PWLYVM7 HUK[LTWVYHYPS`NYV\UKP[[OYV\NOHR£ YLZPZ[VY5V^W\SZL[OLJSVJRPUW\[I`IYPLÅ` JVUULJ[PUNP[[V[OL =SPUL"`V\^PSSZLL [OLJV\U[LYV\[W\[ZJOHUNLZ[H[LHUK^P[O [OLT[OLIPSH[LYHSZ^P[JOLZPU[OL (070034-I) Walking Works! rechargeables 4V8 dry cells 6V K1 * see text 1 6 21 2 24 dry cells (6V) rechargeables (4V8) VIN SOUT SIN 22 RES ATN 1 6 +V E GND 7 8 9 10 Servo 11 +V E GND 12 P0 P15 P1 P14 P2 P13 P3 P12 P4 P11 P5 CB220 P10 P6 P9 P7 P8 4 3 3 * IC1 5 7 2 20 100n 19 C2 18 * 100n 17 16 C1 8 4 9 5 SUB D9 15 14 13 23 Servo 070353 - 11 C. Tavernier (S[OV\NO [OL THQVYP[` VM YVIV[Z I\PS[ I` HTH[L\YZTV]LHYV\UK \ZPUN^OLLSZVYJH[LYWPSSHY [YHJRZ [^V JH[LNVYPLZVJJ\W`HWSHJL HWHY[ ILJH\ZL VM [OL ZWLJ[HJ\SHY^H`[OL` TV]L! [OL OL_HWVK YVIV[ HSZV JHSSLK ZWPKLYYVIV[[OV\NO Z WPK L Y Z H J [ \ HSS` OH]L LPNO[ SLNZ HUK[OL^HSRPUN YVIV[ 0[ TH` ZL LT YLSH[P]LS` LHZ` [V THRL [OL ^OLLSZ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[OYLNHYK[V TLJOHUPJHSLUNPULLYPUN;OLTLJOHUPJHS WHY[Z^LYLOV\ZLKPUH^VVKLUIV_^P[O HZSPKPUNSPK7YVIHIS`MVY[OPZYLHZVU[OL` OH]LZ\Y]P]LK[OL`LHYZYLSH[P]LS`PU[HJ[ HUK`V\JHUYLN\SHYS`ÄUKJVTWSL[LVY WYHJ[PJHSS`JVTWSL[LRP[ZVMMLYLKVU,IH` HUK ZPTPSHY H\J[PVU ZP[LZ ;OL` \Z\HSS` JOHUNLOHUKZMVYHYV\UK[^LU[`[V[OPY[` WV\UKZUH[\YHSS`KLWLUKPUNVU[OLPYNLULYHSJVUKP[PVU1\Z[HZ^P[OHSSVSK[OPUNZ [OLYLHYLJVSSLJ[VYZ^OVHYLPU[LYLZ[LKPU [OLTHUK[OLYLHYL]HYPV\Z^LIZP[LZ^OLYL `V\JHUÄUKTVYLPUMVYTH[PVU Web Links http://ee.old.no/mechanics http://sharon.esrac.ele.tue.nl/~pa0ib/bouwdozn/index.html www.hansotten.com/philipsme1200.html www.girdersandgears.com/norelco.html (070277-1) A Robot with an Elephant’s Memory B. Broussas 7-8/2007 - elektor electronics 11 32 +5V MCLR/VPP RB7/PGD RB6/PGC 4 5 6 7 8 9 10 RB5 RA1/AN1 RB4 RA2/AN2 RB3 RA3/AN3 RB2 RA4/T0CKI RB1 RA5/AN4/SS RB0 14 19 20 21 22 27 28 38 37 36 C2 C1 C3 10M 220n 10M 35 34 33 RE0/RD/AN5 RE1/WR/AN6 RC0/T1CKI RE2/CS/AN7 RC1/CCP2 OSC1/CLKIN RC3/SCK/SCL RC2/CCP1 13 39 OSC2/CLKOUT RC4/SDI PIC18Fxxx RD0/PSP0 RC5/SDO RD1/PSP1 RC6/TXD RD2/PSP2 RC7/RXD 15 16 17 18 23 24 25 26 R6 R4 R3 2k2 3 RA0/AN0 2k2 2 3V3 40 2k2 1 RD3/PSP3 RD4/PSP4 RD6/PSP6 RD5/PSP5 RD7/PSP7 8 7 6 29 5 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ZVM[^HYL[V KL[LYTPUL[OLHUNSLVMYV[H[PVU[V[OLULHYLZ[KLNYLL5V[OH]PUNKPZZLJ[LK[OLISVJR ^LJHUVUS`Z\YTPZLOV^[OPZWYLJPZPVU PZVI[HPULKMYVT[OLLUJVKPUNKPZJ[OH[ VUS`OHZZSV[Z;OLISVJRJVU[HPUZ[^V LSLJ[YVUPJZHZZLTISPLZ!VULPZ[OLTVK\SL [OH[JVUKP[PVUZ[OLZPNUHSMYVT[OLVW[PJHS KL[LJ[VY[OLV[OLYWYV[LJ[ZHNHPUZ[WV[LU- [PHSV]LYSVHKZ;OPZJVTWYPZLZV]LYJ\YYLU[ WYV[LJ[PVUPU[OLMVYTVMHYLZL[[HISL7VS`Z^P[JO®M\ZLHUKH=Z\YNLSPTP[LY ([VULLUKVM[OLISVJRPZ[OLVYHUNLKYP]L KPZJ([[OLV[OLYLUKPZ[OL91WV^LY PUW\[HUKKH[HV\[W\[JVUULJ[LY0[OHZH RL`[VH]VPKJVUM\ZPVU^P[OHZ[HUKHYK[LSLWOVULJHISL 0U[LYLZ[LKYLHKLYZ^PSSÄUK[OLJOHYHJ[LYPZ[PJZHUK]PL^ZVM[OLPUUHYKZVM[OLISVJR VU7OPSV»Z^LIWHNLZBDBD (070371-I) Web links [1] Philo’s NXT® motor internals: http://www.philohome.com/nxtmotor/nxtmotor.htm [2] Lego® 9 V Technic Motors characteristics compared: http://www.philohome.com/motors/motorcomp.htm 7-8/2007 - elektor electronics 133 KiCad: a high-level tool Electronic CAD available to all Rémy Halvick For the month of November, 2005, we had electronic CAD as the theme of Elektor magazine. The issue came with a free DVD packed with software, most of it operating as a Windows demo version. One of the programs stood out due to several unique features. Actually, KiCad is a software package distributed for free under a GPL license, operating in Linux, Windows and Mac OS X environments. As an added treat, this marvel is available in a remarkable number of languages! ;OPUNZOH]LNYLH[S`JOHUNLKZPUJL[OL[PTL^OLULSLJ[YVUPJZOVII`PZ[ZWYVMLZZPVUHSHUKVYHTH[L\YWLLYLKV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YPHS^OPJO^PSSOLSW`V\^P[O`V\YZOVWWPUNLZWLJPHSS`PM`V\ L_WVY[P[[VHZWYLHKZOLL[PUVYKLY[VVW[PTPZLZ\WWS`ZV\YJLZ 7-8/2007 - elektor electronics Figure 1. KiCad is project-based, just like similar products on the market. Figure 2. EeSchema: easy schematic capture. Figure 3. If you haven’t found the component you need on the Internet, there is nothing to stop you from designing it with Libedit! 135 [\HSTLU\Z^P[OVULYPNO[TV\ZLJSPJR;OH[PZVULVM[OLZ[YVUN WVPU[ZVM2PJHK^OPJOI`WYVWVZPUN[OL[VVSZH[[OL[PTL[OL`HYL ULLKLKTHRLZP[WVZZPISL[VWYLZLY]LHJSLHYHUKLHZ`[VNYHZW PU[LYMHJL5V[OPUNSPRL[OVZLOLH]`^LPNO[Z^P[O[OLPYKYLHKM\SS` JS\[[LYLK\ZLYPU[LYMHJLHSTVZ[PTWVZZPISL[VTHZ[LYI`HU`VUL ^OVPZUV[HZWLJPHSPZ[;OLZLJVU[L_[\HSJVTTHUKZHYLKLWLUKLU[VU[OLWHY[`V\JOVVZL[VJSPJRVU\ZPUN[OLYPNO[I\[[VU-VY L_HTWSLJSPJRPUNVUHJVTWVULU[VWLUZ[OLMVSSV^PUNWVZZPIPSP[PLZ!TV]LVYPLU[LKP[JVW`VYKLSL[L[OLJVTWVULU[MYVU[YLHY aVVTH\[VM\UJ[PVUYLJHSJ\SH[L[OLKYH^PUNZLSLJ[[OLZJHSL;OL TLU\PZHKHW[LKKLWLUKPUNVU^OL[OLY`V\JSPJRLKVUHJVTWVULU[H^PYLH[L_[ÄLSKL[J ;OLTV\ZLHSZVTHRLZP[WVZZPISL[VKPZWSH`HaVUL[OH[`V\^PSS ZLSLJ[I`JSPJRPUN^P[O[OL^OLLS!^P[OV\[HKV\I[LMÄJPLU[HUK WYHJ[PJHS ;OLZ[H[\ZIHYH[[OLIV[[VTVM[OL^PUKV^NP]LZ`V\[OLMVSSV^PUNPUMVYTH[PVU!aVVTMHJ[VYHIZV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\Y LU[PYLIVHYK(SS[OH[YLTHPUZPZ[VÄUPZOPUTHU\HSTVKLVY[V TV]LHML^JVTWVULU[ZHUKYLYV\[L[OLV]LYHSSWYVQLJ[4HU\HS YV\[PUNPZHJJVTWSPZOLKVMJV\YZL^P[O[OLTV\ZLHUK`V\^PSS X\PJRS`UV[PJL[OH[7*)5L^RUV^ZOV^[VWSHJL`V\Y[YHJLZPUH ^LSSKPZJPWSPULKMHZOPVU^P[OV\[SHIVYPV\ZS`KLÄUPUN[OLZTHSSLZ[ JOHUNLPUVYPLU[H[PVU+PZWSH`PUN[OLYH[Z»ULZ[KZLL-PN\YL LUHISLZX\PJRHUKYLSPHISL^VYR0MZ[YHWZHYLYLX\PYLK[OL`^PSSIL ZOV^UVU[OL[YHJLZVU[OLJVTWVULU[SH`LYPUYLKVU-PN\YL 6UJL[OLYV\[PUNOHZILLUÄUPZOLK`V\JHUHKKJLU[YPUN[HYNL[Z KPTLUZPVUPUNHUKHU`V[OLYNYHWOPJZZ\JOHZHSVNVJVW`YPNO[ Z`TIVSL[J Figure 7. The rats’ nest in white lines. Internet links [1] Kicad 1 homepage www.lis.inpg.fr/realise_au_lis/kicad/index.htmlx [2] Kicad 2 hmepage iut-tice.ujf-grenoble.fr/kicad/index.html [3] An active group! http://groups.yahoo.com/group/kicad-users/ [4] Libraries, user guides http://www.kicadlib.org/ [5] KiCADWiki http://kicad.bokeoa.com/wiki/index.php/Main_Page [6] Utilities http://www.rohrbacher.net/kicad/quicklib.php [7] Goodies from Brazil: footprints, utilities, etc. (^PZLWYLJH\[PVUJVUZPZ[ZVMJHYY`PUNV\[H+9*JOLJRPUVYKLY [VLUZ\YL[OH[UVYV\[PUNLYYVYVYZOVY[JPYJ\P[Z[PSSL_PZ[Z(SS[OH[ PZSLM[PZMVY`V\[VKVPZ[VWYPU[VYWSV[[VZ[HY[^P[OVUWHWLYPU VYKLY[VKL[LYTPUL[OLMHJ[VYVM[OLWYLJPZLZJHSPUNZL[[PUNP[[V [OLZJHSLYLX\LZ[LKI``V\YWYPU[LY@V\JHU[OLUWYPU[H[YHUZWHYLU[[VPZVSH[L`V\Y0*VY[VNLULYH[L[OLÄSLZYLX\LZ[LKI``V\Y Z\WWSPLY6MJV\YZLWYVMLZZPVUHSZTH`KLTHUKT\JOTVYLMYVT 2P*HK"HJLY[HPUU\TILYVMJVTWHUPLZHYLHSYLHK`\ZPUNP[HYV\UK [OL^VYSK http://www.reniemarquet.cjb.net/kicad.htm [8] KiCAD, from the professional point of view http://xtronics.com/reference/kicad.html [9] Developers http://developer.berlios.de/projects.kicad [10] Kicad hosted in a free world http://kicad.sourceforge.net/en/index.shtml [11] Kicad, from the Russian point of view. 0UJVUJS\ZPVU http://ru.wikipedia.org/wiki/Kicad 2P*HKPZHYLHS^PUKMHSSMVY[OLJYLH[P]LLSLJ[YVUPJZMHUZHTVUN`V\ 0[[O\ZILJVTLZWVZZPISL[VJYLH[LL_JOHUNLHUKTVKPM`ZJOLTH[PJZHUKWYPU[LKJPYJ\P[IVHYKKLZPNUZH[^PSS5VTVYLZLHYJOPUN MVYHQHJRJVUULJ[VY^P[O\UVI[HPUHISLWSHJLTLU[VYºI\[JOLYPUN» HJPYJ\P[PUVYKLY[VHKHW[P[L]LYZVZSPNO[S`>P[O2P*HK`V\OH]L [V[HSMYLLKVTLZWLJPHSS`PMHZ^LOVWLLSLJ[YVUPJTHNHaPULZW\ISPZOTVYLVYSLZZÄUHSPZLK]LYZPVUZVMZJOLTH[PJZHUKVY7*)ZVM WYVWVZLKWYVQLJ[ZVU[OL0U[LYUL[YH[OLY[OHUHÄ_LK7+-;OH[ ^V\SKZPNUPM`[OH[HU`VULHUKL]LY`VULJHUHKHW[JVU]LY[VYL]LU [YHUZMVYT[OLTH[^PSSTH`IL^P[OHZPT\SH[VYPU[OLM\[\YL&)\[ O\ZOUV[OPUNOHZILLUKVULVU[OH[`L[)L[[LY`L[ILHZZ\YLK [OH[PUJHZLVMWYVISLTZOLSW^PSSILH]HPSHISL[V`V\YHWPKS`VU [OL\ZLY»ZMVY\TSPURBD (060373-I) 7-8/2007 - elektor electronics Figure 8. The main icons on a large scale and in low resolution (the originals are a standard size, 16 x 16 pixels). 137 Football with Robots 0U[OPZ:\TTLY*PYJ\P[ZPZZ\L^P[OYVIV[ZHZ P[Z[OLTL^LJHUOHYKS`HMMVYK[VV]LYSVVR [OL9VIV*\W;OL9VIV*\WPZHJVSSLJ[P]L PU[LYUH[PVUHSWYVQLJ[^P[O[OLVIQLJ[P]LVM MVZ[LYPUNYLZLHYJOPUHY[PÄJPHSPU[LSSPNLUJL YVIV[PJZHUKYLSH[LKÄLSKZ-VV[IHSSOHZ ILLUZLSLJ[LKHZ[OLIHZPZHUK[OL\S[PTH[LVIQLJ[P]LPZ[VOH]LH[LHTVMM\SS` H\[VUVTV\ZO\THUVPKYVIV[ZPU[OH[ JHUKLMLH[[OL^VYSKMVV[IHSSJOHTWPVUZ ;OL=PZPVUJHTLYHZHYL[OLL`LZVM[OL YVIV[ ;OL YVIV[ MPS[LYZ [OL PUJVTPUN PTHNLZ \ZPUN JVSV\Y [V YLJVNUPZL [OL IHSS[OLNVHSZ[OLJVYULYWVZ[ZHUKV[OLY YVIV[Z;OLJHTLYHH[[OLMYVU[OLSWZ^P[O WYLJPZL VYPLU[H[PVU ;OL YVIV[ \ZLZ [OL VTUPKPYLJ[PVUHSJHTLYH^OPJOPZVYPLU[LK \W^HYK[V^HYKHZWLJPHSTPYYVY[VRLLWHU L`LVUP[ZZ\YYV\UKPUNZZVP[JHUZLL^OLYL P[PZHUK^OH[PZOHWWLUPUNHYV\UKP[ ;OL73*JVU[YVSSLYTVUP[VYZ[OLZ[H[\ZVM -V\Y SLHN\LZ HYL VWLU [V WHY[PJPWHU[Z! [OLZPT\SH[PVUSLHN\L[OLZTHSSHUKTPK ZPaLKSLHN\L[OLMV\YSLNNLKSLHN\LHUK [OLO\THUVPKSLHN\L([LHTMYVT7OPSPWZ PZ WHY[PJPWH[PUN PU [OL TPKZPaL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LÄLSK;OLYVIV[ ZOVV[Z H[ [OL NVHS HZ ZVVU HZ [OL NVHS VWLUPUNPZSHYNLLUV\NO/V^L]LY^PUUPUN[HRLZTVYL[OHUQ\Z[ÄYPUNVMMOHYK ZOV[Z"ZWLLKHUK[HJ[PJZHYLH[SLHZ[LX\HSS` PTWVY[HU[ (070359-1) elektor electronics - 7-8/2007 7-8/2007 - elektor electronics 139 Puzzle creator: Géry Szcepanski In this bumper double issue of Elektor, staunch supporters of our monthly Hexadoku puzzle (their numbers growing steadily) find themselves confronted with a horrific attack on patience, intuition and intelligence, by a monster puzzle baptised ‘Alphanumski’ by its creator. A R 3 D D 6 L 3 T 1 Q O H E G 7 0 S L P 6 G Q N B J I E C Y I Z S K 1 B J X T S O V 5 I L M Q A D O 8 U 2 Y 9 V 8 C 2 4 5 M G R 0 B 6 0 E T W B Q 9 N X F 3 1 J 3 O G W E I L T K A 6 U V I P D J N G 8 W 1 5 3 V 7 9 N K U P 2 O D 6 Y Q R The method of solving the 36x36 cell Alphanumski puzzle shown here is basically the same as for a 9x9 cell Sudoku, a 16x16 cell Hexadoku or even last year’s 25x25 cell Alphadoku. This month we’re using all letters of the alphabet (A through Z) and all numerals (0 through 9) to be entered in the cells that make up lines (1x36 horizontally), columns (1x36 vertically) and boxes (6x6). In Alphanumski, all letters of the alphabet (A through Z) and all numerals 0 through 9 should occur only once in every line (1x36), every column (1x36) and every box (6x6; identified by red outlines and a background colour). A number of clues are given in the puzzle and these represent the start situation. All correct entries received for the puzzle go into a draw for a main prize and three lesser prizes. All you need to do is send us the combination of seven letters and numerals in the grey boxes. The puzzle is also available as a free download from our website.. (070151-I) 140 1 Z W 5 G J A 2 7 0 K U Y H Y 2 N 9 I Q 8 V 4 5 D 3 L N E X 7 R 0 S K T M A Y 9 F 1 U E G B 6 Z 4 8 5 D I N U L 2 0 P H 8 D 9 4 I P L 5 M A D G Q K T F O 2 U S E Y N 3 H 2 Y R G H V I 1 C W Z B 8 Q Z T E D N O L F 4 2 5 X T X 3 L 0 P A A 7 6 V N J Q U 4 V Y 0 N B S T L V Q F 3 6 7 I W P A R F D 0 C 3 6 P U J Y H K 5 Z M F 2 F J G 0 P 8 O W H N 6 D U B M C X R 4 E Y S X 9 2 K 7 A Z A Q W P U Y 2 4 H 2 M D B E 1 T X S 6 9 U 0 I K V F L J A I D O 8 H Y R 1 J R J 3 M B B S Q X W P O I 5 T 6 S 7 C 2 A K L L 1 7 2 H V K J 3 D Y T W 6 Q 8 9 7 W D G P L 6 E 1 0 3 2 Q 8 U N R 4 O A I B X elektor electronics - 7-8/2007 brain wrecker for the holidays Y M C D 1 B J A O 0 S 9 L 7 8 I U X 2 I J G 6 X S O I F P L R T B 3 W Z E G W 7 T 2 A H Y 4 9 D 0 5 U F Q L 8 E 0 N X 9 S J 1 R C P H B G E 8 Q 5 L I 0 9 7 6 R W F T R N P 7 X E 0 I L 3 Y N A F O K D 1 J Z C V H Y 4 D K U 2 I G O D S 2 8 M B A O B 9 2 1 X E Z M L C 9 A Z N G 2 Y X V 0 5 L M E P T D H S 4 1 H J O A M W C Y R 8 F 7 K S 2 5 T G M H E X A D O K U V L K 0 B 5 9 1 6 J C Z O 7 2 P A R S F T Q O W 0 1 6 2 7 U J G B N X E C 4 S N G I P 8 5 X W L 8 L 5 Y 9 G 3 P 7 4 D Z V T J Z O 2 U E K 0 M C B 3 S X 1 W 6 9 Y 4 0 I R X O H U A 2 5 Q W S 7 N R P 2 X V 5 H 8 I Z 0 N R 9 M L G 3 J W B K U D T S U 6 7 3 F 0 H N K A Q Y 9 G S B P F N 1 A 2 Y 7 K X 0 D V C M 6 5 7-8/2007 - elektor electronics L T H J N C 4 D W 8 H Q M 5 L T 6 E 2 U J G 9 1 X P C I F G E 8 A Z S J 5 2 Y 3 K 1 B N 4 W M 6 0 A Q 0 C 5 U X L 8 D N O 3 S H T M J W G E R Y Solve Alphanumski and win! Correct solutions received enter a prize draw for an E-blocks Starter Kit Professional worth £248.55 and three Elektor Electronics SHOP Vouchers worth £35.00 each. We believe these prizes should encourage all our readers to participate! Participate! Please send your solution (the numbers in the grey boxes) by email to: [email protected] Subject: Alphanumski 07-2007 (please copy exactly). Alternatively, by fax or post to: Elektor Electronics Hexadoku Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom. Fax (+44)(0)208 2614447 The closing date is 1 September 2007. The competition is not open to employees of Segment b.v., its business partners and/ or associated publishing houses. Prize winners The solution of the May 2007 Hexadoku is: B789E. The E-blocks Starter Kit Professional goes to: Michele Casartelli (I). An Elektor SHOP voucher worth £35.00 goes to: David Meiklejohn (AUS) ; Tomas Bakke (N) and Franz Klein (UK). Congratulations everybody! 141 ELEKTORSHOWCASE To book your showcase space contact Huson International Media Tel. 0044 (0) 1932 564999 Fax 0044 (0) 1932 564998 ATC SEMITEC LTD www.atcsemitec.co.uk 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: 01606 871680 Fax: 01606 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 £15.00. BAEC http://baec.tripod.com "The British Amateur Electronics Club Archive Website. Archiving extracts from 140+ Newsletters from 19662002. Currently have interesting and useful selected articles from 12 Newsletters. Also a section about built electronics projects with schematics and photos. Plus useful info., downloads and links. NO ADVERTS!" BETA LAYOUT www.pcb-pool.com Beta layout Ltd Awardwinning site in both English and German offers prototype PCBs at a fraction of the cost of the usual manufacturer’s prices. EasyDAQ FUTURLEC 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, 4DIO & 4 onboard relays capable of switching 240V@10A. With Labview, VC & VB examples - £60 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. EASYSYNC LONDON ELECTRONICS COLLEGE http://www.easysync.co.uk EasySync Ltd sells a wide range of single and multiport USB to RS232/RS422 and RS485 converters at competitive prices. 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. 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 MODular ElecTRONics FIRST TECHNOLOGY TRANSFER LTD. MQP ELECTRONICS http://www.ftt.co.uk/PICProTrng.html Microchip Professional C and Assembly Programming Courses. The future is embedded. Microchip Consultant / Training Partner developed courses: • Distance learning / instructor led • Assembly / C-Programming of PIC16, PIC18, PIC24, dsPIC microcontrollers • Foundation / Intermediate 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. 142 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 FUTURE TECHNOLOGY DEVICES DECIBIT CO.LTD. www.modetron.com • Plug and Program • FREE application s/w • Hobbyist ease-of-use • Professional finish with enclosure and LEXAN faceplate • We will design and brand your custom application • Growing range of PSU’s, i/o modules, displays and microcontrollers 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 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 elektor electronics - 7-8/2007 products and services directory PCB WORLD SYTRONIC TECHNOLOGY LTD USB INSTRUMENTS http://www.pcbworld.org.uk World-class site: Your magazine project or prototype PCB from the artwork of your choice for less. Call Lee on 07946 846159 for details. Prompt service. www.m2mtelemetry.com Supplier of wireless modules and accessories for remote monitoring M2M applications. • GSM/GPRS TCP/IP modules • Embedded GSM/GPRS modem • Development Kits • GPS modules • GSM/GPS antennas • Adapter cables Online ordering facilities. Tel: 01728 685802 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. 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 SOURCEBOOST TECHNOLOGIES http://www.sourceboost.com Next generation C compiler and development products at highly affordable prices: • C, C++, and Basic compilers for PIC12, PIC16, PIC18 • Modern IDE, with PIC simulator, source level debugger and virtual devices. • RTOS for PICmicro. • PIC based controller and Development boards. • Download and try for Free from http://www. sourceboost.com 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 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. 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. www. elektorelectronics. co.uk 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! 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 ............................................................................................................................................................................................. ........................................................................................................................................................................................................................................... ........................................................................................................................................................................................................................................... ........................................................................................................................................................................................................................................... ........................................................................................................................................................................................................................................... 7-8/2007 - elektor electronics 143 & !"' "! %! %#! % %$( – Thomas Gosling, 38, electronics enthusiast – Cheaper than 11 issues from the newsstand Subscribers get up to "! on special Elektor products As a welcome gift you get a free % 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 ^^^LSLR[VYLSLJ[YVUPJZJV\RZ\IZ ;LS 144 elektor electronics - 7-8/2007 Elektor Electronics (Publishing) Regus Brentford 1000 Great West Road Telephone +44 208 261 4509 Brentford TW8 9HH Fax +44 208 261 4447 United Kingdom Email: [email protected] Order now using the Order Form in the Readers Services section in this issue. More information on www.elektor-electronics.co.uk CD-ROM BESTSELLERS 1 Ethernet Toolbox This CD-ROM contains all essential information regarding Ethernet interfaces! To help you learn about the Ethernet interfaces, we have compiled a collection of all articles on this topic that have appeared in Elektor Electronics and complemented them with additional documentation and links to introductory articles on Ethernet interfaces. It includes a collection of data sheets for dedicated Ethernet interface ICs from many different manufacturers. The CD-ROM provides a wealth of information about connectors and components for the physical layer (PHY) and specific software tools for use with the Ethernet (Software). Microcontroller Basics Microcontrollers have become an indispensable part of modern electronics. They make things possible that vastly exceed what could be done previously. Innumerable applications show that almost nothing is impossible. There’s thus every reason to learn more about them. This book offers more than just a basic introduction. It clearly explains ISBN 978-0-905705-67-5 the technology using various microcontroller 230 Pages circuits and programs written in several different £18.70 (US$ 33.70) programming languages. In the course of the book, the reader gradually develops increased competence in converting his or her ideas into microcontroller circuitry. NEW Visual Basic for Electronics Engineering Applications ISBN 978-90-5381-214-3 | £18.90 (US$ 37.90) Elektor 2006 2 This CD-ROM contains all editorial articles published in Elektor Electronics Volume 2006. Using the supplied Acrobat Reader program, articles are presented in the same layout as originally found in the magazine. All free, printed, supplements our readers got last year, like the Visual Basic, C and i-TRIXX booklets are also contained on the CD. The Elektor Volume 2006 CD-ROM has a rather different look and feel than previous editions. It’s gone through a makeover in more than one way! ISBN 978-90-5381-207-5 | £16.25 (US$ 28.75) Robotics A large collection of datasheets, software tools, tips, tricks and Internet links to assorted robot constructions and general technical information. All aspects of modern robotics are covered, from sensors to motors, mechanical parts to microcontrollers, not forgetting matching programmingtools and libraries for signal processing. 3 This book is targeted towards those people that want to control existing or home made hardware from their computer. After familiarizing yourself with Visual Basic, its development environment and the toolset it offers are discussed in detail. Each topic is accompanied by clear, ready to ISBN 978-0-905705-68-2 run code, and where necessary, schematics 476 Pages are provided that will get your projects up to £27.50 (US$ 51.50) speed in no time. BESTSELLING BOOKS Top-5 1 Visual Basic for Electronics Engineering Applications ISBN 978-0-905705-68-2 £27.50 (US$ 51.50) 2 Microcontroller Basics ISBN 978-0-905705-67-5 £18.70 (US$ 33.70) 3 PC-Interfaces under Windows ISBN 978-0-905705-65-1 £25.95 (US$ 52.00) 4 Modern High-end Valve Amplifiers ISBN 978-0-905705-63-7 £25.95 (US$ 52.00) 5 308 Circuits ISBN 978-0-905705-66-8 £18.20 (US$ 37.00) ISBN 978-90-5381-179-5 | £12.05 (US$ 21.25) More bestsellers on www.elektor-electronics.co.uk Order o www.elektor-el Order now using the Order Form in the Readers Services section in this issue. Stand-Alone OBD2 Analyser Software Defined Radio (June 2007) (May 2007) Kit of parts, incl. case, cable, front panel foil and mounting materials Ready-populated and tested board 070038-72 070039-91 £ 51.70 / US$ 97.50 £ 72.45 / US$ 126.50 Free downloads: Speedmaster (May 2007) Online simulator examples (070038-21) The circuit voted winner of the R8C Design Competition! Manual (070038-W1) Ready-populated and tested board (excl. R8C module) 070021-91 See www.elektor-electronics.co.uk No. 367 JULY/AUGUST 2007 Dual Battery 070343-1 PCB, bare £ 51.70 / US$ 97.45 £ $ 5.20 9.75 Fast Charger for NiMH Batteries 070213-1 PCB, bare www.thepcbshop.com Lithium Charger 070273-1 PCB, bare 8.90 12.95 5.20 15.15 9.75 28.50 6.90 12.95 Low2 Cost USB Demo Board 060342-81 CD-ROM, project software 060342-41 PIC18F4550, programmed LPC 900 Programmer 070084-1 PCB, bare MotoBox 070129-1 PCB, bare 070129-41 PIC16F628-04/P, programmed www.thepcbshop.com 14.80 27.95 Propeller Prototyping Board for BoeBot 070275-1 PCB, bare PCB, bare www.thepcbshop.com 5.20 9.75 10.00 18.85 72.45 126.50 5.20 9.75 060378-1 PCB, bare 060378-41 PIC18F2550I/SP, programmed 060287-1 PCB, bare, with programmed microcontroller 060287-41 EP900LC only, programmed 050276-1 PCB, bare www.thepcbshop.com 15.50 29.25 11.00 20.75 P&P only P&P only www.thepcbshop.com Speedmaster 070021-91 Ready-populated and tested board (excl. R8C module) 51.70 97.45 Seismograph 060307-1 PCB, bare 060307-11 CD-ROM, project software 060307-41 ATTiny45,programmed www.thepcbshop.com 5.20 9.75 10.35 19.50 ATtiny as RDS Signal Generator 060253-41 Attiny2313-20, programmed 8.25 5.20 15.50 9.75 7.60 5.20 5.20 14.25 9.75 9.75 5.20 9.75 Linux Oscilloscope 060241-11 CD-ROM, project software 22.75 9.75 18.75 Thank your for Flying USB FliteSim Magnetometer Coil Clinic 060195-1 PCB, bare 060195-11 CD-ROM, project software 060195-41 Atmega48-20PU, programmed 070039-91 Ready-populated and tested board 070039-11 CD-ROM, project software 9.75 31.15 www.thepcbshop.com 12.00 5.20 10.00 No. 365 MAY 2007 Software Defined Radio 5.20 16.50 No. 366 JUNE 2007 2.4 GHz WiFi Spectrum Analyser 070040-1 PCB, bare 070040-11 CD-ROM, Linux & Windows software 060044-1 PCBs, bare; set for TX and RX 060044-11 CD-ROM, project software 060044-41 ATtiny15PC, programmed Universal JTAG Adaptor Stereo Robot Ears 060040-1 PCB, bare 060040-81 CD-ROM, project software 060040-41 PIC16F88, programmed Whistles from on high 20.75 Serial Interface for the Propeller 070276-1 free download 070038-72 Kit of parts, incl. case, cable, front panel foil and mounting materials 51.70 97.50 070038-21 Online simulator examples free download 070038-W1 Manual free download 11.00 Satnav for Robots 070350-81 CD-ROM, project software 070350-41 ATmega32, programmed 060241-W Program listing Stand-Alone OBD2 Analyser 4.20 7.80 10.30 10.30 5.20 16.90 19.50 19.50 9.75 31.85 No. 364 APRIL 2007 Battery Charge-n-Check 050073-1 050073-2 050073-11 050073-41 PCB, bare, main board PCB, bare, display board CD-ROM, project software ST7FMC2S4, programmed Elektor Electronics (Publishing) Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 (0) 208 261 4509 Fax: +44 (0) 208 261 4447 Email: [email protected] nline at ectronics.co.uk Due to practical constraints, final illustrations and specifications may differ from published designs. Prices subject to change. See www.elektor-electronics.co.uk for up to date information. Kits & Modules Wireless USB in miniature (March 2007) g-Force on LEDs (April 2007) iDwarf -168 Transmitter module (built & tested) PCB set, bare, incl. 2 MMA7260 sensors, BDM cable parts 050402-91 £ 24.10 / US$ 45.45 060297-71 £ 10.00 / US$ 18.85 iDwarf Node Board (built & tested) USB Stick with ARM and RS232 050402-91 £ 17.20 / US$ 32.45 (November 2006) Assembled and tested board iDwarf Hub Board (built & tested) 050402-93 £ 17.20 / US$ 32.45 g-Force on LEDs 060297-71 PCB set, incl. 2 MMA7260 sensors, BDM cable parts 060297-11 CD-ROM, project software 060006-91 £ 79.90 / $ 149.95 £ $ 10.00 5.20 18.85 9.75 Programmer for Freescale 68HC(9)08 060263-1 PCB, bare PCB, bare www.thepcbshop.com Very Simple Clock 060350-1 PCB, bare www.thepcbshop.com E-blocks Light Chaser Squared 075032-1 PCB, bare www.thepcbshop.com No. 363 MARCH 2007 AVR drives USB 060276-1 PCB, bare 060276-11 CD-ROM, project software incl. source code 060276-41 ATmega32-16PC, programmed 10.00 5.20 8.95 18.85 9.75 16.85 8.30 24.10 17.20 17.20 15.60 45.45 32.45 32.45 Wireless USB in Miniature 050402-1 050402-91 050402-92 050402-93 PCB, bare, iDwarf prototyping board iDwarf -168 Transmitter module (built & tested) iDwarf Node Board (built & tested) iDwarf Hub Board (built & tested) Mobile Phone LCD for PC 060184-1 PCB, bare 060184-11 CD-ROM, project software 060184-41 ATmega16-16PC, programmed www.thepcbshop.com 5.20 9.75 8.95 16.85 Scale Deposit Fighter 070001-1 PCB, bare www.thepcbshop.com No. 362 FEBRUARY 2007 … 3, 2, 1 Takeoff! 050238-1 050238-2 Transmitter PCB, bare Receiver PCB, bare www.thepcbshop.com www.thepcbshop.com MP3 Preamp 060237-1 PCB, bare 5.20 9.75 122.90 232.50 No. 361 JANUARY 2007 Sputnik Time Machine 050018-1 PCB 050018-11 CD-ROM, project software (incl. source code) 050018-41 AT89C2051, programmed www.thepcbshop.com 5.20 9.75 3.40 6.45 Very Simple Clock 060350-1 PCB 060350-11 CD-ROM, project software (incl. source code) 060350-41 PIC16F628-20, programmed www.thepcbshop.com 5.20 9.75 5.50 10.35 FPGA Course (8) 060025-8-1 Software (incl. source code) 5.20 9.75 No. 360 DECEMBER 2006 Shortwave Capture 030417-1 PCB, bare (receiver board) 030417-2 PCB, bare (control & display boards) 030417-41 AT90S8515-8PC, programmed www.thepcbshop.com www.thepcbshop.com 11.40 21.45 No. 359 NOVEMBER 2006 USB Stick with ARM and RS232 060006-1 060006-41 060006-91 060006-81 PCB, bare AT91SAM7S64, programmed Assembled & tested board CD-ROM, all project software 11.00 20.75 27.60 51.95 79.90 149.95 5.20 9.75 No. 358 OCTOBER 2006 PIC In-Circuit Debugger/Programmer 050348-1 PCB 050348-41 PIC16F877, programmed 050348-71 Kit, incl. PCB, controller, all parts 5.20 17.90 34.50 www.thepcbshop.com Products for older projects (if available) may be found on our website www.elektor-electronics.co.uk www.thepcbshop.com 35.50 66.95 home construction = fun and added value A Telling Way of Telling the Time 050311-1 PCB, bare 050311-31 CPLD, programmed 060025-9-11 CD-ROM, course software incl. source code Explorer-16 Value Pack 060280-91 Four components packaged together in a single box www.thepcbshop.com A Simple Mains Inverter 060171-1 FPGA Course (9) 9.75 33.75 64.95 INFO & MARKET SNEAK PREVIEW FREE LED DRIVER with every issue! With preassembled components! Experiment with white LEDs! Equipment Test: audio amplifier modules Home construction of power amplifiers remains a popular activity among audiophile electronics enthusiasts. Besides the high-end audio construction projects Elektor has become famous for, you may also consider using one of the power amplifier modules available commercially either ready-built or as a kit. These modules require only a power supply and an enclosure to make an audio amp. We have collected a number of interesting AF power modules and put them through their paces in our audio lab. The test results are presented in the September issue. GPS Tracker Ten years ago a technical novelty, now dead common: positioning systems using GPS (Global Positioning System). GPSbased navigators are extremely popular, especially among motorists. However, a GPS receiver is not just suitable for determining one’s own location on the globe, but also that of an object, for example, your car! Elektor’s GPS Tracker was developed specifically for that purpose. It’s a small circuit comprising a GSM modem, a GPS receiver and a miniature antenna. When the GSM modem is texted (by SMS), the receiver will return its current coordinates. This allows you to track the object the circuit is attached to. RESERVE YOUR COPY NOW! UK mainland subscribers will receive the magazine between 18 and 21 August 2007. The September 2007 issue goes on sale on Thursday 23 August 2007 (UK distribution only). Article titles and magazine contents subject to change, please check www.elektor-electronics.co.uk. NEWSAGENTS ORDER FORM SHOP SAVE / HOME DELIVERY Please save / deliver one copy of Elektor Electronics 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 Electronics is published on the third Thursday of each month, except in July. Distribution S.O.R. by Seymour (NS). .elektor-electronics.co.uk www.elektor-electronics.co.uk www.elektor-electronics.co Elektor Electronics on 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 downloads, circuit boards, programmed ICs and corrections and updates if applicable. Complete magazine issues may also be downloaded. In the Elektor Electronics 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 Electronics website: •Electronics news and Elektor announcements •Readers Forum •PCB, software and e-magazine downloads •Surveys and polls •FAQ, Author Guidelines and Contact 148 elektor electronics - 7-8/2007 07/08-2007 Order Form Please supply the following. For PCBs, front panel foils, EPROMs, PALs, GALs, microcontrollers and diskettes, state the part number and description; for books, state the full title; for photocopies of articles, state full name of article and month and year of publication. PLEASE USE BLOCK CAPITALS. Price each Description Qty. Total METHOD OF PAYMENT (see reverse before ticking as appropriate) NEW NEW NEW 309 Circuits Formula Flowcode Buggy CD-ROM Ethernet Toolbox £ 19.95 Bank transfer £ 85.00 Cheque £ 18.90 (UK-resident customers ONLY) Giro transfer CD-ROM Elektor 2006 £ 16.25 Visual Basic for Electronics Engineering Applications £ 27.50 Expiry date: ................................................. Verification code: ......................................... SWITCH ONLY: Start date: .................................................... Issue number: .............................................. Prices and item descriptions subject to change. The publishers reserve the right to change prices without prior notification. Prices and item descriptions shown here supersede those in previous issues. E. & O.E. Sub-total P&P Total paid Tel. Email Date – – 2007 Signature 07/08-2007 Order Form *USA and Canada residents may (but are not obliged to) use $ prices, and send the order form to: Old Colony Sound Lab P.O. Box 876, Peterborough NH 03458-0876. Tel. (603) 924-6371, 924-6526, Fax: (603) 924-9467 Email: [email protected] EL07/08 Subscription Elektor Electronics (Publishing) Tel.: +44 208 261 4509 Fax: +44 208 261 4447 www.elektor-electronics.co.uk. [email protected] Address + Post code Please send this order form to * (see reverse for conditions) Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Name Order Code Yes, I am taking out an annual subscription to Elektor Electronics and receive a free 1GB MP3 player. METHOD OF PAYMENT (see reverse before ticking as appropriate) Bank transfer Cheque (UK-resident customers ONLY) Giro transfer I would like: Standard Subscription (11 issues) Subscription-Plus (11 issues plus the Elektor Volume 2007 CD-ROM) cribers who have not held a subscription * Offer available to Subscribers to Elektor Electronics during the last 12 months. Offer subject to availability. See reverse for rates and conditions. Expiry date: ................................................. Verification code: ......................................... SWITCH ONLY: Start date: .................................................... Name Issue number: .............................................. Address + Post code Please send this order form to Elektor Electronics (Publishing) Tel. Email Date * cross out what is not applicable EL07/08 – – 2007 Signature Regus Brentford 1000 Great West Road Brentford TW8 9HH United Kingdom Tel.: +44 208 261 4509 Fax: +44 208 261 4447 www.elektor-electronics.co.uk. [email protected] ORDERING INSTRUCTIONS, P&P CHARGES Except in the USA and Canada, all orders, except for subscriptions (for which see below), must be sent BY POST or FAX to our Brentford address using the Order Form overleaf. On-line ordering: http://www.elektor-electronics.co.uk Readers in the USA and Canada may (but are not obliged to) send orders, except for subscriptions (for which see below), to the USA address given on the order form. Please apply to Old Colony Sound for applicable P&P charges. Please allow 4-6 weeks for delivery. Orders placed on our Brentford office must include P&P charges (Priority or Standard) as follows: UK: £4.00 Europe: £5.00 (Standard) or £7.00 (Priority) Outside Europe: £8.00 (Standard) or £12.00 (Priority) HOW TO PAY All orders must be accompanied by the full payment, including postage and packing charges as stated above or advised by Customer Services staff. Bank transfer into account no. 40209520 held by Elektor Electronics (Publishing) / Segment b.v. with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. Cheque sent by post, made payable to Elektor Electronics (Publishing) / Segment b.v.. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics (Publishing) / Segment b.v. Please do not send giro transfer/deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA, Access, MasterCard, JCBCard and Switch cards can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. COMPONENTS Components for projects appearing in Elektor Electronics are usually available from certain advertisers in this magazine. If difficulties in the supply of components are envisaged, a source will normally be advised in the article. Note, however, that the source(s) given is (are) not exclusive. TERMS OF BUSINESS Delivery Although every effort will be made to dispatch your order within 2-3 weeks from receipt of your instructions, we can not guarantee this time scale for all orders. Returns Faulty goods or goods sent in error may be returned for replacement or refund, but not before obtaining our consent. All goods returned should be packed securely in a padded bag or box, enclosing a covering letter stating the dispatch note number. If the goods are returned because of a mistake on our part, we will refund the return postage. Damaged goods Claims for damaged goods must be received at our Brentford office within 10-days (UK); 14-days (Europe) or 21-days (all other countries). Cancelled orders All cancelled orders will be subject to a 10% handling charge with a minimum charge of £5·00. Patents Patent protection may exist in respect of circuits, devices, components, and so on, described in our books and magazines. Elektor Electronics (Publishing) does not accept responsibility or liability for failing to identify such patent or other protection. Copyright All drawings, photographs, articles, printed circuit boards, programmed integrated circuits, diskettes and software carriers published in our books and magazines (other than in third-party advertisements) are copyright and may not be reproduced or transmitted in any form or by any means, including photocopying and recording, in whole or in part, without the prior permission of Elektor Electronics (Publishing) in writing. Such written permission must also be obtained before any part of these publications is stored in a retrieval system of any nature. Notwithstanding the above, printed-circuit boards may be produced for private and personal use without prior permission. Limitation of liability Elektor Electronics (Publishing) shall not be liable in contract, tort, or otherwise, for any loss or damage suffered by the purchaser whatsoever or howsoever arising out of, or in connexion with, the supply of goods or services by Elektor Electronics (Publishing) other than to supply goods as described or, at the option of Elektor Electronics (Publishing), to refund the purchaser any money paid in respect of the goods. Law Any question relating to the supply of goods and services by Elektor Electronics (Publishing) shall be determined in all respects by the laws of England. January 2007 SUBSCRIPTION RATES FOR ANNUAL SUBSCRIPTION United Kingdom Surface Mail Rest of the World USA & Canada Airmail Rest of the World USA & Canada Standard £41.90 Plus £48.80 £54.50 US$ 95.50 £61.40 US$106.50 £68.90 US$120.00 £75.80 US$131.00 HOW TO PAY SUBSCRIPTION CONDITIONS Bank transfer into account no. 40209520 held by Elektor Electronics (Publishing) / Segment b.v. with ABN-AMRO Bank, London. IBAN: GB35 ABNA 4050 3040 2095 20. BIC: ABNAGB2L. Currency: sterling (UKP). Please ensure your full name and address gets communicated to us. The standard subscription order period is twelve months. If a permanent change of address during the subscription period means that copies have to be despatched by a more expensive service, no extra charge will be made. Conversely, no refund will be made, nor expiry date extended, if a change of address allows the use of a cheaper service. Student applications, which qualify for a 20% (twenty per cent) reduction in current rates, must be supported by evidence of studentship signed by the head of the college, school or university faculty. A standard Student Subscription costs £33.50, a Student SubscriptionPlus costs £40.40 (UK only). Please note that new subscriptions take about four weeks from receipt of order to become effective. Cancelled subscriptions will be subject to a charge of 25% (twentyfive per cent) of the full subscription price or £7.50, whichever is the higher, plus the cost of any issues already dispatched. Subsciptions cannot be cancelled after they have run for six months or more. Cheque sent by post, made payable to Elektor Electronics (Publishing) / Segment b.v.. We can only accept sterling cheques and bank drafts from UK-resident customers or subscribers. We regret that no cheques can be accepted from customers or subscribers in any other country. Giro transfer into account no. 34-152-3801, held by Elektor Electronics (Publishing) / Segment b.v. Please do not send giro transfer/ deposit forms directly to us, but instead use the National Giro postage paid envelope and send it to your National Giro Centre. Credit card VISA, Access, MasterCard, JCBCard and Switch cards can be processed by mail, email, web, fax and telephone. Online ordering through our website is SSL-protected for your security. January 2007 NEW ISBN 978-90-5381-214-3 £18.90 / US$ 37.90 Software Tools en Hardware Tips ' $#(#'!!''#(!#$&"($# &&#(&#(#(&'$!%,$) !&#$)(((&#(#(&'+* $"%!$!!($#$!!&(!'$#('($% ((*%%&#! ($&!(&$#'# $"%!"#(("+(($#!$)"# (($##!# '($#(&$)($&,&(!'$# (&#(#(&' )$" $ )!$'" "&"( )" ) ) $ )($" ( "& )*$!! (#!)'$!!($#$('('$&((&#(#(& '&$""#,&#("#)()&&'$!%,$)+(,$)&$+# %&$('( %&$*'+!($#$&"($#$)( $##($&'#$"%$##('$&(%,'!!,&#'% '$(+&($$!'$&)'+(((&#($(+& !!$($)"#('& !' &&#$+)'#(&&$&"#( &'&*''($##(''') ! ($&!(&$#')!'# )'6&#($& /...7&(:'($ 6&#($&:45 9#(8#$" ! -110.403/12.5 $'''# " $ %# INDEX OF ADVERTISERS ATC Semitec Ltd, Showcase. . . . . . . . . . . www.atcsemitec.co.uk . . . . . . . . . . . . . . . . . . 142 Number One Systems . . . . . . . . . . . . . . . www.numberone.com . . . . . . . . . . . . . . . . . . . . 60 Avit Research, Showcase. . . . . . . . . . . . . www.avitresearch.co.uk . . . . . . . . . . . . . . . . . 142 Nurve Networks . . . . . . . . . . . . . . . . . . . . www.xgamestation.com . . . . . . . . . . . . . . . . . 139 BAEC, Showcase . . . . . . . . . . . . . . . . . . . http://baec.tripod.com . . . . . . . . . . . . . . . . . . 142 Paltronix. . . . . . . . . . . . . . . . . . . . . . . . . . www.paltronix.com . . . . . . . . . . . . . . . . . . . . . . . 7 Beijing Draco . . . . . . . . . . . . . . . . . . . . . . www.ezpcb.com . . . . . . . . . . . . . . . . . . . . . . . 109 PCB World, Showcase . . . . . . . . . . . . . . . www.pcbworld.org.uk . . . . . . . . . . . . . . . . . . . 143 Beta Layout, Showcase . . . . . . . . . . . . . . www.pcb-pool.com. . . . . . . . . . . . . . . . . 139, 142 Peak Electronic Design. . . . . . . . . . . . . . . www.peakelec.co.uk . . . . . . . . . . . . . . . . . . . . . . 6 Bitscope Designs . . . . . . . . . . . . . . . . . . www.bitscope.com . . . . . . . . . . . . . . . . . . . . . . . 3 Pico. . . . . . . . . . . . . . . . . . . . . . . . . . . . . www.picotech.com . . . . . . . . . . . . . . . . . . . . . 109 Compact Control Design . . . . . . . . . . . . . www.compactcontrol.co.uk. . . . . . . . . . . . . . . . 39 Quasar Electronics . . . . . . . . . . . . . . . . . . www.quasarelectronics.com . . . . . . . . . . . . . . . 97 Decibit Co. Ltd, Showcase . . . . . . . . . . . . www.decibit.com . . . . . . . . . . . . . . . . . . . . . . 142 Robot Electronics, Showcase . . . . . . . . . . www.robot-electronics.co.uk. . . . . . . . . . . . . . 143 EasyDAC, Showcase . . . . . . . . . . . . . . . . www.easydaq.biz . . . . . . . . . . . . . . . . . . . . . . 142 Scantool . . . . . . . . . . . . . . . . . . . . . . . . . www.ElmScan5.com/elektor . . . . . . . . . . . . . . 139 Easysync, Showcase . . . . . . . . . . . . . . . . www.easysync.co.uk. . . . . . . . . . . . . . . . . . . . 142 Schaeffer AG . . . . . . . . . . . . . . . . . . . . . . www.schaeffer-ag.de . . . . . . . . . . . . . . . . . . . 109 Elnec, Showcase . . . . . . . . . . . . . . . . . . . www.elnec.com . . . . . . . . . . . . . . . . . . . . . . . 142 Showcase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142, 143 Eurocircuits . . . . . . . . . . . . . . . . . . . . . . . www.eurocircuits.com . . . . . . . . . . . . . . . . . . 139 SourceBoost Technologies, Showcase . . . www.sourceboost.com . . . . . . . . . . . . . . . . . . 143 First Technology Transfer Ltd, Showcase . www.ftt.co.uk . . . . . . . . . . . . . . . . . . . . . . . . . 142 Sytronic Technology Ltd, Showcase . . . . . www.m2mtelemetry.com . . . . . . . . . . . . . . . . 143 Future Technology Devices, Showcase . . . www.ftdichip.com . . . . . . . . . . . . . . . . . . . . . . 142 Tsien (UK) Ltd, Showcase . . . . . . . . . . . . www.componentbin.com . . . . . . . . . . . . . . 6, 143 Futurlec, Showcase . . . . . . . . . . . . . . . . . www.futurlec.com . . . . . . . . . . . . . . . . . . . . . . 142 Ultraleds, Showcase . . . . . . . . . . . . . . . . www.ultraleds.co.uk . . . . . . . . . . . . . . . . . . . . 143 Jaycar Electronics . . . . . . . . . . . . . . . . . . www.jaycarelectronics.co.uk . . . . . . . . . . . . . . . . 2 USB Instruments, Showcase . . . . . . . . . . www.usb-instruments.com . . . . . . . . . . . . . . . 143 JB Systems, Showcase . . . . . . . . . . . . . . www.modetron.com . . . . . . . . . . . . . . . . . . . . 142 Virtins Technology, Showcase . . . . . . . . . www.virtins.com . . . . . . . . . . . . . . . . . . . . . . . 143 Labcenter. . . . . . . . . . . . . . . . . . . . . . . . . www.labcenter.com. . . . . . . . . . . . . . . . . . . . . 152 London Electronics College, Showcase . . www.lec.org.uk . . . . . . . . . . . . . . . . . . . . . . . . 142 Microchip . . . . . . . . . . . . . . . . . . . . . . . . www.microchip.com . . . . . . . . . . . . . . . . . . . . . 61 Mikro Elektronika . . . . . . . . . . . . . . . . . . . www.mikroe.com . . . . . . . . . . . . . . . . . . . . . . 8, 9 MQP Electronics, Showcase. . . . . . . . . . . www.mqp.com . . . . . . . . . . . . . . . . . . . . . . . . 142 New Wave Concepts, Showcase . . . . . . . www.new-wave-concepts.com . . . . . . . . . . . . 142 Newbury Electronics . . . . . . . . . . . . . . . . www.newburyelectronics.co.uk . . . . . . . . . . . . 139 7-8/2007 - elektor electronics Advertising space for the issue of 24 September 2007 may be reserved not later than 28 August 2007 with Huson International Media – Cambridge House – Gogmore Lane – Chertsey, Surrey KT16 9AP – England – Telephone 01932 564 999 – Fax 01932 564998 – e-mail: [email protected] to whom all correspondence, copy instructions and artwork should be addressed. 151 DESIGN SUITE TIME FOR A CHANGE ? NEW IN DESIGN SUITE 7: NEW: Redesigned User Interface includes modeless selection, modeless wiring and intuitive operation to maximise speed and ease of use. NEW: Simulation Advisor includes reporting on NEW: Design Explorer provides easy navigation, NEW: Trace capability within both MCU and ¿QGLJ design inspection tools and cross-probing support to improve quality assurance and assist with fault NEW: 3D Visualisation Engine provides the means to preview boards in the context of a mechanical design prior to physical prototyping. simulation problems with links to detailed troubleshooting information where appropriate. peripheral models provides detailed information on system operation which allows for faster debugging of both hardware and software problems. NEW: Hundreds of new device models including PIC24, LPC2000, network controllers and general purpose electronic components. Electronic Design From Concept To Completion Labcenter Electronics Limited Registered in England 4692454 E-mail: [email protected] Tel: +44 (0) 1756 753440 Fax: +44 (0) 1756 752857 Registered Address: 53-55 Main Street, Grassington, North Yorks, UK, BD23 5AA
Similar documents
Honorary President Giorgio Federici Università di Roma “Tor
5(+7 PZ HU HUJPLU[ HUK \IPX\P[V\Z TL[HIVSP[L ^OPJO ILZPKLZ HJ[PUN HZ H YLKV_ JVMHJ[VY MVY ZL]LYHS KLO`KYVNLUHZLZ PZ \[PSPaLK PU THU` TL[HIVSPJ HUK YLN\SH[VY` WYVJLZZLZ...
More informationPRODUCT AND SERVICE GUIDE
Terminal Co., Ltd. (SHSICT) (Phase 1) No.1 Tonghui Road, Luchao Gang Town, Nanhui District Shanghai, PRC China / Xiamen Xiamen New World Xiangyu Terminals Co. Ltd. (NWXY) No. 8, Xiangyu load, Huli ...
More informationoemcat14
dQd_R$S[9:$&/739$*7492$ZRd@$&-263B6923@$D-/34<6$QQ\[R$J(*%L D6=M/56-$D6=$!71?23$J\W\L$S\QY_QW[
More informationb-vitamin complex
ZWYLHKPUNVMYVN\LJLSSZ5VYTHSJLSSZOH]LHULUa`TLYOVKHULZL[OH[PUHJ[P]H[L[OLJ`HUPKL TVSLJ\SLVM[OLSHL[YPSJVTWV\UK*HUJLYJLSSZKVUV[OH]L[OPZLUa`TLHUKHJ[\HSS`OH]L HUV[OLYLUa...
More information2_EEDAL2015 - Whaley (ID 95)
Dr David M. Whaley, Dr Stephen R. Berry Barbara Hardy Institute (School of Engineering), University of South Australia, Mawson Lakes, South Australia, 5095 [email protected]
More information