Elektor Electronics 2007 07,08

background image

Sensors
Actuators

Communications

Power Supplies & Chargers
Mechanics

Miscellaneous

Tips & Tricks

Microcontrollers

platform voor elektronica

DOUBLE SUMMER ISSUE

R34

www.elektor-electronics.co.uk JULY/AUGUST 2007 £ 5.65

background image

2

elektor electronics - 7-8/2007

#<;1.F?61.FA<#)5<B?@<;9F

<?A5<@2D5<D.;AA<D?6A2(69C2?D.A2?'1

(69C2?D.A2?$(,(F1;2F*()'"

"<4<;A<

DDD7.F0.?2920A?<;60@0<B82928A<?

3<?F<B?'0.A.9<4B2

(=

10;

D D D 7 . F 0 . ? 2 9 2 0 A ? < ; 6 0 @ 0 < B 8

&%()$&!$'(

%?12?+.9B2

<@A

H H

H

H H

H

H H H

%?12?+.9B2

<@A

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<;
:.69

A205@A<?27.F0.?2920A?<;60@0<B8

&<@A&%%-(69C2?D.A2?$(,B@A?.96.
E=20A.F@<?6?=.?0291296C2?F

,44;;

===5?00;84006

81

/;48?209?292

00;-3<8>;84<8

20;84064;81;3/;48

488<;4<1;

.0</@".112?645
+<9A.426@=9.F!6A

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

5.;;29B6A.?:=96362?!6A

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

#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
G7?87+%
G.?8<8?B:
G?8<@=78
G.B8?876DC

###68?8
?%<@

*:4,!

=19;'948

& )@

#79<1

71

2

(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$
G8<@787@8

)$

*:4

,!=19;

'948$.@

&?<4?.::./92645;2?4F4;6A6<;(F@A2:

4;6A6<;(F@A2:

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!
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?

.;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;6A6<;<69?6C2?

#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

+3;2764;

+.?6./92<<@A!6A3<?
)B?/<05.?42?@

*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

(;;;?93=8

!;<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

%"818;

%#84;48+?;7

%4!4<

#79<1

71

2

9

;

940

48@+;

background image

!/2!%#2*!##&*&'

'+,)2%2!*'#02,'2+&22%#&2%22#&!
%%#*2.!+ 2*&' !*+!+2)&**3+)!)*

!!+#2+&)2*!##&*&'

'2+&22%#&2 %%#*2,*!%2!%,*+)02*+%)
')&*2&)22&%%+2%#&2!%',+*

'+),$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%0+ !%22%2'+,)2,''&)+*2
#!-2+2)'#02%2!*'#02/'&)+

&&&&& !& '&&& &"&&$
& & & & & & & & & $%& #& &
&$%&"!&&&&&&& &&

& & & '& & $& "!& !& & & & &
!& & & & & $ & & !"& & & &
&"$& $&&&&&&

& $& !& & & '& & & & "& & &
&!&$&&#&&&&&&!& &$
&&&&&&&"&$&

&& && &&& ' &"&&
&&& && $&& & &&$&
&#&&!&& &"&&$&"&&&&"
& &&& $&

+.&)"!%

#/!#2%+.&)"2&%%+!-!+02*,''&)+!%2
$,#+!3*&'2&')+!&%2)$&+2$&%!+&)!%2%
+2(,!*!+!&%

+2/'&)+

/'&)+2+2.!+ 22,*!%2'&)+#22!#*2&)
,*2#!))!*2+&2,!#2,*+&$2!+&'2*&#,+!&%*

!+&'22&+.)2&)2!%&.*2%2!%,/

2 %%#2!+&'

2 %%#2!+&'

&"+2%#01)

background image

ACTUATORS

12 V Bidirectional Motor Control

44

3 Amp PWM DC Motor Controller*

50

Catapult for Robots… or Other Uses

56

Complete Stepper Motor Driver

46

Controlling Servos

47

Driving Higher Power Motors

51

Driving Stepper Motors

59

Driving Stepper Motors: KISS

53

MotoBox*

40

PIC 12C508 Stepper Motor Controller

48

PIC Indicator Relay

55

Robot Footballer

54

Servo to Motor Conversion

58

zBot: 10-A Power Stage for DC Motor

45

MICROCONTROLLERS

Low

2

Cost USB Demo Board

75

LPC900 Programmer*

72

Optimised STK200/300 Programmer

77

Propeller Prototyping Board for BoeBot*

69

Contents

Colophon

6

Alphanumski Puzzle

140

Elektor SHOP

145

Sneak Preview

148

SENSORS

A/D Converter for Robots

25

Bat’s Ear

30

CMUCam1 Vision System

18

CO Sensor

35

Compass Sensor for Lego Mindstorms NXT

36

From Cassette Recorder to Robot Propulsion

26

An Inclinometer for your Robot

32

IR Close Object Detector

27

Light Sensing with an LED

38

Light-seeking Robot

29

An Obstacle Detecting Robot

10

Overheat Detector Alarm/Switch

21

PIC or Basic Stamp IR Telemeter

21

PIR Sensor

28

Positioning with Photodiode Arrays

33

A Robot that won’t lose its bearings

24

Sensor for Line Following Robots

20

Simple D/A Converter for Robots

17

Sound Activated Switch

23

Stereo Robot Ears*

13

Ultrasonic Distant Obstacle Detector

37

Whiskers on Robots

34

Wireless Pulse Sensor

12

Summer Circuits 2007

background image

COMMUNICATIONS

2.4 GHz Antenna for Robotics Vehicles

110

IR Communications using a UART

113

IR Remote Control with the R8C

115

Radio Remote Control

for PDAs and Smartphones

115

Receiver for RC5 Remote Controls

112

Removed Pulse Detector

114

Robot Voice

117

zBot: Wireless Link

114

TIPS & TRICKS

Balancing Robot

118

DIY Wheels

120

R8C Measures Negative Voltages

121

MISCELLANEOUS

Chaotic Fireflies

126

Clap Controlled Switcher

132

Colour Tamer

126

Football with Robots

138

Formula Flowcode Buggy

122

KiCAD: a high-level tool

134

New Lego Mindstorms NXT Motor Block

133

Philips ME Construction Kits

130

A Robot with an Elephant’s Memory

131

Stepped Volume Control

127

Walking Works!

128

* PCB design included

Satnav for Robots

78

Serial Interface for the Propeller*

81

Servo Control from a PC

68

‘Teaclipper’ Postage-Stamp Programmer

71

Which Brain for my Robot?

62

POWER SUPPLIES & CHARGERS

3-A Wide-input

Adjustable Switching Regulator

84

Deep Discharge Protection

for Rechargeable Cells

94

Dual Battery*

90

Fast Charger for NiMH Batteries*

93

LDO Regulator with Soft Start or Tracking

95

Lithium Charger*

88

Mini Power Inverter

87

Multi-purpose NiCd & NiMH Charger

91

Paralleling LiPo Batteries

85

PWM Voltage Dropper

89

Switch-Mode 555 Supply

86

USB Converter*

82

Voltage Stabiliser

86

zBot: Solar/Battery Power Supply

83

MECHANICS

Antieu-robot

99

Babybot

100

Bolo

98

Hunter

104

Minimalist Motor

102

Robot MOPS

107

Torque is Cheap

101

Trembly

104

Tribot

103

Volume 33
July/August 2007
no. 367

CONTENTS

background image

6

elektor electronics - 7-8/2007

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.

International Editor: Mat Heffels (

m.heffels@segment.nl

), Wisse Hettinga

(

w.hettinga@segment.nl

)

Editor: Jan Buiting (

editor@elektor-electronics.co.uk

)

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 (

secretariaat@segment.nl

)

Graphic design / DTP: Giel Dols, Mart Schroijen

Managing Director / Publisher: Paul Snakkers

Marketing: Carlo van Nistelrooy

Customer Services: Margriet Debeij (m.debeij@segment.nl)

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:

subscriptions@elektor-electronics.co.uk

Rates and terms are given on the Subscription Order Form

Head Offi ce: Segment b.v. P.O. Box 75 NL-6190-AB Beek The Netherlands
Telephone: (+31) 46 4389444, Fax: (+31) 46 4370161

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:

p.brady@husonmedia.com

Internet:

www.husonmedia.com

Advertising rates and terms available on request.

International Advertising: Frank van de Raadt, address as Head Offi ce
Email:

advertenties@elektuur.nl

Advertising rates and terms available on request.

Copyright Notice

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 permis-
sion to the Publishers to alter the text and design, and to use the contents in other Segment publica-

tions and activities. The Publishers cannot guarantee to return any material submitted to them.

Disclaimer

Prices and descriptions of publication-related items subject to change. Errors and omissions excluded.

© Segment b.v. 2007

Printed in the Netherlands

Advertisement

+44 (0) 1354 778224

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

ƚŽŬŝĐŬƐƚĂƌƚLJŽƵƌĚĞǀĞůŽƉŵĞŶƚ͘

background image

œÜʓ>˜ÞÊ«ˆiViÃʜvÊÌiÃÌÊ
iµÕˆ«“i˜ÌÊV>˜ÊޜÕÊLÕÞÊvœÀÊ˙™¶

7ˆÌ…Ê>Ê*œ-Vœ«iÊ1-ʈ˜ÃÌÀՓi˜ÌÊޜÕÊ}iÌÊ̅iÊvi>ÌÕÀiÃʜvÊ>˜ÊœÃVˆœÃVœ«i]ÊëiVÌÀՓÊ
>˜>ÞÃiÀ]ÊV…>ÀÌÊÀiVœÀ`iÀ]ʏœ}ˆVÊ>˜>ÞÃiÀʭ܈̅Ê1,/]Ê-*]Ê

Ó

Ê>˜`Ê£‡ÜˆÀiÊÃiÀˆ>ÊLÕÃÊ

`iVœ`ˆ˜}®]Ê«>ÌÌiÀ˜Ê}i˜iÀ>̜ÀÊ>˜`ÊõÕ>Ài‡Ü>ÛiÉ*7Ê}i˜iÀ>̜À°Ê/…>̽ÃÊiµÕˆÛ>i˜ÌÊ̜ÊÈÝÊ
«ˆiViÃʜvÊÌiÃÌÊiµÕˆ«“i˜ÌÊvœÀÊ˙™Êˆ˜VÕ`ˆ˜}Ê1Ê`iˆÛiÀÞÊ>˜`Ê6/°

