Thursday, April 2, 2009

Ultrasonic Distance Sensor with the Microcontroller 1


Ultrasonic Distance Sensor Implemented
with the Microcontroller Project

Linear measurement is a problem that a lot of
applications in the industrial and consumer market
segment have to contend with. Ultrasonic technology is
one of the solutions used by the industry. However, an
optimized balance between cost and features are a must
for almost all target applications. The ultrasonic distance
measurer (UDM) is used mainly when a non-contact
measurer is required. This is the type of solution this
document explains using a simple robot toy
implementation.

Description
The UDM is a demo that shows capability and performance
of the MC9RS08KA2 and the ultrasonic sensor to build a
distance measurer. Figure 2 shows the basic building block of
this project.


The firmware generates a 40 kHz burst signal. After the 10 cycle
burst is completed, a variable that measures the distance is
activated. This variable measures the time sound takes to rebound
and is used for distance calculation.

The burst signal goes to the ultrasonic transmitter (US Tx) and is
transmitted as ultrasound through the air Figure 2. When the wave
is reflected off an object, this wave is captured by the ultrasonic
receiver (US Rx.) This received signal is amplified because it
attenuates as it travels. Afterwards, the signal goes back to the
microcontroller unit (MCU), filters it and calculates the distance.
A 40 kHz interrupt is generated by the timer in the MCU. To
perform this, the keyboard interrupt (KBI) is enabled and detects
the external signal. Every time the MCU is interrupted the counter
is increased by three. And the variable used as a counter is
decreased by one for the entrances to the modulus timer module
(MTIM) interrupt service routine (ISR). When this variable is bigger
than eight the ECHO signal is activated. The distance variable is then
set to 0. Refer to Figure 3 for timing diagram. For detailed information
about the firmware see Figure 3.


More pdf


Distance Sensing Project
devices for wireless distance and position determination
usefull as gesture controllers for robotic musical instruments
Since the early seventies we did build sonar devices to control our
self made analog electronic music synthesizers. In those years,
simple to use transducers were not readily available on the
electronic component market and so, we had to make our own,
based on designs used for underwater hydrophones. (Quarz crystals,
inductive devices, self made condensor microphones etc...). Although
the focus of our research later on became doppler based sonar
and radar movement detection and gesture analysis, we always had
quite a few pulsed sonar devices at hand. The easiest and cheapest
ones to build nowadays make use of the commonly available 40kHz
transducers. Two approaches are possible: either one uses a single
transducer as an emitter for a periodic burst of sinewaves and that
then is switched to microphone mode and connected to the input of a
voltage controlled amp (preferably a logamp, compensating for the
square law decay of amplitude with distance). The time between the
start of the burst and the reception of the first echo is a linear function
of the straight distance from the tranducer to the reflective object or
body.


Wednesday, April 1, 2009

HALL EFFECT CURRENT MEASUREMENTS

The Hall sensor based current measurement can be realized
as open loop or closed loop. While in open loop, there is only
primary winding and it can be coiled as 1 turn for practical
applications such as clamp meter but to increase measurement
accuracy it should be coiled as multi turns. The Hall sensor
produces an output voltage proportional to primary current.
Generally intensity of output voltage is not adequate for
measurement and it is necessary to be amplified by an opamp.



Fig. 1. Basic connection scheme of an open loop current transformer

In closed loop, operating principle is very similar to open
loop. Output voltage of the Hall sensor is transformed to
current by means of a transistor circuit and passed from a
secondary winding. The purpose is compensating of the
magnetic flux created by primary winding. The basic
connection schemes of open loop and closed loop Hall Effect
current transformer are given in Fig. 1. and Fig2. [1].



Fig. 2. Basic connection scheme of a closed loop current transformer

The primary current to be measured creates magnetic
flux in the core. The Hall sensor produces voltage in
proportion to the magnetic flux in the core. In other words, the
primary current and output voltage of sensor is proportional.
The output voltage is amplified by means of the amplifier
circuit. Generally, an operational amplifier is preferred. The
amplified voltage is applied to a push-pull transistor circuit
and transformed to secondary current passed from the
secondary winding. In this way, a second magnetic flux is
created in the core. The secondary current is symmetric of the
primary current and its secondary winding is generally coiled
as 1000 turns. In this manner, secondary current create
secondary magnetic flux to balance primary magnetic flux.

The basic equation is;



Source pdf

Hall Effect Sensor and Artificial Neural
Networks Application in Current Transformer
http://www.naun.org/journals/circuitssystemssignal/cssp-64.pdf