没有合适的资源?快使用搜索试试~ 我知道了~
首页2011年7&8月Elektor Electronics UK - 项目生成器
2011年7&8月Elektor Electronics UK - 项目生成器
需积分: 9 0 下载量 106 浏览量
更新于2024-07-23
收藏 10.1MB PDF 举报
"Elektor Electronics UK - 2011-07&08 特辑,这是一期专门关注微控制器、嵌入式、模拟技术、音频、数字技术和测试测量的专业电子杂志。包含了70多页的小型电子产品设计指南,售价为AUS$20.70、NZ$27.50、SAR134.50、NOK140以及£7.20。"
在这期特辑中,Elektor杂志呈现了其年度项目生成器,这是一个集合了电路设计、创新想法和技巧的70多页的综合指南。项目生成器在过去曾被称为“夏季电路”,并在去年更名为“ProjectGenerator”。自1976年以来,这个独特的格式一直是Elektor杂志的特色,没有任何竞争对手尝试复制这一模式。
这期特辑与众不同,不仅跨越了两个月(7月和8月),而且篇幅更长,达到了120页,而不是通常的88页。内容上,它包含了大量正在开发中的项目,而不仅仅是已完成并可供复制的成品。这使得读者有机会深入了解到项目从构思到实施的过程。
自1976年以来,Elektor的7月/8月特辑已经积累了数千个项目,这对于那些对电子技术充满热情的人来说,无疑是一个宝库。无论是对于想要探索微控制器和嵌入式系统的新手,还是寻求模拟电路和音频解决方案的专家,或者是热衷于数字技术或测试测量工具的工程师,这期杂志都提供了丰富的学习和实践素材。
在"ProjectGenerator"中,读者可以发现各种设计提示、电路原理和实用建议,这些内容可能来自于实际项目的实践经验,也可能包含了一些趣闻轶事,增加了阅读的乐趣。通过这个平台,读者不仅可以获取专业知识,还能了解到行业内的最新动态和创新趋势。
"Elektor Electronics UK - 2011-07&08"是电子爱好者和专业人士不可多得的知识源泉,它提供了一个互动的环境,鼓励读者参与到项目的设计和实现中,激发创新思维,并推动个人技能的提升。这期特辑不仅展示了电子领域的广泛性,也体现了Elektor杂志在提供实用、深入且有趣内容方面的专业性。
16 7/8-2011 elektor
Getting Started
with your Free
LPCXpresso Board
By Clemens Valens (France)
If you are among the authors having made
it into this edition of Elektor with one or
more articles, besides a trivial amount of old
fashioned money you have been (or will be)
rewarded with a small but rather powerful
gift kindly offered to you
by NXP.
So what exactly is this gift and
what can you do with it?
LPCXpresso — a joint development by NXP
(they came up with it) [1], Embedded Artists
(hardware) [2] and Code Red Technologies
(software) [3] — is a cheap prototyping
platform for the new ARM Cortex-M0 and -M3
microcontrollers from NXP. Although quite
tiny, these are pretty powerful ICs containing
32-bit processors with flash memory and
RAM besides many useful peripherals. The
controller is mounted on one half of a blue,
long and slim PCB together with a crystal
and an LED, with space available for (mbed
compatible!) extension connectors and
even a modest prototyping area. The other
half of the board, actually a little less, is a
programmer/debugger pod that connects to
the PC through a mini USB connector. The pod
can be separated from the controller once
your application is ready by cutting the PCB
in two (which is far from easy — been there,
done that!).
Several models of these PCBs exist that
differ only in respect of the microcontroller
mounted. Elektor are handing out boards
that have an LPC1114 Cortex-M0 device with
32 KB flash memory, 8 KB RAM, UART, SPI, I²C,
ADC & timers. Note that the UART is RS-485
capable which makes this board very useful
for ElektorBus applications.
However, LPCXpresso is more than just a slim
blue PCB, because it includes free software
followed by Next. Now tick
the examples that
you want to import (I
suggest to tick ‘em all)
and click Finish.
If you did not untick
it, you will now
have a project called
LPCXpresso1114_blinky.
This is the easiest one to try
out and to see if everything
works fine. If you select
it, you can build it from the
‘Start here’ menu. You can also build all the
projects with one single click, but that takes
a bit more time. Build the project and observe
the messages that scroll through the Console
window; there should not be any errors or
warnings. If for some reason you do have
an error or a warning, click on the Problems
tab to get more information. Double clicking
a line in this window will take you to the
offending code.
After a successful build you can run the
program on your LPCXpresso board.
Connect the board to the PC and click Debug
‘LPCXpresso1114_blinky’. Note that for this
to work you should have installed the LPC-
Link drivers first (located in the Drivers\LPC-
Link\ subfolder of the LPCXpresso installation
folder). The IDE will now start the LPC-Link
driver, load the executable to the board and
jump to the first statement of ‘main’. The
C-source file containing this statement is
automatically opened in the IDE.
Click the Resume button (the little green
triangle or press F8 or from the Run menu)
to allow the program to run. The little red
development
tools for Linux and
Windows (‘include’ is not really
the right term to use since you have to
download it all yourself from the Internet).
The software tools come as a nicely packaged
Eclipse-based integrated development
environment with its powerful editor and
the GCC compiler, linker and debugger
suite for ARM. Simply run the downloaded
executable to install the tools. This will also
install many code examples that you can try
out. You will have to create an account before
downloading, as well as register the software
after installation, but once you’ve entered the
serial numbers you received by email, you are
ready to go. The registration process survives
upgrades so you only have to go through it
once.
The LPCXpresso takes a while to start, but
when it is finally ready it offers a quick access
menu named ‘Start here’ containing the
most important functions (and some more)
that you will use often like new project, build
& debug. Here you will also find an option to
import example projects. Click this link to
open the Import dialogue, then click Browse…
and navigate to the LPCXpresso1114.zip
archive in the folder examples/NXP/LPC1000/
LPX11xx. Select the zip file and click Open
17elektor 7/8-2011
LED close to the processor will start blinking
at a rate of 1 Hz. If you get this far without
problems — and honestly I don’t see why you
shouldn’t — then you are up and running. You
can now start writing your own applications!
If you come up with an interesting project,
please do not hesitate to send it to us, we will
be happy to evaluate and publish it in Elektor.
(And maybe you will get another LPCXpresso,
etc. etc., which reminds me that I didn’t get a
board even though I wrote this article…)
For those of you not having made it to the
free LPCXpresso board, you can buy one from
most major component suppliers or directly
from [2].
(110448)
Internet Links
[1] http://ics.nxp.com/lpcxpresso/
[2] www.embeddedartists.com/products/
lpcxpresso/
[3] http://lpcxpresso.code-red-tech.com/
LPCXpresso/Home
[4] http://elektorembedded.blogspot.com
Upgrade your USB Hub
By Kurt Bohnen (Germany)
Problems can arise with USB hubs that are
powered from a PC when gadgets plugged
into them draw too much current. This is
often the case with devices fitted with USB
cables that are too long or too thin, causing
voltage drop.
There’s no need to scrap your old USB hub,
however, if you upgrade it using this little cir-
cuit and an external power supply. Just cut
the 5-V power wire of the USB cable inside
the hub and solder a diode (D1) in the pass-
through direction. Now connect the 5 V wire
from the external power supply to the cath-
ode of this diode. D1 prevents any current
from the power supply from flowing back
into the PC.
(100474)
K1
2
1
3
5V 2A
D1
1N5400
+5V
USB
+5V
HUB
GND
USB
GND
HUB
100474 - 11
OBD Vehicle Protection
By Florian Schäffer (Germany)
Vehicle immobilisers are fitted as standard to
modern cars and heavy goods vehicles. Anti-
theft mechanisms have become more sophis-
ticated but so have the methods employed by
crooks. Nowadays once the thief has gained
access to a vehicle they will most likely use an
electronic deactivation tool which seeks to
disable the immobiliser, once this has been
accomplished a blank transponder key/card
can be used to start the engine. In many cases
communication with the immobiliser is made
using the OBD-II diagnostic connector.
Although the OBD-II protocol itself does not
support the immobiliser, the vehicle manu-
facturer is free to use the interface as neces-
sary for communication, either the standard
OBD-II signals or unused pins in the OBD-II
connector (i.e. those undefined in the OBD-
II standard). Using one of these pathways
car-thieves call, armed with the latest OBD-II
hacking equipment this simple low-cost low-
tech solution may be all that you need. The
idea is very simple: if all connections to the
OBD-II connector are disconnected there is
no possibility for any equipment, no matter
how sophisticated to gain access via the vehi-
cle’s wiring.
The OBD-II connector is usually located
underneath the dashboard on the passenger
side; once its wiring loom has been identified
a switch can be inserted in line with the wires.
The switch should be hidden away some-
where that is not obvious. In normal opera-
tion you will be protected if the vehicle is run
with the wires to the socket disconnected.
Make sure however that you throw the switch
reconnecting the socket before you next take
the vehicle along to a garage for servicing or
fault diagnosis.
the immobiliser can usually be electronically
disabled.
This may be unsettling news for owners of
expensive vehicles but when professional
OBD
12
11
10
16
15
14
13
3
2
19
8
7
6
5
4
S1
110287 - 11
ISO-K ISO-L
CAN-H CAN-L
J1850+ J1850-
GND
GND
VCC
ISO-K
ISO-L
18 7/8-2011 elektor
The diagram shows the ISO K and ISO L wires
switched. To cover all bases it is wise for every
wire to the socket is made switchable except
the two earth connections on pins 4 and 5 and
the supply voltage on pin 16.
Almost every vehicle manufacturer has their
own method of vehicle immobilisation, by dis-
something like ‘protocol unrecognised’ when
any communication with the OBD port is
attempted.
(110287)
connecting every wire it ensures that no com-
munication is possible (even over the CAN
bus). Now the innermost workings of your
vehicle will be safe from prying eyes.
When a hacker plugs in a deactivation tool it
will power up as normal but probably report
2/4/6-hour Timer
By Philippe Schmied
(Switzerland)
Here’s an easy-to-build circuit
to drive a solid-state relay for
a period that can be selected
as two, four, or six hours. This
device forms part of a project by
the author to control a heating
system remotely by telephone
(for a holiday home). The aim of
the circuit is to avoid the risk of
the heating’s running for more
than a certain time if, in the event
of a problem, there is no-one
to stop it or put it into frost
protection position.
A pulse of one second or longer
on pin 6 of the microcontroller sets off the
timer and the output is energized. Once the
chosen time has elapsed, the microcontroller
deactivates the output.
The duration is selected via the DIP switches
connected to ports GP2 and GP3:
When choosing a relay to use
with this circuit, remember
the maximum current the
microcontroller output can
source is 25 mA. Preferably
choose a solid-state relay —
you’ll find several examples in
this issue.
The software has been written
in E-Blocks Flowcode and the
project is available from [1]. For
those who don’t have Flowcode,
the project also includes a file in
C and in assembler language,
as well as a HEX file. The pre-
programmed microcontroller
(PIC12F675 in 8-pin DIL package)
is available from the Elektor online store as
part number 110219-41 [1].
(110219)
Internet Link
[1] www.elektor.com/110219
GP2 GP3 Duration
000 hr
012 hr
104 hr
116 hr
GP2/T0CKI/INT/AN2
GP1/AN1/VREF
PIC12F675
GP5/OSC1
GP3/MCLR
GP4/OSC2
GP0/AN0
IC1
VDD
VSS
7
1
28
4
5
6
3
X1
4MHz
C1
15p
C2
15p
K1
1
R1
4k7
R4
4k7
S1
ON
4
12
3
12
R5
4k7
K2
1
R3
330R
R2
330R
V
CC
CONTROL
RELAY
110219 - 11
ATM18 and Three 1-Wire Thermometers
By Grégory Ester (France)
In this circuit, the Elektor ATM18 [1] is in
charge of communications and represents
the master unit, while the DS18S20 sensors
are the slave units. The DS18S20s respond to
the orders from the master by sending back to
it the temperature they are measuring.
Our circuit makes it possible to measure tem-
(‘parasite power’ mode, up to a few mA) by
exploiting the numerous moments when the
bus is at logic high. Given that most of them
consume less than 100 μA, we just need to
keep an eye on the total number of devices
present on this bus. However, it’s still possi-
ble to power certain Dallas devices locally by
feeding a constant voltage of 3–5.5 V.
Each 1-Wire component has a unique 64-bit
peratures from −55 °C to +125 °C (–67 °F to
257 °F) with 9-bit resolution and an accuracy
of ±0.5 °C from −10 °C to +85 °C (14 °F to 185
°F). However, the resolution can be improved
by using a calculation discussed later, and
which is implemented in the firmware writ-
ten in BASCOM-AVR [2].
The sensors draw their power from the bus
19elektor 7/8-2011
DS18S20
VDD
VDD
GND
DQ
DQ
1
2
3
DS18S20
VDD
GND
GND
DQ
1
2
3
DS18S20
VDD
GND
DQ
1
2
3
R1
4k7
ATM18
+5V
PD5
110398 - 11
PD1
GND
RXGND
HYPERTERMINAL
DS1820
key to identify it. The eight LSBs of this key
contain the family identifier. The code 10h
corresponds to the DS18S20 family of sen-
sors, making it possible to distinguish
between 1-wire sensor types from different
families that may exist on the same bus.
The DS18S20 has an internal memory
(scratchpad) containing the data that are
going to help you calculate the temperature
measured.
Initially, the program calculates the number
of sensors present on the bus and stores in a
memory table the unique identifiers that are
sent from MSB to LSB to the hyperterminal.
The commands CCh + 44h are then executed,
ordering all the sensors to perform the tem-
perature conversion; in this way the scratch-
pads are automatically updated with the new
values, a total of nine bytes per scratchpad.
You now call up each sensor individually by
using its unique identifier followed by the
command BEh. In this way, each time you
can store in a table the contents of the nine
scratchpad bytes of the sensor concerned.
The temperature may be negative, and this
is where two’s complement comes in, to
express the result in the sensor memory. The
ninth bit corresponds to the tenths. A tem-
perature with higher than 9-bit resolution
can be calculated by using the ‘count remain’
and ‘count per C’ data, bytes 6 and 7 of the
scratchpad. The ‘count per C’ value is fac-
tory set to 16 (10h). The value ‘temp read’ is
obtained by truncating the 0.5 °C bit (bit 0 of
the LSB). The temperature in degrees Celsius
can then be calculated accurately using the
equation:
T = temp read − 0.25 + (‘count per C’ − ‘count
remain’) / ‘count per C’
This is the value that is calculated and sent
to the hyperterminal for each of the three
sensors.
(110398)
Internet Links
[1] www.elektor.com/071035
[2] www.elektor.com/110398
Morse Clock
By Ralf Beesner (Germany)
Now this is what we call style: the clock cir-
cuit described here doesn’t just announce the
time in Morse code, but the whole user inter-
face is in Morse! The design even includes an
alarm function.
When designing this circuit it became appar-
ent that it would not be essential to use a
32 kHz watch crystal in conjunction with
the special low-power mode of an ATmega
microcontroller. The current consumption
of an ATtiny45 in idle mode, running from a
standard 3.6864 MHz crystal, can be kept low
enough to allow acceptable operation from a
battery. In normal operation the consumption
is about 0.2 mA, which corresponds to about
1.8 Ah per year.
The crystal must be connected to inputs PB3
and PB4 of the ATtiny45 microcontroller.
The buzzer is connected to PB0, leaving PB1
and PB2 available for the dash and dot con-
a couple of hundred Hertz too high. This is
deliberate: it means that the clock normally
runs a little fast, and this is corrected in soft-
ware by the addition of a small delay to cali-
brate its overall timekeeping.
The circuit should rarely need resetting. A
reset button was included in the author’s
prototype, but in the circuit diagram and sug-
tacts. Besides the microcontroller, crystal,
buzzer and the two buttons the only com-
ponents required are a decoupling capacitor
across the power supply and a volume con-
trol potentiometer. The quartz crystal is used
without the load capacitors recommended in
the datasheet (12 pF to 22 pF). It nevertheless
oscillates reliably, but at a frequency perhaps
ATTINY45
RESET
IC1
PB1 PB0
PB2
PB3
PB4
8
4
7
12
3
65
X1
3.6864MHz
P1
10k
BZ1
S2
S1
RA
RB
+3V
C2
220n
110170 - 11
20 7/8-2011 elektor
gested printed circuit board layout [1] just a
couple of pads are provided.
The supply voltage is 3 V, provided by two
AA cells. The printed circuit board is dimen-
sioned so that it can be attached to the back
of a dual AA battery holder using two screws.
The clock is entirely controlled by commands
in Morse. When the batteries are first fitted,
it announces the time as 0000. The quarter-
hourly chime (referred to as ‘gong’ below) is
enabled.
The following commands, each consisting of
a single character, are available:
? List commands
Z Set time
T Announce time
G Gong (chime function) on/off
C Check: announce gong status, alarm sta-
tus and so on
M Set Morse speed
W Set wake time
A Alarm on/off
E Alarm stop (a single press of the ‘dot’
button)
K Set calibration delay (1 s to 9 s) (slows
clock down)
The commands that set a time expect a four-
digit number, entered without spacing or
triggered once per second by the timer. The
routine counts the seconds and maintains
the time of day, expressed in minutes since
midnight. When a complete day has elapsed
(1440 minutes) the time is reset to zero in the
main code.
The main code simply performs the time cal-
culation and checks the button status before
returning to idle mode to wait for the next
interrupt. To ensure that the clock responds
immediately when a button is pressed, PB1
and PB2 are configured to generate ‘pin
change interrupts’.
Unfortunately we cannot take advantage of
the microcontroller’s power-down mode,
where almost all of its functional blocks are
switched off with a single register setting, as
we need to keep the crystal running. How-
ever, we can use idle mode, where most of
the functional blocks still draw some current:
we need to switch them off individually. The
author has used registers PRR and DIDR0 for
this purpose; there may be further options
available for saving even more power.
(110170)
[1] www.elektor.com/110170
punctuation. The on/off commands expect
a zero or a one, and the Morse speed com-
mand expects a two-digit number. As soon
as a sequence of digits has been entered, the
clock repeats them back for confirmation. If a
non-digit character is entered, the clock will
reply with ‘RPT’ (for ‘repeat’). If too few dig-
its are entered, then after a short delay the
clock will again reply ‘RPT’. In both cases the
clock returns to idle mode, and so the com-
mand letter must be repeated before enter-
ing the digits again.
The Morse speed setting routine will check
whether the requested speed lies in a reason-
able range (between 10 wpm and 30 wpm). If
this is not the case, the clock will reply ‘RPT’
and set the speed to 20 wpm, ensuring that it
still remains usable.
In the current version of the software the
checking of time values is incomplete. The
clock will accept times such as ‘1299’: it is up
to the user to check that the value is reason-
able when it is repeated back in confirmation.
The clock will, however, reject times greater
than ‘2359’ with the ‘RPT’ message.
As always the source code for the software
is available for free download from the Elek-
tor website [1]. The most important subrou-
tine is the interrupt service routine, which is
Pump Controller with Liquid Level Detection
By Guntram Liebsch (Germany)
The circuit described here lets you control a
cellar drainage pump so that it turns on when
a preset liquid level is reached and turns off
again when a different preset level is reached.
The author investigated several approaches
to the problem. Commercially available
pumps equipped with float switches are not
suitable as they are sometimes so power-
ful that there is a danger that their suction
can start to cause movement in the ground
beneath the building.
A more reliable approach is used here. A sim-
ple circuit determines the level of water using
a pair of suitably-spaced electrodes and then
pumps out a preset quantity of water. The
author has used this circuit over a period of
ten years in a sump (a pit dug in the cellar) to
detect the presence of any groundwater less
The circuit has been kept very simple, in the
interests of giving good reliability. Gates
IC2.A and IC2.B form a bistable flip-flop
whose state is flipped by the two electrodes:
and this is all done using a single, low-cost,
CMOS IC. Power switching is done by a relay,
which can equally well be used with either
12 V or conventional 230 V / 115 V pumps.
The author uses both types: a 12 V marine
pump as the primary pump and, as a backup
in case of failure, a conventional pump. The
latter is only activated when the water level
reaches a higher threshold, which does not
occur unless the primary pump has failed.
The 12 V system is powered from a car bat-
tery (12 V, 70 Ah) which is trickle-charged.
Two relays are shown in the circuit diagram,
corresponding to two positions for relays on
the printed circuit board with different pin
than a set level below the cellar floor.
The circuit can be used in two situations.
1. It can be installed in a sump to keep the
groundwater level more than a set distance
below the cellar floor. In this case a pumping
cycle can be designed to reduce the level by
say an inch (perhaps a gallon). Because of the
small change in level there is no risk of causing
movement of the ground below the building.
2. When the heating or the boiler in the cel-
lar must be emptied, for example to replace
the sacrificial anode, the water can be drained
into a tank and pumped from there to the gar-
den: using this pump control circuit means
that the process does not have to be closely
monitored.
剩余119页未读,继续阅读
2015-09-22 上传
2010-03-28 上传
2022-09-14 上传
2022-09-21 上传
2021-05-20 上传
KingQueenWong
- 粉丝: 1
- 资源: 16
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 高清艺术文字图标资源,PNG和ICO格式免费下载
- mui框架HTML5应用界面组件使用示例教程
- Vue.js开发利器:chrome-vue-devtools插件解析
- 掌握ElectronBrowserJS:打造跨平台电子应用
- 前端导师教程:构建与部署社交证明页面
- Java多线程与线程安全在断点续传中的实现
- 免Root一键卸载安卓预装应用教程
- 易语言实现高级表格滚动条完美控制技巧
- 超声波测距尺的源码实现
- 数据可视化与交互:构建易用的数据界面
- 实现Discourse外聘回复自动标记的简易插件
- 链表的头插法与尾插法实现及长度计算
- Playwright与Typescript及Mocha集成:自动化UI测试实践指南
- 128x128像素线性工具图标下载集合
- 易语言安装包程序增强版:智能导入与重复库过滤
- 利用AJAX与Spotify API在Google地图中探索世界音乐排行榜
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功