GfJZfg\`jXcfn$ZfjkLJ9$
YXj\[`ejkild\ekk_XkX[[j
`emXcl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\#
[\Zf[`e^f]L8IK#JG@#@):Xe[
($n`i\j\i`Xc`ek\i]XZ\j%

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

<HL@GD<EK=FI<C<:KIFE@:J;<M<CFGD<EK#KI8@E@E><OG<I@D<EK8K@FE

8ccdXafiZi\[`kXe[[\Y`kZXi[jXZZ\gk\[

"À`iÀʘœÜʜ˜ÊÀiivœ˜iÊänääÊÈ£ÓÊÓ£Îx

œÀʜ˜ˆ˜iÊ>ÌÊÜÜÜ°«>ÌÀœ˜ˆÝ°Vœ“

›/$Z_Xee\c(b?qkf(D?q

gXkk\ie^\e\iXkfin`k_kXYlcXi
nXm\]fid]fidXkk`e^fi[`i\Zk
k`d`e^Z_Xikgcfkk`e^fek_\
jZi\\e%

›JhlXi\$nXm\&GNDglcj\

n`[k_df[lcXk`fe ^\e\iXkfi%

:fdgXk`Yc\n`k_D`Zifjf]k
N`e[fnjD<#)'''Xe[OG#
GfJZfg\`jjlggc`\[n`k_\Xjp$
kf$lj\jf]knXi\Xe[XLJ9
ZXYc\%FjZ`ccfjZfg\gifY\jXe[
cf^`ZXeXcpj\ik\jkc\X[&Zc`gj\kj
Xi\XmX`cXYc\j\gXiXk\cp%

background image

8

elektor electronics - 7-8/2007

mikroElektronika

:.(+

,-!

'&$- %&- - - #$"$ $

"$-&-%- $""!&$"$%

"!&!'!-&%-&$&"!-%-"!-"

&-%&%&-%-#$"$ $

"!

&-

$&-

-

!)

%%- )&- &- $"

!")- %'##"$&%- "$- %

%-(!--("#$--)$

"- "- %- - "$- '$.

&$-#$"&"&+#-("# !&

.()

'$-!%-+"'

&"-*'&- $"-- $"%

- $"%- #$"$ %- "!- &

"%&- %- $""!&$"$

!-()-($-('%-#

'!&"!-%&$%-- .

"$+-!--)-&-#$".

$ -%-$'!!!

'.,.( )':

(-::6:

86':.()

"")!-&-&$.

&"!- "- &%- #$.

%%"$- - <

%-"!-"-&-%&--7.#!--("# !&-%+%& %-"!-&- $.

&- &-

'.,.(

%- "$- !)- &'$%- "$- &- % - #$

+%& -%'##"$&%-&-&%&-53.-!-7.#!-- $""!&$"$%

&-%-($-)&-2774-!+-"-&%-$+-

* #%-'$!&-%'%%'-'%-"-&-%+%& -&$-%&-"!.

"$-#$"$ $-!-

.()

!.$'&-'$-!%

($+- !&- '!- !- %&$- #$"&"&+#- ("#!

* #%-!-

( - '&6.(

!-

!'-$-#$"(-)&

&-"$

*<:.( )':

(-::6

:86':.()

C-%+%& -%'##"$&%-27.-7.-!-3.-#!- $""!&$"$%-&

" %- )&- &- %32- !$- #'$#"%- $""!.

&$"$-)&-!&$!-2.&-;--

*<:.(

%- !+-.

&'$%- &&- - +"'$- ("# !&- %+- !+- "- &%

$+- -* #%-!--;-!-;;@ !'

'$!&- %'%%'- '%- "- &- %+%& - C- '&$- %&- "!.

"$- #$"$ $- !-

.()

!.$'&- '$

!%-($+-!&-'!-!-%&-#$"&"&+#-("#.

!

:.(54)':

(-::6:

86':.()

C-%+%& -%'##"$&%-%- $""!&$"$%-!-53.-!-7.-#!%

#%- &- %- ($- )&- &- %523; $""!.

&$"$-

:.(54

("# !&-%+%& -%--'.&'$-(.

"# !&-"$-"$-&-$"#-%--%-"$

")%- $""!&$"$-&"--!&$-)&-*&$!-$'&%-

!

$"-$!-"-#$#$-(%-C%-("# !&-"$-%

!-"!."$---#$"$ $-!-!&$&-"!!&"$%-"$

- "$+- $%- - *- - #"$&- 374- ;A- "!.

"$-A7>5-&$!&-"!&$"$-;-&

*<&95 )':

:86'

C-%+%& -%'##"$&%-

$$:

$""!&$"$%

&-" %-)&-;C<;25--I' #$- !&-!-#!-%

$+- $-"!-&-"$-&-%-#"%%-&"-&%&-&- "%&-"

!'%&$- !%- "!- &- %+%& 9- & #$&'$- "!&$"$%

"'!&$%-& $%-&--

*<&95

%-!-%+.&".'%-;& -;D

("# !&-%+%& !."$---#$"$ $- %

+"'$-("# !&-%+-* #%-!-

'&6.(

!-

!.

'-$-#$"(-)&-&-"$

*<&52)':

:86'

*<&52

"$

" %-

)&

& # %

@23- $""!&$"$- - I' #$- !&- !- #!- %

$+- $-"!-&-"$-&-%-#"%%-&"-&%&-&- "%&-"

!'%&$- !%- "!- &- %+%& 9- & #$&'$- "!&$"$%

"'!&$%- & $%- &- -%+;-%- !+- &'$%- !

+"'$- ("# !&- %+-!- "- & - %- "!."$- -

#$"$ $- )&- '&" &- %)&- &)!- H$'!1 !- H#$".

$ !1 "-* #%-!-

(

!'-$-#$"(-)&

&-"$

*<$!& )':

:86'

C-%+%& -%-" .

#&-)&-

"

!-

$""!&$"$%-&-" %-)&-;C7874

C---#$"$ $-%-

'&.!-!-#$"$ !-!-

"!-)&"'&-$ "(!-&- $""!&$"$-!+-"-!'%&$

##&"!%-!--&%&-"!-&-%+%& -9-& #$&'$-"!.

&$"$%-"'!&$%-&

.-;-"-"'$-#$"'&%-$--

%##-!-%#-

;

. !.!-%'$-"$$!-

#$"(%--%&-!-%-

)+-"-'+!-"'$-#$"'&%

DEVELOPMENT TOOLS | COMPILERS | BOOKS

*<6()':

:86'

C- %+%& - %'#.

#"$&%-

$ $

!-

$

$".

"!&$"$%- &- " %- )&- F7673- - I' #$- !&

!-#!-%-$+- $-"!-&-"$-C-

*<6(

%-!

%+.&".'%-"-("# !&-%+%& -!."$---#$".

$ $-#$"(%-%&-!-%+-!.%+%& -#$"$ !

19 )':

(-::6:

86':.()

C- %+%& - %'#.

#"$&%- 53.- 7.- !

2.-#!%-33=%- $""!&$"$%-&-" %-)&

3>85<;2- .- 3- 25.&- $""!&$"$-85- ?- %

"$+-7-?-;-!-2-!--* #%-!-;

;;@ !- - $- !'- !- &- %+%& - F"'- !- ""%

&)!--!-*&$!-")$-%'##+-

19

%- !+

&'$%- &&- - +"'$- ("# !&- %+- *#"$- !)

33=%- - %- )&- @D- 3.- !- *#$.

!--(!&%-"-&%- $""!&$"$%-

8)6)':

:86'

C-%+%& -%'##"$&%--;D-742-;-!-"- $".

"!&$"$%-)&--$-!' $-"-#$#$%!-"$$-&"-"!.

&!'-)"$!-)&--$!&-#-!-&-% -("# !&

!($"! !&- +"'- I'%&- !- &"- %)- - $-

83.)6

%

!+- &'$%- &&- - +"'$- ("# !&- %+-F"'-!

""%-&)!--"$-*&$!-")$-%'##+--

$-%-&%-")!---#$"$ $/

S O F T W A R E A N D 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

:

+:<:8086&,</+6

,7<

.< 6 ( 2: 2< &

7

6=:16<*<

'.,&95)':

:86'

C- %+%& - %'##"$&%- 53.#!- !- 2.#!- ;D- $""!.

&$"$%-&-%-($-)&-;C<;27-)"$!-&-2=K

!+- $+- - * #%- '$!&- %'%%'- '%- "

&- %+%& -

'.,&95

%- ;& - ;D- ("# !&- %+%&

)-%-%+-&"-'%-<;D-%- !+-&'$%-&&- %

+"'$- ("# !&- %+- F"'- !- ""%- &)!- - "$

*&$!-")$-%'##+-<;D-%"-%'##"$&%-$&$-@

%-)-%-<$#-@-

$"&$"!- !'&'$%- " #&&(- ("# !&- %+%.

& %-E-($-"'$-#$"'&%-$"%%-&-"-!-"'$-%&%.

-'%&" $%-$-&-%&-'$!&-"-"'$-$%&.$&-%$(

C- " #!+- %- !- "- "!%'&!&- "!- &- - $""!.

&$"$%- !- &- &$- #$&+-#$&!$-"- $"#- " #!+-E

$- %"- !- "- "!%'&!&- !- &- &$- #$&+- #$&!$- "-

+#$%%

"!'&"$%- %!- - !- - "- "!%'&!&- "- #%

&$"!%-" #!+-%-)-;-"'$-#$"'&%-$-"=-" #!

&

1.(+

,

!-'&$-%&---#$"$ .

$- "$- &- 3- - %

%-; !)-@(%-)&

&- $"- !")- %'##"$&%

"$-%-(!--("#$-

)$- "- "- 3-

%--"$-'$&$-#$"&".

&+#-("# !&

.()

'$- !%

+"'- &"- *'&- $"-

$"%- - $"%- #$".

$ %- "!- &- "%&- 3-

%- $""!&$"$- !

()- ($- ('%- #

'!&"!- %&$%-

"$+- !- - )

&-#$"$ -%-$'!!!

.(+

,- !

'&$-%&---#$"$ $

"$- &- - $""!&$"$%

"!&!'!- &%- &$&"!- %- "!

"- &- %&%&- - #$"$ $

"!-&- $&--!)-%

)&- &- $"- !")- %'#.

#"$&%- "$- - %- (!

("#$- - )$- - "- "

- - "$- '$&$- #$"&"&+#

("# !&

.()

'$- !%

+"'- &"- *'&- $"-

$"%- - $"%- #$".

$ %- "!- &- "%&- - $".

"!&$"$-!-()-($-(.

'%- #- '!&"!- .

%&$%-- "$+-!-.

-)-&-#$"$ -%-$'!.

!!

.(1("& )':

(-::6:86'

:.()

.(1("&

%- - %+%& - %!- "$- "!&$"!- !'%&$- %+%& %

!- !%-25-!#'&%-)&-"#&""'#$%-!-25-$+%-'#-&"-

4;

!-%&%+- !+-!'%&$-!%-C-'&$-%&-

.()

!.$'&

'$-!%-($+-!&-'!-!-%&-#$"&"&+#-

(.

"# !&- - $+- %- &%- ")!- ($%&"$- %"- &&- &- %#$- !- !

"&

-&-"!&&%-E!-"*

-&-%+%& - +--'%-!- "%

&

0-'%&+-!($"! !&

.(1($&

%- - %+%& - %!- "$- "!&$"!- !'%&$- %+%& %

!- !%-7-!#'&%-)&-"#&""'#$%-!-7-$+%-'#-&"-4;

-!

%&%+- !+- !'%&$- !%- C- '&$- %&-

.()

!.$'&

'$-!%-($+-!&-'!-!-%&-#$"&"&+#-

(.

"# !&-

"")!-&-&$&"!-"-&%-#$%%"$-%+-%-"!-"-&

-%&

- ("# !&- %+%& %- "!- &- $&- &- %+3- %- "$

!)-&'$%-"$-&-% -#$-C-%+%& -%'##"$&%-7.-23.-2

7.-.

- 7.- !- 3.- #!- - $""!&$"$%- &- " %- )&- &

25766;-C-

.()

!.$'&-'$-!%-($+-.

!&- '!- !- %&- #$"&"&+#- ("#!- * #%- !-

(

'&6.(

!-

!'-$-#$"(-)&-&-"$

*<.( )':

(-::6:

86':.()

.(1($& )':

(-::6:86'

:.()

&52+

,

;%- %- !- - - #$".

$ $-"$-&-;- +-"

#%L- $""!&$"$%D$+

%&-!-%+-&"-"!!&-"!-&

"$- &- !- #$"$ - - - &

#%- ;- $""!&$"$%

F"'- &- &- - #$"$ $

)- "%!L&- '%- ""&- "$

"$-!+-% $-)+-"-#$"$ .

!-C-)"-;- "$+

!- - #!%- $- (- &"

+"'-%%-+"'-)-(-&

%&&.".&.$&- %&- -

;- #$"$ $- "$- +"'$

'&'$-#$"I&%

$!

,- !

'&$- %&- - - #$"$ $

"$- &- ;& - 742- $""!.

&$"$%E!-

"!!&-

&"

(-"$-("# !&-%+%& -&

" %- !- A.FC- #$".

$ $- E!- #'- !- G

%"&- &- " %- - %&!$

#$"$ $- F"'- !- "$$- !

"#&"!- G- %"&- '%- "$

- ("' - #$"'&"!- "!+

!- "- &- #"%%&%- "- "!.

!&!-742#$"-&"--&- $".

"!&$"$- %- (- !- 2- "!.

!&"$-C- 742#$"- !- %"

#$"$ -&-&%&- "%-

background image

9

7-8/2007 - elektor electronics

% ('

52)*

$# $

$# $

% ( '

!# #

# $

!

" $

##

#

( % ' &

6

$# $

$# $

#

-

! 7 2

2#

$#

( % '

#

!

#

!

##

S O F T W A R E A N D 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

' % 0

&

6

'

%

0

!

A

##

# # $

$

A# A# $

#

#

B #

# $

#

' % 03

, &

6

'

%

0 3

,

4 ? - 5

!?#!

!# 72# $

# #

4 - ; !

#72#$

,#!#72

##

4-;#!# #72#

, ( % &

6

, ( %

A# $

$

# # $

"

#

23

# &

6

23

#

$

# $

# # $

&

!# # $

# $

##

## $

$# $

#

#$$##A#!#

###!?

'

*

&

6

.A# !A#

-#

# A# $

@$

9

A

B

$

A######

%

&

6

%

#

#

:

# A#

#

?#

#

A

A

, ( % &

6

, 6

# # !

9( $

! !

4 - ;

# 4

4-7# $

- 8

6 7

&

6

- 8

6

# # $

# #

A

# #

$A

#

))

21/

&

6

) )

2 1 /

AA#

# # $

A $

#$

24'

&

6

9 $

:

?#

24'

#

#

?

?#?#

!

4-;##

//'

3(

&

6

//'

6

# # $

# #

&

# #

A

A

7-

3

)

&

6

)

#

# A

$

#$

! ?

# #

! ?

35

)

8'

&

6

'

A# $

# A#

@ A $

#$

# ;#

!# # !

# $

$##

(,

.''

&

6

7

#

# !

A# #

!? =

!#

# # 72-

6

#

# $

###&#A###

####

)

8,

&

6

. A 2

,# ?

A

# #

# @A

2 7 !

-

##A

)7

6

&

6

/'

3"

# A# $

2'6#

"

72

?

###

41

B # #

&

$

$# 2'6# #

2'6# # #

,' )7

&

6

1 8A#

,'

) 7

6

A# #

# !#

: ##*$&#$

&# $&# *$&# *$

# $# #

27

?

+.'(

7!

% 6

-# A

4 ! $ ! '

:

"# 03-

A 1

@A#

#

!# >

+.'(

# 7!

% 6

- A

*" 03-

A

4 - ;

1

@A#

!# >

.'(

% 6

-#A

-

3 -

A

4 - ;

1 @A

#!

>

3

.'(

+.'(

% 6

-# A

*"# 03-

"

-#3-

A

4 - ;

1

@A

# !

>#

3

.'(

% 6

-# A

-#3-

A

4 - ;

1

@A

-#3-

# !

>

3

7

#%

6

-# A

:

( -

:

" *

0 3-

A 1

@A

# !

>

+.'(

7

#

% 6

-#A

:

( -

:

" *

0# 3-

A 1

@A#

#!

>

3

+.'(

7!

% 6

-#A

:

( -

:

"

0# 3-

A 1

@A#

#!

>

52

&

6

: #

# $

&

#

! #

$

#

)

8 2141

&

6

-# A

A

!

@ A

2 -#$

5

52

&

6

: #

# $

# A

#

-'

-# *$

#)##((

+#

%#!A

.A$$# ,2-# A$

"&# #

&# $# &

##A##"$

# # !#

@?###

72-

?,# # 72-#

A# # # "$

# # # ..7964&

/31##44-&#

#

-/# # &# !

###

3-

&# $# $

&# "# ?A#

7'# &# #

##&#$

# # &#

& 2-& 72&

9 ( & - 5 & ; , &

9 * ) 6 <

& 4# $

&## &

7<4&#&#

- &# $

# 7# #

# 72-# 4-;#

A# # #

A

7# &

A# #

##"#

72-# ?7# # 72-

# A# #

"# # # ..7$

964&# /31# # 44-&

##-/##&

!# #

# # 3-

&# $

# &# "

?A# # 7'# &

# # #

&# #

&

& 2-& 72&

9 ( & - 5 & ; , &

9 * ) 6 <

& 4# $

&## &

7<4&#&#

: #!##"A

# A# 52# -&# !

## #2

.#

# ?#

: #

# 7A# #

"# # $

: # ?-# # 72-#

A# # # "$

# # # ..7964&

/31##44-&#

#

-/# # &# !

###

3-

&# $# $

&# "# ?A#

7'# &# #

# # &# $

# # &#

& 2-& 72&

9 ( & - 5 & ; , &

9*)##6<#$

& 4

&# # $

&#7<4&#&#

+

%# !A

.A$$# ,2-# A$

"&# #

&# $# &

# A# # "$

# #!# @?

72-(# '# ((# # 72-

?,##72-('((

# 72-# # A# $

# # "#

# ..7964&# /31#

44-&#

# # -/#

& ! $

###3-

&

$# &

"# ?A# # 7'

&# # # $

& ##&

& 2-&

72&# 9(& -5& 9*)

6 < &

4 &

&

7<4&#&#

- &# $

# 7# #

72-(# '# ((# # 72-

4 - ;

A

# # # $

A# 7

&# # A

"

72-(# '# ((# # 72-

-# # A# $

"#

# ..7964&# /31#

4 4 - '

- /

& !

###

3-

&##&

"# ?A# # 7'

&# # # $

&##&

& 2-&

72&# 9(& -5& 9*)

6 < &

4 &

&

7<4&#&#

: #!##"A

# A# 52# -&# !

## #2

.#

# ?#

: # #

# 7A# #

"# # $

: # ?-# # 72-('

((# # 72-# # A

# # "

##..7964&#/31

# 44-&#

# # -/

& !

###

3-

&# $# $

&# "# ?A#

7'# &# #

# # &# $

# # &#

& 2-& 72&

9(& -5& ;,& 9

*)# # 6<# $

&# 4# $

&## &

7<4&#&#

+#

%#!A

.A$$# ,2-# A$

"&# #

&# $# &

#A##"$

# # !#

@?###

9

?,# # 72-#

A# # # "$

# # # ..7964&

/31##44-&#

#

-/# # &# !

###

3-

&# $# $

&# "# ?A#

7'# &# #

# # &# $

# # &#

& 2-& 72&

9(& -5& ;,& 9*

)# # 6<# &

4 &

&

7<4&#&#

- &# $

# 7# #

9#4-;#

#A

# # #

# A# 7# $

&# # A# $

" 9 4-;

?7# # 9#

A# # # "$

# # # ..7964&

/31##44-&#

#

-/# # &# !

###

3-

&# $# $

&# "# ?A#

7'# &# #

# # &# $

# # &#

& 2-& 72&

9(& -5& ;,& 9*

)# # 6<# &

4 &

&

7<4&#&#

background image

10

elektor electronics - 7-8/2007

An Obstacle Detecting Robot

C. Tavernier

www.tavernier-c.com

>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\[HZSVUNHZ`V\[HRLHSP[[SL
JHYLV]LY[OLVIZ[HJSLZP[TPNO[LUJV\U[LY
P[»SSZ[PSSJYLH[LX\P[LHUPTWYLZZPVU(UK
`V\»SSILHISL[V\ZL[OPZZ[HY[PUNWVPU[HZH
ZWYPUNIVHYKMVY`V\YV^UKL]LSVWTLU[Z
;VKLHS^P[O[OLTLJOHUPJHSPZZ\LZ[OH[
VM[LU WVZL WYVISLTZ MVY THU` HTH[L\Y
YVIV[I\PSKLYZ ^L»YL THRPUN \ZL VM H
º9VN\L)S\L»IHZL^^^YVN\LYVIV[PJZ
JVTZVSKHZHRP[HUK]LY`LHZ`[VHZZLT-
ISL^P[OV\[ZWLJPHS[VVSZ>OH[»ZTVYL[OPZ
RP[PZKPZ[YPI\[LKPU-YHUJLI`3L_[YVUPJ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obstacle As Byte

Input 0

‘ Right whisker input

Input 1

‘ Left whisker input

Low 5

‘ P5 output for PWM

Low 6

‘ P6 output for PWM

Delay 1000

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

No

obstacle

Pwm 0,3590,32768

‘ Forward

Pwm 1,3195,32768
Case 1

‘ Obstacle on the right side

Pwm 0,3600,32768

‘ Slight turn to the left

Pwm 1,3600,32768
Pause 1000
Case 2

‘ Obstacle on the left side

Pwm 1,3180,32768

‘ Slight turn to the right

Pwm 0,3180,32768
Pause 1000
Case

3

Head-on

obstacle

Pwm 0,3750,32768

‘ Full half turn

Pwm 1,3750,32768
Pause 1500
End Select
Loop

background image

12

elektor electronics - 7-8/2007

[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[[OLZHTLZWLLKMVYW\SZLZVM
[OLZHTL^PK[O0U[OPZJHZLHSS`V\OH]L
[VKVPZTHRLTPUVYHKQ\Z[TLU[Z[V[OLÄYZ[
WHYHTL[LYVMVULVY[OLV[OLYVM[OL7>4

;OLUP[»Z\W[V`V\[VKL]LSVWP[I`HKK-
PUNMVYL_HTWSLVIZ[HJSLKL[LJ[VYZVM[OL
ZHTL[`WLI\[[V[OLYLHYHU\S[YHZVUPJ
KPZ[HU[VIZ[HJS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WVULU[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\ZLHJSPWMYVTHJVT-
TLYJPHSOLHY[YH[LTVUP[VY

(070006-I)

NE555

IC2

DIS

THR

OUT

TR

CV

2

7

6

4

R

3

5

8

1

TSOP1136

TSOP1136

IC3

2

3

1

C1

470n

C4

100n

C3

10n

C2

1n

C5

100n

T2

BC547

T1

BD139

R11

100

7

R8

6k8

R9

22k

R5

220

7

R4

10k

R3

47k

R2

1k

R1

100k

R7

220

7

LDR1

P2

100k

P1

100k

P3

10k

R10

1k8

LED2

LED1

R6

1k8

6

5

7

IC1.B

2

3

1

IC1.A

IR

+5V

+5V

LED3

+5V

BC547

C

B

E

B

E

C

BD139

30 ... 40 kHz

IC1

8

4

IC1 = LM358

070006 - 11

2

1

3

plastic tube

heat shrink sleeve

LED

070006 - 12

LDR

15mm

21 mm

Ø 22 mm

background image

13

7-8/2007 - elektor electronics

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 cross-

correlation 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 degrees.

+LZWP[LP[ZPTWYLZZP]LM\UJ[PVUHSP[`.(:-
;65 JHUUV[ ^VYR ^P[O H JVU[PU\V\Z
H\KPV ZPNUHS SL[ HSVUL MVSSV^ H TV]PUN
ZV\UKZV\YJL;OPZHIPSP[`YLX\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[Z
Y\KPTLU[HY`ºMHJL»^OPJOPZ\ZLK[VL_WYLZZ
HSPTP[LKYHUNLVMLTV[PVUZ0UHKKP[PVUP[
PZHISL[VKL[LJ[ZV\UKZHUK[\YUP[ZOLHK
PU[OLKPYLJ[PVUVM[OLZV\UKZV\YJL0[\ZLZ
HUHYYH`VM[OYLLTPJYVWOVULZ[VNL[OLY
^P[OHTPJYVJVU[YVSSLY[VTHRLHZPTWSL
ºWYLJLKLUJLZLUZVY»^OPJOTLHZ\YLZ[OL
[PTLKPMMLYLUJLWYVK\JLK^OLUHZV\UK
WYLZZ\YL^H]LMYVU[THKLI`HJSHWVYÄU-
NLYJSPJRZ[YPRLZ[OLTPJYVWOVULZ

R

L

060040 - 13

Sound source

Figure 1.

The head acts as a low-pass filter

attenuating frequencies above 1 kHz.

The ear nearest the sound source will hear the

sound louder than the far ear.

background image

14

elektor electronics - 7-8/2007

;OLLHYT\Z[HSZVILHISL[VKL[LYTPUL
PM[OLZV\UKLTHUH[LZMYVTPUMYVU[VMVY
ILOPUK[OLLHYHUKHSZVLP[OLYMYVTHIV]L
VYILSV^;OLWVPU[ZPU[OYLLKPTLUZPVUHS
ZWHJL^OLYLHZV\UKZV\YJL^PSSWYVK\JL
PKLU[PJHS[PTLKPMMLYLUJLZPU[OLSLM[HUK
YPNO[ LHY HJ[\HSS` MVYT [OL Z\YMHJL VM H
O`WLYIVSVPK0[PZ[OV\NO[[OH[[OLIYHPUJHU
YLZVS]L[OLZLZWH[PHSHTIPN\P[PLZI`KL[LJ[-
PUNZ\I[SLJOHUNLZPU[OLZPNUHSZWLJ[Y\T
JH\ZLKI`[OLV\[LYLHYZOHWLHIZVYW[PVU
ZJH[[LYPUNI`[OL[VYZVHUKOLHKSVJHSPZPUN
I`[\YUPUNVM[OLOLHKHUKWVZZPIS`HSZVI`
KL[LJ[PUN+VWWSLYLMMLJ[Z
>OH[L]LY WYVJLZZLZ [OL IYHPU \ZLZ [V
YLZVS]L[OLSLM[YPNO[KPYLJ[PVUWYVISLTP[PZ
PU[LYLZ[PUN[VWS\NZVTL]HS\LZPU[V[OLMVY-
T\SHMVYHZV\UKZV\YJLWVZP[PVULKPUMYVU[
HUK[V[OLYPNO[VM[OLOLHK([HILHYPUN
A$‡HUKHZZ\TPUNHULHYZLWHYH[PVUVM
JTH[PTLKPMMLYLUJLVM›Z^PSSIL
HWWHYLU[H[[OLLHYZ([HUHaPT\[OVMQ\Z[
‡[OL[PTLKPMMLYLUJL^PSSVUS`IL›Z0[
PZKPMÄJ\S[[VPTHNPULOV^[OLIYHPU^P[O
HUL\YVUZ^P[JOPUN[PTLPU[OLTPSSPZLJVUK
YHUNLJHUYLZVS]LZ\JOZOVY[[PTLKPMMLY-
LUJLZHUKNP]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.

RA4/T0CKI

PIC16F88

RB0/INT

OSC2

IC2

OSC1

MCLR

RA1

RA0

RA2

RA3

RB1

RB2

RB3

RB4

RB5

RB6

RB7

18

17

13

12

11

10

16

15

14

1

3

9

8

7

6

2

4

5

X1

20MHz

C10

22p

C9

22p

K2

K3

Digital

TX

K4

RX

K5

PWM/Servo

MICR

R3

22k

C1

1

μ

16V

R4

1k

R5

47k

R6

10k

2

3

1

IC1.A

C2

1

μ

16V

R7

2k2

R8

100k

R9

10k

6

5

7

IC1.B

V

REF

V

REF

+5V

MICL

R10

22k

C3

1

μ

16V

R11

1k

R12

47k

R13

10k

9

10

8

IC1.C

C4

1

μ

16V

R14

2k2

R15

100k

R16

10k

13

12

14

IC1.D

V

REF

V

REF

+5V

R18

10k

R20

10k

R19

10k

JP1

JP2

+5V

100k

R17

SENSITIVITY

HOLD

RELA

TIVE

C8

100n

K1

C6

100

μ

16V

C5

22

μ

16V

C7

100n

IC1

11

4

R1

47k

R2

33k

+5V

V

REF

IC1 = LM324N

POWER

060040 - 11

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.

background image

15

7-8/2007 - elektor electronics

[HRLHYV\UK›Z[V[YH]LS[OLKPZ[HUJL
IL[^LLU[OLLHYZ^OPJOLX\H[LZ[VHOHSM
J`JSLVYH‡WOHZLZOPM[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[PTWVZ-
ZPISL[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\Y-
WVZLPNUVYPUNHU`Z\IZLX\LU[LJOVLZ;OL
WOHZLKPMMLYLUJLVM[OL[^VZPNUHSZNP]LZ
[OLHaPT\[OILHYPUNVM[OLZV\UKZV\YJL
;OL3,.6YVIV[.(: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ZWVUZL^HZUV[
^VY[O^OPSL

;OL70*-TPJYVJVU[YVSSLY\ZLKPU[OPZ
WYVQLJ[^HZWYVNYHTTLK\ZPUN[OL<S[P-
TH[LF70*[VVSZ^OPJOHYLIHZLKVU[OL
3HI]PL^WYVNYHTTPUNLU]PYVUTLU[;OL
IL[H]LYZPVUVM<S[PTH[LF70*PZH]HPSHISL
MYVT;OL*LU[LYMVY,UNPULLYPUN,K\JH-
[PVU6\[YLHJO*,,6H[;\M[Z<UP]LYZP[`
4HZZHJO\ZL[[Z

;OLHZZLTISLYHUKOL_ÄSLZMVY[OPZWYVQLJ[
)PUH\YHSF]HZTHUK)PUH\YHSF]OL_
JHUILMYLLS`KV^USVHKLKMYVT[OL,SLR[VY
Electronics
^LIZP[LBD^OLYLHWYLWYV-
NYHTTLK70*JVU[YVSSLYJHUILVYKLYLKHZ

060040- 1

(c) Elektor

1

14

7

8

1

18

9

10

1

1

1

1

1

1

1

060040-1

(c) Elekto r

C1

C2

C3

C4

C5

C6

C7

C8

C9

C10

IC1

IC2

JP

1

JP

2

Q1

R1

R2

R3

R4

R5

R6

R7

R8

R9

R10

R1

1

R12

R13

R14

R1

5

R1

6

R17

R18

R19

R20

SL1

SL2

SL3

SL4

SL5

SL6

SL7

Figure 4.

Component layout of the binaural sensor PCB.

The PCB files can be downloaded from [3].

Figure 5.

Resolution of the sound source

bearing is a function of its azimuth.

The average value is approximately 9°.

Figure 6.

The binaural sensor prototype.

Components list

Resistors

R1,R5,R12 = 47k

7

R2 = 33k

7

R3,R10 = 22k

7

R4,R11 = 1k

7

R6,R9,R13,R16,R18,R19,R20 = 10k

7

R7, R14 = 2k

72

R8, R15 = 100k

7

R17 = 100k

7 preset

Rx = 100k

7

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

Semiconductors

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

background image

17

7-8/2007 - elektor electronics

HUHS[LYUH[P]LMYVT[OL:/67ZLJ[PVU;OL
7*)SH`V\[HUKJVTWVULU[WSHJLTLU[PZ
ZOV^UPU-PN\YL4;[OL7*)HY[^VYRÄSLZ
HYLHSZVH]HPSHISLMVYKV^USVHKMYVTBD

*VUZ[Y\J[PVUHUK;LZ[

( 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

;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\Y-
WVZLZI\[]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)

>LISPURZ

[1] www.convict.lu/Jeunes/RoboticsIntro.htm

[2] www.ultimaterobolab.com

[3] www.elektor-electronics.co.uk

K2

5 Bit Digital IN

R2

10k

R1

20k

R4

10k

R3

20k

R6

10k

R5

20k

R8

10k

R7

20k

R10

20k

R9

20k

2

3

1

IC1.A

6

5

7

IC1.B

IC1

8

4

+5V

K1

IC1 = LM358N

U

out

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

22

2 ms

26

Central

12

1.5 ms

16

Extreme left

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` HJJVTWSPZOLK I` PU[LYMHJPUN
HUVMM[OLZOLSM+(JVU]LY[LY[V[OL
TPJYVJVU[YVSSLY»ZI\Z(UL]LUZPTWSLY
HUKTVYLJVZ[LMMLJ[P]LZVS\[PVUIHZLK
VUHUHWWSPJH[PVUUV[LMYVT4PJYVJOPW
BDPZZOV^UOLYL(TPJYVJVU[YVSSLY
WYVK\JLZH7>4W\SZL^PK[OTVK\-
SH[LKKPNP[HSV\[W\[ZPNUHS^OPJOPZÄS-
[LYLKI`HSV^WHZZ9*ÄS[LY(S[OV\NO
[OL7>4ZPNUHSOHZHÄ_LKYLWL[P[PVU
YH[L[OLVU[VVMMYH[PVPZ]HYPLKMYVT
[V^OPJOHM[LYÄS[LYPUNNP]LZ
HU HUHSVN\L V\[W\[ ZPNUHS WYVWVY[PVUHS
[V[OLYH[PV(ZPUNSLKPNP[HSV\[W\[MYVTH
WVY[WPUKYP]LUMYVTHUVUJOPW[PTLYMVY
L_HTWSLJHU[OLYLMVYLMVYT[OLIHZPZVM
HUHUHSVN\LV\[W\[ZPNUHS

.\PKLSPULZ[VJHSJ\SH[L]HS\LZMVY[OL9*
SV^WHZZÄS[LYHYLNP]LUPU[OLHWWSPJH[PVU
UV[L<ZPUN[OL]HS\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oeBot (and other robots) vision!

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 enga-
ges 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

G

min

G

max

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.

background image

19

7-8/2007 - elektor electronics

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[ [HR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[OYLLI`[LZ¸¹
<WVUHZ\JJLZZM\S[YHUZTPZZPVUVMHJVT-
THUK[OL(*2Z[YPUNZOV\SKILYL[\YULK
0M[OLYL^HZHWYVISLTPU[OLZ`U[H_VM[OL
[YHUZTPZZPVU VY PM H KL[LJ[HISL [YHUZMLY
LYYVYVJJ\YYLKHU5*2Z[YPUNPZYL[\YULK
(M[LYLP[OLYHU(*2VYHU5*2HUCYPZ
YL[\YULK>OLUHWYVTW[ºCY»MVSSV^LKI`
Hº!»PZYL[\YULKP[TLHUZ[OH[[OLJHTLYH

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 com-
mand 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.

background image

20

elektor electronics - 7-8/2007

HUVIQLJ[;Y`KPMMLYLU[JVSV\YVIQLJ[ZHUK
KPMMLYLU[ ZPaLZ [V ZLL [OL LMMLJ[Z VU [OL
[YHJRPUNKH[H;OPZPZHUPTWVY[HU[WYVNYHT
[OH[`V\^PSSYL\ZLTHU`[PTLZHZ`V\HZ
`V\ÄUKTVYLHUKTVYLPU[LYLZ[PUN[OPUNZ
[VKV^P[O`V\Y*4<JHTHUK)VL)V[
;OPZWYVNYHTHSSV^Z`V\[VZLLHUK\UKLY-
Z[HUKL_HJ[S`^OH[`V\Y)VL)V[JHUZLL
^P[OP[Z*4<JHT]PZPVUZ`Z[LT
( ZOVY[ ]PKLV ZOV^PUN H *4<JHT
LX\PWWLK )VL)V[ SVJH[PUN H YLK VIQLJ[
TH`ILMV\UKH[BD

(070132-I)

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

PZ^HP[PUNMVYHUV[OLYJVTTHUKPU[OLPKSL
Z[H[L>OP[LZWHJLZKVTH[[LYHUKHYL\ZLK
[VZLWHYH[LHYN\TLU[WHYHTL[LYZ;OLCY
(:*00JHYYPHNLYL[\YUPZ\ZLK[VLUK
LHJOSPULHUKHJ[P]H[LLHJOJVTTHUK0M
]PZPISLJOHYHJ[LY[YHUZTPZZPVUL_LY[Z[VV

T\JOV]LYOLHKP[PZWVZZPISL[V\ZL

]HY`PUNKLNYLLZVMYH^KH[H[YHUZMLY

º9H^TVKL»

;OLZ`Z[LTZ\WWVY[Z[^VJVTTHUK

ZL[Z · IHZPJ ;HISL HUK HK]HUJLK

;HISL

<[PSP[`WYVNYHTZ

(SZVPUJS\KLKVU[OL:LH[[SL9VIV[PJZ*+
964HYL[OLMVSSV^PUN\[PSP[`WYVNYHTZ
;LZ[*4<JHT[V)VL)V[JVTT\UPJH-
[PVU
;OPZWYVNYHTZL[Z\WH IH\K
ZLYPHSJVUULJ[PVUIL[^LLU[OL:[HTWHUK
[OL*4<JHT0[[OLU[LSSZ[OL*4<JHT
[VISPURP[ZNYLLU3,+
+PZWSH` *4<JHT [YHJRPUN KH[H VU

KLI\NZJYLLU;OLÄYZ[KH[HWHJRL[KPZ-

WSH`LKI`[OL+LI\NZJYLLUPZ[OLº:»:[H-
[PZ[PJZWHJRL[^OPJO[LSSZ`V\[OLJVSV\YVM
[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HJVTWHYH-
[VY^PYLKHYV\UKH*(VWHTW0*
(]VS[HNLKP]PKLYUL[^VYR97ZL[Z[OL
[OYLZOVSK]VS[HNLH[[OLPU]LY[PUNPUW\[VM
[OLVWHTW;OL[OYLZOVSK]VS[HNLKL[LY-
TPULZ[OLHKQ\Z[HISL[LTWLYH[\YL[YPWSL]LS
H[^OPJO[OLJPYJ\P[PZHJ[P]H[LK
>OLU[OLTLHZ\YLK[LTWLYH[\YLL_JLLKZ
[OL \ZLYKLMPULK SL]LS [OL JVTWHYH[VY
W\SSZ P[Z V\[W\[ /PNO [V HWWYV_ =
JH\ZPUN[YHUZPZ[VY;[VILMVY^HYKIPHZLK
PUZ[HU[S`;PZHSZVZ^P[JOLKVUZ\WWS`PUN
[OLVZJPSSH[VYJPYJ\P[HYV\UK0*^P[OZ\M-
ÄJPLU[]VS[HNL[VZ[HY[^VYRPUN;OLZL[
\WPUHZ[HISLTVKLKPYLJ[S`KYP]LZHJ[P]L

WPLaVLSLJ[YPJI\aaLY)a[VYHPZLHSV\K
HSLY[*VTWVULU[Z99HUK*KL[LY-
TPUL[OLVUVMMYO`[OTVM[OLZV\UKLY
( [YHUZPZ[VY IHZLK YLSH` KYP]LY TH` IL
KYP]LUVMM[OLLTP[[LYVM;;7:PTPSHYS`

YLWSHJPUN[OLWPLaVZV\UKLY^P[OHZ\P[-
HISLYLSH`HSSV^ZZ^P[JOPUNVMOPNOWV^LY
ÅHZOLYZZPYLUZVYOVYUZ^VYRPUNVU[OL(*
THPUZZ\WWS`

(060349-I)

CA3130

IC2

2

3

6

7

4

1

8

5

R1

1k

R3

10k

R5

2k2

R6

1M

R8

22k

R7

220k

R2

12k

R4

12k

C1

10

M

16V

C3

1

M

16V

C4

10

M

16V

C5

47

M 16V

C6

100

M

16V

LM35

IC1

1

3

2

10k

P1

T1

BC 547

T2

IC3

LMC555

DIS

THR

OUT

TR

CV

2

7

6

4

R

3

5

8

1

BZ1

5V

2x

+5V

REG

TP1

060349 - 11

PIC or Basic Stamp IR Telemeter

with a PIC or
a Basic Stamp

C. Tavernier

(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

(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

TVK\SLZ[OH[HYLHSSYLSH[P]LS`HJJ\YH[L
JOLHWHUKJVTWHJ[;HRPUNHSVVRH[09
[LSLTL[LYZ[OL:OHYWYHUNLPZJ\YYLU[S`[OL
SHYNLZ[HUKTVZ[YLHKPS`H]HPSHISLPUZVMHY

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-

Signal

processing

circuit

LED drive

circuit

Reflective

object

IR LED

Light detector (PSD)

Regulator

V

CC

V

CC

GND

V

CC

V

OUT

V

IN

(Control

signal

input)

Control

circuit

V

CC

12k

4

3

1

2

070235 - 11

1

background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
VIQLJ[PZHUKOLUJLHSSV^Z[Y\LKPZ[HUJL
TLHZ\YLTLU[WYV]PKLK[OLYLPZHTPUP-
THSHTV\U[VMZPNUHSWYVJLZZPUN[VL_WSVP[
[OL PUMVYTH[PVU NLULYH[LK I` [OL **+
ZLUZVY

Listing 1. Use of GP2Dxx with a Basic Stamp.

Vin

con

0

‘ Definition of control input

Vout

con

1

‘ Definition of data output

Measr

var

Byte

‘ Allocation of one byte for the result

Measr = 0

‘ Initialization of variable « Measr »

Read:
Vin = 0 ‘

Validation

of

telemeter

Wait:
IF Vout = 0 THEN Wait

‘ Wait until result is available

SHIFTIN Vout, Vin, 2, [Measr]
Vin = 1

‘ Put telemeter to sleep

Pause = 1

‘ Pause as a precaution

‘ The result of the measurement is available in the variable ‘Measr’

Listing 2. Use of GP2Dxx with a PIC controller.

Read
BCF

PortA.0

‘ Validation of telemeter

NOP
Wait
BTFSS

PortA,1

‘ Wait until result is available

GOTO

Wait

BSF

PortA,0

‘ Vin goes High

CLRF

Measr

‘ Initialization of the variable ‘Measr’

MOVLW

8

‘ Get ready to read 8 bits

MOVWF

Count

BCF

Status,C

‘ Zero the carry

NOP
Readbit
BCF

Porta.0

‘ Make clock Low

NOP
NOP
RLF

Measr,f

‘ Rotation of preceding bit

BTFSC

PortA.1

‘ Read data bit

BSF

Measr,0

BSF

PortA.0

‘ Make clock High

NOP
NOP

DECFSZ Count,f

‘ Count down number of bits to read

GOTO

Readbit

‘The result of the measure is available in the variable ‘Measr’

background image

23

7-8/2007 - elektor electronics

;OL [LSLTL[LY HWWSPJH[PVU JPYJ\P[ JHU
IL Z\TTLK \W HZ ZOV^U PU -PN\YL
^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[\-
HSS`UV[OPUN^OLU[OLYLPZUVTLHZ\Y-
PUN[HRPUNWSH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[VWLYMVYTHJ[\HS
KPZ[HUJLTLHZ\YLTLU[

0UMHJ[·HUK[OPZPZWLYOHWZ[OLZVSL
ZOVY[JVTPUNVM[OLZL[LSLTL[LYZ·[OL
PUMVYTH[PVU[OL`WYV]PKLPZMHYMYVTSPU-
LHYHZZOV^UPU-PN\YL

(070235-I)

2

3

4

070235 - 12

1

D1

PIC

or

Basic Stamp

+5V

1N4148

Connector

GP2Dxx

RA0 (PIC) or
P0 (Stamp)

RA1 (PIC) or
P1 (Stamp)

White paper: KODAK made gray chart R-27

white surface (reflectivity: 90%)

Gray paper: KODAK made gray chart R-27

gray surface (reflectivity: 18%)

220

200

180

160

140

120

100

80

60

40

20

0

0

20

40

60

80

100

120

140

Distance measur

ing output (DEC)

Distance to reflective object L (cm)

White

Gray

070235 - 14

V

IN

Output

Example of distance measuring output (8-bit)

70 ms or more

1 ms or more

0.2 ms or less

MSB

LSB

LSB

070235 - 13

1.5 ms or more

1.5 ms or more

Power

OFF

2

3

4

Sound Activated Switch

Hesam Hoshiri

*VU[YVSI`ZV\UKTH`IL]LY`\ZLM\S
UV[Q\Z[VUHYVIV[I\[HSZVMVYHIP[
VM OVTL H\[VTH[PVU MVY L_HTWSL H
ZV\UKHJ[P]H[LKSPNO[YLZWVUKPUN[VH
RUVJRVU[OLKVVYVYHOHUKJSHW;OL
SPNO[ ^PSS IL H\[VTH[PJHSS` Z^P[JOLK
VMMHM[LYHML^ZLJVUKZ(UHS[LYUH[P]L
\ZLPZI\YNSHYWYV[LJ[PVU·PMZVTLVUL
^HU[Z[VVWLU[OLKVVYVYIYLHRZVTL-
[OPUN[OLSPNO[^PSSJVTLVUZ\NNLZ[PUN
[OH[ZVTLVUL»ZH[OVTL
;OL JPYJ\P[ JHU ^VYR MYVT HU` ¶
=+*YLN\SH[LKWV^LYZ\WWS`WYV-
]PKLKHYLSH`^P[O[OLZ\P[HISLJVPS]VS[-
HNLPZ\ZLK
>OLU `V\ MPYZ[ JVUULJ[ [OL Z\WWS`
]VS[HNL [V [OL JPYJ\P[ [OL YLSH` ^PSS
ILLULYNPZLKILJH\ZLVM[OLLMMLJ[VM

JHWHJP[VY*(SSV^HML^ZLJVUKZMVY
[OLYLSH`[VILZ^P[JOLKVMM@V\JHU
PUJYLHZLVYKLJYLHZL[OLºVU»WLYPVK
I`JOHUNPUN[OL]HS\LVM*(OPNOLY
]HS\LYLZ\S[ZPUHSVUNLYºVU»WLYPVK
HUK ]PJL ]LYZH +V UV[ \ZL H ]HS\L
NYLH[LY[OHU›-
)PHZPUN YLZPZ[VY 9 KL[LYTPULZ [V H
SHYNLL_[LU[[OLTPJYVWOVULZLUZP[P]-
P[`(ULSLJ[YL[TPJYVWOVUL\Z\HSS`OHZ
VULPU[LYUHS-,;PUZPKL^OPJOYLX\PYLZ
HIPHZ]VS[HNL[VVWLYH[L;OLVW[PT\T
IPHZSL]LSMVYYLZWVUZL[VZV\UKOHZ[V
ILMV\UKI`[YPHSHUKLYYVY
(SSYLSL]HU[LSLJ[YPJHSZHML[`WYLJH\-
[PVUZZOV\SKILVIZLY]LK^OLUJVU-
ULJ[PUNTHPUZWV^LYLKSVHKZ[V[OL
YLSH`JVU[HJ[Z

(060379-I)

T1

2SC945

T2

2SC945

T3

BD140

R2

3M3

R1

5k6

R3

47k

R4

33k

R6

1k8

R5

330

7

C1

0

M1

C2

4

M7

RE1

D1

1N4007

MIC1

+5V...+12V

060379 - 11

background image

24

elektor electronics - 7-8/2007

A Robot that won’t Lose its Bearings

C. Tavernier

*YLH[PUNHYVIV[JHWHISLVMMVSSV^PUNHU
L_HJ[ JV\YZL ^P[OV\[ ULLKPUN HU`
L_[LYUHSWO`ZPJHSOLSW·SPRLH
SPULTHYRLKVU[OLNYV\UK
MVY L_HTWSL · OHZ MVY
H SVUN [PTL ILLU H
]LY` [YPJR` VWLYH[PVU
[V HJOPL]L ;OHURZ [V
[OL IVVT PU HTH[L\Y
YVIV[PJZ VU [OL VUL
OHUKHUK[V[OLKL]LS-
VWTLU[VMUL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Z[VIL[HRLU^P[O[OPZ
JPYJ\P[JVUJLYU[OL0

*I\ZW\SS\WYLZPZ-

[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\JVY-
YLJ[S`JOVVZL[OLWVY[ZPU[LUKLK[VOHUKSL
[OL:+(HUK:*3ZPNUHSZVM[OL0

*I\Z

HZJLY[HPU)HZPJJVTWPSLYZPTWVZLYLZ[YPJ-
[PVUZOLYL
;VILPUHWVZP[PVU[V^YP[L[OLJVYYLZWVUK-
PUNWYVNYHTHSS`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

BS2

IC1

SOUT

P15

P14

P13

P12

P11

P10

SIN

ATN

RES

VIN

P0

21

23

P1

P2

P3

P4

P5

10

P6

11

20

19

18

17

16

15

P9

14

P7

12

P8

13

22

24

5

4

6

7

8

9

1

2

3

CMPS03

CMP03

or

1

2

3

4

5

6

7

8

9

S1

+U

070304 - 11

1

background image

25

7-8/2007 - elektor electronics

JVKLK[OPZ[PTLPU[^VI`[LZPU
[OLMVYTVMHU\TILYIL[^LLU
HUK L_WYLZZLKPUKLJP-
THS^OPJOPZPUMHJ[[OLHUNSLPU
KLNYLLZT\S[PWSPLKI`

-YVT[OH[WVPU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*]LYZPVUMVYPU[LYMHJPUN^P[O

[OL*47TVK\SLP[NP]LZ`V\
WVZP[PVUPUMVYTH[PVUHIV\[`V\Y
YVIV[»Z[YHQLJ[VY`^P[OYLZWLJ[[V
THNUL[PJ5VY[O(SS[OH[YLTHPUZ
MVY`V\[VKVPZ[VTHRLNVVK\ZL
VMP[ZV`V\YYVIV[^VU»[ºSVZLP[Z
ILHYPUNZ»

(070304-I)

Web Links

Devantech

http://www.robot-electro-
nics.co.uk/shop/Compass_
CMPS032004.htm

A little background reading:

http://zedomax.com/blog/zedo-
max-diy-hack-lets-make-a-digital-
compass/

http://zedomax.com/
blog/2006/08/16/digital-compass-
using-cmps03/

CMPS03

CMP03

or

1

2

3

4

5

6

7

8

9

S1

+U

070304 - 12

R2

4k7

R1

4k7

CB220

IC1

SOUT

P15

P14

P13

P12

P11

P10

SIN

ATN

RES

VIN

P0

21

23

P1

P2

P3

P4

P5

10

P6

11

20

19

18

17

16

15

P9

14

P7

12

P8

13

22

24

5

4

6

7

8

9

1

2

3

SCL

SDA

Pin 9 - 0V GND

Pin 8 - No Connect

Pin 7 - 50/60 Hz

Pin 6 - Calibrate

Pin 5 - No Connect

Pin 4 - PWM

Pin 3 - SDA

Pin 2 - SCL

070304 - 13

Pin 1 - +5V

2

3

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\ZPUNJVT-
WH[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

ten

ten

tsu(CS)

B7

B0

B1

B2

B3

B4

B5

B6

B7

Conversion

operating sequence

Data B

MSB

MSB

LSB

Hi-Z State

MSB

LSB

(see Note B)

MSB

Previous Conversion Data A

A7

A7

A6 A5 A4 A3 A2 A1 A0

Hi-Z State

Don’t

1

1

(see Note A)

tconv

tsu(CS)

Access
Cycle B

8

8

7

6

5

4

3

2

7

6

5

4

3

2

CLOCK

I/O

CS

OUT

DATA

Care

Sample
Cycle B

Access

Cycle C

Sample

Cycle C

twH(CS)

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.

background image

26

elektor electronics - 7-8/2007

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`

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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IN2

NC

7

2

5

4

1

8

3

6

M1

400mA max.

M

C1

10

M

16V

+6V

070303 - 12

Truth table

for LB1630 motor control IC.

IN1

IN2

OUT1

OUT2

Motor

H

L

H

L

Forward run

L

H

L

H

Reverse run

H

H

HiZ

HiZ

Stop

L

L

HiZ

HiZ

Stop

2

IR Close Object Detector

B. Broussas

(S[OV\NO \S[YHZV\UK PZ ^LSS Z\P[LK [V
KL[LJ[PUNKPZ[HU[VIQLJ[ZP[PZX\P[L\U\ZH-
ISLMVYJSVZLYVIQLJ[ZPL^OLU[OLKL[LJ-
[PVU KPZ[HUJL JVTLZ KV^U [V HYV\UK H
JLU[PTL[YLVYSLZZ<UKLY[OLZLJVUKP[PVUZ
[^VZVS\[PVUZJHUIL\ZLK![OLI\TWLY
VYZPTPSHYKL]PJLHJ[P]H[PUNVULVYTVYL
TPJYVZ^P[JOLZ·I\[[OH[PZZ[PSSHTLJOHU-
PJHSZVS\[PVU·VY[OLPUMYHYLKKL[LJ[VY
^L»YLZ\NNLZ[PUNI\PSKPUNOLYLJVTIPUPUN
[OLLSLNHUJLVMLSLJ[YVUPJZ^P[OMYLLKVT
MYVTHU`TV]PUNWHY[Z
;OLWYPUJPWSLVMZ\JOHKL[LJ[VYPZ]LY`
ZPTWSL ( [YHUZTP[[PUN LSLTLU[ ^OPJO
OLYLPZNVPUN[VILHZPTWSL3,+LTP[ZH
TVYLVYSLZZKPYLJ[PVUHSILHTVM097VZP-
[PVULKUL_[[V[OPZ[YHUZTP[[LYHYLJLP]PUN
LSLTLU[^OPJOTH`ILHWOV[VKPVKLVY
WOV[V[YHUZPZ[VYPZZ\P[HIS`VYPLU[LKZV[OH[

\UKLY UVYTHS JPYJ\TZ[HUJLZ P[ KVLZU»[
YLJLP]LHU`[OPUN)\[HZZVVUHZHUVIZ[H-
JSL PZ WYLZLU[ H[ H Z\P[HISL KPZ[HUJL P[
YLMSLJ[Z WHY[ VM [OL SPNO[ LTP[[LK I` [OL
3,+IHJRVU[V[OLWOV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HZL P[
X\PJRS` ILJVTLZ HWWHY-
LU[[OH[PM^L\ZLKHZPTWSL
[OYLZOVSKKL[LJ[VYPUWSHJL
VM [OL TPJYVJVU[YVSSLY P[
^V\SKILPTWVZZPISL[VNL[
YLSPHISLYLZ\S[Z(TPJYVJVU-
[YVSSLY^P[OºPU[LSSPNLU[»ZVM[-
^HYLJV\SKMVYL_HTWSLIL
WYVNYHTTLK [V JHSJ\SH[L
[OLKPZ[HUJL[V[OLULHYLZ[
VIQLJ[VY[VYLWVY[[OLKPZ-
[HUJLZ [V ZL]LYHS VIQLJ[Z
ZPT\S[HULV\ZS`

:PUJL[OLVUS`JVUULJ[PVUZ
[V[OLJPYJ\P[HYLH=Z\W-
WS` HUK NYV\UK H JVU[YVS
ZPNUHSMVY[OL[YHUZTP[[LYHUK
[OLHUHSVN\LLU]LSVWLZPN-
UHSYL[\YULKI`[OLYLJLP]LY
[V[OLWYVJLZZPUNOHYK^HYL
P[PZZ[YHPNO[MVY^HYK[V^PYL
\WMV\YJVWPLZVM[OLJPYJ\P[
TV\U[LKH[YPNO[HUNSLZ[V
VUL HUV[OLY 0U H YVIV[-
PJZ HWWSPJH[PVU [OPZ ^V\SK
NP]L[OLYVIV[[OLHIPSP[`[V
KL[LJ[VIQLJ[ZPUHU`WVZP-
[PVUYLSH[P]L[VP[ZLSM

(070281-I)

2

1

3

IC1.A

r1

5

6

4

IC1.B

r1

12

13

11

IC1.D

r1

8

9

10

IC1.C

r1

R1

39k

P1

10k

R5

470k

C1

150p

STI

1

3

2

4

R9

22k

+5V

US TX

(40kHz)

US

+5V

(40kHz)

US

2

3

1

IC2.A

9

10

8

IC2.C

13

12

14

IC2.D

R3

56k

R6

100k

C3

10p

C6

10p

C7

100n

C2

100n

R7

3k9

R2

4k7

D1

LL4448

R4

180k

R8

180k

C4

4

M7

25V

C8

4

M7

25V

V+

R10

22k

C9

100n

US RX

6

5

7

IC2.B

IC2

11

4

IC1

14

7

C5

100n

V+

070281 - 11

+5V

GND

CONTROL

IC1 = CD4001

IC2 = TL084

1

t

1

t

2

control input

analogue output

time

070281 - 12

2

t

1

t

2

control input

analogue output

time

070281 - 13

strong refection

3

t

1

control input

analogue output

time

070281 - 14

1

st

maximum

2

nd

maximum

1

rd

maximum

4

background image

32

elektor electronics - 7-8/2007

An Inclinometer for Your Robot

C. Tavernier

www.tavernier-c.com

0M`V\YTVIPSLYVIV[»ZZVSLM\UJ[PVUPZ[V
YVHTHIV\[[OL[PSPUNVY^VVKLUMSVVYZ
VM`V\YOVTLP[»ZUV[]LY`SPRLS`[VOH]L
T\JOULLKVM[OLZLUZVY^L»YLNVPUN[V
ILKLZJYPIPUNPU[OPZHY[PJSL/V^L]LYPM
P[OHZ[VJVUMYVU[[OLOHYZOYLHSP[PLZVM[OL
NYV\UKVM[OLV\[ZPKL^VYSK^P[OP[ZOVSLZ
HUKI\TWZHUPUJSPUVTL[LYTH`WYV]L
L_[YLTLS`\ZLM\SPUVYKLYMVYP[UV[
[V RLLS V]LY H[ [OL MPYZ[ L]LY ZV
ZSPNO[\UL]LUULZZ
)LMVYL LSLJ[YVUPJZ RUL^ OV^ [V
HJJVTWSPZOHSS[OLMLH[Z[OH[^LHYL
\ZLK[V[VKH`HUPUJSPUVTL[LY^HZ
HW\YLS`TLJOHUPJHSZ`Z[LT^P[O
HSS[OLKPMÄJ\S[PLZVMPTWSLTLU[H-
[PVUJ\TILYZVTLULZZHUKSHJRVM
HJJ\YHJ`[OPZPTWSPLK4PNO[HZ^LSS
ZH`[OH[P[Z\ZLPUHUHTH[L\YYVIV[
^HZPMUV[PTWVZZPISLH[SLHZ[]LY`
KPMÄJ\S[
-VYHML^`LHYZUV^[OPZOHZUV
SVUNLY ILLU [OL JHZL [OHURZ [V
[OLTHYRL[PUNI`(UHSVN+L]PJLZ
VMºZVSPKZ[H[L»HJJLSLYVTL[LYZPL
WYVK\JLKPU[OLMVYTVM0*Z^P[O
UV]PZPISLTV]PUNWHY[Z
0UMHJ[P[»ZZ[PSSPT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1

XOUT

BIAS

YOUT

VDD

COM

NC

ST

NC

8

3

1

2

4

5

7

6

6

5

7

IC2.B

2

3

1

IC2.A

C2

47n

C3

47n

C1

100n

+6V...+12V

C4

10n

8

4

IC2 = OP284

C5

10

M

16V

070305 - 12

PIC16F876

RA4/T0CKI

RA3/AN3

RA5/AN4

RA1/AN1

RA0/AN0

RA2/AN2

RC3/SCL

RC4/SDA

MCLR

IC3

OSC2

OSC1

RB0

RC6

RC7

RC0

RC1

RC2

RC5

RB1

RB2

RB3

RB4

RB5

RB6

RB7

20

10

28

27

26

25

24

23

22

21

11

12

13

14

16

15

17

18

19

8

1

9

3

2

4

6

5

7

1

2

background image

33

7-8/2007 - elektor electronics

^OLYL(

?

HUK(

Y

HYL

[OLHUHSVN\L]VS[HNLZ
Z\WWSPLKI`[OLHJJLS-
LYVTL[LY ^OLU P[ PZ
PUJSPULKHUK(

?

HUK

(

@

[OL]VS[HNLZZ\W-

WSPLK ^OLU P[ PZ WLY-
MLJ[S`OVYPaVU[HS
( Z ZOV^U PU -PN-
\YL
[OLHJJLSLYVT-
L[LYHWWSPJH[PVUJPYJ\P[
KVLZU»[ HTV\U[ [V
]LY`T\JO;OLVUS`
PTWVY[HU[ LSLTLU[Z
HYLPUMHJ[JHWHJP[VYZ
*HUK*^OPJOÄS-
[LY[OLHJJLSLYVTL[LY
V\[W\[]VS[HNL0[HJ[\-
HSS`OHZHWHZZIHUKVM
ZL]LYHSR/aHUKJHU
[OLYLMVYLYLHJ[[V]LY`
MHZ[]PIYH[PVUZUV[H[
HSS^OH[^L^HU[PUHUHWWSPJH[PVUHZHU
PUJSPUVTL[LY>P[O[OL]HS\LZJOVZLUOLYL
[OLWHZZIHUKPZYLZ[YPJ[LK[V/aLHZ-
PS`LUV\NO
;OL[^VVWHTWZHYYHUNLKHZMVSSV^LYZ
H]VPKHU`L_[LYUHSPUÅ\LUJLVU[OLZLÄS[LY
JHWHJP[VYZHUKHSSV^[OLHJJLSLYVTL[LY[V
ILJVU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[L
MVYL_HTWSL

t

i

l

t

=

Adc _ Read(0)

tilt = tilt - 512

‘ a d j u s t

according to the voltage output

‘ w h e n t h e i n c l i n o m e t e r i s

horizontal

[VYLJV]LY[OL[PS[PUMVYTH[PVU^P[OH70*
WYVNYHTTLK PU )HZPJ PU [OPZ L_HTWSL
4PRYV)HZPJJVTWPSLYHUKIP[(+*
;OLZHTLPUZ[Y\J[PVUZ^PSSVI]PV\ZS`IL\ZLK
MVYYVSSI\[\ZPUNHUHSVN\LJOHUULSPM`V\
OH]LHKVW[LK[OLJPYJ\P[KPHNYHTZVM-PN-
\YLZVY;OLUP[VUS`YLTHPUZMVY`V\[V
L_WSVP[[OPZKH[H[VWYL]LU[`V\YYVIV[»ZMHSS-
PUNV]LYVU[LYYHPU[OH[»Z[VVZ[LLWMVYP[

(070305-I)

R2

47

7

R1

220k

ADXL311

IC1

XOUT

BIAS

YOUT

VDD

COM

NC

ST

NC

8

3

1

2

4

5

7

6

6

5

7

IC2.B

2

3

1

IC2.A

C2

47n

C3

47n

C1

100n

+6V...+12V

C4

10n

8

4

IC2 = OP284

CB220

IC3

SOUT

P15

P14

P13

P12

P11

P10

SIN

ATN

RES

VIN

P0

21

23

P1

P2

P3

P4

P5

10

P6

11

20

19

18

17

16

15

P9

14

P7

12

P8

13

22

24

5

4

6

7

8

9

1

2

3

070305 - 13

3

Positioning with Photodiode Arrays

Pascal Choquet

0UK\Z[YPHSWYVK\J[PVUSPULYVIV[ZYLX\PYL
OPNOYLZVS\[PVU ZLUZVYZ [V TLHZ\YL [OL
WVZP[PVUVMYVIV[PJHJ[\H[VYZZV[OH[[OL
[VVSZJHUILHJJ\YH[LS`N\PKLKVU[V[OL
^VYRWPLJL(WOV[VKPVKLHYYH`[VNL[OLY
^P[OHUL_[LYUHSSPNO[ZV\YJLPZVM[LU\ZLK
HZHZLUZVYPU[OPZHWWSPJH[PVU;OPZJOPW
JVU[HPUZHSPULVMWOV[VKPVKLZ[VNL[OLY
^P[OHZLYPLZV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

MCLR/VPP

RC2/CCP1

RB0/INT0

RB3/CCP2

RB1/INT1

RB2/INT2

RA0/AN0

RB7/PGD

RB6/PGC

RA1/AN1

RC5/SDO

RB5/PGM

IC3

OSC1

OSC2

RB4

20

11

28

27

26

25

23

24

22

21

19

12

13

14

10

18

17

16

15

8

9

1

3

2

4

6

5

7

MLX90255

A OUT

IC2

CLK

SI

5

3

1

4

2

C1

1

M

25V

C2

1

M

25V

C3
1

M

25V

C4

1

M

25V

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

JHUILTHKL\ZPUNZ[LLSN\P[HYZ[YPUNZ;OL
TH[LYPHSPZ]LY`ÅL_PISLHZ^LSSHZILPUN

Whiskers on Robots

Alexander Wiede-
kind-Klein

:VTL[PTLZ ZVWOPZ[P-
JH[LKZLUZVYZIHZLKVU
]PKLV JHTLYHZ PUMYH-
YLK VY \S[YHZV\UK HYL
UV[X\P[L\W[V[OLQVI
HUK^LOH]L[VYLZVY[[V
ZVTL^OH[TVYLWYPTP-
[P]L Z^P[JO[`WL ZLU-
ZVYZ ;OLZL ^VYR SPRL
HUHUPTHS»Z^OPZRLYZVY
ºHU[LUUHL» VU PUZLJ[Z
KL[LJ[PUNULHYI`VIQLJ[Z
PU [OL LU]PYVUTLU[
>OLUKPZ[\YILKHZLU-
ZVYZLUKZHW\SZL[V[OL
YVIV[[VPUKPJH[L[OH[HUVIQLJ[PZWYLZLU[
:LUZVYZ[OH[HYLIV[OZLUZP[P]LHUKYVI\Z[

JVUK\J[P]L ;OL PKLH
JV\SKUV[ILTVYLZPT-
WSL! ^L WHZZ [OL ^PYL
[OYV\NO H TL[HS [\IL
HUK^OLU[OL^PYLPZPU
JVU[HJ[^P[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
[OH[`V\\ZL[OL^OPZRLY[V[YPNNLYHÅPWÅVW

HZZOV^UPU-PN\YL;OLTPJYVJVU[YVSSLY
PU[OLYVIV[JHU[OLUYLHK[OLZ[H[LVM[OL
ÅPWÅVWH[P[ZSLPZ\YLHUK[OLUYLZL[P[

(070282-I)

IC1.A

3

C

1

R

2

D

4

S

5

6

Q

Q

10k

+5V

070282 - 11

SENSOR INPUT

RESET

IC1 = 74HC74

2

3

CO Sensor

;OL-PNHYV;.:ZLUZVYPZHJHYIVU
TVUV_PKL ZLUZVY [OH[ PZ \ZLK WYPTHYPS`
PUPUK\Z[YPHSHWWSPJH[PVUZZ\JOHZZTVRL
KL[LJ[VYZÄYLKL[LJ[PVULX\PWTLU[HUK
]LU[PSH[PVUJVU[YVSSLYZMVYPUKVVYJHYWHYRZ
HUK[OLSPRL;OLZLUZVYPZX\P[LZ\P[HISLMVY
\ZLPUIH[[LY`WV^LYLKHWWSPJH[PVUZHUKP[
OHZZL]LYHSHK]HU[HNLZV]LYJVU]LU[PVUHS
ZLUZVYZ;OLLSLJ[YVS`[LPZLU]PYVUTLU[HSS`

MYPLUKS`HUK[OLOV\ZPUNPZSLHRWYVVM;OL
ZLUZVYJHUTLHZ\YL*6JVUJLU[YH[PVU\W
[VHUKP[OHZH[LTWLYH[\YLYHUNLVM¶
¢*[V¢*;OLOV\ZPUNOHZ[OLZHTL
MVYTHZHU((IH[[LY`

(ML^ZWLJPÄJH[PVUZ!

:\P[HISL MVY \ZL PU IH[[LY`WV^LYLK

LX\PWTLU[

Gas inlet

Gas inlet

Cap / Working electrode

terminal

Active charcoal filter

Gasket

Gas sensing layer

Water

Backing

Layer

Catalyst

Layer

Separator

(immersed by liquid

alkaline electrolyte)

Gas diffusion

control film

Can /

Counterelectrode

terminal

Washer

070187 - 12

2

3

1

IC1

AD708

R1

1k

R2

100k

C1

22

M

070187 - 11

U

out

TGS5042

counter

working

Figure 1.

Internal structure of the sensor.

Figure 2.

A simple sample application circuit.

background image

36

elekt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LMYVT[OL,SLR[VY,SLJ[YVU-
PJZ^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/

background image

37

7-8/2007 - elektor electronics

Ultrasonic
Distant Obstacle Detector

B. Broussas

;OLÄYZ[ZLUZVYHYVIV[\Z\HSS`NL[ZÄ[[LK
^P[OPZHUVIZ[HJSLKL[LJ[VY0[TH`[HRL
[OYLLKPMMLYLU[MVYTZKLWLUKPUNVU[OL
[`WLVMVIZ[HJSL`V\^HU[[VKL[LJ[HUK
HSZV·PUKLLKHIV]LHSS·VU[OLKPZ-
[HUJLH[^OPJO`V\^HU[KL[LJ[PVU[V[HRL
WSHJL

-VYJSVZLVY]LY`JSVZLVIZ[HJSLZYLÅLJ[P]L
09ZLUZVYZHYLTVZ[VM[LU\ZLKHUL_HTWSL
VMZ\JOHWYVQLJ[HWWLHYZLSZL^OLYLPU[OPZ
PZZ\L;OLZLZLUZVYZHYLOV^L]LYSPTP[LK
[VKPZ[HUJLZVMHML^TT[V[LUVYZVTT
H[TVZ[
(UV[OLYZPTWSLHUKMYLX\LU[S`LUJV\U-
[LYLKZVS\[PVUJVUZPZ[ZVM\ZPUNHU[LUUHL
SPRLJVU[HJ[KL[LJ[VYZVYº^OPZRLYZ»^OPJO
HYLUV[OPUNTVYL[OHUSVUNLYVYZOVY[LY
WPLJLZVMWPHUV^PYLVYZVTL[OPUNZPTPSHY
V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LY
;OLJPYJ\P[ZOV\SK^VYRH[VUJLHUKHSS
`V\ OH]L [V KV PZ HKQ\Z[ 7 [V ZL[ [OL
KL[LJ[PVUKPZ[HUJL`V\^HU[·I\[[OPZPZ
HSZVKLWLUKLU[VU[OLWVZP[PVUPUNVM[OL
[YHUZK\JLYZ-VYVW[PT\TVWLYH[PVU^L
YLJVTTLUK`V\HUNSL[OLTHZZOV^UPU
-PN\YL

(070236-I)

T1

BC548B

T2

BC548B

T3

BC548B

R1

4k7

R2

470k

R3

330

7

R4

470k

R5

2k2

R7

10k

P1

1k

lin.

RXUS

TXUS

C1

22n

C2

560p

C4

10n

C3

470n

C5

100

M

15V

R6

220k

D2

1N4148

D1

1N4148

1

2

1

IC1.A

3

4

S2

S1

1

IC1.B

+5V...+12V

IC1

14

7

IC1 = 74HC14

070236 - 11

Distance

maximum

de

détection

Obstacle

070236 - 12

1

2

background image

38

elektor electronics - 7-8/2007

Light Sensing with an LED

Andreas Grün

4HU`YVIV[PJHWWSPJH[PVUZYLX\PYLHZLU-
ZVY[VTLHZ\YLSPNO[SL]LSZ;OLJVU]LU-
[PVUHSHWWYVHJOHZZOV^UPU-PN\YL\ZLZ
HU(+JVU]LY[LY[VTLHZ\YL[OL]VS[HNL
KYVWHJYVZZYLZPZ[VY9WYVK\JLKI`[OL
WOV[VJ\YYLU[[OYV\NOHWOV[V[YHUZPZ[VY
;OLÄ_LK]HS\LVM9SPTP[Z[OLSPNO[YHUNL
^OPJOJHUILTLHZ\YLK"HOPNOYLZPZ[VY
]HS\LPZZ\P[HISLMVYTLHZ\YPUNSV^SPNO[
SL]LSZ^OPSLHSV^YLZPZ[HUJLPZNVVKPU
IYPNO[JVUKP[PVUZ;OLYLZVS\[PVUVM[OL
(+JVU]LY[LYHSZVWSH`ZHWHY[PUKL[LY-
TPUPUN[OLYHUNLVMSPNO[SL]LSZ[OH[JHU
ILTLHZ\YLK
(SP[[SL\ZLKWYVWLY[`VMHZ[HUKHYK3,+

PZP[ZYL]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LZHSS[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+PMMLY-
LU[3,+ZHYLZLUZP[P]L[VZWLJPÄJJVSV\YZ
^OPJOJHUHSZVIL\ZLM\SPUZVTLYVIV[PJ
HWWSPJH[PVUZ

(070356-I)

Web link

[1] www.merl.com/publications/TR2003-035/

T1

R1

070356 - 11

V

CC

Listing

Example program:

#include <avr/io.h>
#include <avr/interrupt.h>

#define LEDPIN 0x40 // LED on PB6

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

sei();

while(1)
{
if((PINB & LEDPIN) == 0) // discharge complete
{
PORTB = LEDPIN; // PB6 hi

// multiple times

to get enough charging time

DDRB |= LEDPIN; // PB6 output and hi, charges LED
DDRB |= LEDPIN; // PB6 output and hi, charges LED
DDRB |= LEDPIN; // PB6 output and hi, charges LED
DDRB |= LEDPIN; // PB6 output and hi, charges LED

DDRB &= ~LEDPIN; // PB6 input, still charging w/ pullup
PORTB = 0; // switch off pullup
PORTA ^= LEDPIN; // toggle PORTA for display LEDs
}
}

return(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[VYZHYLKYP]LUI`[OLWV^LYZ[HNLZ
WYV]PKLKI`[OL3 LHJOKYP]PUNHZPUNSL

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!

MotoBox Specifications

• Drives 3 types of motors:

• bipolar stepper motors

• DC motors

• servo motors

• Motor actuated using serial port @ 9600,N,1

• Up to 13.8V supply for motors

• Easy to use command set

• Curr

ent monitoring, up to 2

A (DC and servo motor)

or 4 A

(stepper motor)

• LED indicator: gr

een ‘ok’, r

ed ‘err

or’

• Individual contr

ol of each motor driver bridge

background image

41

7-8/2007 - elektor electronics

TV[VY;OL3 PZHK\HSOHSMIYPKNLKYP]LY
JHWHISL VM ( WLY JOHUULS ^P[O ZLWH-
YH[LLUHISPUNHUKJ\YYLU[ZLUZPUNMVYLHJO
IYPKNL0[PZZ\P[LK[VKYP]PUNKPMMLYLU[[`WLZ
VMTV[VYZ0U[OPZWYVQLJ[[OL3 PZLUH-
ISLKI`[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[V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LKOUT

15

VD

D

14

IC1

PIC16F628-04/P

C1+

1

VD

D

2

C1-

3

C2+

4

C2-

5

VE

E

6

T2OUT

7

R2IN

8

R2OUT

9

T2IN

10

T1IN

11

R1OUT

12

R1IN

13

T1OUT

14

GND

15

VCC

16

IC3

MAX232CPE

D1

D2

D3

D4

D5

D6

C17

100n

C19

100n

C21

100n

K6

K7

K8

GND

GND

GND

Vsup

Vsup

+5V

R1

10

k

R11

330

D14

5W

R9

0R

22

R5

4k7

R3

10

k

R4

10k

C13

100n

C12

220n

GND

1E

1

1Y1

2

1Y2

3

VC

C2

4

1A1

5

1A2

7

1EN

6

GN

D

8

VC

C1

9

2A1

10

2EN

11

2A2

12

2Y1

13

2Y2

14

2E

15

IC5

L298KV

7

5

6

IC6B

D7

D8

D9

D10

D11

D12

C18

100n

C16

100n

K5

K10

K9

GND

GND

Vsup

Vsup

+5V

R2

10k

R13

330

D15

5W

R10

0R22

R8

4k7

R6

10k

R7

10k

C15

100n

C14

220n

GND

GND

C4

100n

R12

47

0

+5V

+5V

GND

K4

C10

100n

C11

100n

GND

D13

1N4148

25V

C8

1u

25V

C6

1u

25V

C7

1u

25V

C9

1u

25V

C22

10u

C3

100n

1

2

3

4

5

6

7

8

9

11

10

K3

D Connector 9

K2

K1

Vsup

63V

C1

100u

25V

C20

47u

C5

100n

C2

100n

+5V

GND

3

2

1

IC2

L78L05CZ

R14

470

D16

R15

4k7

+5V

GND

+5V

GND

4

8

IC6C

GND

GND

6x 1N5400

6x 1N5400

IC6 = LM358AJG

070129 - 11

1

2

3

4

5

6

1

2

3

4

5

6

R16

5k6

+5V

R17

1k5

C23

100n

GND

Table 1. Driver options chart

Motor header function

Output

Motor 1

Motor 2

μC Pin

RB3

RB2

RB1

RB0

RB7

RB6

RB5

RB4

Header pin

2

3

4

5

2

3

4

5

Mode

Stepper driver

Each output

drives a motor phase

Each

output drives a motor phase

DC motor driver (1)

Servo driver (2)

(3)

P(4)

P(4)

(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

Figure 1.

Circuit diagram of Motobox, the ‘one size fits all’ controller for motors typically used in robots.

background image

42

elektor electronics - 7-8/2007

TV\U[VU[OL7*)VM^OPJO[OLJVTWV-
ULU[V]LYSH`PZZOV^UPU-PN\YL
;OLYL»ZSP[[SL[VZH`VU[OLJVTWVULU[Z
\ZLKL_JLW[[OH[[OLæYLZPZ[VYPZ
WYLMLYHIS` UV[ VM [OL ^PYL^V\UK [`WL
HUK[OLIPJVSV\Y3,+ZOH]L[^VWPUZ
UV[[OYLL0M`V\KVUV[LU]PZHNLPU[LY-
MHJPUN [OL IVHYK [V H 7* [OL Z\I+
JVUULJ[VY TH` IL SLM[ V\[ /V^L]LY
[OL4(?ZOV\SKHS^H`ZILWYLZLU[
3PRL^PZL0*HUK0*ZOV\SKHS^H`ZIL
ZVSKLYLK[V[OL7*)

+Y`[LZ[PUN

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;OLTPJYV-
JVU[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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JVYYLJ[S`
[OLSL[[LYº,»^PSSILZLU[IHJRPUKPJH[PUN

\W^OLU[OLZ`Z[LTPZ^VYRPUNJVYYLJ[S`
HUKYLK^OLU[OLTV[VYKYP]LYOHZILLU
[\YULKVMM

HULYYVULV\ZJVTTHUK;OLJVTTHUK
I\MMLYPZJSLHYLKHUK[OLIVHYK^HP[ZMVY
HUL^JVTTHUK;OL3,+Z^PSS[\YUSPNO[

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

IC3

R9

D6

1

C7

C

6

C4

C2
3

C2
0

D1
2

6

1

C9

9

5

C3

C2
2

C1
1

K3

R1
7

R1
2

R1
6

R1
5

D1
3

K4

C1
0

C1
2

C8

IC1

D1
4

R1
1

R1

C1
8

IC4

R5

C1
6

15

D3

R2

C5

R1
3

D1
5

IC2

C2

R1

0

C1
7

1

C1
9

K1

C1

IC5

15

D9

R4

K2

R3

C1
3

IC6

R6

D1
6

C1
5

C2
1

R8

R7

C1
4

R1
4

D1

D5

D2

D4

D7

D1
1

K6

K7

K8

D8

D1
0

K5

K10

K9

Figure 2. Component mounting plan of the PCB designed for Motobox. The copper track layout is a

free download from the Elektor website.

background image

43

7-8/2007 - elektor electronics

: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

20

DCBBAK

DC both motors ccw

21

DCBOFF

DC both motor OFF

22

SV2FOR

Servo 1 cw

23

SV2BAK

Servo 1 ccw

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

COMPONENTS LIST

Resistors

R1-R4,R6,R7 = 10k

7

R5,R8,R15 = 4k

77

R9,R10 = 0.22

7 5W

R11,R13 = 330

7

R12,R14 = 470

7

R16 = 5k

76

R17 = 1k

75

Capacitors

C1 = 100μF 40V radial
C2-C5,C10,C11,C13,C15-C19,C21 = 100nF
C6-C9 = 1μF 25V radial
C12,C14 = 220nF
C20 = 47μF 25V radial
C22 = 10μF 25V radial
C23 = 100nF

Semiconductors

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.

background image

44

elektor electronics - 7-8/2007

VMM Z^P[JOPUN VM +* TV[VYZ ^PSS JH\ZL
SHYNLJ\YYLU[ZWPRLZ^OPJOTH`JH\ZL
[OLJVU[YVSSLY[VZO\[KV^U[OLWHY[PJ-
\SHYTV[VYKYP]LY@V\JHUKPZHISL[OL
J\YYLU[ TVUP[VYPUN I\[ [OPZ PZ UV[ YLJ-
VTTLUKLK6]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

Author’s websites and email address

http://telecomms.no-ip.org

www.mcast.edu.mt

jozamm@gmail.com

Web links

www.microchip.com

www.st.com/stonline/products/literature/
ds/1773.pdf

ILZLU[HUK[Y`[VNL[[OLTV[VY\UZ[\JR
MYVTP[ZJ\YYLU[WVZP[PVU

:VM[^HYL

;OL ZV\YJL JVKL HUK OL_ JVKL MVY [OL
70*-(PZH]HPSHISLHZHMYLLKV^U-
SVHKMYVT[OL,SLR[VY,SLJ[YVUPJZ^LIZP[L
;OLMPSLU\TILYPZ aPW 1\S`
(\N\Z[

(070129-I)

M

M

M

Motor

Board

Power supply

Serial

input

Motor

Board

Power supply

Serial

input

3

2

2

3

070129 - 12

1

4

5

6

Motor

Board

Power supply

Serial

input

2

3

4

5

Figure 3. How to connect up your motors.

12 V Bidirectional Motor Control

Stefan Brandstetter

;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
;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`[OLZ\WWS`HUKJHWHJP[VY
*WYV]PKLZZTVV[OPUN[VNP]L
H+*V\[W\[]VS[HNLVMHYV\UK
= ( JSHZZPJ º/» IYPKNL
JVUMPN\YH[PVUPZTHKL\W^P[O[YHUZPZ[VYZ

;; HUK;;;YHUZPZ[VYZ; HUK;
[VNL[OLY^P[OYLZPZ[VYZ9HUK9WYV]PKL

[OLJ\YYLU[ZLUZLHUKSPTP[PUNTLJOHUPZT
;OLTH_PT\TV\[W\[J\YYLU[SPTP[JHUIL

D1

D3

D2

D4

TR1

C1

1000

M

40V

R1

150

7

R2

150

7

R7

0

7

47

P1.A

2k2

D5

BAT42

T1

T5

BC327

R5

150

7

T3

R9

1k

C2

1

M

R3

150

7

R4

150

7

R8

0

7

47

P1.B

2k2

D6

BAT42

T2

T6

BC327

R6

150

7

T4

230V

070104 - 11

1W

1W

18V
1A5

4x 1N5401

T3, T4 = BDW94C; BD902; BD680

T1, T2 = BDW93C; BD901; BD679

background image

45

7-8/2007 - elektor electronics

JOHUNLKMYVT(I`\ZPUNKPMMLYLU[]HS\L
YLZPZ[VYZMVY9HUK9!

I

6<;

$=R

^OLYL9NP]LZ[OL]HS\LMVY9HUK9-VY
PUJYLHZLKJ\YYLU[SPTP[[OLTHPUZ[YHUZMVY-
TLYHUKKPVKLZ^PSSULLK[VILJOHUNLK[V
JVWL^P[O[OLL_[YHJ\YYLU[HZ^LSSHZ[OL
MV\Y[YHUZPZ[VYZ\ZLKPU[OLIYPKNLJVUÄ-

N\YH[PVU4V[VYZWLLKJVU[YVSHUKKPYLJ-
[PVUPZJVU[YVSSLKI`H[^PUNHUNLKSPULHY
WV[ 7 ;OL [^V [YHJRZ VM 7 [VNL[OLY
^P[O99HUK99MVYT[^VHKQ\Z[H-
ISLWV[LU[PHSKP]PKLYUL[^VYRZ>PYPUN[V
[OL[YHJRLUKZHYLYL]LYZLKZV[OH[HZ[OL
WV[PZ[\YULK[OLV\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U[YVS-
SLYZ^P[JOLZ[OLWV^LYZ[HNLºSV^ZPKL»
KPYLJ[S`-VYOPNOZPKLKYP]PUNSL]LSZOPM[LYZ
HYLULJLZZHY`
;OLZJOLTH[PJVM[OL/IYPKNLWV^LYZ[HNL
ZOV^ZHML^PU]LY[LYZ5(5+NH[LZHUK
[^V[YPZ[H[LHISLKYP]LYZ;OLZLSVNPJM\UJ-
[PVUZHYL]LY`PTWVY[HU[HZ[OLLHZPLY^H`
PLKPYLJ[S`JVU[YVSSPUNHSSMV\Y46:-,;
OHZHMH[HSKPZHK]HU[HNL

0U JHZL VM H ZVM[^HYL JYHZO P[

JV\SKOHWWLU[OH[[^VVYL

TVYL46:-,;ZHYL

Z^P[JOLKVU

PUJVY-

YLJ[S`

MVYL_HT-

WSL;HUK;0U[OH[JHZL[OL

J\YYLU[[OYV\NO[OL[YHUZPZ[VYZPZSPTP[LK
I`[OLPU[LYUHSYLZPZ[VYZVM[OL46:-,;Z

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

(070172-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).

T4

RFP30P06

T7

BUK101

D2

1N4001

D5

1N4001

R14

10k

R18

10k

T3

BC337

R15

10k

1

2

3

IC7.A

&

9

10

8

IC7.C

&

4

5

6

IC7.B

&

IC8

EN

2

3

1

T5

RFP30P06

T8

BUK101

D1

1N4001

D6

1N4001

R21

10k

R17

10k

T6

BC337

R18

10k

12

13

11

IC7.D

&

IC8

EN

5

6

4

M

U+

C11

IC7

14

7

IC8

14

7

070172 - 11

IC7 = 74HCT00

IC8 = 74HCT125

STOP

PWR

DIR

background image

46

elektor electronics - 7-8/2007

Complete Stepper Motor Driver

Hesam Moshiri

>P[O[OPZJPYJ\P[`V\JHUTHRLHZ[LWWLY
TV[VYKVQ\Z[HIV\[HU`[OPUNP[^PSSULLK
[VKVPUYVIV[PJZHWWSPJH[PVU!YV[H[PVU[V
[OLSLM[VYYPNO[PUM\SSZ[LWVYOHSMZ[LW
TVKL
:[LWWLYTV[VYZJVU]LY[LSLJ[YPJHSW\SZLZ
PU[VTLJOHUPJHSTV]LTLU[0UHWWSPJH-
[PVUZSPRLOHYKKPZRZWYPU[LYZHUKWOV[V-
JVWPLYZ [V TLU[PVU I\[ H ML^ Z[LWWLY
TV[VYZHYL\ZLKMVYYV[H[PVUHUKVYHJJ\-
YH[LWVZP[PVUJVU[YVSVMTLJOHUPJHSHZZLT-

ISPLZ,]LY`Z[LWWLYTV[VYOHZVULWLYTH-
ULU[S`THNUL[PJH_SLJHSSLK[OLrotor;OPZ
PZZ\YYV\UKLKI`HÄ_LKWHY[JHSSLK[OL
stator<Z\HSS`Z[LWWLYTV[VYZOH]LMV\Y
Z[H[VY^PYLZ^P[O[^VVYVULJVTTVU^PYL
^OPJOPZUVYTHSS`JVUULJ[LK[V[OLWVZP-
[P]LZ\WWS`]VS[HNL

)` HWWS`PUN H JVU[YVSSLK ZLX\LUJL VM
W\SZLZ[V[OLPUKP]PK\HSZ[H[VY^PUKPUNZ
[OLYV[VY^PSSZ[HY[[VYV[H[L:[LWWLYTV[VYZ
TH`KPMMLYPUZPaLZOHWLWV^LYZ\WWS`
]VS[HNL JVZ[ HJJ\YHJ` HUK ZV VU I\[

PTWVY[HU[S`PU[OLU\TILYVMZ[LWZ[OH[
THRL\WVULJVTWSL[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-

INT0/P3.2

INT1/P3.3

AT89C2051

P1.0/IN+

P1.1/IN–

RXD/P3.0

TXD/P3.1

T0/P3.4

T1/P3.5

IC2

P1.2

P1.3

P1.4

P1.5

P1.6

P1.7

P3.7

RST

X1

X0

20

10

12

13

14

15

16

17

18

19

11

5

4

2

3

1

6

7

8

9

C5

10

M

16V

R1

8k2

R2

10k

S1

HALF

R3

10k

S2

FULL

R4

10k

S3

RIGHT

R5

10k

S4

LEFT

X1

12MHz

C4

33p

C3

33p

ULN2003

IC3

GND

DS

10

11

12

13

14

15

16

I1

I2

I3

I4

I5

I6

I7

O1

O2

O3

O4

O5

O6

O7

9

1

2

3

6

7

4

5

8

STEP

STEP

M1

M

R6

10k

R7

10k

R8

10k

R9

10k

+5V

7805

IC1

C1

47

M

16V

C2

100n

+5V

+9V

070228 - 11

M1 = 5V Stepper Motor

Table 1

Step angle

(degrees)

Steps per

revolution

0.72

500

1.8

200

2.0

180

2.5

144

5.0

72

7.5

48

15

24

Table 2. Full-step mode.

Rotation to the right

(cw)

Step

Winding A

Winding B

Winding C

Winding D

Rotation to the left

(ccw)

§

1

1

0

0

0

£

2

0

1

0

0

3

0

0

1

0

4

0

0

0

1

Table 3. Half-step mode.

Rotation to the right

(cw)

Step

Winding A

Winding B

Winding C

Winding D

Rotation to the left

(ccw)

§

1

1

0

0

0

£

2

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LY [V WYV-
K\JL[OLTJVU[PU\V\ZS`WYL]LU[PUN[OL
)HZPJ:[HTWMYVTKVPUNHU`[OPUNLSZL0M
`V\KVU»[^HU[[V\ZLH*\ISVJHUV[OLY
ZVS\[PVUJVUZPZ[ZPU\ZPUNHZWLJPHSPaLK0*
SPRL[OL40*MYVT4PJ[YVUPJZ^^^
TPJ[YVUPJZJVT^OPJOJHUJVU[YVS\W[V
ZLY]VZZPT\S[HULV\ZS`PUHZ[HUKHSVUL
THUULYPMULJLZZHY`YLMLY[V[OL,SLR[VY
:\TTLY*PYJ\P[ZLKP[PVU

(070238-I)

[OPZ^H`P[JHUMVYL_HTWSLTV]LHZLU-
ZVYPUVULWSHULV]LYH[V[HSHTWSP[\KLVM
‡ZLL3PZ[PUN
;OLPUZ[Y\J[PVU7<3:6<;NLULYH[LZW\SZLZ

Listing 1

‘ Basic Stamp I and II or in

Basic programmed PIC version

loop:

for b2 = 100 to 200

for b3 = 1 to 5

pulsout

0,b2 ‘ servo connected to port P0

pause 15

next

next

goto loop

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

PIC12C508 Stepper Motor Controller

C. Tavernier

www.tavernier-c.com

>OLU ^L»YL UV[ \ZPUN H Z[LWWLY
TV[VY[VLUZ\YLWYLJPZLWVZP[PVUPUNVM
HYVIV[LSLTLU[P[JHUIL\ZLKHZH
[YHJ[PVUTV[VYPUWSHJLVM[OLZ[HUK-
HYKTVKPÄLKZLY]VZWYLZLU[LKLSZL-
^OLYLPU[OPZPZZ\L<UKLY[OLZLJVU-
KP[PVUZ[OLYL»ZUVSVUNLYHU`ULLK
[VºJV\U[[OLZ[LWZ»[OLTV[VYOHZ[V
THRLHZHSS^L^HU[PZ[VTHRLP[
YV[H[LJVU[PU\V\ZS`PUVULKPYLJ[PVU
VY[OLV[OLY
:L]LYHSZVS\[PVUZ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

GP4

GP5

D1...D8 = 1N4004

070302 - 12

M

2

Table 1. Programming step duration
by modifying a constant used in the
program.

Binary Step

constant

duration

10010010

1 ms

10010011

2 ms

10010100

4 ms

10010101

8 ms

10010110

16 ms

10010111

32 ms

MA

M

MB

M

GP0A

GP1A

GP4A

GP5A

GP0B

GP1B

GP4B

GP5B

L1

L2

L3

L4

L5

L6

L7

L8

ULN2803

IC1

VEE

11

12

13

14

15

16

17

18

I1

I2

I3

I4

I5

I6

I7

I8

O1

O2

O3

O4

O5

O6

O7

O8

10

1

2

3

6

7

8

4

5

9

070302 - 13

+U

M

+U

3

background image

50

elektor electronics - 7-8/2007

Rajkumar Sharma

;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[VYMYL-
X\LUJ`PZKL[LYTPULKI`[OLJVTWVULU[Z
H[[HJOLK[VWPUZHUK7YLZL[7ZLY]LZ
[VHKQ\Z[[OLMYLX\LUJ`IL[^LLUR/a
HUKR/a(S[OV\NOP[PZNLULYHSS`YLJ-
VTTLUKLK[VZ[H`HIV]LR/aHZV[O-
LY^PZL [OL TV[VY ^PSS WYVK\JL H\KPISL
ZV\UKPUZVTLJHZLZ[OH[»ZQ\Z[UV[WVZ-
ZPISLKLWLUKPUNVU[OLTV[VY`V\»YL\ZPUN
7V[7KL[LYTPULZ[OLK\[`J`JSL^OPJO
JHU IL HKQ\Z[LK MYVT [V [V
LMMLJ[P]LS`JVU[YVS[OLTV[VYZWLLK»0U[LY-
UHS[YHUZPZ[VYZHYL\ZLKPUHZ\JOH^H`HZ
[VVI[HPUK\[`J`JSL;OLPU[LYUHS
KYP]LY[YHUZPZ[VYZHYLNYV\UKLKI`WPUZ
HUKMVYHS[LYUH[LVZJPSSH[VYJ`JSLZ7PU
VM[OL0*PZ[OL9,-=[LYTPUHS^OPJONP]LZ
=V\[9LZPZ[VY9MLLKZ[OLZ\W-
WS`]VS[HNL[VHU

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

OUT B

14

OSC OUT

4

IN+

2

RT

6

CT

5

DISC

7

CMPEN

9

IN-

1

SYNC

3

GND

12

SS

8

VC

C

15

VC

13

OUT A

11

VR

EF

16

SD

10

IC1

SG3525AN

BS1

1

OUT1

2

DIR

3

B

4

PWM

5

VS

6

GND

7

CS

8

T

9

OUT2

10

BS2

11

IC2

LMD18200

C3

18n

C2

100n

C4

100n

GND

GND

GND

R1

10k

R6

2k7

R3

2k2

C1

100n

R4

18

k

R5

330

C5

100n

C9

100n

C7

100n

R2

18k

S1

VCC2

VCC2

VCC1

VCC1

VCC1

1

3

2

IC3

L7805ACV

63V

C8

100u

63V

C6

100u

R7

1k5

D1

D2

GND

GND

GND

100k

P2

VCC2

K1

K3

K2

P1

10k

060339 - 11

0

0

C3

3

IC3

2

C9

R1

IC1

C1

D1

R6

R5

R4

11

R7

1

C8

C5

K2

D2

C6

C7

K3

IC2

C4

K1

P1

P2

R3

R2

1

S1

C2

Featur

es

• Moto

r supp

ly volt

age 1

2 V to 3

0 V DC

• Deli

vers u

p to 3 a

mps c

ontinu

ous ou

tput

• PWM f

reque

ncy a

djusta

ble fro

m 1.16

kHz to 3

5.1 KH

z

• PWM c

ontinu

ously a

djusta

ble by p

ot

• Duty

cycle 0 to 1

00%

• Dire

ction c

ontrol by s

witch

• Sho

rted lo

ad prote

ction

• Therma

l shutdo

wn

• No S

MD co

mpon

ents

• No micr

ocontr

oller

1

2

3 Amp PWM DC Motor Controller

background image

51

7-8/2007 - elektor electronics

[OL JOPW [LTWLYH[\YL PZ KLNYLLZ
;OL0*PZH\[VTH[PJHSS`ZO\[KV^U^OLU
KLNYLLZ * PZ YLHJOLK 7PU VM [OL
34+PZ[OLJ\YYLU[ZLUZLPUW\[9
JVUULJ[Z[OPZWPU[VNYV\UK;OL)YHRL
PUW\[WPUPZOHYK^PYLK[VNYV\UK*
HUK*H[[OLTV[VYV\[W\[HYLºIVV[Z[YHW»
JHWHJP[VYZ7PUZHUKHYL[OL/)YPKNL
V\[W\[ZWV^LYPUN[OL+*TV[VY
0U[OLWV^LYZ\WWS`ZLJ[PVUJHWHJP[VYZ*
[OYV\NO* ZLY]L[VZ\WWYLZZUVPZLVU[OL
[^VZ\WWS`YHPSZ;OL3(*=]VS[HNL
YLN\SH[VYMVY[OLSVNPJZ\WWS`HJJLW[ZHU`
\UZ[HIPSPZLK+*]VS[HNLIL[^LLU=[V
=HWWSPLK[V2;OLV[OLYZ\WWS`JVU-
ULJ[VY2PZMVY[OLTV[VYWV^LY;OL
JHWHJP[` VM [OL TV[VY Z\WWS` VM JV\YZL
KLWLUKZVU[OLTV[VY\ZLK0M[OLTV[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[OLJVW-
WLY[YHJRZ[VMYVT22^P[OSLUN[OZVM
TT

2

ZVSPKJVWWLY^PYL

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

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
aPW
MYVTV\Y^LIZP[L

(060339-I)

COMPONENTS LIST

Resistors

R1 = 10k

7

R2,R4 = 18k

7

R3 = 2k

72

R5 = 330

7

R6 = 2k

77

R7 = 1k

75

P1 = 10k

7 potentiometer

P2 = 100k

7 preset

Capacitors

C1,C2,C4,C5,C7, C9, = 100nF

C3 = 18nF
C6,C8 = 100μF 63V

Semiconductors

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

Driving Higher Power DC Motors

B. Broussas

+YP]PUN [OL ºZTHSS» TV[V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ZOVY[JPYJ\P[LKHUKPZIYHRLKI`

M1

M

RE2

RE1

+U

M

070317 - 11

control

2

control

1

RSA

SENSE A

OUT 1

RSB

SENSE B

070317 - 12

OUT 4

OUT 2

IN 1

IN 2

IN 3

IN 4

EN A

EN B

OUT 3

+V

S

100n

A

V

ref

B

1

2

3

4

+V

SS

100n

12

10

11

5

9

2

3

4

13

14

8

1

15

7

6

1

2

background image

52

elektor electronics - 7-8/2007

P[ZV^UIHJRLTMLSLJ[YVTV[P]LMVYJL
9LSH`ZJHWHISLVMZ^P[JOPUN(HUK`L[
VUS`YLX\PYPUN=HUKHML^[LUZVMT(
MVY[OLPYJVPSZHYLJVTTVUWSHJLUV^HKH`Z
ZLLMVYL_HTWSL[OL-PUKLYYLSH`ZHUKZV
JHUIL\ZLKPU[OPZ^H`^P[OV\[KPMÄJ\S[`
0M`V\KVU»[SPRL[OPZLSLJ[YVTLJOHUPJHS
ZVS\[PVU^LYLJVTTLUK`V\[V\ZL[OL
IYPKNLWV^LY0*VUL^VY[O`YLWYLZLU[H-
[P]LVM^OPJOPZ[OL3 MYVT:;4PJYV-
LSLJ[YVUPJZ(ZP[ZPU[LYUHSISVJRKPHNYHT

JVUULJ[PVUZ[VLHY[OVY[V[OLZ\WWS`YHPS
HZPUKPJH[LKPU-PN\YL)`Q\NNSPUN^P[O
[OLJVTIPUH[PVUZVMSVNPJSL]LSZVU[OL
JVU[YVS HUK LUHISL PUW\[Z VM [OL 3
`V\JHUL]LUOH]L[^VVW[PVUZMVYTV[VY
Z[VWWPUNHZPUKPJH[LKPU[OL[HISLILSV^!
[OLºMYLL^OLLS»VY\UIYHRLKTVKLVY[OL
IYHRLKTVKLHZZLLUWYL]PV\ZS`^P[O[OL
YLSH`JPYJ\P[;HISLZOV^Z[OLYLSL]HU[
SVNPJSL]LSJVTIPUH[PVUZ
0M[OLKPYLJ[PVUVMYV[H[PVUVM[OLTV[VY
OHZ[VILHISL[VILJOHUNLKP[PZULJLZ-
ZHY`[V\ZL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[LU[^P[OHZPUNSLKPYLJ[PVUVMYV[H[PVU0[PZ
[OLUWVZZPISL[V[HRLVULVM[OLZLTV[VY

+U

M

M2

M

D2

M1

M

D1

OUT1(3)

OUT2(4)

IN1(3)

IN2(4)

ENA(B)

+VSS

L298

GND

+VS

1

2

/

IN1(3)

IN2(4)

ENA(B)

+U

C1

100n

C2

100n

L

070317 - 13

D1, D2 = BY252; 1N5402

3

IN1(3)

IN2(4)

ENA(B)

+VSS

L298

1(3)

2(4)

GND

+VS

OUT

OUT

1

2

/

M1

M

D1

D2

D3

D4

IN1(3)

ENA(B)

IN2(4)

+U

M

C1

100n

070317 - 14

+U

C2

100n

L

D1 ... D2 =
BY252; 1N5402

Table 1.

EnA(B)

In1(3)

In2(4)

M1

M2

H

H

H

Braked

Running

H

L

L

Running

Braked

L

X

X

Freewheel

stop

Freewheel

stop

4

1

/ L298

4

D1

1N4148

R1

10k

C1

1n5

Inx

Outx

070317 - 15

5

+VSS

L298

GND

+VS

10

13

12

14

15

11

4

5

8

2

7

3

9

1

6

1

2

3

4

R1

Rs

OUT1

OUT2

IN1

IN2

EN

+U

M

C1

100n

+U

C2

100n

L

070317 - 16

6

background image

53

7-8/2007 - elektor electronics

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(H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[PUNOLYL^OPJOQ\Z[\ZLZ[^V
Z[HUKHYK*46:SVNPJ0*Z
(Z `V\ TH`IL HSYLHK` RUV^ [OLYL HYL
HJ[\HSS`[^V[`WLZVMZ[LWWLYTV[VY!ZPUNSL

WVSLTV[VYZHUKWVSLVULZ>OPSL[OL
ÄYZ[VUS`ULLKZPUNSLW\SZLZZLU[[V[OLPY
MV\Y^PUKPUNZ[OLSH[[LYYLX\PYLPU]LYZPVU
VM[OLZPNUHSWVSHYP[`HWWSPLK[V[OL^PUK-

PUNZ:VHZUV[[VJVTWSPJH[LV\YJPYJ\P[
\UK\S`^LOH]LKLZPNULKP[MVYZPUNSLWVSL
TV[VYZ[OL[PTPUNKPHNYHTMVY^OPJOPZ
NP]LUPU[OL[HISLILSV^

IC2.A

3

6

5

7

1

2

C

J

K

S

4

R

R1

2k2

R2

2k2

T4

BD679

T3

BD679

D1

D2

M1

M

D8

D7

IC2.B

13

10

11

12

15

14

C

J

K

S

9

R

R3

2k2

R4

2k2

T2

BD679

T1

BD679

D3

D4

D6

D5

5

6

4

IC1.C

=1

8

9

10

IC1.D

=1

1

2

3

IC1.A

=1

12

13

11

IC1.B

=1

STEP

DIR

IC3

78L05

+U

+5V

+5V

+5V

IC1

14

7

IC2

16

8

C1

10n

C3

220n

C4

1000

M

25V

C2

10

M

16V

070299 - 11

IC1 = 4070

IC2 = 4027

D1...D8 = 1N4004

motor

50mA max

L1

L2

L3

L4

1

background image

54

elektor electronics - 7-8/2007

9LHKPUN[OLJVS\TUZVM[OPZ[HISLMYVT
[VJVYYLZWVUKZ[VYV[H[PVUVM[OLTV[VY
PUVULKPYLJ[PVU^OPSLNVPUNMYVT[V
YL]LYZLZ[OLKPYLJ[PVUVMYV[H[PVU,HJO
JVS\TUVM[OPZ[HISLJVYYLZWVUKZ[VVUL
TLJOHUPJHSZ[LWVM[OLTV[VY;OLZLZ[LWZ
]HY`MYVT‡[V‡KLWLUKPUNVU[OL
[`WLVMTV[VYJOVZLU
:V[OL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Z[VYZWYV[LJ[LKMYVT[OL]VS[HNLZWPRLZ
NLULYH[LKI`[OLJ\YYLU[Z^P[JOPUNPU[OL
TV[VY^PUKPUNZI`KPVKLZ+¶+>P[O
[OL[YHUZPZ[VYZ\ZLKP[PZWVZZPISL[VZ^P[JO
J\YYLU[ZVM\W[V(HSSV^PUNWSLU[`VM
ÅL_PIPSP[`PU[OLJOVPJLVMZ[LWWLYTV[VY
;OLSVNPJZPKLVM[OLJPYJ\P[PZWV^LYLK
MYVTHÄ_LK=Z\WWS`Z[HIPSPaLKI`0*
THRPUN[OL:;,7HUK+09PUW\[Z;;3JVT-
WH[PISL;OPZZ\WWS`TH`HSZVIL\ZLK[V
WV^LY[OLJPYJ\P[WYPVY[V[OPZKYP]LYHZ
SVUNHZ`V\KVU»[L_JLLKHYV\UKT(
^P[O[OLYLN\SH[VYJOVZLU
0M`V\YTV[VYPZWV^LYLKH[=P[PZHK]PZ-
HISL[VYLWSHJL0*I`HU34 AMVY
L_HTWSL^OPJOPZHSV^]VS[ZKYVW=
YLN\SH[VY-VYJVYYLJ[VWLYH[PVU[OL3
VYPNPUHSS`ZWLJPÄLKMVY0*YLX\PYLZHSTVZ[
=IL[^LLUPUW\[HUKV\[W\[·JSLHYS`
PTWVZZPISL[VVI[HPU^P[OHTV[VYZ\WWS`
VMVUS`=

=1

C

CLK

J

K

J

K

Q

Q

S

R

XOR

070299 - 12

JK FLIP-FLOP

A

B

S

S

B

A

0

0

0

1

1

0

1

0

1

0

1

1

K

J

CLK

x

1

0

X

X

0

1

X

1

1

X

0

1

0

1

Qo

X

1

1

0

0

Qo

X

Q

n

Q

n

+ 1

Qn

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

2

Robot Footballer

by Julian Straub

@V\ ^PSS KV KV\I[ OH]L ZLLU WPJ[\YLZ
MYVTº9VIV*\W»ZOV^PUNYVIV[ZIVV[PUN
MVV[IHSSZMYVTV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:^PZZOV^UVWLY-
H[LKJVYYLZWVUKPUN[V[OLJH[HW\S[»ZYL
HYTLKWVZP[PVU
9LMLYYPUN [V [OL KYH^PUN PU -PN\YL
P[»Z LHZ` [V MVSSV^ [OL VWLYH[PVU VM [OL
JH[HW\S[

>OLU[OLZVSLUVPKPZIYPLÅ`WV^LYLK]PH
[OLº-09,»PUW\[[OH[JVU[YVSZ[YHUZPZ[VY;
[OLSL]LY3PZYLSLHZLKW\SSLK\WI`ZWYPUN
9;OPZSL]LYLUKZP[Z[YH]LS\WHNHPUZ[[OL
Y\IILY Z[VW . H[[HJOLK [V [OL TV[VY»Z
ZLY]VHYT^OLLS7
0UJVTPUN[VYLZ[HNHPUZ[[OPZZ[VW[OLWYV-
QLJ[PSLPZÄYLKHUK[OLSL]LYHSZVVWLYH[LZ
:^LULYNPaPUN[OLYLSH`9,^OPJOPU[\YU
SH[JOLZ]PHP[ZJVU[HJ[YL)HUKTPJYVZ^P[JO

NE555

IC1

DIS

THR

OUT

TR

CV

2

7

6

4

R

3

5

8

1

D1

R1

P1

P2

C2

C1

R2

K1

Servo

C3

re1A

+4V8...+6V

re1B

RE1

Sw1

Sw2

T1

6V

R4

D2

R3

S1

070210 - 11

4k7

10k

1RT

1RT

2RT-6V

4k7

68k

330n

10n

470

M

16V

2N2219

1N4148

1N4148

P1, P2 = 4k7 ... 5k multiturn

electromagnet

fire button

G

2

1

L

P

V

070210 - 12

Sw1

Sw2

R

electromagnet

Figure 1.

The catapult electronics.

Figure 2.

Operating diagram of the catapult.

background image

57

7-8/2007 - elektor electronics

square stock

sectional
steel/iron

Sw2

connecting

rod

spring

electromagnet

catch

Sw1

curved slots

070210 - 13

:^I`[OPZ[PTLYL[\YULK[VP[ZYLZ[Z[H[L
;OLZLY]VTV[VYZ[HY[Z[V[\YUJSVJR^PZL
HUK[OLY\IILYZ[VWMVYJLZ[OLSL]LYIHJR
[VP[ZYLHYTLKWVZP[PVU([[OLLUKVM[OL
[YH]LS[OLSL]LYOV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LJOHUPJHSZ[LWVM[OLTV[VY·YLTLT-
ILY[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[YVSSLYWYV-
NYHTTLKPU)HZPJ[OLYLPZHUL_[YLTLS`
ZPTWSLHUKJOLHWZVS\[PVUMVYTHRPUNP[
KYP]L[OPZ[`WLVMTV[VY

(SS^LHJ[\HSS`ULLK[VKVPZ\ZLHWLY-
MLJ[S` VYKPUHY` <35 VY <35

M1

M

070237 - 11

R1

1k

R2

1k

R3

1k

R4

1k

P0

P1

+5V Stamp / Cubloc

Basic Stamp

Cubloc

or

(50V max)

ULN2003

IC1

GND

DS

10

11

12

13

14

15

16

I1

I2

I3

I4

I5

I6

I7

O1

O2

O3

O4

O5

O6

O7

9

1

2

3

6

7

4

5

8

+U

motor

L3

L1

L2

L4

Table 1

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

‘ Control of a unipolar stepper motor

‘ The step number is put in w1

‘ The rotation direction is defined by b0

‘ Variable’s definition

Symbol direction = b0

Symbol incr = w1

Symbol index = w2

Symbol 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

background image

60

elektor electronics - 7-8/2007

respectively seven-way or eight-way inte-
grated power Darlingtons normally used to
drive relay coils. The required software is
very simple, thanks to a couple of tips sug-
gested by Parallax (the manufacturer of the
Basic Stamp).

The fi rst is to note that the status of wind-
ings 1 and 2 on the one hand, and wind-
ings 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 amplifi cation
by the ULN2003 (or 2803). Windings 2
and 4 receive these signals after inversion,
performed using two of the spare ampli-
fi ers 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
amplifi ers in the ULN2003 (or 2803), as
the Darlingtons are only open-collector.

The second tip suggested by Parallax con-
sists 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

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 trans-
posable, 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 lan-
guage. It can likewise be easily migrated
to a PicBasic or a Cubloc from Comfi le
Technology.

(070237-I)

needed
is a simple XOR logic func-
tion, as shown in the program
listing
.
This short example of code may be
included as is into a more complete appli-
cation. As can be seen, it makes the step-
per motor connected as shown in the
fi gure 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 defi ne
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

background image

61

7-8/2007 - elektor electronics

$$$ #!"! !" "




! "

# $%&'
$() *
## (+,'-. *

& " +/(" +/( & / 0$1 * 1

# * 2 ', & /* 1 #* 3!4.35!*,

# ! " % " # # " "

+ 6

@+

/= &

?

&* >

$

<

7A18

7?8

7B(8

?

(+,').5:.5;.

'5.5!

!)5'544.

4 9!'.

'* .*.?

>> /5%"

( ( $

$ $ % 1

(+,'!5'54

'

.

4 9!'.

!*: .*.?

>> /5%

(+,'4!5'54

,.

.

.

4 9!'.

!*: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avernier-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[VHJVU]LU[PVUHSLSLJ[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^OV^[V
NLULYH[LW\SZLZTVYLVYSLZZYLWL[P[P]LS`
6\YYVIV[PZVI]PV\ZS`Ä[[LK^P[OZLUZVYZ
(S[OV\NO[OLZPTWSLZ[]LYZPVUZTHRLKV
^P[OZPTWSLº^OPZRL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HZPJ:[HTWJHUIL\ZLK
[VKYP]LHYVIV[^L\UOLZP[H[PUNS`HK]PZL
\ZPUNH[SLHZ[[OL)HZPJ:[HTW[VILULÄ[
MYVT[OLTVYLU\TLYV\ZYLZV\YJLZHUKH
M\SSLYPUZ[Y\J[PVUZL[>OH[»ZTVYLTHU`
Z\JJLZZVYZ[V[OL)HZPJ:[HTWYLMLYYLK
[VMYVTUV^VUHZ):HYLWPUJVTWH[PISL
^P[OP[HSSV^PUNMVYWVZZPISLM\[\YL\WNYHK-
PUNHZHYVIV[L]VS]LZ^P[OV\[ULLKPUN[V
TVKPM`[OLHZZVJPH[LKLSLJ[YVUPJZ
-PN\YLZOV^IV[O[OLWO`ZPJHSHWWLHY-

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-

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

S

OUT

1

Programming output (PC serial port)

S

IN

2

Programming input (PC serial port)

ATN

3

Programming input (PC serial port)

V

SS

4 et 23

Ground

P0 à P15

5 à 20

Input/output ports

V

DD

21

5 V stabilized output (input if VIN is too low)

RST

22

Manual external reset input (if required)

V

IN

24

Unstabilized positive supply from 5–15 V
(12 V for 2E, 2SX, and 2P24)

Photo 1.

Though it’s been a bit left behind now, here’s the father of all the Basic Stamps,

the Basic Stamp 1.

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.

background image

64

elektor electronics - 7-8/2007

ZPVUPU[LYTZVMZWLLKVUS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[OV^L]LYIL
[HRLUYLSH[P]LS`PUHZT\JO[OH[HU\TILYVM
TPJYVJVU[YVSSLYZ[OH[KVZ\WWVY[P[HYLWPU
JVTWH[PISL^P[O[OLWPU)HZPJ:[HTWZ
HSSV^PUNLHZ`Z\IZ[P[\[PVUPU[OLL]LU[VM
`V\YYVIV[»ZL]VS]PUNPU[OPZKPYLJ[PVU

)HZPJ:[HTWºJSVULZ»

;OLZ\JJLZZVM[OL)HZPJ:[HTWOHZJSLHYS`
THKLZVTLWLVWSLLU]PV\ZHUK]HYPV\Z

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)

2 K

8 x 2 K

8 x 2 K

8 x 2 K

8 x 2 K

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

background image

65

7-8/2007 - elektor electronics

JSLHYS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P[[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\YKPZ-
WVZHSHMVY\THUKHIV]LHSSHZWHJLVU
P[Z^LIZP[L^OLYLHU`VULJHU\WSVHK[OL
]HYPV\ZVIQLJ[TVK\SLZ[OL`OH]LKL]LS-
VWLKMVY[OL7YVWLSSLY;OPZWHY[PJPWH[VY`
SPIYHY`J\YYLU[S`OHZV]LYVIQLJ[TVK-
\SLZJV]LYPUN[OLTVZ[KP]LYZLÄLSKZHUK

Figure 2.

Internal architecture of the Cubloc CB220.

Figure 3.

Internal architecture of the Propeller – impressive, and allowing true multitasking.

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

background image

67

7-8/2007 - elektor electronics

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^VMZWLJPHSWYVJ-
LZZVYZ 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[JHUILWYVNYH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V

H^PYLI\ZHUK^P[OV\[HU`HKKP[PVUHS
L_[LYUHSJVTWVULU[Z:V^P[O[OL667PJ
P[»ZWVZZPISL[VJYLH[L^OH[PZJHSSLKZLTP
KPZ[YPI\[LKYVIV[HYJOP[LJ[\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

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

4 K

4 K

4 K

4 K

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

5 V

5 V

5 V

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

Photo 4.

The Cubloc CB220 (right) is directly interchangeable with the Basic Stamp 2 (left).

background image

68

elektor electronics - 7-8/2007

HZPTWSLJHISLJVUULJ[LK[V[OLWHYHSSLS
WVY[VMHU`7*

*VUJS\ZPVU

;OPZV]LY]PL^PZVMULJLZZP[`PUJVTWSL[L
LZWLJPHSS`^OLU`V\[OPUR[OH[[OLWYV-
NYHTTPUNTHU\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

(070319-I)

Addresses

URL

Company

Comments

www.atmel.com

Atmel

Manufacturer of AVR
microcontrollers

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

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.

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`ZPT-
WSL^H`6US`[OLU\TILYZVM[OLZLY]VZ
[VILJVU[YVSSLK[OLW\SZL^PK[OWVZP[PVU
HUK[OLZWLLKVY[PTLULLK[VILRUV^UPU

VYKLY [V THRL

HZLY]VTV]L0MHZWLLKPZ

ZWLJPÄLK[OLU[OLZLY]V^PSSTV]L[V

[OLYLX\PYLKWVZP[PVUH[[OH[ZWLLK0MH

[PTL PZ

ZWLJPMPLK [OLU [OL

ZLY]V^PSS[HRL[OH[HTV\U[VM

[PTL[VTV]L[V[OLUL^WVZP[P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[OHUP[ZSP[[SLIYV[OLYPUH38-7WHJR-
HNL)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

^OLYLHZ[OLºVSK»)HZPJ:[HTWIVHYKJHTL
LX\PWWLK^P[OHTPUPIYLHKIVHYK6U[OL
7YVWLSSLYIVHYK^L[OLYLMVYLOH]L[VZVSKLY
HU`L_[YHJVTWVULU[Z^OPJOPZHIP[TVYL

P0

1

P1

2

P2

3

P3

4

P4

5

P5

6

P6

7

P7

8

P8

13

P9

14

P10

15

P11

16

P12

17

P13

18

P14

19

P15

20

P16

21

P17

22

P18

23

P19

24

P20

25

P21

26

P22

27

P23

28

P24

33

P25

34

P26

35

P27

36

P28

37

P29

38

P30

39

P31

40

VS

S

9

BO

E

10

XO

31

XI

30

RE

S

11

VD

D

32

VD

D

12

VS

S

29

IC4

P8X32A-D40

NC

1

NC

2

NC

3

GN

D

4

SDA

5

SCL

6

WC

7

VC

C

8

IC3

24LC256

X1

5MHz

GND

3V3

GND

1

2

3

4

IC1

LM2937ES-5.0

1

2

3

4

IC2

LM2937ES-3.3

R1

270

D1

16V

C2

10u

16V

C1

10u

C3

100n

S1

S2

5V

3V3

K2

K3

C4

100n

C5

100n

3V3

GND

GND

K1

GND

R2

10k

RESn

TX

RX

RX
TX
RESn

+5V

+5V

+5V

+5V

GND

GND

GND

GND

GND

+5V

3V3

070275 - 11

Figure 1:

The circuit diagram of the Propeller prototyping board.

P26

P4

R2

C5

IC3

D1

K3

P31

P30

P27

P29

P28

K2

P0

P3

P1

P2

P24
P25

X1

P23

P22

P21

P20

P19

P18

P16
P17

IC4

C4

P5

P7
P6

P9
P8

P14

P15

P10

P11

P13

S2

P12

C2

R1

C1

K1

C3

S1

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.

Components list

Resistors

R1 = 270

7

R2 = 10k

7

Capacitors

C1,C2 = 10

MF 16V radial

C3,C4,C5 = 100nF

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

background image

71

7-8/2007 - elektor electronics

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[O-
Z[HUK=5L_[[V:[OLWV^LYZ^P[JOPZH
NYV\WVMMV\Y[OYLLWVSL:03JVUULJ[VYZMVY
[OLJVUULJ[PVUVMZLY]VZHUKV[OLYWLYPWO-
LYHSZ[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\N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 = 390

7 SMD (0805)

R3,R4,R7,R9,R11,R12,R13 = 1k

7 SMD (0805)

R5,R6,R8,R10 = 220k

7 SMD (0805)

Capacitors

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

T1 = BC857 SMD (SOT23)

LED1,LED2 = LED, red, SMD (0805)

IC1 = LM317 SMD (SO8)

IC2 = 74HCT00 SMD (SO14)

IC3 = MAX3232 (SO16)

Miscellaneous

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

background image

73

7-8/2007 - elektor electronics

[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

6WLYH[PVU PZ Z[YHPNO[MVY^HYK ;OL *7<
JHUILWV^LYLK\WHUKKV^U\ZPUN[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JVTWH[PISLTPJYVJVU[YVSSLY

Figure 1.

‘Code Architect’ is a free tool that makes using

the LPC900 microcontroller very straightforward.

C7

1u

C6

1u

1
2

&

3

IC2A

4
5

&

6

IC2B

R6

220k

R10

220k

1

2

3

4

5

6

7

8

9

11

10

K2

16

C1+

1

C1-

3

C2+

4

C2-

5

T1IN

11

R1OUT

12

R1IN

13

T1OUT

14

V-

6

V+

2

GND

15

T2IN

10

R2OUT

9

T2OUT

7

R2IN

8

IC3

MAX3232

R5

220k

R8

220k

+3V3

12
13

&

11

IC2D

9

10

&

8

IC2C

R12

1k

R9

1k

R11

1k

+3V3

C5

1u

C8

1u

OUT

2

IN

1

3

ADJ

4

6
7

IC1

LM317

R1

240R

R2

390R

T1

BC857

R4

1k

K3

LED2

LED1

R7

1k

R3

1k

6V

C2

10u

25V

C1

4u7

D1

1N4001

+3V3

+3V3_ISP

R13

1k

+3V3

ISP connector

3V3

switched

CPU_VCC
CPU_RXD
CPU_TXD
CPU_RES
CPU_GND

C4

1u

+3V3_ISP

C3

100n

14

7

IC2

K1

IC2 = 74HCT00

070084 - 11

VCC

Figure 2.

Circuit of the LPC900 programmer.

R6

9

LED2

K3

LPC900 P ROGR A MME R

T1

R3

C

3

IC2

5

R5

R4

R 2

LE
D

1

C2

IC1

R 1

C 1 D1

K1

C8

C7

R1
3

C6

(c

)

E

le

k

to

r

07

00

84

-1

C 5

K 2

1

R1
2

IC

3

R1
1

R7

R9

C4

R1
0

6

R8

Figure 3.

Layout and component mounting

plan for the printed circuit board.

background image

74

elektor electronics - 7-8/2007

ILJH\ZL[OLJVTWPSLYWYVK\JLZ]LY`JVT-
WHJ[JVKL0UWHY[PJ\SHY[OLJVTWPSLYPZ
]LY`WHYZPTVUPV\Z^P[O[OLSPTP[LKPU[LY-
UHS9(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

-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^USVHK-
PUNHWYVNYHT[V[OLTPJYVJVU[YVSSLYPZHU
PU[\P[P]LVWLYH[PVU-PN\YL0[PZYLJVT-
TLUKLK[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/pro-

ducts/lpc900 (NXP, manufacturer of the
LPC900 family).

[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 (geotech-

nical research and development).

Figure 4.

Initialisation specific to the LPC900 requires just five instructions.

Figure 5.

The μC/51 compiler uses a well-structured classical ‘make’ system.

Figure 6.

Flash Magic is a free tool for programming LPC microcontrollers.

Figure 7.

Settings for the RTS and DTR signals

in the Flash Magic terminal program.

background image

75

7-8/2007 - elektor electronics

Low

2

Cost USB Demo Board

C your way
through USB

Martin Valle

Slick graphics, reading
analogue values and making
them appear in graphs,
cockpit-style meters and dials,
all on USB… How do they do it?

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

/HYK^HYL

([[OLOLHY[VM[OLJPYJ\P[PU-PN\YLPZH
70*-TPJYVJVU[YVSSLYMYVT4PJYV-
JOPW;OPZOHZI\PS[PU<:)JVUULJ[P]P[`·
PM`V\RUV^OV^[VHJ[P]H[LP[;OLTPJYV
PZJSVJRLKH[4/aI`X\HY[aJY`Z[HS?
;OLZ^P[JOLZL_JLW[:3,+ZL_JLW[+
HUK[OLWV[LU[PVTL[LYJVUULJ[LK\W[V[OL
70*TPJYVHYL`V\YIHZPJ06PUW\[V\[W\[
KL]PJLZ
;OLJPYJ\P[ZOV\SKILLHZ`[VI\PSKVUH
WPLJLVMWYV[V[`WPUNIVHYKVY=LYVIVHYK
HRHWLYMIVHYKVYZ[YPWIVHYK

:VM[^HYL

0UZ[HYRJVU[YHZ[^P[O[OLTPUPTHSOHYK^HYL
[OLZVM[^HYLMVY[OPZWYVQLJ[PZX\P[LL_[LU-
ZP]L@V\^PSSSPRL[VOLHY[OH[P[»ZH]HPSHISL

MYLLVMJOHYNLMYVT[OL,SLR[VY^LIZP[LHZ
HYJOP]LaPW;OLYLHK`WYV-
NYHTTLK 70*- MVY [OL WYVQLJ[ PZ
H]HPSHISL[VVP[»ZP[LTMYVT[OL
,SLR[VY:/67

;OLYLHYLHJ[\HSS`MV\YaPWWLKÄSLZ!
4*/7-:<:)aPWJVU[HPUZHSS[OLWYVQLJ[
JVTWVULU[ZMYLLS`H]HPSHISLMYVT4PJYV-
JOPWWS\Z[OLJ\Z[VTWYVQLJ[MVY[OLTPJYV-
JVU[YVSSLY[OLKLTV]LYZPVUZVM[^HYLHUK

C2

100n

C1

100n

PIC18F4550

RC0/T1OSO

RC1/T1OSI

RA4/T0CKI

MCLR/VPP

RC2/CCP1

RD0/SPP0

RD1/SPP1

RD2/SPP2

RD3/SPP3

RD7/SPP7

RD4/SPP4

RD5/SPP5

RD6/SPP6

RB0/AN12

RB1/AN10

RB4/AN11

RA5/AN4

RA3/AN3

RA2/AN2

RE0/AN5

RE1/AN6

RE2/AN7

RB3/AN9

RB2/AN8

RA0/AN0

RB7/PGD

RB6/PGC

RA1/AN1

RB5/PGM

RC4/D-

RC7/RX

RC6/TX

RC5/V+

VUSB

IC1

OSC1

OSC2

11

15

40

39

38

37

35

36

34

33

31

12

10

32

16

17

18

19

20

21

22

13

14

26

25

24

23

30

27

28

29

1

3

2

4

6

5

7

8

9

R9

10M

X1

20MHz

C4

22p

C5

22p

K1

+5V

GND

D–

D+

1

2

3

4

R10

10

7

R11

10

7

R8

1

7

C6

100n

R12

330

7

D1

R13

330

7

D2

R14

330

7

D3

R15

330

7

D4

R5

470

7

R4

470

7

R6

10k

R7

10k

R1

10k

S3

S2

S1

R2

470

7

R3

470

7

C3

100n

JP1

P1

10k

JP2

RD0

RD1

RD2

RD3

R16

330

7

D5

PWR

VDD

VDD

USB-B

060342 - 11

Figure 1.

Schematic of the USB demo board.

USB Quick & Easy

• 2 analogue inputs (1 on pot)

• 2 digital inputs (switches)

• 4 digital outputs (LEDs)

• 1 (one) IC: PIC18F4550 (available

ready-pr

ogrammed)

• Full suite of softwar

e building blocks

• Project softwar

e for Builder C++ 6

• Demo pr

ogram for 2-channel A/D

with graph/meter r

eadout on PC

Figure 2.

Device Manager showing the installation of the PICDEM FS USB Demo Board.

background image

76

elektor electronics - 7-8/2007

[OLIVV[SVHKLYº[HSRLY»
7YVQLJ[aPW JVU[HPUZ HSS [OL
MPSLZ ULLKLK [V I\PSK [OL
WYVQLJ[PU)\PSKLY*
9,8<09,+aPWJVU[HPUZ[OL
MPSLZ VM [OL WYVQLJ[aPW [OH[
`V\OH]L[VJVW`PM`V\^HU[
[VTHRLHUL^WYVQLJ[
>P[OV\[I\PSKLYaPWJVU[HPUZ
HSS[OLÄSLZULLKLK[VY\U[OL
L_LÄSL^P[OV\[[OL)\PSKLY
PUZ[HSSLKPU[OLJVTW\[LY

/LYL»Z OV^ [V WYVJLZZ [OL
ZVM[^HYL
,_[YHJ[ [OL MPSL 4*/7--
:<:)aPW
[V [OL *! YVV[
KPYLJ[VY` *OLJR [OH[ [OLYL
PZ UV K\WSPJH[LK MVSKLY
4 * / 7 - : <: ) SPRL! C:\
4*/7-:<:)C4*/7--
:<:)CMVSKLYZF__
PUZ[LHKVM!
*!C4*/7-:<:)CMVSKLYZF__
<ZPUNHZ\P[HISLWYVNYHT-
TLYWYVNYHT[OL70*-
TPJYVJVU[YVSSLY^P[O[OLÄSL!
*!C4*/7-:<:)CM^CFMHJ-
[VY`FOL_CWPJKLTMZ\ZIOL_
;OL JOPW PZ HSZV H]HPSHISL
YLHK`WYVNYHTTLK

>HRPUN\W[OL-

6UJL `V\ OH]L I\PS[ [OL WYVQLJ[ HUK
JOLJRLKP[MVYTPZ[HRLZ`V\JHUJVUULJ[
[OL<:)[V[OLOVZ[-VY[OLÄYZ[[PTL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HU[[VTHRLHUL^)\PSKLYWYVQLJ[
`V\VUS`OH]L[VSVVRHM[LY[^V[OPUNZ!

(KK[OLOPKSPIÄSLI`KVPUN!

7YVQLJ[­(KK[VWYVQLJ[­OPKSPI

*OHUNL[OL+H[HHSPNUTLU[MYVT8\HK

^VYK[VI`[LI`KVPUN!
7YVQLJ[­6W[PVUZ­(K]HUJLK
6W[PVUZ­+H[HHSPNUTLU[

(060342-I)

Figure 5.

Two ADC Channels and USB of the PIC in action.

Listing 1.

/** 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

/* Parameter definitions are defined in usbdrv.h */

#define MODE_PP _PPBM0

#define UCFG_VAL _PUEN|_TRINT|_FS|MODE_PP

//#define USE_SELF_POWER_SENSE_IO

//#define USE_USB_BUS_SENSE_IO

Optimised STK200/300 Programmer

for AVR Micros

Hesam Moshiri

;OL :;2 WYVNYHTTLY PZ
MV\UKPUULHYS`L]LY`WYVNYHTTLY
ZVM[^HYLMVY([TLS(=9TPJYVJVU-
[YVSSLYZ;OLWYVNYHTTLYZOV^UOLYL
KPMMLYZMYVTV[OLYZPTPSHYJPYJ\P[ZPU
UV[YLX\PYPUNHU`L_[YHWV^LYZ\WWS`
MVYP[ZLSM^OPSLZ[PSSVMMLYPUN:;2
HZ ^LSS HZ :;2 WYVNYHTTLY
M\UJ[PVUHSP[`

0U JHZL `V\ KPK UV[ RUV^ (=9
TPJYVJVU[YVSSLYZJHUILWYVNYHTTLK
PUJPYJ\P[^P[OVUS`Ä]L^PYLZ!*SVJR
46:040:69LZL[HUK.YV\UK;V
[OLZLZOV\SKILHKKLK[OL=Z\W-
WS`]VS[HNL[HRLUMYVT[OLTPJYVJVU-
[YVSSLYVU[OL[HYNL[IVHYK
;OLWYVNYHTTLYZJOLTH[PJJVU[HPUZ

UV[OPUNTVYL[OHUVULI\MMLY0*[`WL
/*VULWPUTHSLZ\I+JVU-
ULJ[VYMVYOVVRPUN\W[V[OLWHYHSSLS
WYPU[LYWVY[º*LU[YVUPJZ»VU[OL7*
HR£W\SS\WYLZPZ[VYVU[OL40:6
SPULHUKH›-KLJV\WSPUNJHWHJP[VY
VU[OL=Z\WWS`YHPS

>P[OZVTL[PURLYPUN[OLJVTWSL[L
JPYJ\P[JHUILÄ[[LKPU[OLZ\I+JVU-
ULJ[VYOV\ZPUN(ZOVY[SLUN[OVMÅH[-
JHISLHUKH^H`0+*ZVJRL[H[[OL
[HYNL[IVHYKZPKLJVTWSL[L[OLWYV-
NYHTTLY (M[LY WYVNYHTTPUN `V\
ZPTWS` KPZJVUULJ[ [OL WYVNYHTTLY
JHISLMYVT[OL[HYNL[IVHYK
;OL:;2VY:;2WYVNYHTTLY
OHYK^HYLPZH]HPSHISLPUSV[ZVMTPJYV-
JVU[YVSSLYWYVNYHTTLYZVM[^HYLMVY
L_HTWSL)(:*64HUK*VKL=PZPVU

(060374-I)

74HC244

IC1

EN1

EN2

1D1

1D2

19

11

13

15

17

18

16

14

12

1

2

4

6

8

9

7

5

3

K1

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

1

2

3

4

5

6

7

8

9

IC1

20

10

C1

100n

R1

100k

SUB D25

060374 - 11

+5V

GND

CLK

MOSI

RST

MISO

background image

78

elektor electronics - 7-8/2007

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[YVU-
PJZ
^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[LYMH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L ^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

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 I

2

C bus.

How to program track points

Before attempting any autonomous journeys we must program a

series of set coordinates (‘track points’) into the navigation system.

The first step is to replace the GPS mouse with a (null modem) data

cable, connected to a PC. On the PC, start up a terminal emula-

tor program such as Hyperterminal. A terminal emulator is also

included in the BASCOM package.

The interface parameters must be set as for the mouse (i.e., to

4800 baud). When connection has been set up, press the reset and

programming buttons simultaneously. Then first release the reset

button and then the programming button around a second later.

You should see a welcome message (which indicates how to get

help) and a prompt on the terminal.

The following commands are also available: ‘Data’ lists the stored

GPS data; ‘Input’ allows the GPS data to be edited; and ‘Reset’

restarts the navigation system.

The coordinates of the track points can be determined using a sep-

arate GPS system; alternatively, the robot can be moved manually

to each track point in turn and the coordinates read off the LCD.

With the track point data programmed in, the robot can be left to

its own devices!

background image

79

7-8/2007 - elektor electronics

Figure 2.

Prototype navigation system printed circuit board for autonomous robots.

LU[H[PVU^L^PSSHSZVULLKHU3*+TVK\SL
;OLTPJYVJVU[YVSSLYPZYH[OLYSHJRPUNPU06
WVY[WPUZHUKZV[OLTVZ[WYHJ[PJHSZVS\[PVU
PZ[VKYP]L[OLKPZWSH`HSZV]PH[OL0

2

*I\Z

;OLYLKVL_PZ[3*+TVK\SLZ^P[OI\PS[PU

0

2

* PU[ L Y-

MHJLZI\[HU
HS[LYUH[P]L
PZ[V\ZLHU
0

2

*PU[LYMHJL

JOPWZ\JOHZ
[OL7*-
BDZLL-PN
\YL
>L
^ P S S Z L L
HUV[OLY
\ZL VM [OPZ
K L]PJL PU
V\Y JPYJ\P[
SH[LYVU

4V[VY
JVU[YVS

6M JV\YZL
^L KV UV[
Q\ Z [ ^H U [
V\Y YV I V[
[V KPZWSH`
^OLYL P[ PZ"
^L ^HU[ P[
[V THRL P[Z

TVK\SLPZMVYL_HTWSL[OL+L]HU[LJO
*47:H]HPSHISLMYVTBD;OPZJVTWHZZ
PZJVUULJ[LK[V[OL0

2

*WVY[VUV\YWYPU[LK

JPYJ\P[IVHYK
0M^L^HU[[VKPZWSH`[OLWVZP[PVUHUKVYP-

PUIL[^LLU6M[LUHYVIV[»ZTHPUJPYJ\P[
IVHYK^PSSHSYLHK`OH]LHZ\P[HISLSL]LS
ZOPM[LY0*VUP[
;OL.7:TV\ZLNP]LZ[OLL_HJ[NLVNYHWOPJ
JVVYKPUH[LZSH[P[\KLHUKSVUNP[\KLPUH
KLMPULK MVY-
TH[!ZLL[L_[
IV_ 0[ JHU
HSZV KL[LY-
T P U L [ O L
JVTWHZZ
KPYLJ[PVU VM
TV]LTLU[
PM P[Z ZWLLK
PZTVYL[OHU
HIV\[RT
O [V RT
O : P U J L
^L ^PZO [V
KL[LYTPUL
VYPLU[H[PVU
L]LU ^OLU
Z[H[PVUHY`
^L YLX\PYL
HUHKKP[PVUHS
ºLSLJ[YVUPJ
JVTWHZZ»
ZLL ISVJR
KPHNYHT PU
-PN\YL
( Z\P[ HISL
JVTWHZZ

PCF8574

IC2

SDA

SCL

INT

P0

15

16

P1

P2

P3

P4

P5

10

P6

11

P7

12

14

13

A0

A1

A2

4

8

5

6

7

9

1

2

3

R9

4k7

R8

4k7

R7

4k7

R6

4k7

R10

4k7

R11

4k7

R12

4k7

R13

4k7

X1

16MHz

C2

22p

C1

22p

R23

10k

R17

470

7

R18

470

7

R22

470

7

S3

RESET

R24

10k

S2

PRG

D6

D5

D3

R14

10k

R15

10k

R16

10k

PB2(INT2/AIN0)

PB3(OC0/AIN1)

PB0(XCK/T0)

(TOSC1)PC6

(TOSC2)PC7

PB5(MOSI)

PB6(MISO)

PD2(INT0)

PD3(INT1)

PD4(OC1B)

PD5(OC1A)

PD6(ICP1)

(ADC7)PA7

(ADC6)PA6

(ADC5)PA5

(ADC4)PA4

(ADC3)PA3

(ADC2)PA2

(ADC1)PA1

(ADC0)PA0

ATmega32

PB7(SCK)

PD0(RXD)

PD1(TXD)

PD7(OC2)

(SCL)PC0

(SDA)PC1

(TCK)PC2

(TMS)PC3

(TDO)PC4

(TDI)PC5

PB1(T1)

PB4(SS)

XTAL1

XTAL2

IC1

AVCC

AREF

RST

GND

VCC

GND

12

11

10

13

31

30

32

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

33

34

35

36

37

38

39

40

1

2

3

4

5

6

7

8

9

1

2

3

4

5

6

7

8

9

10

K1

K6

K5

K7

K4

ISP

R1

2k2

R2

2k2

+5V

+5V

R5

10k

R4

10k

R3

10k

+5V

+5V

7805

IC3

D1

1N4001

+8V ... +15V

C4

47

M

C7

1

M

C5

100n

C6

100n

R19

470

7

D2

+5V

MISO

SCK

RST

MOSI

RXD

TXD

SYSTEM
RUN

DRIVE SIGNAL

READOUT

SDA

SCL

SDA

SCL

+5V

GND

+5V

GND

POWER

compass

I

2

C LCD 16 x 4

I

2

C - Bus

able

I

2

C - Bus

to main controller

trackpoint assignment

ADR

JP1

JP2

JP3

Figure 1.

The ATmega32 communicates with the compass and the LCD over an I

2

C bus; the GPS mouse is connected via RS-232.

The PCF8574 I

2

C interface chip takes on the task of accepting a control byte and making it available on pins 33 to 40 of the ATmega.

background image

80

elektor electronics - 7-8/2007

^H`[VV\YKLZPYLKKLZ[PUH[PVU0UKVPUN
[OPZ[OLUH]PNH[PVUZ`Z[LTV\[W\[ZKPYLJ[PVU
JVU[YVSPUMVYTH[PVUVU[^VWPUZ6\[W\[
WPUZ4V[VYFSHUK4V[VYFYJVTIPULKNP]L
[OLKLZPYLKKPYLJ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k

[3] http://www.kanda.com

[4] http://www.robot-electronics.co.uk

[5] http://www.nxp.
com/cgi-bin/pldb/pip/pcf8574

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
[OL0

2

*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[LY-
TPULZ [OL KPYLJ[PVU [V [OL KLZ[PUH[PVU
;OPZ JHSJ\SH[LK KPYLJ[PVU PZ [OLU JVT-
WHYLK [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

0M[OLKLZPYLKHUKHJ[\HSKPYLJ[PVUZHYLPU
HNYLLTLU[[OLYVIV[HK]HUJLZPUHZ[YHPNO[
SPUL0MHZP[TV]LZ[OLYVIV[ZOV\SKKL]P-
H[LMYVT[OLSPUL[V[OLKLZ[PUH[PVU[OL

compass

RS232

GPS

I

2

C

I

2

C

track point

assignment

go left

go right

target OK

RST

LEFT

RIGHT

GPS-BOT-DRIVE

PRG

070350 - 13

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.

PCF8574

IC4

SD

A

SCL

INT

P0

15

16

P1

P2

P3

P4

P5

10

P6

11

P7

12

14

13

A0

A1

A2

4

8

5

6

7

9

1

2

3

K8

10k

+5V

LC DISPLAY

16 x 4

VSS

VDD

R/W

VO

RS

D0

D1

D2

10

D3

11

D4

12

D5

13

D6

14

D7

1

2

3

4

5

6

E

7

8

9

070350 - 12

SD

A

SCL

+5V

GND

Figure 4.

The LCD is driven over an I

2

C bus,

the PCF8574 interface chip making a second

appearance in the circuit (see Figure 1).

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

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 approxi-
mately 1 s. The settings are made using the software provided with the GPS mouse.

Protocol

Time

Latitude

Longitude

measurement quality (0=insufficient, 1=ok)

no. of visible satellites

Motor_l

Motor_r

Function

0

0

STOP

1

1

straight on

1

0

turn left

0

1

turn right

background image

81

7-8/2007 - elektor electronics

Serial Interface for the Propeller

Simple and
inexpensive

Luc Lemmens

;OL7YVWLSSLYWYV[V[`WPUNIVHYKKLZJYPILK
LSZL^OLYLPU[OPZPZZ\LULLKZHWYVNYHT-
TPUNPU[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[;OLZLTP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ZPU[LU[PVUHSS`
ILLUSHPKV\[^P[O[OLZPNUHSSPULZPU[OL
ZHTLZLX\LUJLHZVU[OL7YVWLSSLY7S\N
I\[OLYL^LULLKHUHKKP[PVUHSSPULMVY[OL
=Z\WWS`]VS[HNL;OPZTHRLZP[WVZ-
ZPISL[V\ZL[OLPU[LYMHJLIVHYK^P[O[OL
7HYHSSH_IVHYKHZ^LSS/V^L]LYPU[OH[
JHZLHZTHSSTVKPÄJH[PVUPZULJLZZHY`MVY
[OLZ\WWS`]VS[HNLJVUULJ[PVU

>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

`V\KVU»[OH]L[V^VYY`HIV\[JVUÄN\Y-
PUNHSSZVY[ZVMZL[[PUNZIH\KYH[LU\TILY
VMIP[ZHUKZVVU·[OL7YVWLSSLY;VVS
KL]LSVWTLU[ZVM[^HYLKVLZHSS[OPZMVY`V\
<ZLH[VJHISLMVY[OLZLYPHSSPURUV[H
JYVZZV]LYJHISLVYU\SSTVKLTJHISL

(070276-I)

R7

R3

K1

T3

T2

1

6

R4

9

5

T1

R5

C1

R1

R6

K2

R2

C1

10n

R4

10k

R5

10k

R7

10k

R3

4k7

1

2

3

4

5

6

7

8

9

11

10

K1

D Connector 9

R1

10k

R2

10k

GND

3V3

R6

1k

K2

T2

BC547

T1

BC547

T3

BC560B

TX (P30)

RX (P31)

RESn

070276 - 11

+3V3

GND

COMPONENTS LIST

Resistors

R1,R2,R4,R5,R7 = 10k

£

R3 = 4k

£7

R6 = 1k

£

Capacitors

C1 = 10nF

Semiconductors

T1,T2 = BC547

T3 = BC557

Miscellaneous

K1 = 9-way sub-D socket (female), angled

pins, PCB mount

K2 = 5-way SIL socket

PCB, ref. 070276-1 from www.thepcbshop.

com

background image

82

elektor elector - 7-8/2007

USB Converter

Jörg Schnyder

+VLZ[OPZZV\UKMHTPSPHY!`V\I\`HZTHSS
WPLJLVMLX\PWTLU[Z\JOHZHWYVNYHTTPUN
KLI\NNPUNPU[LYMHJLMVYHTPJYVJVU[YVS-
SLYHUK`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`]VS[HNLPZ=0M
`V\ULLKHOPNOLY]VS[HNL`V\JHU\ZL[OL
<:)JVU]LY[LYKLZJYPILKOLYL;OPZZTHSS
Z^P[JOTVKLZ[LW\WJVU]LY[LYJHUNLULY-
H[LHUV\[W\[]VS[HNLVM\W[V=^P[OH
TH_PT\TV\[W\[J\YYLU[VMT(
;OL34PZHNLULYHSW\YWVZLZ^P[JO
TVKL]VS[HNLJVU]LY[LY-PN\YLZOV^ZP[Z
PU[LYUHSISVJRKPHNYHT/LYL^L\ZLP[HZ
HZ[LW\WJVU]LY[LY;OLJPYJ\P[KPHNYHT
PU-PN\YLZOV^Z[OLULJLZZHY`JVTWV-
ULU[Z=VS[HNLJVU]LYZPVUPZHJOPL]LKI`
Z^P[JOPUNVU[OLPU[LYUHS[YHUZPZ[VY\U[PSP[
PZZ^P[JOLKVMMI`[OLJVTWHYH[VYVY[OL
J\YYLU[SPTP[PUNJPYJ\P[;OLJVSSLJ[VYJ\Y-
YLU[ÅV^Z[OYV\NOJVPS3^OPJOZ[VYLZ
LULYN` PU [OL MVYT VM H THNUL[PJ MPLSK
>OLU[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)7*)TV\U[<:)JVUULJ[VYMVY
JVUULJ[PVU[V[OL<:)I\Z([LYTPUHSZ[YPW
^P[OHWP[JOVMTTJHUIL\ZLKMVY
[OLV\[W\[]VS[HNLJVUULJ[VY6MJV\YZL
`V\JHUHSZVZVSKLYHJHISLKPYLJ[S`[V[OL
IVHYK;^VHKKP[PVUHSOVSLZHYLWYV]PKLK

PU[OLJPYJ\P[IVHYKMVY[OPZW\YWVZL
(Z^LOH]LU»[ILLUHISL[VPU]LU[HKL]PJL
[OH[WYVK\JLZTVYLLULYN`[OHUP[JVU-
Z\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\[

LM3578AM

I LIM

IC1

-IN

+IN

OSC

UIN

E

C

1

5

4

7

2

3

6

8

K2

+5V

GND

D–

D+

1

2

3

4

USB

L2

47

MH

L1

820

MH

C1

100n

C3

22p

C2

2n2

C4

100n

K1

R4

220k

R2

1

7

R1

1

7

R3

1

7

C11

68

M

20V

C7

68

M

20V

C9

47

M

16V

C6

68

M

20V

C5

1n5

C10

47

M

16V

C8

68

M

20V

R5

82k

R6

10k

D1

SK34SMD

070119 - 11

R5 and R6 for other
output voltages:

6V:

R5 = 47k,
R6 = 9,1k

12V:

R5 = 110k,
R6 = 10k

15V:

R5 = 130k,
R6 = 9,1k

1

2

background image

83

7-8/2007 - elektor elector

]VS[HNLHUKKP]PKLKHNHPUI`:WLJPÄ-
JHSS`^P[OHUV\[W\[J\YYLU[VMT(H[
=[OLPUW\[J\YYLU[VU[OL<:)I\ZPZ
HWWYV_PTH[LS`T(
-PUHSS`-PN\YLZOV^ZHZTHSS7*)SH`-
V\[MVY[OLJPYJ\P[(SSVM[OLJVTWVULU[Z
L_JLW[[OLJVUULJ[VYHUK[OL[LYTPUHSZ[YPW
HYL:4+Z

(070119-I)

Web link

Author’s homepage: www.systech-gmbh-de

components list

(for U

O

= 9 V)

Resistors

R1,R2,R3 = 1

7

R4 = 220k

7

R5 = 82k

7

R6 = 10k

7

Capacitors

(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

C10 = 47μF 16V

C11 = 68μF 20V

Inductors

L1 = 820μH (SMD CD105)

L2 = 47μH (SMD 2220)

Semiconductors

D1 = SK34SMD (Schottky)

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

3

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-

IH[[LYPLZPZMVY[OLWV^LYZ\WWS`VM[OL
TPJYVJVU[YVSSLYVUS`
([OPYKVW[PVUHSWV^LYZV\YJLPZ[OLZVSHY
WHULS0[PZUV[YLHSS`ULJLZZHY`MVYPUP[PHS
L_WLYPTLU[ZI\[P[OLSWZ[VRLLW[OLYVIV[

H\[VUVTV\ZSVUNLY
;OLJPYJ\P[VMa)V[»ZTHPUWV^LYZ\WWS`Z`Z-
[LTPUJS\KLZHZWLJPHSMLH[\YL![OLJOHYNL
JVU[YVSJPYJ\P[IHZLKHYV\UKH4(?-VY
LMMLJ[P]LVWLYH[PVU^LOH]L[VRUV^[OL

MAX472

IC6

SIGN

SHDN

N.C.

OUT

GND

VCC

RG1

RG2

5

8

1

4

7

2

3

6

7805

IC5

T9

RFP30P06

C13

10

M

25V

C14

10

M

25V

T10

BC337

R30

10k

R31

47k

R27

2k

R22

2k

R23

51k

R29

82k

R28

18k

R24

0

71

R26

0

71

+5V

D7

1N4001

C12

100n

JP6

D8

1N5408

10A T

F1

Solar Panel

BATT

POWER

POWER

ON

V BATT

V CHARGE

SIGN

070171 - 11

GND

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(SRHSPUL(((

background image

84

elektor elector - 7-8/2007

L_HJ[JHWHJP[`VM[OLIH[[LY`0THNPUPUN[OL
KPZJOHYNL]VS[HNLKPHNYHT^LRUV^[OH[
[OL]VS[HNLPZ]PY[\HSS`Z[HISLMVYTVZ[VM[OL
KPZJOHYNL[PTLHUKZ\KKLUS`IYLHRZKV^U
^OLU[OLIH[[LY`Y\UZV\[VMJHWHJP[`;OPZ
[PTLPZ]LY`ZOVY[ZVP[JV\SKOHWWLU[OH[
[OLYVIV[JV\SKILSVZ[
(ZPTWSL]VS[HNLJVU[YVSKVLZU»[NP]L\Z[OL
PUMVYTH[PVU^LULLK;OLVUS`^H`[VVI[HPU
L_HJ[]HS\LZPZTVUP[VYPUN[OLKPZJOHYNPUN
;OL4(?NP]LZ[^V]HS\LZ[OLJ\YYLU[

PSPHY`Z`Z[LTa)V[JVTT\UPJH[LZ^P[O[OL
VWLYH[VY^PYLSLZZS`0U[OPZ^H`[OLPUKL-
WLUKLU[WV^LYZV\YJLPUJYLHZLZ[OLZLJ\-
YP[`VM[OLZ`Z[LT

(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).

[OYV\NO99HZHWYVWVY[PVUHS]VS[HNL
H[WPUHUK[OLJ\YYLU[KPYLJ[PVU[OYV\NO
[OLYLZPZ[VYZ:0.5)V[O]HS\LZHSSV^JHS-
J\SH[PVUVM[OLJOHYNPUNZVSHYWHULSVYKPZ-
JOHYNPUNVM[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\_-

3-A Wide-input
Adjustable Switching Regulator

Luc Lemmens

;OL 7;5 PZ H ZLYPLZ VM OPNOLMMP-
JPLUJ`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!

5V[L[OH[[OL¶(]LYZPVUZ\WWSPLZHULNH-
[P]LV\[W\[]VS[HNL
;OLKL]PJLZWYV]PKLOPNOLMÄJPLUJ`Z[LW
KV^U]VS[HNLJVU]LYZPVUMVYSVHKZVM\W
[V(

;OL 7;5 KL]PJLZ HYL Z\P[LK [V H
^PKL]HYPL[`VMNLULYHSW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UNYLX\PYLTLU[Z

-VY7;5>KL]PJLZZ\WWS`PUN
V\[W\[]VS[HNLZSV^LY[OHU=[OL
TPUPT\TPUW\[]VS[HNLPZ=

6

=VY

=^OPJOL]LYPZOPNOLY

U

O

U

O Sense

U

I

PTN78060

GND

INH

ADJ

SNS

GND

V

I

V

O

V

O

V

O

1

2

3

4

5

7

6

R

SET

0W05

1%

INH

C1

C2

100

M

070115 - 11

R

L

Device

V

in

V

out

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

Device

V

O

(desired)

(V)

R

SET

(standard value)

(k

7)

V

O

(actual)

(V)

V

I

range

(V)

PTN780x0W

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

PTN780x0H

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

background image

85

7-8/2007 - elektor elector

-VY7;5>ZZ\WWS`PUNV\[W\[
]VS[HNLZVM=HUKOPNOLY[OLTPUPT\T
PUW\[]VS[HNLPZ=

6

=

;OLTH_PT\TPUW\[]VS[HNLMVY
7;5>PZ=

6

VY=^OPJOL]LY

PZSLZZ

-VY7;5/V\[W\[]VS[HNLZSV^LY
[OHU =[OLTPUPT\TPUW\[]VS[HNLPZ
=

6

=VY=^OPJOL]LYPZOPNOLY

-VY7;5/V\[W\[]VS[HNLZLX\HS
[V =HUKOPNOLY[OLTPUPT\TPUW\[
]VS[HNLPZ=

6

=

(ZHUL_HTWSL[OLTableNP]LZ[OLVWLY-
H[PUNPUW\[]VS[HNLYHUNLMVYZVTLJVT-
TVUS`\ZLKV\[W\[I\Z]VS[HNLZ
;OLTVK\SLZHYLWYV[LJ[LKHNHPUZ[SVHK
MH\S[Z^P[OHJVU[PU\V\ZJ\YYLU[SPTP[JOHY-
H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TPJJHWHJP-
[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

Paul
Goossens

3P7V3P[OP\T7VS`TLYIH[-
[LYPLZOH]LHU\TILYVMHK]HU-
[HNLZJVTWHYLK[V5P*KHUK5P4/
IH[[LYPLZ0UHKKP[PVU[VOH]PUNHSV^LY
^LPNO[MVY[OLZHTLJHWHJP[`3P7VIH[[LY-
PLZJHUHSZVILTHKLPU]HYPV\ZZOHWLZ
;OLÄYZ[WYVWLY[`PZLHNLYS`L_WSVP[LKI`
THU\MHJ[\YLYZ VM TVIPSL WOVULZ 47
WSH`LYZHUK[OLSPRL
)LZPKL[OLZLHK]HU[HNLZ3P7VIH[[LYPLZHSZV
OH]LHML^KPZHK]HU[HNLZ6ULVM[OLZL
KPZHK]HU[HNLZPZ[OH[[OL`HYLUV[HISL[V
Z\WWS`[OLZHTLHTV\U[VMJ\YYLU[HZ[OLPY
5P*KHUK5P4/IYL[OYLU;OLTH_PT\T
J\YYLU[PZ[`WPJHSS`*^OLYL*PZ[OL
UVTPUHSJHWHJP[`5L^LY]LYZPVUZHYLHISL
[VZ\WWS`*[V*JVU[PU\V\ZS`I\[
`V\^PSSILWH`PUNHT\JOOPNOLYWYPJL
MVY[OVZL
<ZPUNHIH[[LY`YH[LKH[T(O[OPZ
TLHUZ [OH[ H UVYTHS 3P7V JLSS TH` IL

SVHKLK H[

\W[VT(

VY(;OLJ\YYLU[

PZ VM[LU HSSV^LK [V IL

KV\ISL[OH[MVYZOVY[WLYPVKZ

VM[PTLI\[[OH[PZUV[ZVILU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z[HY[LMMLJ[;OL
]HS\LVM9JHUYHUNLMYVTRæMVYHU
V\[W\[]VS[HNLVM=[VRæMVYHUV\[-
W\[]VS[HNLVM=
-VY[OLZHRLVMZHML[`SPTP[[OLALULY]VS-
[HNL[VHTH_PT\TVM=;HUK;
JHUILYH[LKMVYHTH_PT\TVM=;OL
-,;PZUV[JYP[PJHS"`V\TH`HSYLHK`OH]L
VULPU`V\YZWHYLWHY[ZIPU[OH[JHUZ^P[JO
LUV\NOJ\YYLU[0M[OLJVPSILJVTLZ^HYT
[OLJVYLPZ[VVZTHSSVY[OL^PYLPZ[VV[OPU
;OL:JOV[[R`KPVKLPZ[OLVUS`JVTWVULU[
[OH[PZHJ[\HSS`JYP[PJHS+VUV[\ZLHUVYKP-
UHY`KPVKLZPUJLP[^PSSILJVTLT\JO[V

OV[@V\»YLIV\UK[VÄUKH:JOV[[R`KPVKL
PU HU VSK JVTW\[LY WV^LY Z\WWS` Q\Z[
JOLJRMVYHMVY^HYK]VS[HNLVM=VU
[OLKPVKLYHUNLVM`V\YT\S[PTL[LY
;OL Z\WWS` ZOV^U OLYL JHU KLSP]LY
HWWYV_PTH[LS` > ;OL PUW\[ Z\W-
WS`]VS[HNLJHUYHUNLMYVT=[V=
+VU»[MVYNL[[OH[[OLTH_PT\T]VS[HNL[OL
5,JHUOHUKSLPZ=
-PUHSS`[OPZWV^LYZ\WWS`PZUV[ZOVY[JPY-
J\P[WYVVM(ZSV^ISV^M\ZLVU[OL=
ZPKLPZYLJVTTLUKLK

(070023-I)

NE555

IC1

DIS

THR

OUT

TR

CV

2

7

6

4

R

3

5

8

1

T1

BUZ11

R2

47k

R4

4k7

R3

470

7

R7

1k

R1

18k

R6

R5

1k

T3

BC547

T2

BC557

D2

r14V

D1

C3

220p

C7

220n

C1

220n

C5

47n

C6

470

M

C2

470

M

C4

470

M

L1

33

MH

+U

+12V

OUT

R = 0.6 / I

070023 - 11

Voltage Stabiliser

Alexander Wiedekind-Klein

,SLJ[YPJTV[V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[HNLPZZJHSLKI`[OL]VS[HNLKP]PKLY
MVYTLK I` 9 HUK [OL ZLYPLZ JVTIPUH-
[PVU VM 9 HUK 9 ;OL V\[W\[ ]VS[HNL
PZJVU[YVSSLKZV[OH[H]VS[HNLVM=
HWWLHYZHJYVZZ9HUKOLUJLVU[OLMLLK-
IHJRPUW\[WPUVM0*;OLJPYJ\P[JHU
ILTVKPÄLKMVYKPMMLYLU[V\[W\[]VS[HNLZ
I`JOHUNPUN[OLJVTWVULU[]HS\LZPU[OL
]VS[HNLKP]PKLY-VYSV^LYV\[W\[]VS[HNLZ
[OL PUW\[ ]VS[HNL JHU HSZV IL YLK\JLK
JVYYLZWVUKPUNS`

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

FDS6680

T1

1

5

4

2

3

6

7

8

SYNC/SHDN

MAX668

IC1

PGND

FREQ

CS+

EXT

LDO

REF

10

FB

8

3

9

7

1

6

5

2

4

R1

100k

R4

0

7

05

R5

3k0

R2

5k6

R3

1k

C3

220n

C2

1

M

C4

100n

C5

560p

C1

47

M

16V

C8

47

M

16V

C9

47

M

16V

C6

10

M

50V

D1

MBRA130LT3

1

2

4

3

CTX50-4

TR1

STI

1

3

2

Uin = 13V ...25V

Uout = 12V

750mA

070280 - 11

FB = 1V25

P

S

Mini Power Inverter

Alexander
Wiedekind-Klein

,]LUYVIV[Z`Z[LTZVJJH-
ZPVUHSS`ULLKHULNH[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 ULJLZ-
ZHY` PU [LYTZ VM J\YYLU[
VYZWHJL0MHSV^J\YYLU[
=Z\WWS`PZULLKLKHUK
VUS`=PZH]HPSHISLH
UH[\YHS THU\MHJ[\YLY [V
[\YU [V PZ 4H_PT HUK
PUKLLK PU [OPZ JHZL [OL`
KVUV[SL[\ZKV^U

;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`PUW\[]VS[HNLIL[^LLU
=HUK=>P[OH=PUW\[[OL
V\[W\[PZ[`WPJHSS`¶=^P[OHSVHKVM
T(,MÄJPLUJ`H[T(PZHYV\UK

STI

1

3

2

C2

100

M

16V

MAX660

IC1

OSC

OUT

C+

C–

LV

FC

8

5

3

2

4

6

7

1

C4

100n

C1

100n

L1

10

MH

C3

4

M7

25V

C5

100

M

16V

+5V

–5V

070279 - 11

R1

0

7

background image

88

elektor elector - 7-8/2007

HUKH[T(PZHYV\UK>P[O
HUVWLUJPYJ\P[V\[W\[[OL0*KYH^ZHX\P-
LZJLU[J\YYLU[VMQ\Z[›(

;OLYLPZSP[[SL[VZH`HIV\[[OLJPYJ\P[P[ZLSM
;OL7YLZPZ[VYVUWPUZLSLJ[Z[OLVWLY-
H[PUNMYLX\LUJ`>P[O9Ä[[LK[OLJPYJ\P[
VWLYH[LZH[R/a"^P[OV\[P[H[R/a

H]HPSHISLMVYKV^USVHKMYVT[OL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\P[OV^THU`
JLSSZHYLJVUULJ[LKPUZLYPLZPUZPKL[OLIH[-
[LY`;OPZPZ]LY`PTWVY[HU[ZPUJLP[KL[LY-
TPULZ^OH[[OLTH_PT\T]VS[HNLTH`IL
HJYVZZ[OLIH[[LY`
;OLTH_PT\T]VS[HNLWLYJLSSPZHKQ\Z[LK
]PH=

HKQ

HUKJHUILZL[IL[^LLU =HUK

=9LZPZ[VYZ9HUK9ZL[[OL[LYTP-
UHS]VS[HNL[V=PU[OPZJHZL)LJH\ZL
=

HKQ

OHZHUHYYV^VWLYH[PUNYHUNL^LOH]L

[V\ZLJSVZL[VSLYHUJLYLZPZ[VYZ[VZL[
[OL]VS[HNL]LY`HJJ\YH[LS`

*VUZ[Y\J[PVU

;OHURZ[V[OL\ZLVMHKV\ISLZPKLK7*)
[OLJVUZ[Y\J[PVUVM[OPZJPYJ\P[PZ]LY`ZPT-
WSL(SSJVTWVULU[ZHYLTV\U[LKVU[OL
[VWZPKLVM[OLIVHYK>OLUZVSKLYPUN[OL

DC

IN

2

VL

3

BST

20

DHI

18

LX

19

DLO

17

CS

15

BATT

14

PGND

16

IBAT

1

GN

D

10

CC

I

5

CC

V

4

STATUS

13

VADJ

8

SETI

9

REF

7

THM/SHDN

6

CELL0

12

CELL1

11

IC1

MAX745

C6

47n

C5

100n

R6

10k

GND

D1

BAT54

C3

100n

7

2

1

8

T1A

6

4

3

5

T1B

C2

10u

GND

L1

22u

D2

D3

1%

R3

100k

1%

R4

100k

C4

100n

1%

250mW

R5

180m

K1

K2

C1

10u

GND

JP2

JP1

R1

10k

R2

10k

CEL0

CEL1

POWER IN

0V

Accu

070273 - 11

T1 = FDS6911

D2, D3 = MBRS540T3G

Table 1.

JP1

JP2

Number of

cells

Closed

Closed

1

Open

Closed

2

Closed

Open

3

Open

Open

4

background image

89

7-8/2007 - elektor elector

JVPSP[TH`ILULJLZZHY`[VSL[[OLZVSKLY-
PUNPYVUOLH[\WHIP[TVYLÄYZ[;OLJVU-
ULJ[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)

COMPONENTS LIST

Resistors

R1,R2,R6 = 10k

7 (SMD 0805)

R3,R4 = 100k

7 1% (SMD 0805)

R5 = 0.18

7 0.25W (SMD 1210), e.g. Digikey

P.18SCT-ND

Capacitors

C1,C2 = 10

MF 25V (SMD 12010)

C3,C4.C5 = 100nF (SMD 0805)
C6 = 47nF (SMD 0805)

Semiconductors

D1 = BAT54 (SOT-23)
D2,D3 = MBRS540T3G (SMC), e.g. Digikey

MBRS540T3GOSCT-ND

IC1 = MAX745
T1 = FDS6911 (SOIC12), e.g. Digikey

FDS6911CT-ND

Miscellaneous

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)

PWM Voltage Dropper

Von Stefan Brandstetter

;OPZJPYJ\P[^HZKL]LSVWLK[VHSSV^HJHY
[YHPSLY KLZPNULK MVY = VWLYH[PVU [V
IL\ZLKHZH[YHPSLYMVYH]HU^P[OH=
Z\WWS`(U\TILYVMJVWPLZVM[OLJPYJ\P[
^L THKL MVY [OL SLM[ HUK YPNO[ PUKPJH-
[VYZIYHRLSPNO[ZU\TILYWSH[LSPNO[H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[OL
PUK\J[HUJLVM[OL^PYPUN(U`Z[HUKHYK5
JOHUULS-,;HISL[V^P[OZ[HUK=JHU
IL\ZLKMVY;
>P[O[OLJVTWVULU[]HS\LZZOV^U[OLJPY-
J\P[PZZ\P[HISLMVY\ZL^P[O=SHTWZH[
\W[V>;OLJ\YYLU[SPTP[ZL[I`9
T7PZHYV\UK(;OLJ\YYLU[SPTP[
PZLZZLU[PHSILJH\ZLJVSKSHTWZWYLZLU[H

]LY`SV^YLZPZ[HUJL^OLU]VS[HNLPZÄYZ[
HWWSPLK;OLTHYRZWHJLYH[PVPZZL[[V
HWWYV_PTH[LS`!VU[PTL\ZPUN
7;OLJPYJ\P[JHUILTVKPÄLKMVY\ZLH[
OPNOLYJ\YYLU[ZHUKP[JHUHSZVIL\ZLKHZ
[OLIHZPZVMHZPTWSLHUKLMÄJPLU[ZWLLK
JVU[YVSSLYVYSPNO[KPTTLY

(070127-I)

1

2

3

IC1.A

&

5

6

4

IC1.B

&

8

9

10

IC1.C

&

12

13

11

IC1.D

&

R4

20k

R3

0

7

047

4W

R6

47

7

R7

4k7

R1

1k

R2

1k

P1

50k

D2

1N4148

D3

2x

R5

1k5

C2

10n

50V

C1

10

M

25V

C3

3

M3

25V

C4

220

M

63V

T1

BC547B

D1

16V

D5

75V

D4

16V

T2

STP20NE06FP

IC1

14

7

24V

DC

IC1 = 4093

070127 - 11

typ. 12V

background image

90

elektor elector - 7-8/2007

Dual Battery

For enhanced
operational
reliability

Paul Goossens

<ZPUN YLJOHYNLHISL IH[[LYPLZ [V WV^LY
JPYJ\P[ZPZHWYV]LUTL[OVKMVYWYV]PKPUN
LULYN`[VTHPUZPUKLWLUKLU[LX\PWTLU[
(THQVYKPZHK]HU[HNLVM[OPZPZ[OH[[OL
IH[[LY`\Z\HSS`[\YUZV\[[VILLTW[`H[
[OLTVZ[PUVWWVY[\ULTVTLU[(ZH\ZLY
`V\HYL\UL_WLJ[LKS`JVUMYVU[LK^P[O[OL
MHJ[[OH[[O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LYTPULZ^OPJOVM
[OLIH[[LYPLZPZ[VIL\ZLK
0M[OL]VS[HNLHJYVZZIH[[LY`(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

K2

7

2

1

8

T1A

4

3

5

6

T2B

C1

100n

IN BAT A

R1

100k

GND

R2

100k

R3

1M

ENABLE_A

T3

FDV301N

T4

FDV301N

K3

4

3

5

6

T1B

7

2

1

8

T2A

C2

100n

IN BAT B

R5

100k

GND

R6

100k

R7

1M

ENABLE_B

T5

FDV301N

T6

FDV301N

K1

GND

POWER OUT

D1

BAT54

D2

BAT54

Vbat

Vbat

Vbat

C5

100n

3

1

RST

2

Vcc

GND

IC2

LM809M3-4.38

3

1

RST

2

Vcc

GND

IC4

LM809M3-4.38

GND

GND

1
2

3

&

IC1A

5
6

4

&

IC1B

8
9

10

&

IC1C

13
12

11

&

IC3D

14

7

IC1E

Aok

ON

Bok

1
2

3

&

IC3A

5
6

4

&

IC3B

8
9

10

&

IC3C

13
12

11

&

IC1D

14

7

IC3E

R9

10k

R8

10k

C3

100n

C4

100n

GND

GND

D4

BAT54

D3

BAT54

C7

100n

S1

Vbat

GND

R4

10k

R10

1k

D5

*

R11

1k

D6

*

GND

GND

GND

IC1, IC3 = 4093

T1, T2 = IRF7329

070343 - 11

background image

91

7-8/2007 - elektor elector

H Z^P[JOVU KLSH` [OH[ JH\ZLZ IH[[LY`
Z^P[JOVU[VILKLSH`LKZVTL^OH[;OPZ
PZILJH\ZLP[PZ\UKLZPYHISL[VOH]LIV[O
IH[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LZ\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[

(070343-I)

Components list

(all R and C: SMD 0805 case)

Resistors

R1,R2,R5,R6 = 100k

£

R3,R7 = 1M

£

R4,R8,R9 = 10k

£

R10,R11 = 1k

£

Capacitors

C1-C6 = 100nF

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

electronics.co.uk)

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\Y-
YLU[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 JOHYNL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LU[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[OLJHS-
J\SH[PVUZMVYHJOHYNLYMVYHWHJRVMMV\Y
=5P4/IH[[LYPLZ^P[OHJHWHJP[`VM

HZHML[`MHJ[VYVMOLUJL[OLTVKPÄLK
LX\H[PVU
@V\YJOHYNLYPZUV^VWLYH[PVUHSHUKPZ
L_[YLTLS`ZPTWSL[V\ZL"I\[ILJH\ZLVM[OL
WYVJLZZVYZPUZPKL[OL4(?P[PZLZZLU-
[PHS[VTHRL[OLJVUULJ[PVUZ[V7.4[V
7.4ILMVYLHWWS`PUNWV^LY[V[OLJPY-
J\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

T1

TIP32A

+BATT

-BATT

R3

150

7

C1

10n

LED1

R2

680

7

K1

K2

K3

K4

R4

68k

R5

22k

R1

C2

1

M

25V

D1

1N4002

C3

10n

R6

C4

10

M

25V

+VA

C5

10

M

25V

BATT

MAX713

IC1

BAT–

PGM2

TEMP

VLIM

BAT+

PGM0

PGM1

PGM3

FCHG

GND

TLO

DRV

THI

REF

14

12

13

10

11

CC

15

V+

16

9

7

6

1

2

3

4

5

8

V+

REF

BATT-

070301 - 11

*

*

see text

*

Table 1. Programming charge time via PGM2 & PGM3.

Maximum charge

time (min)

PGM3

PGM2

22 V+

REF

33

V+

BATT–

45

O/C

REF

66

O/C

BATT–

90

REF

REF

132

REF

BATT–

180

BATT–

REF

264

BATT–

BATT–

Table 2. Programming number of cells via PGM0 & PGM1.

Number

of cells

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–

background image

93

7-8/2007 - elektor elector

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_P-
T\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;!P

D

$ ¶

PL>:V^L»SSJOVVZLMVYL_HTWSLH
;07(NP]PUN\ZHUL_JLSSLU[ZHML[`THY-
NPUP

+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)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PUYLZPZ[HUJL
(JVTWHJ[7*)^HZKLZPNULKMVY[OLJPY-
J\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[OLJHS-
J\SH[PVUL_HTWSLWYVWVZLK[OLYL<ZL[OL
ZHTL[HISLZ[VZL[[OLWHYHTL[LYZVM[OPZ
JPYJ\P[HZ[OLVULZNP]LUPU[OH[HY[PJSL

(070213-I)

C2

100n

63V

C3

10u

R2

68k

R3

22k

D1

K1

K2

K3

K4

2

3
1

K6

63V

C7

10u

63V

C6

10u

T1

BF245C

T2

BC547B

T3

BC547B

T4

BC557B

D3

PBYR745

D2

PBYR745

T5

IRF9520

15

13

THI

5

TLO

6

CC

11

PGM0

PGM0

REF

REF

BAT-

PGM0

V+

V+

PGM1

REF

BAT-

PGM1

V+

PGM2

REF

BAT-

PGM2

V+

PGM3

REF

BAT-

PGM3

V+

3

PGM1

4

PGM2

9

PGM3

PGM0
PGM1
PGM2
PGM3

10

REF

16

VLIM

1

TEMP

7

FCHG

8

DRV

14

BAT+

2

BAT-

BAT-

12

IC1

MAX712

25V

C5

1u

R4

1k

R5

4k7

C1

220p

R1

0R22

63V

C4

10u

GND

GND

K5

L1

220uH

+BATT.

-BATT.

+8V...+15V

1A3

070213 - 11

Components list

Resistors

R1 = 0.22

7 5W

R2 = 68k

7

R3 = 22k

7

R4 = 1k

7

R5 = 4k

77

Capacitors

C1 = 220pF
C2 = 100nF
C3,C4,C6,C7 = 10

MF 63V radial

C5 = 1μF 25V radial

Inductor

L1 = 220

MH suppressor choke

Semiconductors

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

V+

PGM

x

PGM

x

REF

BA

T

-

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[[OLYLJOHYNL-
HISLJLSSZMYVTILPUNJVTWSL[LS`
KYHPULK ^OLU `V\ MVYNL[ [V [\YU
[OLLX\PWTLU[VMM>OLU[OLIH[-
[LY`]VS[HNLKYVWZILSV^HWYLZL[
SPTP[ =PU[OPZL_HTWSL[OLJPY-
J\P[^PSSH\[VTH[PJHSS`KPZJVUULJ[
[OLIH[[LY`7V^LYPZYLJVUULJ[LK
^OLU [OL ]VS[HNL YPZLZ HIV]L HU
\WWLY[OYLZOVSKSL]LS=OLYL

[OPZ^PSS[`WPJHSS`VJJ\YHM[LY[OL
LX\PWTLU[OHZILLUWS\NNLKPU[V
P[ZYLJOHYNPUNZ[H[PVU;OLJPYJ\P[PZ
KLZPNULK[V\ZLHZSP[[SLWV^LYHZ
WVZZPISL

;OL0*3MYVT0U[LYZPSMVYTZ[OL
OLHY[VM[OLJPYJ\P[;OPZ0*JVU[HPUZ
[^VJVTWHYH[VYZ[VNL[OLY^P[OH
]VS[HNL YLMLYLUJL HUK JVUZ\TLZ
Q\Z[›(;OLJPYJ\P[VUS`\ZLZVUL
VM[OLJVTWHYH[VYZ[OL]HS\LZVM
YLZPZ[VYZ9[V9ZOV^UPU[OLKPH-
NYHT^PSSJH\ZL[OLJPYJ\P[[VZ^P[JO

background image

95

7-8/2007 - elektor elector

H[[OLSL]LSZTLU[PVULKHIV]L;OL
JVTWHYH[VYV\[W\[Z^P[JOLZ[OL7
JOHUULS46:-,;;^OPJOPU[\YU
JVU[YVSZWV^LY[V[OLSVHK9

36(+

;OLZ^P[JOPUN[OYLZOVSKSL]LSZHUK
O`Z[LYLZPZJHUILJOHUNLKI`\ZPUN
KPMMLYLU[]HS\LZVMYLZPZ[VYMVY9[V
90UJYLHZPUN[OL]HS\LVM9[V
27^PSSYHPZL[OL\WWLY[OYLZO-
VSKSL]LS[V=;OL0*3
KH[HZOLL[NP]LZL_HTWSLZVMZ\P[-
HISL YLZPZ[VY ]HS\LZ [OH[ JHU IL
\ZLK OLYL ;OL 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

(070087-I)

Links

Data sheet IRL7665: www.intersil.com/
data/fn/fn3182.pdf

Data sheet IRLML6402: www.irf.
com/product-info/datasheets/data/
irlml6402.pdf

ICL7665

HYST1

HYST2

IC1

OUT1

SET1

SET2

OUT2

1

2

4

8

5

3

6

7

BT1

R2

820k

R3

130k

R1

100k

R4

100k

RL1

T1

IRLML6402

070087 - 11

LDO Regulator
with Soft Start or Tracking

Dirk Gehrke

(Texas Instruments Germany)

;OLKL]PJLZKLZJYPILKOLYLHYL[HPSVYLK[V
Ä[[OLULLKZVMTVKLYU+:7ZWYVJLZZVYZ
HUK-7.(Z[OH[YLX\PYLSV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(HUK(+*J\YYLU[
YLZWLJ[P]LS` HUK OH]L HU :: WPU ^OPJO
HSSV^Z[OL\ZLY[VZL[[OLSPULHYYHTWYH[L
VM[OLV\[W\[]VS[HNL

-VY [OL ;7: [OL ]HS\L VM 9 PU
H ]VS[HNL KP]PKLY HSSV^Z [OL \ZLY [V
ZLSLJ[LP[OLYZPT\S[HULV\ZVYYH[PVTL[YPJ
ZLX\LUJPUN9»Z]HS\LPZJHSJ\SH[LKMYVT
[OLLX\H[PVUZPU[OLKH[HZOLL[HZZ\TPUN
HUL_[LYUHS=YHTWZPNUHSPZHWWSPLK

C4

C3

4

M7

C1

1

M

C2

1

M

TPS74201
TPS74401

IC1

BIAS

OUT

GND

FB

IN

EN

SS

5

3

4

7

6

1

2

R1

2k49

R2

4k99

U

U

IN

OUT

U

BIAS

*

C3

4

M7

C1

1

M

C2

1

M

R1

2k49

R2

4k99

U

U

IN

OUT

U

BIAS

*

R4

R3

4k99

TPS74301

TRACK

IC1

BIAS

OUT

GND

FB

IN

EN

5

3

4

7

6

1

2

TRACK

IN

070231 - 11

see text

*

Figure 1.

Schematic of TPS74201, TPS74301 and TPS74401

(see text for values of R4 and C4).

background image

96

elektor elector - 7-8/2007

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 Simultane-
ous Sequencing
(Figure 2). The TPS74301
output voltage will have the same rate of
rise (dv/dt) as the external ramp signal but

TPS74201 1.5A LDO with Programmable Soft-
Start, Texas Instruments Literature # SBVS064C

TPS74x01EVM-118 User’s Guide, Texas Instru-
ments Literature # SLVU143.

Sequencing Power Supplies in Multiple Volt-
age Rail Environments by David Daniels, Dirk
Gehrke and Mike Segal, Texas Instruments
Literature # SLUP228 or http://focus.ti.com/lit/
ml/slup228/slup228.pdf

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 differ-
ent rates of rise, they will have the same
soft-start time.

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 real-
ize 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.

(070231-I)

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

Tracking LDO TPS74301 with

simultaneous startup (R4 = 10k

).

Timebase: 2 mV/div.

Figure 3.

Tracking LDO TPS74301with

ratiometric startup (R4 = 1.78k

).

Timebase: 2 mV/div.

Figure 4.

Soft-Start LDO TPS74201 and TPS74401

with 1ms soft startup (C4 = 1nF).

Timebase: 2 mV/div.

Figure 5.

Soft-Start LDO TPS74201 and TPS74401

with 10ms soft startup (C4 = 10nF).

Timebase: 2 mV/div.

!

"!!!

"$

"

!#

NEW




$ *),!('$()
*)%'"",&)#)+
%
(

#

"!

background image

97

7-8/2007 - elektor electronics

Quasar Electronics Limited
PO Box 6935, Bishops Stortford
CM23 4WP, United Kingdom
Tel: 0870 246 1826
Fax: 0870 460 1045
E-mail: sales@quasarelectronics.com
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.

Secure Online Ordering Facilities Ɣ Full Product Listing, Descriptions & Photos Ɣ Kit Documentation & Software Downloads

Infrared RC Relay Board

Individually control 12 on-
board relays with included
infrared remote control unit.
Toggle or momentary. 15m+
range. 112x122mm. Supply: 12Vdc/0.5A
Kit Order Code: 3142KT - £47.95
Assembled Order Code: AS3142 - £59.95

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) pro-
grammed PIC micro control-

lers. Free fully functional software. Blank chip
auto detect for super fast bulk programming.
Parallel port connection. Supply: 16-18Vdc.
Assembled Order Code: 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

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

Serial Isolated I/O Relay Module

Computer controlled 8-
channel 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 Win-
dows 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

Computer Temperature Data Logger

4-channel temperature log-
ger for serial port. °C or °F.
Continuously logs up to 4
separate sensors located
200m+ from board. Wide
range of free software appli-

cations 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 in-
cludes one Tx but more avail-
DEOHVHSDUDWHO\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, Anti-
Tamper, 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

Controllers & Loggers

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 direc-
tion control. Operates in stand-alone or PC-
controlled mode. Up to six 3179 driver boards
can be connected to a single parallel port.
Supply: 9Vdc. PCB: 80x50mm.
Kit Order Code: 3179KT - £11.95
Assembled Order Code: AS3179 - £18.95

NEW! Bi-Polar Stepper Motor Driver

'ULYHDQ\ELSRODUVWHSSHU

motor using externally sup-
plied 5V levels for stepping
and direction control. These
usually come from software
running on a computer.
Supply: 8-30Vdc. PCB: 75x85mm.
Kit Order Code: 3158KT - £17.95
Assembled Order Code: AS3158 - £27.95

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 con-
trolled 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).

Motor Drivers/Controllers

Here are just a few of our controller and
GULYHUPRGXOHVIRU$&'&8QLSRODU%LSRODU

stepper motors and servo motors. See
website for full details.

7KH(OHFWURQLF6SHFLDOLVWV6LQFH

7KH(OHFWURQLF6SHFLDOLVWV6LQFH

7KH(OHFWURQLF6SHFLDOLVWV6LQFH

7KH(OHFWURQLF6SHFLDOLVWV6LQFH

Credit Card

Sales

background image

98

elektor electronics - 7-8/2007

Bolo

Abraham Vreugdenhil

)VSVPZHSPNO[ZLLRPUNYVIV[I\PS[PU[VH
WSHZ[PJIHSS;OLHK]HU[HNLVMHIHSSPZ[OH[
PMP[NL[ZZ[\JRP[JHUHS^H`ZNVIHJR[OL
ZHTL^H`P[JHTL0M`V\W\[HYVIV[inside
HIHSSP[JHUHS^H`ZIHJR\WHUK[OLUYVSS
H^H`MYVTHU`VIZ[HJSLP[Y\UZPU[V

+YP]LTLJOHUPZT

;VL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_[LUZPVU ^V\SK IL HU 9*

YLJLP]LYZV[OLYVIV[JV\SKYLJLP]LJVT
THUKZMYVTHºZ[HUKHYK»YLTV[LJVU[YVS
\UP[;OPZ^V\SKTHRLP[WVZZPISL[VZ[LLY
[OLIHSSPUHWHY[PJ\SHYKPYLJ[PVUVYZLSLJ[
VULVMZL]LYHSKPMMLYLU[ILOH]PV\YWH[[LYUZ

X1

12MHz

ULN2003

IC2

GND

DS

10

11

12

13

14

15

16

I1

I2

I3

I4

I5

I6

I7

O1

O2

O3

O4

O5

O6

O7

9

1

2

3

6

7

4

5

8

M1

M

M2

M

R4

470

7

D4

R3

470

7

D3

D1

BP41W

D2

BP41W

R1

1k

R2

1k

47k

P1

AT89C2051

P3.2

P3.3

P1.0

P1.1

P3.0

P3.1

P3.4

P3.5

IC1

P1.2

P1.3

P1.4

P1.5

P1.6

P1.7

P3.7

RST

X1

X2

20

10

12

13

14

15

16

17

18

19

11

5

4

2

3

1

6

7

8

9

BT1

2V4

BT2

9V

2x 1V2

7805

IC3

S1

+5V

+2V4

070295 - 11

R

L

1

background image

99

7-8/2007 - elektor electronics

Z\JOHZZPNO[ZLLRPUNSPNO[H]VPKPUNVY
YHUKVT ;OLYL HYL THU` JVUJLP]HISL

ILOH]PV\YWH[[LYUZMVYYVIV[Z;OLJVT
WPSLY\ZLKMVY[OLTPJYVJVU[YVSSLYPU[OPZ

YVIV[)(:*64WYV]PKLZHZWLJPÄJ
JVTTHUKMVYYLJLP]PUN9*ZPNUHSZ:\JO
HUPU[LYMHJL^V\SK[O\ZILLHZ`[VPTWSL
TLU[(ZP[Z[HUKZ)VSVVUS`ILOH]LZHZH
SPNO[ZLLRPUNYVIV[

7YVNYHTTPUN

;OL *JHUILWYVNYHTTLK\ZPUNH
ZPTWSLWYVNYHTTLY)SV^0[PZHWYVNYHT
TLYJVUZPZ[PUNVMQ\Z[HML^]VS[HNLYLN\
SH[VYZ[^V[YHUZPZ[VYZHUKHML^YLZPZ[VYZ
HUKJHWHJP[VYZBD6MJV\YZLP[HSZVOHZH
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;

;OLZVM[^HYLMVY)VSVJHUILKV^USVHKLK
MYLLVMJOHYNLMYVT[OL,SLR[VY,SLJ[YVUPJZ
^LIZP[LHZÄSLUV070295-11

(070295-1)

Web links

[1] www.geocities.com/dinceraydin/8051/
index.html

Het programma voor Bolo is gratis te
downloaden van de Elektuur-website (EPS
070295-11).

AT89C2051

P3.2

P3.3

P1.0

P1.1

P3.0

P3.1

P3.4

P3.5

IC1

P1.2

P1.3

P1.4

P1.5

P1.6

P1.7

P3.7

RST

XL1

XL2

20

10

12

13

14

15

16

17

18

19

11

5

2

3

1

6

7

8

9

4

K1

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

1

2

3

4

5

6

7

8

9

DB25M

R4

10k

T2

BC547

R3

10k

R5

1k

C1

1n

T1

BC547

R1

10k

R2

2k7

+12V

+5V

070295 - 12

2

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]LILLUTHKLMYVT
WYL,\YVJVPUZ
;OLTV[[VVM[OPZYVIV[PZºZTHSSI\[M\UJ
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[ [OL Z^P[JOPUN JVU[HJ[ JHU
THRLPZ]LY`ZTHSS

;OL SLNZ JHUUV[ Z\WWVY[ HUK
TV]LT\JO^LPNO[LP[OLY6U
[OL VUL OHUK [OPZ OHZ [V KV
^P[O[OLSPTP[LKW\SSPUNWV^LY
VM[OLLSLJ[YVTHNUL[HUKVU[OL
V[OLYOHUK^P[O[OLMYHNPSLJVU
Z[Y\J[PVUVM[OLPUULY^VYRPUNZ
VM[OLZLZTHSSYLSH`Z0[PZSPRLS`
[OH[ [OL SPUR MYVT THNUL[ [V
Z^P[JOPUNJVU[HJ[^PSSMHSSHWHY[
MYVT[PTL[V[PTL

(UK[OPZTLHUZ·KLWLUKPUN
VU[OL[`WLVMYLSH`·HSV[VM
ÄKKSPUN[VW\[P[IHJRPU[OLYPNO[
WSHJL)HI`)V[PZI`UVTLHUZH
YLHSYVI\Z[JVUZ[Y\J[PVUI\[P[PZ
\ZLM\SMVYL_WLYPTLU[H[PVUHUK
HU`OV^[OL^OVSL[OPUNSVVRZ
X\P[LUPJL

(070278-I)

Video clip of the walking mini robot:

http://www.xj3.nl/_dreijer/backsite/willem/
babybot.avi

background image

101

7-8/2007 - elektor electronics

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
HYLH]HPSHISLMVYQ\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
( º» TV[VY JVYYL
ZWVUKZ[V[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U[WYVNYHT
PU[OLYVIV[
(WHPYVMTT3,+ZPZTV\U[LKHIV]L
[OLL`LZMVYZOV^;OL3,+ZHYLJVUULJ[LK
MYVT[OLWVZP[P]LZ\WWS`[V[OLWYVJLZZVY
]PHR7YLZPZ[VYZ;VJVTWSL[L[OLYVIV[
JPYJ\P[[OLYLPZHSZVHIH[[LY`OVSKLYMVYMV\Y
((JLSSZHUKHUVUVMMZ^P[JO
;OL (; : ZVM[^HYL MVY [OL 4PUPTHSPZ[
4V[VYJHUILKV^USVHKLKMYVT[OL,SLR[VY
^LIZP[LHZÄSLU\TILYaPW

(070284-I)

MOSI

MISO

K1

GND

GND

GND

GND

SCK

Kanda Dongle

10

V+

1

2

3

4

5

6

7

8

9

+4V8

AT90S2313

XTAL1

XTAL2

IC1

PB6

PB5

PB1

PB0

PD2

PD3

PB7

PB3

PD0

PD1

PD6

PD4

PD5

RST

PB4

PB2

20

10

19

18

17

16

15

14

13

12

11

5

4

1

2

3

6

7

8

9

M1

M

X1

8MHz

R5

21k

R6

21k

R4

560

7

R3

560

7

D1

D2

R1

560

7

R2

560

7

CNY70

IC2

3

4

1

2

CNY70

IC3

3

4

1

2

+4V8

070284 - 11

MOSI

MISO

SCK

background image

103

7-8/2007 - elektor electronics

TriBot

Abraham Vreugdenhil

;OPZPZH[YPHUN\SHYYVIV[^P[O[OYLL^OLLSZ
[OH[ JHU VUS` YV[H[L PU VUL KPYLJ[PVU
+LZWP[L[OPZP[JHUTHRLP[Z^H`[V^HYKZH
SPNO[;OH[»Z;YP)V[
;OL YVIV[ OHZ [OYLL 3+9 SPNO[ ZLUZVYZ
^OPJOHYL\ZLK[VKL[LYTPUL^OPJOZPKL
MHJLZ[OLIYPNO[LZ[SPNO[0[HSZVOHZ[OYLL
HU[LUUHL[OH[HYL\ZLK[VKL[LJ[^OLUP[PZ
HIV\[[VI\TWPU[VZVTL[OPUN
-VY[OLWYVJLZZVY^L\ZLK[OL *
I`([TLSHUPJLWYVJLZZVYH[HYLHZVUHISL

WYPJL^OPJOOHZHRWYVNYHTTLTVY`
0[PZHSZVWVZZPISL[V\ZLHKPMMLYLU[WYVJLZ
ZVYHZSVUNHZP[OHZH[SLHZ[UPUL06WPUZ!
[OYLLMVY[OL3+9Z[OYLLMVY[OLHU[LUUHL
[OYLLMVY[OLTV[VYZHUKPM[OL`»YLH]HPS
HISL[OYLLMVY[OL3,+Z
;OLTLHZ\YLTLU[VM[OLSPNO[PU[LUZP[`]PH
3+9ZPZPTWSLTLU[LK\ZPUN[OL3+9ZPU
ZLYPLZ^P[OHU-JHWHJP[VYHUKJHSJ\SH[
PUN[OL9*[PTLJVUZ[HU[;OL]HS\LVM[OL
3+9^OPJOPZHMMLJ[LKI`[OLSPNO[PU[LU
ZP[`JOHUNLZ[OL9*[PTLJVUZ[HU[VM[OPZ

UL[^VYRPM`V\YLMLY[V[OLWYVNYHTP[^PSS
THRL[OL^VYRPUNJSLHYLY
;OL JVTWPSLY \ZLK OLYL )(:*643;
VY )(:*64 OHZ H M\UJ[PVU [OH[
KVLZHSS[OLOHYK^VYRMVY\Z!.,;9*WPU
U\TILY
;OLHU[LUUHLHYLTHKLVMJVWWLYWPWLZ
^P[OHWPLJLVMZWYPUNZ[LLS^PYL[OYV\NO
[OLJLU[YL;OL`HYLZLWHYH[LKMYVTLHJO
V[OLY^P[OHSLUN[OVMPZVSH[LK^PYL>OLU
[OLZWYPUNZ[LLS^PYLPZTV]LKP[THRLZ
JVU[HJ[ ^P[O [OL JVWWLY WPWL ^OPJO PZ

Connections to the 89C2051

Pin

Function

Connects to

1

RST

2

RxD

3

TxD

4

Xtal2

5

Xtal1

6

P3.2

(RC5 expansion)

7

P3.3

Motor 2

8

P3.4

Motor 3

9

P3.5

Motor 1

10

GND

11

P3.7

LED 1

12

P1.0

Antenna 1

13

P1.1

Antenna 2

14

P1.2

Antenna 3

15

P1.3

LDR 1

16

P1.4

LDR 2

17

P1.5

LDR 3

18

P1.6

LED 2

19

P1.7

LED 3

20

VCC

X1

12MHz

C5

22p

C6

22p

ULN2003

IC2

GND

DS

10

11

12

13

14

15

16

I1

I2

I3

I4

I5

I6

I7

O1

O2

O3

O4

O5

O6

O7

9

1

2

3

6

7

4

5

8

M1

M

M2

M

M3

M

R5

D1

R6

D2

R7

D3

C4

10

M

16V

R4

10k

LDR3

C3

10

M

35V

LDR2

C2

10

M

35V

LDR1

C1

10

M

35V

AT89C2051

P3.2

P3.3

P1.0

P1.1

P3.0

P3.1

P3.4

P3.5

IC1

P1.2

P1.3

P1.4

P1.5

P1.6

P1.7

P3.7

RST

X1

X2

20

10

12

13

14

15

16

17

18

19

11

5

4

2

3

1

6

7

8

9

R3

1k

R2

1k

R1

1k

BT1

4V8

4x 1V2

S4

070289 - 11

S1

S2

S3

S1 ... S3 = antenna

motor 1

LDR 1

LDR 2

LDR 3

motor 2

070289 - 12

antenna 3

antenna 1

antenna

2

motor 3

background image

104

elektor electronics - 7-8/2007

KL[LJ[LKI`[OLWYVJLZZVY
;OL TV[VYZ HYL VSK ZLY]VZ ^P[O HSS [OL
PU[LYUHSLSLJ[YVUPJZYLTV]LK;OLTV[VYZ
HYLKYP]LUKPYLJ[S`]PHH[YHUZPZ[VY;OL`
JHUVUS`IL[\YULKVUVYVMMHUKJHUYV[H[L
PUVUS`VULKPYLJ[PVU
>OLUHSS[OYLLTV[VYZHYL[\YULKVUH[
[OLZHTL[PTL[OLYVIV[^PSSYV[H[LHYV\UK
P[ZH_PZ0M^L[OLU[\YUVULVM[OL[OYLL
TV[VYZ VMM ;YP)V[ ^PSS YV[H[L HIV\[ [OL
Z[H[PVUHY`^OLLS;\YUPUNVU[OLZ[H[PVU

PUJPYJ\SHYTV[PVUZPZU»[L_HJ[S`[OLTVZ[
LMÄJPLU[TL[OVKVM[YH]LS0U[OH[JHZL^L
ZOV\SKOH]L\ZLKVTUPKPYLJ[PVUHS^OLLSZ
PUZ[LHKVMUVYTHSY\IILYVULZ)\[[OH[
^HZU»[HYLX\PYLTLU[MVY[OLKLZPN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3

PB7

PB3

PD0

PD1

PD6

PD4

PD5

RST

PB4

PB2

20

10

19

18

17

16

15

14

13

12

11

5

4

2

1

2

3

6

7

8

9

PIR sensor

s

7805

IC2

BT1

7V2

S4

+5V

+7V2

070283 - 11

S1

S2

MOSI MISO

SCK

GND

RST

V

CC

L

M

R

L

R

1

4

3

6

5

8

V

CC

GND

7

10

9

MOSI

RST

SCK

MISO

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

PB4 Left

eye

17

PB5 - MOSI

Left PIR sensor / ISP via jumper

18

PB6 – MISO

Middle PIR sensor / ISP via jumper

19

PB7 – SCK

Right PIR sensor / ISP via jumper

background image

106

elektor electronics - 7-8/2007

709ZLUZVY

=HYPV\ZTVKLSZVM709HYLH]HPSHISLJVT
TLYJPHSS` Z\JO HZ [OL ,S[LJ MYVT
(JYVUHTL;OLTHPUKPZHK]HU[HNLVM[OPZ
TVKLSPZP[ZWYPJL;OLYL»ZHSZV[OL/0
MYVT*VUYHK0[ZKPZHK]HU[HNLPZP[ZPUJVU
]LUPLU[LSLJ[YPJHSPU[LYMHJL;OLZPNUHSMYVT
[OPZZLUZVYT\Z[ÄYZ[ILHTWSPÄLKILMVYLP[
JHUIL\ZLK

(Z HU HS[LYUH[P]L ^L ZLSLJ[LK H ^LSS
RUV^UZLUZVY[OH[PZYLSH[P]LS`PUL_WLUZP]L!
HTV[PVUKL[LJ[VYH]HPSHISLPU+0@OVTL
PTWYV]LTLU[ZOVWZMVYSLZZ[OHU‰
;OL MPYZ[ [OPUN [V KV PZ [V YLTV]L 7*)
^P[O[OLZLUZVYMYVT[OLTV[PVUKL[LJ
[VYHM[LY^OPJO`V\JHUÄ[[OLZLUZVY[V
HZLWHY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NYV\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[

T1

BC557

T2

BC547

T4

BC547

T5

BC547

D3

D4

T3

R3

100k

R4

560k

R1

1k8

R6

180

7

R5

4k7

R7

1k

R9

180

7

R2

1k8

R8

2k2

P1

10k

C2

470

M

16V

C1

1

M

16V

RE1

D1

1N4148

M 1

M

M 2

M

D2

1N4148

S1

+4V5

070143 - 11

070143 - 12

T3

D3

plastic tube

protects against

ambient light

1

2

background image

108

elektor electronics - 7-8/2007

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,
suffi cient 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 con-
nections. D2 now becomes reverse biased
and no current can fl ow through motor
M2 while M1 goes into reverse. This gives
MOPS the reverse and turn response to
obstacles. A few seconds after the obsta-
cle is no longer detected the relay switches
back and MOPS carries on as before but in
a different direction.

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

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

sources. With this set-up it was possible
to detect obstacles at a distance of 10 cm.
The range depends largely on the refl ective
properties of the obstacle so darker objects
will only be seen at shorter ranges. The cir-
cuit can be modifi ed to read microswitches
connected to contact feelers mounted on
the front of MOPS this will help avoid col-

U

M2

070143 - 13

U

M1

3

NEW

#$%!&&!&&"!"&#"#'$

*$'&%%$%"""%"!!"!&!%

" #$!%(($&+"$'&%%'$'&%

&#%!&$%!%!%"$&$"!%

%$'&%"$$#$%!&&(!&"!

"#$%!&+&$"!%

'$*%$%!&'%%&%)!""'&!"))&&"*#&

$'&%"!&!% !+'+"$&&$"!%#$"&%

!&"!&$$!' $"'%%"))&#"&!&

"$'%!+"'$")!$%$#$"&%!##&"!%

"! !+"&$!%#$!&"#%&"")!&"$%$)

#$%!&!&%""&%& %'$ !&$"" #'&$%

!#$#$%'"(""+! "! $""!&$"$%

" $!#")$%'##%&&$+$$%&&$

8$$!")'%!&8$$"$ !

&$%:$(%%&"!!&%%%'

4&"$4&$"!%9'%!

'%3$!&"$

-5$&<%&"

3$!&"$<266

;!&7!"

,//.2.1-/0

Complete your 30x

circuits series now!

ISBN 978-0-905705-69-9

Approx. 432 pages

£19.95 / US$ 39.95

background image

109

7-8/2007 - elektor electronics

background image

110

elektor electronics - 7-8/2007

2.4 GHz Antenna
for Robotics Vehicles

Ragnar Jensen

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

/LYLNVLZ

The raw material: a short piece of 50-

7 coax cable.

Cut off about 40 mm of the outer insulation. This will expose the braid

that forms the cable shield.

Push down the braid to expose the inner insulation.

Using the pointed tool, carefully unweave the braid strands.

Until your hairdressing looks something like this…

Distribute the strands into four equally sized and likewise spaced

bundles (wow, tresses!)

1

2

3

4

5

6

background image

111

7-8/2007 - elektor electronics

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.

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.

Done soldering!

Apply a few drops of hot glue…

… will help keep the proper shape.

Cut the radials and the radiator to a length of 30 mm

(yes that’s 0.25 lambda).

And we are done!

(070142-I)

(reproduced with modifications and extensions from CQ-TV issue 217)

7

8

9

10

11

12

13

background image

112

elektor electronics - 7-8/2007

Receiver for RC5 Remote Controls

Thomas Möll

: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[WYVJLZZ9*Z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H[LZHSV^

NVPUNW\SZL^OPJOPZPU]LY[LKI`:JOTP[[
[YPNNLYPU]LY[LY:;;OLYLZ\S[PUNOPNO
NVPUNW\SZLPZ\ZLK[VJSLHY[OL*+
ZOPM[YLNPZ[LY
;OL 8 V\[W\[ VM [OL *+ WPU
JHYYPLZHZX\HYL^H]LH[R/aJVY
YLZWVUKPUN[VHWLYPVKVM›ZHUKH
W\SZL^PK[OVM›Z6\[W\[8WPU
VM[OL*+PZPU]LY[LKI`:JOTP[[[YPN
NLY:;"[OLV\[W\[VM[OPZNH[LPZ[OLYL
MVYLPUP[PHSS`OPNO;OLKPVKLTH[YP_MVYTZ
HU(5+NH[L^OPJOZL[ZVULPUW\[[V:;
OPNOQ\Z[HZ8YPZLZMVY[OLÄYZ[[PTL:PUJL
[OLJVTWSLTLU[HY`V\[W\[VM--PZHSZV
OPNOHOPNONVPUNW\SZLPU]LY[LKI`:;
PZKLSP]LYLK[V[OL*+ZOPM[YLNPZ[LY
JH\ZPUNP[[V[HRLVULZHTWSLVM[OLPUJVT
PUNKH[HZ[YLHT;OPZWYVJLZZPZYLWLH[LK
›ZHM[LY[OLZ[HY[VMLHJOIP[WLYPVK
VYL_HJ[S`[OYLLX\HY[LYZVM[OL^H`PU[V

IC1.B

SRG4

C1/

2

1D

15

14 1

11 12 13

R

IC1.A

SRG4

C1/

10

1D

7

6

9

3

4

5

R

IC2.A

SRG4

C1/

10

1D

7

6

9

3

4

5

R

IC2.B

SRG4

C1/

2

1D

15

14 1

11 12 13

R

TSOP1736

IC3

2

3

1

R1

100

7

R2

47k

R4

1k

R20

10k

R3

10k

C6

220n

C1

100n

C7

1000

M

T1

R19

1k

R16

1k

D1

D16

D15

R18

1k

R17

1k

D14

D13

R15

1k

R14

1k

D12

D11

R13

1k

R12

1k

D10

D9

R11

1k

R10

1k

D8

D7

R9

1k

R8

1k

D6

D5

R7

1k

R6

1k

D4

D2

R5

1k

D3

IC4

78L05

D30

1N4148

C2

100n

C3

100n

C4

47

M

C5

470

M

+8V

+5V

IC6.A

3

C

6

S

5

D

4

R

1

2

R28

100k

C11

100p

R23

1M

D17

IC5

7555

DIS

THR

OUT

TR

CV

2

7

6

4

R

3

5

8

1

C10

100n

CTR12

IC7

CT=0

4040

10

11

13

15

14

12

11

10

CT

16

4

2

3

5

6

7

9

1

+

9

8

7

6

5

4

3

2

1

0

8

C9

150p

IC6.B

11

C

8

S

9

D

10

R

13

12

10k

P1

R26

180k

R27

39k

R22

33k

1

2

3

IC8.A

&

5

6

4

IC8.B

&

9

8

10

IC8.C

&

12

13

11

IC9.D

&

12

13

11

IC8.D

&

8

9

10

IC9.C

&

5

6

4

IC9.B

&

1

2

3

IC9.A

&

R29

100k

D19

D22

D23

D21

D20

R25

100k

R24

100k

D18

D24

D25

D26

D28

D27

D29

R30

100k

C8

47

M

R21

100k

+5V

IC1

16

8

IC2

16

8

IC6

14

7

IC8

14

7

IC9

14

7

+5V

1

2

3

1

2

3

4

5

6

7

8

9

10

11

12

13

14

DATA

DATA

CLK

RESET

18kHz

070089 - 11

IC1, IC2 = CD4015

IC6 = CD4013

IC8, IC9 = CD4093

BC557B

Reset 01

Reset 02

D17...D29 =

1N4148

background image

113

7-8/2007 - elektor electronics

LHJOIP[;OPZPZ[OLRL`[V[OLJPYJ\P[![OL
]HS\LVM[OLZPNUHSZHTWSLKH[[OPZWVPU[
NP]LZ[OLLUJVKLKKH[HIP[
(M[LYIP[Z[OL9*WHJRL[PZJVTWSL[L
([[OPZWVPU[HKPVKLTH[YP_MVYTPUNHU
(5+NH[LH[[OLV\[W\[ZVM[OL*+
ZL[Z -- 0[Z V\[W\[ NVLZ SV^ HUK [OL
JSVJR[V[OLZOPM[YLNPZ[LYPZISVJRLK

6ULJ`JSLVM[OL[YHUZTP[WYV[VJVS[HRLZ
IP[[PTLZ8VM[OL*+JV\U[LYNVLZ
OPNOIP[[PTLZHM[LY[OLZ[HY[VM[OL9*
WHJRL[YLZL[[PUN--HUK[OLYLI`Z[VWWPUN
[O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.7

P0.6

P0.5

P0.4

P0.3

P0.2

P0.1

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

1

2

3

4

5

6

7

8

9

+5V

K1

8x 1k

K2

8x 1k

TSOP1736

TSOP1736

2

3

1

2k2

10k

T1

BC638

+5V

1k

1k

JP1

070191 - 11

1

2

3

4

5

8

7

6

max. 15mA

green

red

background image

114

elektor electronics - 7-8/2007

MHJLJPYJ\P[[OH[`V\OH]L[VI\PSK`V\Y
ZLSM2JHUILSVHKLK^P[OHTH_PT\T
VMT(
3V^WV^LY3,+ZPUKPJH[L[OLWYLZLU[Z[H[L
VM[OLLPNO[IP[ZVMWVY[7

;OL ZVM[^HYL MVY [OPZ WYVQLJ[ PZ H MYLL
KV^USVHKMYVT[OL,SLR[VY^LIZP[L·ZLL
HYJOP]LÄSL070191-11.zip

(070191-I)

;OLNYLLU3,+VUWPUM\UJ[PVUZHZVU
VMMPUKPJH[VYMVY[OLJPYJ\P[
0[PZVMJV\YZLHSZVWVZZPISL[V\ZLHWPLaV
I\aaLYMVY[OLHJV\Z[PJHSHYTVU77
TH`ILSVHKLKI`\W[VT(

zBot:Wireless Link

Jens Altenburg

;OLYLL_PZ[HSV[VM^PYLSLZZJVTT\UP
JH[PVUTVK\SLZHSSHWWYV]LKMVY\ZL
^P[OPU [OL 0:4 YHKPV IHUKZ PUK\Z
[YPHSZJPLU[PÄJTLKPJHSMVYL_HTWSL
4/a4/aHUKYLJLU[S`HSZV
./a@V\NL[ZPTWSLHUKJOLHW
VULZ^P[OSV^[YHUZTPZZPVUKH[HYH[LZ
HUK`V\JHUÄUKL_JLSSLU[OPNOZWLLK
Z`Z[LTZ¸/V^T\JO^PSS[OL[OPUN
ZL[TLIHJR&¹PZ[OLTVZ[MYLX\LU[S`
HZRLKX\LZ[PVUPM`V\ZLHYJOMVYHU9-
TVK\SL3V^ZWLLKUVUPU[LSSPNLU[TVK
\SLZHYLJOLHW"OPNOZWLLKPU[LSSPNLU[VULZ
WYL[[`L_WLUZP]L;OH[»ZLHZ`I\[P[KVLZU»[
OLSW
;OL*;=PKLV.TI/^^^J[]PKLVJVT
THYRL[ZHZWLJPHSTVK\SL^P[OOPNOZWLLK
KPNP[HS KH[H [YHUZTPZZPVU JHWHIPSP[` HUK
UVPU[LSSPNLUJLH[HYLHZVUHISLWYPJL;OL

TVK\SLPZIHZLKVUHM\SS`PU[LNYH[LK[YHUZ
JLP]LY^P[OHKPNP[HSPU[LYMHJL0[PZ\ZLKPU
a)V[

^P[ONVVKYLZ\S[Z

;OLTVK\SLJVTLZHZHZTHSSM\SS`HZZLT
ISLKHUK[LZ[LKIVHYK;OLIVHYKPUJS\KLZ
[OLJVTWSL[L9-ZLJ[PVUZ0[^VYRZPU[OL
4/a 0:4 IHUK HUK OHZ H [YHUZTP[
WV^LYVMT>JV\WSLK^P[OHYLJLP]LY

ZLUZP[P]P[`VMHIV\[¶K)T
-VYPTWSLTLU[PUN[OLTVK\SLPU`V\Y
V^U WYVQLJ[Z H ZVM[^HYL TVK\SL PZ
H]HPSHISL[VV;OLTVK\SLVUS`ULLKZ
H ML^ YLZV\YJLZ VM [OL TPJYV ZVTL
.706Z NLULYHS W\YWVZL PUW\[ V\[
W\[WPUHUKVUL<(9;JOHUULS;OL
<(9;OHZ[VILWYVNYHTTLK[VNP]L
HIH\KYH[LVMRIP[ZZ;OLIH\K
YH[LULLKZ[VILHJJ\YH[LPMUV[`V\»SS
Z\MMLYHULMMLJ[[OH[THUPMLZ[ZP[ZLSMHZ
SV^YLJLP]LYZLUZP[P]P[`
;OLZVM[^HYLTVK\SLMVY[OL^PYLSLZZ

YHKPVPZHÄSLJHSSLKrf433.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

(KL[LJ[VY[VÅHNTPZZ
PUNW\SZLZPZHTVUN[OL
TVYLPTWVY[HU[JPYJ\P[Z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[OLHWWYVWYPH[L]LYZPVUVM
*VTWHJ[-YHTL^VYRH]HPSHISL
MVYKV^USVHKMYVT4PJYVZVM[!

>PUKV^Z4VIPSL7VJRL[7*HUK:THY[WOVUL!5,;*-]

^THYT]PJHI"

7VJRL[7*HUK:,!5,;*-]WWJHYT]JHI"

>PUKV^Z?7!UL[JMZL[\W]TZP

5L_[JVW`[OLÄSLH]YIS\LYLTV[LL_L[V[OL[HYNL[WSH[MVYTMVY
L_HTWSLVU[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/avrbluer-
emote.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

PB3(MOSI/OC2)

PC5(ADC5/SCL)

PC4(ADC4/SDA)

PB2(SS/OC1B)

PD4(XCK/TO)

PC6(RESET)

PD2(INT0)

PD3(INT1)

PD6(AIN0)

PD7(AIN1)

PB1(OC1A)

PB4(MISO)

PC3(ADC3)

PC2(ADC2)

PC0(ADC0)

PC1(ADC1)

ATmega8L

PD0(RXD)

PD1(TXD)

PB0(ICP)

PB5(SCK)

PD5(T1)

XTAL1

XTAL2

AREF

IC1

AGND

AVCC

GND

VCC

21

10

22

20

11

12

13

14

15

16

17

18

19

28

26

25

23

24

27

1

9

8

7

2

3

4

5

6

ULN2803

IC2

VEE

+VS

11

12

13

14

15

16

17

18

I1

I2

I3

I4

I5

I6

I7

I8

O1

O2

O3

O4

O5

O6

O7

O8

10

1

2

3

6

7

8

4

5

9

X1

7,3728MHz

C4

22p

C5

22p

S1

JP2

JP1

D3

R1

1k

D6

1N4148

RE1

D1

R2

220

7

D2

R3

1k

IC4

LP2950

3V

K1

1

2

3

4

5

6

ISP

R4

4k7

+3V

+5V

+3V

C1

10

M

C2

10

M

C3

100n

SCK

MISO

MOSI

FB1

FB2

FB3

FB4

FB5

FB6

OUT1

OUT2

OUT3

OUT4

OUT5

OUT6

070126 - 11

Blue Nice Com III

VDD_DIGI

LSTAT_0

LSTAT_1

Host_wu

TX_LED

RESET

ISEL1

ISEL2

IC3

ENV1

ENV0

GND

VCC

RTS

CTS

RX

TX

10

11

12

13

14

15

16

8

9

1

2

3

4

5

6

7

R7

1k

R5

220

7

D4

R6

220

7

D5

+3V

+3V

Reset Bluetooth

VCC

RX

TX

background image

117

7-8/2007 - elektor electronics

Robot Voice

Pascal Choquet

-HUZVM[OLÄSTºH:WHJL6K`ZZ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k

R2

10k

R1

1k

C6

4

M7

16V

C7

22

M 16V

R8

4k7

D2

R4

220

7

+5V

R9

4k7

R7

4k7

S2

Next

16

7

LS1

070313 - 11

ISD2560

MICREF

ANAOUT

AUX IN

ANAIN

IC1

VCCA

VCCD

VSSA

VSSD

XCLK

SP+

SP–

AGC

MIC

P/R

OVF

EOM

CE

PD

17

23

24

27

19

15

14

16

28

18

20

21

13

12

A0

A1

A2

A3

A4

A5

A8

10

A9

A6

A7

11

22

25

26

1

2

3

4

5

6

9

7

8

S1

S3

PD

Play/Rec

C5

100n

C4

100n

background image

118

elektor electronics - 7-8/2007

ZLUZVYJHUHSZVKL[LYTPUL[OLHUNSLVM[OL
YVIV[^P[OYLZWLJ[[V[OL,HY[O;OLHJJLS-
LYH[PVUVIZLY]LKI`[OLZLUZVYPZZOV^U
PU -PN\YL ^P[O [OL ]LJ[VYZ am HUK
am>OLU[OLZLUZVYPZUV[Z\IQLJ[LK[V
HU`V[OLYHJJLSLYH[PVU[OLZLUZVYPZVUS`
ZLUZP[P]L[V[OLHUNSLVM[OLZLUZVY^P[O
[OLKPYLJ[PVUVMNYH]P[`HUKNYH]P[`P[ZLSM
^OPJOPZJVUZ[HU[(ZZVVUHZ[OLZLUZVY
PZHSZVZ\IQLJ[LK[VHK`UHTPJHJJLSLYH[PVU
a[OLZLUZVY^PSSVIZLY]L[OPZHZ^LSS
;OPZ PZ [OL JHZL MVY L_HTWSL ^OLU
[OLYVIV[PZKYP]PUNMVY^HYKZ
VY IHJR ^HYKZ
;OL YLZ\S[PUN
HJJLSLYH[PVU
am [OLU
KLWLUKZ
V U [ O L
K`UHTPJ
HJJLS-
LYH[PVU
NYH]P[`
HUK [OL
HUNSL
;OPZNP]LZ
H KPYLJ[
PUZPNO[
P U [ V [ O L
WYVISLT!
[ OL PUZ [ HU[
[OH[ [OL YVIV[
TV]LZ [OL ZPN-
UHSMYVT[OLZLUZVY
JHUUV[IL\ZLKHU`TVYL[V
KPYLJ[S`KL[LYTPUL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LYVIV[PZVMPTWVY[HUJLZPUJL
P[PZ[OLPU[LU[PVU[VJVU[YVS[OLWVZP[PVU
VM[OLYVIV[)`MLLKPUN[OLZL[OYLL]HYP-
HISLZIHJR[V[OLTV[VYZ[OLYVIV[JHUIL
JVU[YVSSLKPU[VHZ[HISLWVZP[PVUZLLEqua-
[PVU
(TH[OLTH[PJHSWO`ZPJHSIHZPZVM
[OPZJVU[YVSZ[YH[LN`JHUILMV\UKPUBD
HTVUNV[OLYZPUJS\KPUN[OLKLYP]H[PVUVM
[OLYLSL]HU[LX\H[PVUZVMTV[PVU

:LUZVYZ

;VKL[LYTPUL[OLHMVYLTLU[PVULK]HYPHISLZ
HUHJJLSLYVTL[LYHUKHN`YVZJVWLHYL\Z\-
HSS`\ZLK
>P[O HU HJJLSLYVTL[LY [OL HJJLSLYH-
[PVU[OH[[OLZLUZVYPZZ\IQLJ[[VJHUIL
TLHZ\YLK;OLKPYLJ[PVUVMHJJLSLYH[PVU
PZ HSZV TLHZ\YLK ( ZLUZVY [OH[ PZ MYL-
X\LU[S`\ZLKPZ[OL(+?3MYVT(UHSVN
+L]PJLZ^OPJOJHUTLHZ\YLHJJLSLYH[PVU
PU[^VT\[\HSS`WLYWLUKPJ\SHYKPYLJ[PVUZ
)LJH\ZL[OLZLUZVYPZHSZVZLUZP[P]L[V[OL
Z[H[PJHJJLSLYH[PVUK\L[VNYH]P[`N[OL

Gyroscope

Angle

Angular

velocity

PWM outputs

Spindle

070294 - 11

Speed

H-bridge

Motor L

Encoder

Motor R

Microcontroller

Pots

Accelero-

meter

Filter

Control

background image

119

7-8/2007 - elektor electronics

T

l

g

2

Q

T

period [s]

g

gravitational acceleration [m/s

2

]

l

length from pivot to centre of mass [m]]

PWM

k

k

k

v

–

– –

1

2

3

R

R

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]

k

k

1

3

...

Feedback factors, constant

R

R

R

R

B

B

G

v

n

k

n

k

n

k

n

[ ]

[

]

[ ]

[ ]

–

–

–

4

5

6

1

R

G

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 [°]

k

k

4

6

...

constants

070294 - 12

a

a

m

2

g

a

m

1

g

H Y L ^ L P N O [ L K

^P[OYLZWLJ[[VLHJOV[OLY;OL

^LPNOPUNMHJ[VYZ[OH[HYL\ZLKHYL

KL[LYTPULKK`UHTPJHSS`^OPSLIHS-

HUJPUN)LJH\ZL[OL^LPNOPUN]HS-

\LZ[LUK[VX\PJRS`JVU]LYNL[VH

WHY[PJ\SHY]HS\LÄ_LKYLSH[PVUZOPWZ

JHUHSZVIL\ZLK,X\H[PVU;OL

HWWYVWYPH[L^LPNOPUNMHJ[VYZJHUIL

KL[LYTPULKK\YPUN[OLJHSPIYH[PVUVM

[OLZ`Z[LT

0[PZJVTTVUWYHJ[PJLMVY[OLTV[VYZ

PU[OLYVIV[[VILÄ[[LK^P[OLUJVK-

LYZ;OLZLNP]LW\SZLZ^OLU[OLTV[VY

[\YUZ )` JV\U[PUN [OL U\TILY VM

W\SZLZWLY\UP[[PTLVYTLHZ\YPUN

[OL[PTLIL[^LLUW\SZLZP[

PZWVZZPISL[VKL[LYTPUL

[OLZWLLKVMYL]VS\-

[PVUVM[OL^OLLSZ

HUK [OLYLMVYL

[OL ZWLLK VM

[ O L Y V I V [

> O P J O V M

[OLZLTL[O-

VKZ NP]LZ

[OLOPNOLZ[

YLZVS\[PVU

P Z K L [ L Y-

TPUL K I`

[OL U\TILY

VMW\SZLZ[OH[

HYLWYVK\JLK

I`[OLLUJVKLY

MVYLHJO[\YUVM[OL

^OLLS

(J[\H[VYZ

(UV[OLYZWLJPHSWVPU[VMPU[LYLZ[HYL[OL
HJ[\H[VYZ>OPSLIHSHUJPUN[OLYVIV[[OL
TV[VYZ OH]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S\LZHUKKL[LYTPUL[OLJVYYLJ[]HS-
\LZMVY[OL^LPNOPUNMHJ[VYZ

(070294-I)

Web links

[1] http://robotics.ee.uwa.edu.au/the-

ses/2003-Balance-Ooi.pdf This docu-
ment describes a final year project during
which a balancing robot was built. The
research is quite detailed with respect to
the physical and mathematical model-
ling 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/~dpa-

www/robo/nbot/

This is the web-

site 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

Importer of

the Segway.

[6] www.sparkfun.com

MVYL_HTWSLI`JVUULJ[PUNHU\TILYVM
KPNP[HSVYHUHSVN\LWV[LU[PVTL[LYZ[V[OL
TPJYVJVU[YVSSLY;OLWYVNYHT[OH[Y\UZPU
[OLTPJYVJVU[YVSSLYYLHKZ[OLWVZP[PVUVM
[OLWV[LU[PVTL[LYZHUKJVU]LY[Z[OLYLS-
L]HU[ ]HS\LZ PU[V MLLKIHJR ]HS\LZ ;OL
JHSPIYH[PVUJHUUV^ILKVUL^P[OHSV[
VMWH[PLUJL(ÄYZ[Z[LWPZ[VPUJYLHZL[OL
MLLKIHJRMHJ[VYMVY[OLHUNSL0M[OPZMHJ-
[VYPZ[VVZTHSS[OLU[OLYVIV[^PSSYLHJ[
ZSV^S`"PM[OPZPZ[VVSHYNL[OLU[OLYVIV[
^PSSX\PJRS`VZJPSSH[LHYV\UK[OLIHSHUJL
WVPU[0U[OLSH[[LYJHZL[OLMLLKIHJRMHJ-
[VYJHUILYLK\JLKHUK[OLMLLKIHJRMHJ-
[VYMVYZWLLKJHUILPUJYLHZLK0U[OPZ^H`
[OLYVIV[^PSSX\PJRS`NHPUPUZ[HIPSP[`(
ÄUHSZ[LWJHUILTHKLI`PUJYLHZPUN[OL
MLLKIHJRMVYZWLLK;OPZ^PSSYLZ\S[PUIL[-
[LYWVZP[PVUPUNMVY[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O H
KPHTL[LYVMTTVUHWPLJLVMTT
WS`^VVKHUK[OLUJ\[VYZH^[OLKPZJZ
V\[+YPSSHTTOVSLPU[OLJLU[YLVM
LHJOKPZJ

(Z`V\JHUZLLMYVT[OLKYH^PUNHU4
ZJYL^^P[OHSLUN[OVMH[SLHZ[TTT\Z[

ILÄ[[LKPU[OLOVSL5V^ZLJ\YL[OLZJYL^
\ZPUNH^HZOLYHUKU\[HUK[OLUJSHTWP[
PU[OLJO\JRVMHKYPSSWYLZZ<ZPUNHZTHSS
ISVJRVM^VVK^YHWWLKPUZHUKWHWLY`V\
JHUX\PJRS`ZHUK[OLKPZJPU[VHUPJLJPY-
J\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)

box-column drill

washer

070145 - 11

long M3 screw
or threading

wooden block covered
with sandpaper

background image

121

7-8/2007 - elektor electronics

R8C Measures Negative Voltages

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[-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[HNLKP]PKLYZ9[V99
HUK9MVY[OLZPNUHSZ[VILTLHZ\YLK
H]HPSHISLH[JVUULJ[VY2^OLYLHSS[OL
PTWVY[HU[ZPNUHSZMYVT[OL/LYJ\SLZ;HISL
HYLH]HPSHISL

>LJHUZLL[OH[[OLZJOLTH[PJHSZVJVU-
[HPUZHYLSH`[OH[JHUILZ^P[JOLKI`[OL
9*[VPTTLKPH[LS`Z[VW[OL[HISLTV]L-
TLU[;OPZPZVW[PVUHS
5V^^LOH]L[V[HRLZWLJPHSJHYL^OLU
^LOH]LULNH[P]L]VS[HNLZ;OLYLZVS\[PVU
VM[OLIP[(+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 )

// less than

0, then minus sign

{

lcddata (45);

}

>LHSZVOH]L[VHKQ\Z[[OL]VS[HNLSL]-
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; //p or t

3.3

=>

for

channel selection via analogue MUX

pd3 _ 2 = 1;

p3 _ 2 = 0; //p or t

3.2

=>

for

channel selection via analogue MUX

;OYLLJOHUULSZHYLKPYLJ[S`JVUULJ[LK[V
[OL(+JVU]LY[LY6ULJOHUULSPZT\S[P-
WSL_LKMVY[OL]VS[HNLZVM=¶=HUK
¶=

(070010-I)

R8C Module

VSS

VCC

P17

P16

P13

P12

P11

P10

P33

P32

AN0

AN1

AN2

AN3

AN4

AN5

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

1

2

3

4

5

6

7

8

9

J1

J2

+2V5

LC DISPLA

Y

J3

VSS

VDD

R/W

LCD

VO

RS

D0

D1

D2

10

D3

11

D4

12

D5

13

D6

14

D7

15

16

1

2

3

4

5

6

E

7

8

9

+2V5

+2V5

+12V

K1

SUB D37

R19

56k

R20

10k

R15

47k

R16

10k

+12V

–2V5

–12V

–2V5

R11

39k

R12

10k

R9

47k

R10

10k

–12V

R13

39k

R14

10k

R7

39k

R8

10k

R5

39k

R6

10k

ADG408

IC3

VSS

VDD

GND

MUX

S1

13

14

S2

S3

S4

S5

12

S6

11

S7

10

S8

EN

A0

A2

15

A1

16

D

4

3

8

5

6

7

9

2

1

070010 - 11

+12V

–12V

V LIFT

+8V

–8V

V WHEEL

LIFT EN

LM317

IC1

R1

100

7

R3

100

7

LM337

IC2

R2

100

7

R4

100

7

+2V5

+12V

T1

BC547A

R18

100

7

RE1

D1

1N4001

+2V5

–2V5

–12V

–2V5

background image

122

elektor electronics - 7-8/2007

Formula Flowcode Buggy

3PRL THU` PU [OL LUNPULLYPUN [LHJOPUN MYH[LYUP[` [OL H\[OVY PZ
PUJYLHZPUNS`H^HYL[OH[LSLJ[YVUPJZ¶HUKTVZ[LUNPULLYPUNHUKZJP-
LUJLYLSH[LKHJ[P]P[PLZ¶MHPS[VH[[YHJ[`V\UNWLVWSL;VWLVWSL^OV
OH]LNYV^U\W^P[OHMHZJPUH[PVUMVY[LJOUVSVN`[OPZPZHNYLH[ZOHTL
HUKP[YLHSS`PZ]LY`Z[YHUNL^OLU`V\JVUZPKLY[OH[`V\UNWLVWSLHYL
MHZJPUH[LKI`HSS[OPUNZLSLJ[YVUPJ¶SPRLPWVKZKPNP[HSJHTLYHZHUK
TVIPSLWOVULZ)\[MVYZVTLYLHZVUV\YZJOVVSZMHPS[VJHWP[HSPZLVU
[OPZPU[LYLZ[HUKH[[YHJ[`V\UNWLVWSL[V[LJ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MVYSLHYUPUNHIV\[LSLJ[YVUPJZHUKWYVNYHTTPUN;OPZ
HY[PJSLKLZJYPILZ^OH[-VYT\SH-SV^JVKLKVLZOV^P[^VYRZOV^
^LOVWLP[JHUIL\ZLK[VSLHYUHSSHIV\[YVIV[PJZ

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.

1.

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

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

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

Figure 1.

Formula Flowcode functional parts.

background image

123

7-8/2007 - elektor electronics

(UKOLYLP[PZ

-PN\YLZOV^ZHWPJ[\YLVM-VYT\SH-SV^JVKLHUKHSPZ[VM[OLJVT-
WVULU[ZHUKMLH[\YLZVU[OLI\NN`)\[OV^KVLZP[HSS^VYR&3L[»ZZ[HY[
H[[OLILNPUUPUN;OL^OVSL)\NN`PZKLZPNULKHYV\UK[OLUL^HUK
]LY`WV^LYM\S70*-TPJYVJVU[YVSSLYMYVT4PJYVJOPW;OPZ
WPUKL]PJLVWLYH[LZH[4/aHUK^PSSL_LJ\[LWYVNYHTZH[HUHTHa-
PUNZWLLKVM407:(TLL[NYLL[KPHNYHTVM[OPZ*7<PZZOV^UPU
-PN\YL;OLKL]PJLJVUULJ[ZKPYLJ[S`[V`V\Y<:)WVY[HUKJVU[HPUZ
HIVV[SVHKLYWYVNYHTZV[OH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JRZSPRL3*+
)S\L[VV[OHUKTHU`TVYL

:V\UK06HUKSPNO[ZLUZVY

;OLI\NN`JHUYLHJ[[VZV\UKOHUKJSHWZ\ZPUN[OLHTWSPÄLK
TPJYVWOVULJPYJ\P[JVUULJ[LK[V9)(ZZOV^UPU-PN\YL[OPZ
ZV\UKZLUZVYTH`IL\ZLKHZHKPNP[HSPUW\[HUL_[LYUHSPU[LYY\W[

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

Figure 3.

The L293D Double H-bridge motor driver circuit.

Figure 4.

Two switches, eight LEDs and the E-Blocks D-type connector.

Figure 5.

The microphone, loudspeaker and light sensor circuitry.

background image

124

elektor electronics - 7-8/2007

VYL]LUHZHUHUHSVN\LPUW\[;OLI\NN`HSZVPUJS\KLZHZPTWSL
OPNOPTWLKHUJLZWLHRLY[OH[JHUIL\ZLK[VNLULYH[LMYLX\LUJPLZ
IL[^LLU/aHUKR/a([[OLMYVU[VM[OLI\NN`PZHZTHSS
MVY^HYKMHJPUNSPNO[ZLUZVY[OH[HSSV^Z[OL]LOPJSL[VTLHZ\YLSPNO[
PU[LUZP[`PU[OLMVY^HYKKPYLJ[PVU

0UMYHYLK
KPZ[HUJLTLHZ\YPUNJPYJ\P[

;OLI\NN`HSZVPUJS\KLZ[OYLLKPZ[HUJLZLUZVYZVU[OLMYVU[SLM[HUK
YPNO[VM[OLTHPUJPYJ\P[IVHYK-PN\YLZOV^Z[OLJPYJ\P[KPHNYHT
(ZPUNSLZLUZVYPZHJVTIPUH[PVUVMHU093,+[OH[LTP[Z09SPNO[

HUKHU09ZLUZP[P]LWOV[V[YHUZPZ[VYWYVK\JPUNHUHUHSVN\L]VS[HNL
[OH[»ZPU]LYZLS`WYVWVY[PVUHS[V[OLHTV\U[VM09SPNO[YLÅLJ[LK

3PULMVSSV^PUNJPYJ\P[

(SZVVU[OLMYVU[VM[OLI\NN`PZHZTHSS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L]HU[KLNYLLZPU
LSLJ[YVUPJZHUKJVTW\[LYZJPLUJL

;OLJV\YZLZPUJS\KLZ\JOZ\IQLJ[ZHZ!

u

3PNO[HZPUNSL3,+"

u

4HRLHº5PNO[9PKLY»LMMLJ[VU[OL3,+ZVU[OLMYVU[VM-VYT\SH

-SV^JVKL"

u

+L]LSVWHWYVNYHT[OH[\ZLZ[OLVUIVHYKSPNO[ZLUZVY[VHSSV^

Figure 6.

Distance measurement circuit on board

the Formula Flowcode Buggy.

Figure 7.

Line follower circuit.

Figure 8.

The simple but all-important power supply.

background image

125

7-8/2007 - elektor electronics

-VYT\SH-SV^JVKL[VZ[LLY[V^HYKZ[OL
SPNO[MYVTHOHUKOLSK[VYJO"

u

+L]LSVWHWYVNYHT[OH[HSSV^Z-VY-

T\SH -SV^JVKL [V ºKHUJL [V [OL
T\ZPJ» ,]LY` [PTL `V\ JSHW P[ T\Z[
[\YU[OYV\NO KLNYLLZ"

u

+L]LSVWHWYVNYHT[OH[HSSV^Z-VYT\SH

-SV^JVKL[VMVSSV^HTL[YLSVUNSPUL
THKL\WMYVTHISHJRPUZ\SH[PUN[HWL
)LH[H[PTLVMZLJVUKZ"

u

+L]LSVWHWYVNYHT[OH[HSSV^Z-VY-

T\SH -SV^JVKL [V ZVS]L H JLSS
THaL\ZPUN[OLSLM[OHUK^HSSMVSSV^-
PUN[LJOUPX\L

;OLZLJV\YZLZHYLHSSL_WSHPULK[VZ[\KLU[Z
PU [OL MVYT VM [HZRIHZLK ^VYRZOLL[Z
:VTLHYLJVTWL[P[P]LPU[LYTZVM[PTL
VYM\UJ[PVUHUK^PSSMVYT[OLIHZPZMVY
YLNPVUHSJVTWL[P[PVUZ[OH[^LOVWL^PSS
ILY\UI`,SLR[VYHUKLK\JH[PVUHSPUZ[P[\-
[PVUZHJYVZZ,\YVWL6[OLYJV\YZLZHYLQ\Z[

MVYM\UVYPUKLW[OL_WSVYH[PVUVMWYVNYHT-
TPUNHUKOHYK^HYLMLH[\YLZ
:\WWVY[MVYHSSVM[OPZ^PSSILH]HPSHISLVU
4H[YP_4\S[PTLKPH»Z^LIZP[LMVY\THJJLZ-
ZPISL ]PH ^^^TH[YP_T\S[PTLKPHJVT
^OLYL\ZLYZHZRLHJOV[OLYX\LZ[PVUZHUK
Z^HWWYVNYHTZ>LHSZVWSHU[VY\U^VYR-
ZOVWZVU-VYT\SH-SV^JVKL[VNL[`V\UN
WLVWSL\WHUKY\UUPUNHUKPU[LYLZ[LKPU
[LJOUVSVN`

0UHKKP[PVU[V[OPZ,SLR[VY^PSSILW\ISPZO-
PUNHIVVR^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[YVU-
PJZLU[O\ZPHZ[Z\W[V`LHYZVMHNL

(070323-I)

Figure 9.

Typical line following exercise.

Figure 10.

Solving a simple ‘left’ maze.

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 barthuyskens@scarlet.be, or through Elektor.

You can purchase a Formula Flowcode buggy from the Elektor SHOP at a cost of £ 85 or

` 125 including VAT.

background image

126

elektor electronics - 7-8/2007

Colour Tamer

RGB LED adjustment

Nivard van de Boogaard

>P[O[OPZZPT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JOLZ[VVMMPL[OL

OPNOLZ[H[[LU\H[PVU^PSSL_PZ[PU[OLH\KPV
WH[OHZPU[OH[JHZLUVULVM[OLR£YLZPZ-

4040

CTR12

IC1

CT=0

10

11

13

15

14

12

11

10

CT

16

4

2

3

5

6

7

9

1

+

9

8

7

6

5

4

3

2

1

0

8

S1

RESET

T1

BC547

P1

10k

R5

100k

R6

10k

MIC1

R1

1k

R2

1k

R3

1k

R4

1k

IC2.A

13

1

2

IC2.B

5

3

4

IC2.C

12

11

10

IC2.D

6

9

8

C1

10

M

12V

IC2

14

7

+5V

IC2 = 4066

070034 - 11

background image

128

elektor electronics - 7-8/2007

[VYZHYLZOVY[LKV\[
;VJHSPIYH[L[OLJPYJ\P[KPZJVUULJ[[OL
JSVJRPUW\[WPUMYVT[OL^PWLYVM7

[OLJV\U[LYV\[W\[ZJOHUNLZ[H[LHUK^P[O
[OLT[OLIPSH[LYHSZ^P[JOLZPU[OL

(070034-I)

HUK[LTWVYHYPS`NYV\UKP[[OYV\NOHR£
YLZPZ[VY5V^W\SZL[OLJSVJRPUW\[I`IYPLÅ`
JVUULJ[PUNP[[V[OL =SPUL"`V\^PSSZLL

Walking Works!

C. Tavernier

(S[OV\NO [OL THQVY-

P[` VM YVIV[Z I\PS[ I`

HTH[L\YZTV]LHYV\UK

\ZPUN^OLLSZVYJH[LY-

WPSSHY [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 HJ [ \HSS`

OH]L LPNO[ SLNZ

HUK[OL^HSRPUN

YVIV[ 0[ TH`

ZLLT YLSH-

[P]LS` LHZ`

[V THRL

[OL

^OLLSZ
[\YU
\ZPUN

TV[VYZ

^OPJO PZ [OL

ZVSLYLX\PYLTLU[PUHJVU]LU[PVUHSTVIPSL
YVIV[I\[YLWYVK\JPUN^HSRPUNILP[VM
HUPUZLJ[PUHOL_HWVKVYVMHO\THUPU
H^HSRPUNYVIV[TPNO[HWWLHYTHYRLKS`
TVYLKPMÄJ\S[

0U[OPZHY[PJSL^L»SSZLLOV^[VKV[OPZMVYH
^HSRPUNYVIV[^OPJO^L»]LVW[LK[VI\`PU
RP[MVYTMVY[OLTLJOHUPJHSWHY[(S[OV\NO
[OLZLKH`ZHU`NVVKOHUK`THUJHUI\PSK
HºJVU]LU[PVUHS»TVIPSLYVIV[IHZLPL
^P[O ^OLLSZ VY [YHJRZ [OL TLJOHUPJHS
JVUZ[Y\J[PVUVMH^HSRPUNYVIV[PZT\JO
[YPJRPLYTHPUS`ILJH\ZLVM[OLWHY[PJ\SHY
HJ[PVUPU]VS]LKPU^HSRPUN^OPJO^L»SSIL
KLZJYPIPUNPUHTVTLU[

;VV\YRUV^SLKNL[OLYLHYLJ\YYLU[S`VUS`
[^V TLJOHUPJHS RP[Z MVY ^HSRPUN YVIV[Z
ZVSK H[ HU HMMVYKHISL WYPJL! [OL MHTV\Z
;VKKSLYMYVT7HYHSSH_^^^WHYHSSH_JVT
HUKJSVZLY[VOVTL[OL@L[PMYVT(YL__
,UNPULLYPUN^^^HYL__JVT
(Z[OLZL[^VYVIV[ZVWLYH[LPU]PY[\HSS`[OL
ZHTLMHZOPVUPU[LYTZVM[OLWYPUJPWSLVM

CB220

IC1

SOUT

P15

P14

P13

P12

P11

P10

SIN

ATN

RES

VIN

P0

21

23

P1

P2

P3

P4

P5

10

P6

11

20

19

18

17

16

15

P9

14

P7

12

P8

13

22

24

5

4

6

7

8

9

1

2

3

K1

SUB D9

1

2

3

4

5

6

7

8

9

rechargeables

4V8

dry cells

6V

dry cells (6V)

rechargeables (4V8)

C1

100n

C2

100n

070353 - 11

+V
E
GND

+V
E
GND

Servo

Servo

*

*

*

see text

background image

129

7-8/2007 - elektor electronics

[OLPY^HSRPUN^LZL[[SLKVU[OLRP[MVY[OL
@L[PKPZ[YPI\[LKI`3L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\[P[OHKHJLY[HPU
THNPJMVYHZTHSSIV`
7OPSPWZ HSZV [YPLK [V NL[ L]LU
`V\UNLYJOPSKYLUPU[LYLZ[LKPU
TLJOHUPJHS LUNPULLYPUN HUK
[O\ZJYLH[LHWVVSVMUL^J\Z-
[VTLYZMVY[OL4,RP[Z7OPSV-
MVYTHJVUZ[Y\J[PVUZ`Z[LT[OH[

background image

131

7-8/2007 - elektor electronics

Z[YVUNS`YLZLTISLK3LNV;LJOUPJHUKJV\SK
IL\ZLK[VNL[OLY^P[O4,^HZPU[YVK\JLK
PU /V^L]LY[OLLUKVM[OLSPULMVY
[OLZLTLJOHUPJHSJVUZ[Y\J[PVUTH[LYPHSZ
MYVT,PUKOV]LUJHTLPU
0UJPKLU[HSS`[OLÄYZ[4,RP[[OL4,
OHKH]LY`Z[YVUNMLH[\YL^P[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[OLPYNLU-
LYHSJVUKP[PVU1\Z[HZ^P[OHSSVSK[OPUNZ
[OLYLHYLJVSSLJ[VYZ^OVHYLPU[LYLZ[LKPU
[OLTHUK[OLYLHYL]HYPV\Z^LIZP[LZ^OLYL
`V\JHUÄUKTVYLPUMVYTH[PVU

(070277-1)

Web Links

http://ee.old.no/mechanics

http://sharon.esrac.ele.tue.nl/~pa0ib/bouw-
dozn/index.html

www.hansotten.com/philipsme1200.html

www.girdersandgears.com/norelco.html

A Robot with an El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VIV[ZHYLTVZ[VM[LUWV^-
LYLKMYVT=;OLÄN\YLZ\NNLZ[ZHJPYJ\P[

[OH[JHUIL\ZLK^P[OHSS70*TPJYVJVU[YVS-
SLYZPU[OL70*MHTPS`MYVT4PJYVJOPW
/V^L]LY[OLWYVISLTPZUV[PJLHIS`[YPJR-
PLY ^OLU P[ JVTLZ [V [OL ZVM[^HYL MVY
THUHNPUN[OLZLTLTVY`JHYKZ*VU[YHY`
[V^OH[^LTPNO[H[ÄYZ[[OPUR[OLZLHYL
UV[Q\Z[ZPTWSL,,7964-SHZOTLTVYPLZ
^P[OZLYPHSHJJLZZI\[TVK\SLZ[OH[OH]L
[OLPYV^UPU[LYUHSPU[LSSPNLUJL:VP[»ZUV[
WVZZPISL[VYLHKVY^YP[LKPYLJ[S`[V[OLZL
TLTVYPLZHZ`V\^V\SKKV^P[OHUVYKP-
UHY`ZLYPHSHJJLZZ,,7964SPRLH*
MVYL_HTWSL
;OLKPHSVN\LOHZ[VYLZWLJ[HWYLJPZLWYV-
[VJVS HZ [OL JHYK VUS` YLJVNUPaLZ HUK
YLZWVUKZ [V H JLY[HPU U\TILY VM JVT-

RC3/SCK/SCL

OSC2/CLKOUT

RA5/AN4/SS

RE0/RD/AN5

RE1/WR/AN6

RE2/CS/AN7

OSC1/CLKIN

RC0/T1CKI

PIC18Fxxx

RA4/T0CKI

RC1/CCP2

MCLR/VPP

RC2/CCP1

RD0/PSP0

RD1/PSP1

RD2/PSP2

RD3/PSP3

RD7/PSP7

RD4/PSP4

RD5/PSP5

RD6/PSP6

RA3/AN3

RA2/AN2

RC4/SDI

RC7/RXD

RC6/TXD

RA0/AN0

RB7/PGD

RB6/PGC

RA1/AN1

RC5/SDO

RB0

RB3

RB1

RB2

RB5

RB4

11

15

40

39

38

37

35

36

34

33

31

12

10

32

16

17

18

19

20

21

22

13

26

25

24

23

30

27

28

29

14

1

3

2

4

6

5

7

8

9

+3V3

DOUT

DIN

GND

SCK

GND

CS

1

2

3

4

5

6

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
LSLJ[YPJHSLX\PWTLU[ZJHUIL
JVU[YVSSLK\ZPUNJOHUNLV]LY
JVU[HJ[ZVUYLSH`Z
;OLJPYJ\P[KPHNYHTZOV^ZH
JVUKLUZLYLSLJ[YL[TPJYV-
WOVUL 4 JVUULJ[LK [V
[OLPUW\[VMWYLHTWSPÄLY;
;OLZV\UKWPJRLK\WI`[OL
TPJYVWOVULPZWYLHTWSPÄLK
HUKMLK[V[OLPUW\[WPU
VMH[PTLY0*ZL[\WPU
TVUVZ[HISL JVUMPN\YH[PVU
;OLV\[W\[VM[OLPZJVU-
ULJ[LK[V[OLJSVJRPUW\[VM
H JV\U[LY
>OLUL]LY H W\SZL HYYP]LZ
H[ [OL JSVJR PUW\[ VM 0*
WPUP[WYVK\JLZHIP[
IPUHY`LX\P]HSLU[JVKLH[P[Z
MV\Y V\[W\[Z (Z HU L_HT-

LM555C

IC1

DIS

THR

OUT

TR

CV

2

7

6

4

R

3

5

8

1

74LS90

R0(1)

R0(2)

R9(1)

R9(2)

IC2

14

11

12

QA

QB

QC

QD

10

1

6

7

8

9

2

3

B

A

5

C3

10n

C1

100n

C2

100n

C4

10n

R8

10k

R7

3k3

R6

100k

R5

10k

R1

1k

T5

BC547

T1

BC547

RE1

D1

1N4148

+5V

+5V

R2

1k

T2

BC547

RE2

D2

1N4148

+5V

R3

1k

T3

BC547

RE3

D3

1N4148

+5V

R4

1k

T4

BC547

RE4

D4

1N4148

+5V

MIC1

070092 - 11

background image

133

7-8/2007 - elektor electronics

WSL^OLU[OLÄYZ[W\SZLPZHWWSPLK[V[OL
»Z;90.PUW\[[OLIPUHY`JVKLKV\[W\[
VU[OL ^PSSILMVY[OLZLJVUK
W\SZL[OLV\[W\[^PSSILHUKZVVU
-VY[OL

[O

W\SZL[OLV\[W\[^PSSIL

6UYLJLP]PUN[OLUL_[W\SZL0*H\[VTH[P-
JHSS`J`JSLZIHJR[VZ[H[L
;OLJV\U[LY»ZMV\YV\[W\[ZJVU[YVSKYP]LY
[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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[LS-
LWOVULJHISL
0U[LYLZ[LKYLHKLYZ^PSSÄUK[OLJOHYHJ[LY-
PZ[PJZHUK]PL^ZVM[OLPUUHYKZVM[OLISVJR
VU7OPSV»Z^LIWHNLZBDBD

(070371-I)

Web links

[1] Philo’s NXT® motor internals:

http://www.philohome.com/nxtmotor/nxt-
motor.htm

[2] Lego® 9 V Technic Motors characteristics
compared:

http://www.philohome.com/motors/motor-
comp.htm

background image

134

elektor electronics - 7-8/2007

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]LYZJOLTH[PJKPHNYHTZ
MVYTHU`OV\YZKYH^PUNJPYJ\P[Z^P[OWLUJPSHUKWHWLY[OLUWYV-
K\JLKP[HSSV]LYHNHPUMVYHºJSLHU»]LYZPVU)\ZPULZZLZ^LYL[OLÄYZ[
[VOH]L[OLTLHUZ[V\[PSPZL*(+ZVM[^HYLZ\JOHZ6YJHKVY7YV[LS
VUWV^LYM\SZ`Z[LTZ^P[OZ[HMMLZWLJPHSS`[YHP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the Internet,

there is nothing to stop you from designing it with Libedit!

Figure 2.

EeSchema: easy schematic capture.

Figure 1.

KiCad is project-based, just like similar products on the market.

background image

136

elektor electronics - 7-8/2007

;OLYPNO[PJVUIHYNYV\WZ[OLKPMMLYLU[KYH^PUN[VVSZ!HKKPUNJVT-
WVULU[[OLNH[LJVUULJ[PVUI`^PYLVYI\ZSHILSZJVTTLU[HY-
PLZHUKV[OLYLTILSSPZOTLU[Z[OH[^PSSPTWYV]L[OLWYLZLU[H[PVU
VM`V\YZJOLTH[PJ
;OLYLZ[VM[OLYLX\PYLKJVTTHUKZHYLHJJLZZPISLMYVT[OLJVU[L_-

[\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_[\HSJVTTHUKZHYLKLWLUK-
LU[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\JSPJRLKVUHJVTWV-
ULU[H^PYLH[L_[ÄLSKL[J
;OLTV\ZLHSZVTHRLZP[WVZZPISL[VKPZWSH`HaVUL[OH[`V\^PSS
ZLSLJ[I`JSPJR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HY`ÄSLZ;OLº+»HUKº/LSW»TLU\ZZWLHRMVY[OLTZLS]LZ
<UKLY[OLKPMMLYLU[TLU\IHYZ`V\^PSSÄUKZJYVSSPUNSPZ[Z[OH[HSSV^
`V\[VLHZPS`JOHUNL[OL^PK[OVM[OL[YHJLKPTLUZPVUZVM[OL]PHZ
NYPKWP[JOU\TILYVM[OLSH`LYHUKaVVT
;OLPJVUZSVJH[LKVU[OLSLM[VM[OL^PUKV^HYLYLSH[LKTHPUS`[V
^OH[PZYLWYLZLU[LKVU[OLZJYLLU!KPZWSH`VM[OLWVSHYJVVYKPUH[LZPU
[OLZ[H[\ZIHYTLHZ\YLTLU[\UP[ZZOHWLVM[OLJ\YZVYKPZWSH`VM[OL
YH[ZULZ[YLWYLZLU[H[PVUI`ZLNTLU[ZVM[OLJVUULJ[PVUZ[VILYV\[LK

Figure 6.

3D display of the capacitance meter as described in Elektor.

Figure 5.

Design PCBNew printed circuits.

Figure 4.

CVPCB: choice of component case.

background image

137

7-8/2007 - elektor electronics

H\[VTH[PJLYHZPUNVM[YHJLZ[OH[`V\OH]LYLYV\[LKKPZWSH`VMWHKZ
HUK[YHJLZPUM\SSSPULZVYPUJVU[V\YZPUOPNOJVU[YHZ[KPZWSH`
;OL\WWLYPJVU[VVSIHYQ\Z[SPRLPU,,:JOLTHNYV\WZ[OLÄSLJVT-
THUKZHUK[OLZLSLJ[PVUVM[OLZOLL[MVYTH[;OLUL_[PJVUHSSV^Z
`V\[VHJJLZZ[OLTVK\SLLKP[VYVYMVV[WYPU[ZVM[OLJVTWVULU[Z
PU[OL\USPRLS`JHZL[OH[[OLSPIYHYPLZZ\WWSPLKHUK[OVZLH]HPSHISL
VU[OL0U[LYUL[HYLPUZ\MÄJPLU[0[ZVWLYH[PVU]LY`T\JOYLZLTISLZ
[OLVULVM[OL3PI,KP[JVTWVULU[LKP[VY^OPJOTLHUZ`V\ZOV\SK
MLLSTVYLJVTMVY[HISL^P[OP[

>LOH]LUVZWLJPÄJJV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MHSSMVY[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\I-
SPZOTVYLVYSLZZÄ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)

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.

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.

http://ru.wikipedia.org/wiki/Kicad

Figure 8.

The main icons on a large scale and in low resolution (the

originals are a standard size, 16 x 16 pixels).

Figure 7.

The rats’ nest in white lines.

background image

138

elektor electronics - 7-8/2007

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[P-
TH[LVIQLJ[P]LPZ[VOH]LH[LHTVMM\SS`
H\[VUVTV\ZO\THUVPKYVIV[ZPU[OH[
JHUKLMLH[[OL^VYSKMVV[IHSSJOHTWPVUZ

-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 TPKZPaLK SLHN\L
4:3
;OLYVIV[ZPU[OL4:3T\Z[IL+0@JVU-
Z[Y\J[PVUZHUKT\Z[ILH\[VUVTV\Z;OPZ
TLHUZ[OH[HSS[OLPYPU[LSSPNLUJLT\Z[IL
VUIVHYKHUKUVIVK`PZHSSV^LK[VJVU-
[YVS[OLYVIV[MYVT[OLZPKLSPUL
;OL7OPSPWZYVIV[ZHYLLX\PWWLK^P[O[OL
MVSSV^PUNJVTWVULU[Z[VLUHISL[OLT[V
WSH`MVV[IHSS!

[^V=PZPVUJHTLYHZVULÄ_LKJHTLYH

H[ [OL MYVU[ HUK VUL VTUPKPYLJ[PVUHS
JHTLYH

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UHK]HUJL(JVSSPZPVUPZW\U-
PZOLK I` H `LSSV^ JHYK HUK H YLWLH[
VMMLUJL`PLSKZHYLKJHYK^OPJOTLHUZ
[OLYVIV[OHZ[VSLH]L[OLÄLSK;OLYVIV[
ZOVV[Z H[ [OL NVHS HZ ZVVU HZ [OL NVHS
VWLUPUNPZSHYNLLUV\NO/V^L]LY^PU-
UPUN[HRLZTVYL[OHUQ\Z[ÄYPUNVMMOHYK
ZOV[Z"ZWLLKHUK[HJ[PJZHYLH[SLHZ[LX\HSS`
PTWVY[HU[

(070359-1)

background image

139

7-8/2007 - elektor electronics

background image

140

elektor electronics - 7-8/2007

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.

The method of solving the 36x36 cell Alphanumski puz-
zle shown here is basically the same as for a 9x9 cell Su-
doku, 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 ver-
tically) 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; iden-
tified by red outlines and a background colour).

A number of clues are given in the puzzle and these repre-
sent 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 nu-
merals in the grey boxes
. The puzzle is also available
as a free download from our website..

(070151-I)

A

R

3 D

1 Z W

D 6 L

3 T 1 Q

5

G J A

2

O

H

E G

7

0

K U Y

7

0

S L P 6 H Y 2

N

9 I Q

G Q N B J

I E

8

V 4 5 D

3 L

C

Y I Z S K N

E

X 7 R

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

F J G 0

P 9 4

I 2

3 V

7 8

O

W H N

P L U S

9

N

6 D U B

5

M E Y

K

U M C X

R 4

A D

G N 3

P 2

O D

E Y

S

Q K

T

6 Y

Q R X 9

2 K 7 A

F O

H

0 S K 5 D

2

Y R

G H

V

I

T M

A I N U 1 C

W Z B

8

Y

9 F L 2 0

Q

Z T E

D

1 U

E

P

N

O L

F

4 2 5 X

G B 6

H T

X 3 L 0

P A

Z 4

8

D A 7 6 V

N

J Q U

8

2

4 V Y 0 N

K J

Z A Q W P

B

S

T L V U

Y 2

4 H

Q

F 3 6

2 M D

B

E 1 T

7 I W P A R F

X

S 6 9 U

0

D

0 C 3 6 P

I

K V

F L J

U J Y H

K 5 Z

A

I

D O

M F

8 H Y

R 1 J 3

7 W D

G

R J

3

M B

D Y P L

6

E

B S Q

X W P

O

T 1

0 3

I

5

T 6 S 7

W 2 Q 8

C

2 A

K L

6 Q U

N R 4

L

1 7 2

H V 8 9 O A I B X

Puzzle creator: Géry Szcepanski

background image

141

7-8/2007 - elektor electronics

Y M

7

I

J G 6 X

F Q

L 8

C

B 8

S O

I E 0

N

D 1

J I F P L

R

X

9 S

A O U T B 3 W Z E

G J 1 R

0 S

9 X W 7 T 2 A H

Y

C

L

2 4 9

D 0 5

U 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

N

M H E X A D O K U

V L

T G 2 Y D K 0 B 5 9 1 6

J C Z

X

H O

7

2 P A R

S F

9

V

S

T Q O W

0 1 6

2 7

A 0

5 4 U

J G

B N

X

Z L

M 1 E

C 4

S N

G I P 8 5

E

P

X W

L

8 N C 4

T 6

H J L 5

Y 9 G

D

E 2

O

A 3

P

7 4 W

8 U

J

M W

C Y D Z V

T J

H

G

R 8 F 7 K Z O

2 U

Q M 5 9 1

S 2 5 T G

E K 0

M C

L X P

B 3

S

X

U 6

C I

F

G

1

W 6

7 3 F 0 E 8

A

9 Y 4 0 I R X H N K A Z S

J 5

O H

Q

2

Y

3 K

U A

2 5 Q W S

Y

1

B

N

7 N

R

P 9

G

4 W M 6 0

2

X V

5 S

B P

L

A

Q 0

H

8 I Z 0 F N 1

T

C 5 U X

N R 9

M A 2 Y 7

H

L

8

D

L G

K X J

N

O 3

3 J W

B

0

D V

S H

T M

K U D T S C M 6 5

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:

editor@elektor-electronics.co.uk
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!

brain wrecker for the holidays

background image

142

elektor electronics - 7-8/2007

E L E K T O R

S H O W C A S E

To book your showcase space contact Huson International Media

Tel. 0044 (0) 1932 564999

Fax 0044 (0) 1932 564998

FUTURLEC

http://www.futurlec.com

Save up to 60% on
• Electronic Components
• Microcontrollers, PIC, Atmel
• Development Boards, Programmers
Huge range of products available on-line for
immediate delivery, at very competitive prices.

LONDON ELECTRONICS COLLEGE

http://www.lec.org.uk

Vocational training and education for national
qualifications in Electronics Engineering and
Information Technology (BTEC First National,
Higher National NVQs, GCSEs and Advanced
Qualifications). Also Technical Management and
Languages.

MODular ElecTRONics

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

MQP ELECTRONICS

www.mqp.com

• Low cost USB Bus Analysers
• High, Full or Low speed captures
• Graphical analysis and filtering
• Automatic speed detection
• Bus powered from high speed PC
• Capture buttons and feature connector
• Optional analysis classes

NEW WAVE CONCEPTS

www.new-wave-concepts.com

Software for Hobbyists:
• Livewire - circuit simulation

software, only £34.99

• PCB Wizard - PCB design

software, only £34.99

• Circuit Wizard - circuit, PCB and breadboard

design software, only £59.99

Available from all Maplin Electronics stores and
www.maplin.co.uk

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 1966-
2002. 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 Award-
winning site in both
English and German
offers prototype
PCBs at a fraction of the cost of the usual
manufacturer’s prices.

DECIBIT CO.LTD.

www.decibit.com

Smallest 2.4 GHz ISM band MCU embedded
transceiver modules. Complete tiny solution,
ready to transmit RF data by only attaching as
example a CR2032 coin cell to it.

EasyDAQ

www.easydaq.biz

We design & supply low cost USB/RS232 based
data acquisition, automation & control products:
• USB connected & powered, 8 opto isolated

voltage inputs chans, 4DIO & 4 onboard relays
capable of switching 240V@10A. With
Labview, VC & VB examples - £60

EASYSYNC

http://www.easysync.co.uk

EasySync Ltd sells a wide
range of single and multi-
port USB to RS232/RS422
and RS485 converters at competitive prices.

ELNEC

www.elnec.com

• device programmer

manufacturer

• selling through contracted

distributors all over the world

• universal and dedicated device programmers
• excellent support and after sale support
• free SW updates
• reliable HW
• once a months new SW release
• three years warranty for most programmers

FIRST TECHNOLOGY TRANSFER LTD.

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

FUTURE TECHNOLOGY DEVICES

http://www.ftdichip.com

FTDI designs and sells
USB-UART and USB-FIFO
interface i.c.’s.
Complete with PC drivers,
these devices simplify the task of designing or
upgrading peripherals to USB

background image

143

7-8/2007 - elektor electronics

PCB WORLD

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.

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

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

...........................................................................................................................................................................................................................................

...........................................................................................................................................................................................................................................

...........................................................................................................................................................................................................................................

...........................................................................................................................................................................................................................................

SHOWCASE YOUR COMPANY HERE

SYTRONIC TECHNOLOGY LTD

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

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.

p r o d u c t s a n d s e r v i c e s d i r e c t o r y

USB INSTRUMENTS

http://www.usb-instruments.com

USB Instruments specialises
in PC based instrumentation
products and software such
as Oscilloscopes, Data
Loggers, Logic Analaysers
which interface to your PC via USB.

VIRTINS TECHNOLOGY

www.virtins.com

PC and Pocket PC based
virtual instrument such
as sound card real time
oscilloscope, spectrum
analyzer, signal generator,
multimeter, sound meter,
distortion analyzer, LCR meter.
Free to download and try.

www.

elektor-

electronics.

co.uk

background image

144

elektor electronics - 7-8/2007

^^^LSLR[VYLSLJ[YVUPJZJV\RZ\IZ
;LS

+

&!"'
"! %!
%#!
% %$(

– 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



,**$

!+%

)

.--!

/,

background image

Elektor 2006

This CD-ROM contains all

editorial articles published in

Elektor Electronics Volume

2006. Using the supplied

Acro bat Reader program, arti-

cles 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 data-

sheets, software tools, tips,

tricks and Internet links to

assorted robot construc tions

and general technical infor-

mation. All aspects of modern

robotics are covered, from

sensors to motors, mechanical

parts to microcontrollers, not

forgetting matching programmingtools and

libraries for signal processing.

More information on www.elektor-electronics.co.uk

Telephone +44 208 261 4509
Fax

+44 208 261 4447

Email: sales@elektor-electronics.co.uk

Order now using the Order Form in

the Readers Services section in this issue.

CD-ROM BESTSELLERS

Elektor Electronics (Publishing)
Regus Brentford
1000 Great West Road
Brentford TW8 9HH
United Kingdom

Ethernet Toolbox

This CD-ROM contains all essential

information regarding Ethernet inter-

faces! 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 additio-

nal docu men tation and links to intro-

ductory 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).

ISBN 978-90-5381-214-3 |

£18.90 (US$ 37.90)

More bestsellers on www.elektor-electronics.co.uk

Microcontroller Basics

Microcontrollers have become an indispensable

part of modern electronics. They make things pos-

sible that vastly exceed what could be done previ-

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

the tech nology using various micro controller

circuits and programs written in several different

programming languages. In the course of the

book, the reader gradually develops increased

competence in converting his or her ideas into

microcontroller circuitry.

ISBN 978-0-905705-67-5

230 Pages

£18.70 (US$ 33.70)

ISBN 978-90-5381-179-5 |

£12.05 (US$ 21.25)

Visual Basic

for Electronics Engineering Applications

This book is targeted towards those people that

want to control existing or home made hardware

from their computer. After famil iarizing yourself

with Visual Basic, its development environment

and the toolset it offers are discussed in detail.

Each topic is accompanied by clear, ready to

run code, and where necessary, schematics

are provided that will get your projects up to

speed in no time.

ISBN 978-0-905705-68-2

476 Pages

£27.50 (US$ 51.50)

3

2

Top-5

BESTSELLING BOOKS

Visual

Basic

for Electronics Engineering Applications

ISBN

978-0-905705-68-2

£27.50

(US$ 51.50)

Microcontroller Basics

ISBN

978-0-905705-67-5

£18.70

(US$ 33.70)

PC-Interfaces under Windows

ISBN

978-0-905705-65-1

£25.95

(US$ 52.00)

Modern High-end Valve Amplifiers

ISBN

978-0-905705-63-7

£25.95

(US$ 52.00)

308 Circuits

ISBN 978-0-905705-66-8 £18.20

(US$ 37.00)

2

3

4

5

1

1

NEW

background image

Order o

www.elektor-el

No. 367 JULY/AUGUST 2007

Dual Battery

070343-1

PCB, bare

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

Low2 Cost USB Demo Board

060342-81

CD-ROM, project software

5.20 9.75

060342-41

PIC18F4550, programmed

15.15 28.50

LPC 900 Programmer

070084-1

PCB, bare

6.90 12.95

MotoBox

070129-1

PCB, bare

www.thepcbshop.com

070129-41

PIC16F628-04/P, programmed

14.80 27.95

Propeller Prototyping Board for BoeBot

070275-1

PCB, bare

11.00 20.75

Satnav for Robots

070350-81

CD-ROM, project software

5.20 9.75

070350-41

ATmega32, programmed

16.50 31.15

Serial Interface for the Propeller

070276-1

PCB, bare

www.thepcbshop.com

Stereo Robot Ears

060040-1

PCB, bare

www.thepcbshop.com

060040-81

CD-ROM, project software

5.20 9.75

060040-41

PIC16F88, programmed

10.00 18.85

No. 366 JUNE 2007

2.4 GHz WiFi Spectrum Analyser

070040-1

PCB, bare

8.25 15.50

070040-11

CD-ROM, Linux & Windows software

5.20 9.75

Coil Clinic

060195-1

PCB, bare

7.60 14.25

060195-11

CD-ROM, project software

5.20 9.75

060195-41

Atmega48-20PU, programmed

5.20

9.75

Linux Oscilloscope

060241-11

CD-ROM, project software

5.20 9.75

£ $

060241-W

Program listing

free download

Stand-Alone OBD2 Analyser

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

Whistles from on high

060044-1

PCBs, bare; set for TX and RX

12.00 22.75

060044-11

CD-ROM, project software

5.20 9.75

060044-41

ATtiny15PC, programmed

10.00 18.75

No. 365 MAY 2007

Software Defined Radio

070039-91

Ready-populated and tested board

72.45 126.50

070039-11

CD-ROM, project software

5.20 9.75

Thank your for Flying USB FliteSim

060378-1

PCB, bare

www.thepcbshop.com

060378-41

PIC18F2550I/SP, programmed

15.50 29.25

Universal JTAG Adaptor

060287-1

PCB, bare, with programmed microcontroller

11.00 20.75

060287-41

EP900LC only, programmed

P&P only P&P only

Magnetometer

050276-1

PCB, bare

www.thepcbshop.com

Speedmaster

070021-91

Ready-populated and tested board (excl. R8C module)

51.70 97.45

Seismograph

060307-1

PCB, bare

www.thepcbshop.com

060307-11

CD-ROM, project software

5.20 9.75

060307-41

ATTiny45,programmed

10.35 19.50

ATtiny as RDS Signal Generator

060253-41

Attiny2313-20, programmed

4.20 7.80

No. 364 APRIL 2007

Battery Charge-n-Check

050073-1

PCB, bare, main board

10.30 19.50

050073-2

PCB, bare, display board

10.30 19.50

050073-11

CD-ROM, project software

5.20 9.75

050073-41

ST7FMC2S4, programmed

16.90 31.85

Order now using the Order Form in

the Readers Services section in this issue.

Stand-Alone OBD2 Analyser

(June 2007)

Kit of parts, incl. case, cable, front panel foil
and mounting materials

070038-72

£ 51.70 / US$ 97.50

Free downloads:

Online simulator examples
(070038-21)

Manual
(070038-W1)

See www.elektor-electronics.co.uk

Speedmaster

(May 2007)

The circuit voted winner of
the R8C Design Competition!

Ready-populated and tested
board (excl. R8C module)

070021-91

£ 51.70 / US$ 97.45

Software Defined Radio

(May 2007)

Ready-populated and
tested board

070039-91

£ 72.45 / US$ 126.50

background image

£ $

Products for older projects (if available) may be found on

our website www.elektor-electronics.co.uk

home construction = fun and added value

g-Force on LEDs

060297-71

PCB set, incl. 2 MMA7260 sensors, BDM cable parts

10.00 18.85

060297-11

CD-ROM, project software

5.20 9.75

Programmer for Freescale 68HC(9)08

060263-1

PCB, bare

www.thepcbshop.com

A Simple Mains Inverter

060171-1

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

10.00 18.85

060276-11

CD-ROM, project software incl. source code

5.20 9.75

060276-41

ATmega32-16PC, programmed

8.95

16.85

Wireless USB in Miniature

050402-1

PCB, bare, iDwarf prototyping board

8.30 15.60

050402-91

iDwarf -168 Transmitter module (built & tested)

24.10 45.45

050402-92

iDwarf Node Board (built & tested)

17.20 32.45

050402-93

iDwarf Hub Board (built & tested)

17.20 32.45

Mobile Phone LCD for PC

060184-1

PCB, bare

www.thepcbshop.com

060184-11

CD-ROM, project software

5.20 9.75

060184-41

ATmega16-16PC, programmed

8.95 16.85

Scale Deposit Fighter

070001-1

PCB, bare

www.thepcbshop.com

No. 362 FEBRUARY 2007

… 3, 2, 1 Takeoff!

050238-1

Transmitter PCB, bare

www.thepcbshop.com

050238-2

Receiver PCB, bare

www.thepcbshop.com

MP3 Preamp

060237-1

PCB, bare

www.thepcbshop.com

A Telling Way of Telling the Time

050311-1

PCB, bare

www.thepcbshop.com

050311-31

CPLD, programmed

35.50 66.95

FPGA Course (9)

060025-9-11

CD-ROM, course software incl. source code

5.20 9.75

Explorer-16 Value Pack

060280-91

Four components packaged together in a single box

122.90 232.50

No. 361 JANUARY 2007

Sputnik Time Machine

050018-1

PCB

www.thepcbshop.com

050018-11

CD-ROM, project software (incl. source code)

5.20 9.75

050018-41

AT89C2051, programmed

3.40 6.45

Very Simple Clock

060350-1

PCB

www.thepcbshop.com

060350-11

CD-ROM, project software (incl. source code)

5.20 9.75

060350-41

PIC16F628-20, programmed

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)

www.thepcbshop.com

030417-2

PCB, bare (control & display boards)

www.thepcbshop.com

030417-41

AT90S8515-8PC, programmed

11.40 21.45

No. 359 NOVEMBER 2006

USB Stick with ARM and RS232

060006-1

PCB, bare

11.00 20.75

060006-41

AT91SAM7S64, programmed

27.60 51.95

060006-91

Assembled & tested board

79.90 149.95

060006-81

CD-ROM, all project software

5.20 9.75

No. 358 OCTOBER 2006

PIC In-Circuit Debugger/Programmer

050348-1

PCB

5.20 9.75

050348-41

PIC16F877, programmed

17.90 33.75

050348-71

Kit, incl. PCB, controller, all parts

34.50 64.95

Kits & Modules

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: sales@elektor-electronics.co.uk

USB Stick with ARM
and RS232

(November 2006)

Assembled and
tested board

060006-91

£ 79.90 / $ 149.95

Wireless USB in miniature

(March 2007)

iDwarf -168 Transmitter
module (built & tested)

050402-91

£ 24.10 / US$ 45.45

iDwarf Node Board

(built & tested)

050402-91

£ 17.20 / US$ 32.45

iDwarf Hub Board
(built & tested)

050402-93

£ 17.20 / US$ 32.45

g-Force on LEDs

(April 2007)

PCB set, bare,
incl. 2 MMA7260
sensors, BDM cable
parts

060297-71

£ 10.00 / US$ 18.85

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.

background image

All magazine articles back to volume 2000 are available online in pdf format. The article summary and parts list (if applicable)
can be instantly viewed to help you positively identify an article. Article related items are also shown, including software down-
loads, circuit boards, programmed ICs and corrections and
updates if applicable. Complete magazine issues may also
be downloaded.
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

Elektor Electronics on the web

RESERVE YOUR COPY NOW!

The September 2007 issue goes on sale on Thursday 23 August 2007 (UK distribution only).

UK mainland subscribers will receive the magazine between 18 and 21 August 2007.

Article titles and magazine contents subject to change, please check www.elektor-electronics.co.uk.

w.elektor-electronics.co.uk www.elektor-electronics.co.uk www.elektor-electronics.co

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

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 ampli-

fier 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). GPS-

based 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 mini-

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

INFO

&

MARKET

SNEAK PREVIEW

148

elektor electronics - 7-8/2007

background image

Order Form

Order Form

07/08-2007

07/08-2007

Subscr

iption

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.

309 Circuits

£

19.95

Formula Flowcode Buggy

£

85.00

CD-ROM Ethernet Toolbox

£

18.90

CD-ROM Elektor 2006

£

16.25

Visual Basic for Electronics
Engineering Applications

£

27.50

Description

Price each Qty. Total Order Code

Sub-total

P&P

Total paid

Please send this order form to *
(see reverse for conditions)

Elektor Electronics

(Publishing)

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.
sales@elektor-electronics.co.uk

*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: custserv@audioXpress.com

Please send this order form to

Elektor Electronics

(Publishing)

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.
subscriptions@elektor-electronics.co.uk

METHOD OF PAYMENT

(see reverse before ticking as appropriate)

Bank transfer

Cheque

(UK-resident customers ONLY)

Giro transfer

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.

EL07/08

EL07/08

Name

Address + Post code

Tel.

Email

Date – – 2007

Signature

Name

Address + Post code

Tel.

Email

Date – – 2007

Signature

* cross out what is not applicable

* Offer available to Subscribers who have not held a subscription
to Elektor Electronics during the last 12 months. Offer subject to availability.
See reverse for rates and conditions.

NEW

METHOD OF PAYMENT

(see reverse before ticking as appropriate)

Bank transfer

Cheque

(UK-resident customers ONLY)

Giro transfer

Expiry date: .................................................

Verification code: .........................................

SWITCH ONLY:

Start date: ....................................................

Issue

number

: ..............................................

cribers who have not held a subscription

Yes, I am taking out an annual subscription

to Elektor Electronics and receive a free

1GB MP3 player.

I would like:

Standard Subscription (11 issues)

Subscription-Plus
(11 issues plus the Elektor Volume 2007 CD-ROM)

NEW
NEW

background image

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 Elec tronics 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 Electro nics (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

HOW TO PAY

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.

SUBSCRIPTION CONDITIONS

The standard subscription order period is twelve months. If a perma-
nent 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) reduc-
tion 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 Subscription-
Plus 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% (twenty-
five 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.

January 2007

SUBSCRIPTION RATES FOR ANNUAL

SUBSCRIPTION

Standard

Plus

United Kingdom

£41.90

£48.80

Surface Mail
Rest of the World

£54.50 £61.40

USA & Canada

US$ 95.50

US$106.50

Airmail
Rest of the World

£68.90 £75.80

USA & Canada

US$120.00 US$131.00

background image

151

7-8/2007 - elektor electronics

I

NDEX OF

A

DVERTISERS

ATC Semitec Ltd, Showcase. . . . . . . . . . . www.atcsemitec.co.uk . . . . . . . . . . . . . . . . . . 142

Avit Research, Showcase. . . . . . . . . . . . . www.avitresearch.co.uk . . . . . . . . . . . . . . . . . 142

BAEC, Showcase . . . . . . . . . . . . . . . . . . . http://baec.tripod.com . . . . . . . . . . . . . . . . . . 142

Beijing Draco . . . . . . . . . . . . . . . . . . . . . . www.ezpcb.com . . . . . . . . . . . . . . . . . . . . . . . 109

Beta Layout, Showcase . . . . . . . . . . . . . . www.pcb-pool.com. . . . . . . . . . . . . . . . . 139, 142

Bitscope Designs . . . . . . . . . . . . . . . . . . www.bitscope.com . . . . . . . . . . . . . . . . . . . . . . . 3

Compact Control Design . . . . . . . . . . . . . www.compactcontrol.co.uk. . . . . . . . . . . . . . . . 39

Decibit Co. Ltd, Showcase . . . . . . . . . . . . www.decibit.com . . . . . . . . . . . . . . . . . . . . . . 142

EasyDAC, Showcase . . . . . . . . . . . . . . . . www.easydaq.biz . . . . . . . . . . . . . . . . . . . . . . 142

Easysync, Showcase . . . . . . . . . . . . . . . . www.easysync.co.uk. . . . . . . . . . . . . . . . . . . . 142

Elnec, Showcase . . . . . . . . . . . . . . . . . . . www.elnec.com . . . . . . . . . . . . . . . . . . . . . . . 142

Eurocircuits . . . . . . . . . . . . . . . . . . . . . . . www.eurocircuits.com . . . . . . . . . . . . . . . . . . 139

First Technology Transfer Ltd, Showcase . www.ftt.co.uk . . . . . . . . . . . . . . . . . . . . . . . . . 142

Future Technology Devices, Showcase . . . www.ftdichip.com . . . . . . . . . . . . . . . . . . . . . . 142

Futurlec, Showcase . . . . . . . . . . . . . . . . . www.futurlec.com . . . . . . . . . . . . . . . . . . . . . . 142

Jaycar Electronics . . . . . . . . . . . . . . . . . . www.jaycarelectronics.co.uk . . . . . . . . . . . . . . . . 2

JB Systems, Showcase . . . . . . . . . . . . . . www.modetron.com . . . . . . . . . . . . . . . . . . . . 142

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

Number One Systems . . . . . . . . . . . . . . . www.numberone.com . . . . . . . . . . . . . . . . . . . . 60

Nurve Networks . . . . . . . . . . . . . . . . . . . . www.xgamestation.com . . . . . . . . . . . . . . . . . 139

Paltronix. . . . . . . . . . . . . . . . . . . . . . . . . . www.paltronix.com . . . . . . . . . . . . . . . . . . . . . . . 7

PCB World, Showcase . . . . . . . . . . . . . . . www.pcbworld.org.uk . . . . . . . . . . . . . . . . . . . 143

Peak Electronic Design. . . . . . . . . . . . . . . www.peakelec.co.uk . . . . . . . . . . . . . . . . . . . . . . 6

Pico. . . . . . . . . . . . . . . . . . . . . . . . . . . . . www.picotech.com . . . . . . . . . . . . . . . . . . . . . 109

Quasar Electronics . . . . . . . . . . . . . . . . . . www.quasarelectronics.com . . . . . . . . . . . . . . . 97

Robot Electronics, Showcase . . . . . . . . . . www.robot-electronics.co.uk. . . . . . . . . . . . . . 143

Scantool . . . . . . . . . . . . . . . . . . . . . . . . . www.ElmScan5.com/elektor . . . . . . . . . . . . . . 139

Schaeffer AG . . . . . . . . . . . . . . . . . . . . . . www.schaeffer-ag.de . . . . . . . . . . . . . . . . . . . 109

Showcase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142, 143

SourceBoost Technologies, Showcase . . . www.sourceboost.com . . . . . . . . . . . . . . . . . . 143

Sytronic Technology Ltd, Showcase . . . . . www.m2mtelemetry.com . . . . . . . . . . . . . . . . 143

Tsien (UK) Ltd, Showcase . . . . . . . . . . . . www.componentbin.com . . . . . . . . . . . . . . 6, 143

Ultraleds, Showcase . . . . . . . . . . . . . . . . www.ultraleds.co.uk . . . . . . . . . . . . . . . . . . . . 143

USB Instruments, Showcase . . . . . . . . . . www.usb-instruments.com . . . . . . . . . . . . . . . 143

Virtins Technology, Showcase . . . . . . . . . www.virtins.com . . . . . . . . . . . . . . . . . . . . . . . 143

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: gerryb@husonmedia.com to whom all

correspondence, copy instructions and artwork should be addressed.

NEW

Software Tools en Hardware Tips

'$#(#'!!''#(!#$&"($#
&&#(&#(#(&'$!%,$)
!&#$)(((&#(#(&'+*
$"%!$!!($#$!!&(!'$#('($%
((*%%&#! ($&!(&$#'#
$"%!"#(("+(($#!$)"#
(($##!# '($#(&$)($&,&(!'$#
(&#(#(&'

(#!)'$!!($#$('('$&((&#(#(&
'&$""#,&#("#)()&&'$!%,$)+(,$)&$+#
%&$('(%&$*'+!($#$&"($#$)(
$##($&'#$"%$##('$&(%,'!!,&#'%
'$(+&($$!'$&)'+(((&#($(+&
!!$($)"#('&!'

$'''# " $ %#

&&#$+)'#(&&$&"#(
&'&*''($##(''')
! ($&!(&$#')!'#
)'6&#($&
/...7&(:'($
6&#($&:45
9#(8#$"
! -110.403/12.5

ISBN 978-90-5381-214-3

£18.90 / US$ 37.90

)$" $
)!$'" "&"(
)"
)
) $
)($" ( "&
)*$!!

background image

DESIGN

SUITE

NEW:

Redesigned User Interface includes modeless

selection, modeless wiring and intuitive operation to
maximise speed and ease of use.

NEW:

Design Explorer provides easy navigation,

design inspection tools and cross-probing support to
improve quality assurance and assist with fault

¿QGLQJ

NEW:

3D Visualisation Engine provides the means to

preview boards in the context of a mechanical design
prior to physical prototyping.

NEW IN DESIGN SUITE 7:

NEW:

Simulation Advisor includes reporting on

simulation problems with links to detailed
troubleshooting information where appropriate.

NEW:

Trace capability within both MCU and

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

E-mail: info@labcenter.com

Labcenter Electronics Limited
Registered in England 4692454

Registered Address: 53-55 Main Street, Grassington, North Yorks, UK, BD23 5AA

Tel: +44 (0) 1756 753440

Fax: +44 (0) 1756 752857

TIME FOR A CHANGE ?


Wyszukiwarka

Podobne podstrony:
Elektor Electronics 2005 07 08
Elektor Electronics 2005 07 08
Elektor Electronics 2007 05
Elektor Electronics 2007 09
Elektor Electronics 2007 06
Elektor Electronics 2007 01
Elektor Electronics 2007 06
Komunikat SARP [2007 07 08]wkladka
Elektor Electronics 2007 01
nr I z 07-08.11.2006, studia, 3 rok, Mikrobiologia, pytania, testy, ROK AKADEMICKI 2006-2007, Medycy
07 08 2007 zmiany w tzw dyrektywie VAT owskiej
ankieta 07 08
ei 2005 07 08 s085 id 154185 Nieznany
fiszki 01 07 i 08
chemia lato 12 07 08 id 112433 Nieznany

więcej podobnych podstron