Академический Документы
Профессиональный Документы
Культура Документы
The invisible instrument is a relatively simply device, used to trigger up to four sounds at
a time on a PC. It uses a PIC microcontroller to create a USB/generic HID device to
control some bespoke software that is used to play the sounds.
By replacing one of the resistors with a light dependent resistor (LDR) so that the ratio
between the resistors changes depending on light conditions, we can generate a varying
voltage which is related to the amount of light being received.
This set-up works well, even in moderate light conditions, but there are some caveats:
The value being read onto the input pin can “drift” causing the value to change by one or
two over time, even when the light level is constant (this is a limitation of the analogue-
to-digital convertor on the microcontroller).
To make our device stable and to avoid “false triggers” we use a threshold value to
determine whether a change has occurred. Only when the light level changes (causing
the voltage on the input pin to change) by a certain amount (let’s say 0.1V) do we take
the reading as an accurate value.
In bright light, the LDR resistance is low When a shadow is introduced, the
and so the output voltage is high resistance in the LDR increases so the
output voltage drops
By how much the voltage drops depends on the type or rating of the LDR.
Remember that it is not the actual value that is important, but the ratio between the
two resistances that varies the voltage. So an LDR that is rated at 200K in darkness and
100ohms in bright light may sound ideal, because it has a wide range of values, but it
won’t necessarily work if the resistor at the bottom isn’t matched to it.
Instructions and Assembly Guide
Also remember that although different LDRs (light dependent resistors) can have
different minimum and maximum values, it is the range somewhere in the middle that
we’ll be working with – in ambient light, sometimes with and sometimes without a
shadow. You will need to change the value of the bottom resistor depending on the
sensitivity of your LDR and the light conditions you’re working in.
So now we need to have one resistance for bright working conditions, and one for darker
– since it’s effectively the difference in ambient light that we’ll be detecting.
The easiest way to introduce variable resistance is by using a potentiometer.
If we replace the bottom (fixed) resistor with a potentiometer (variable voltage) we can
“tune” the device to work in whatever light conditions we find ourselves in!
A potentiometer allows us to change the value of the bottom resistor to match the
lighting conditions we’re working in
For this project we’re using a PIC 18F2455 because we’re already familiar with it’s
functionality and it has built-in USB support so no extra hardware will be required to
communicate with the PC.
Instructions and Assembly Guide
The schematic below shows how the LDRs and potentiometers can be arranged, using a
PIC18F2455 as the microcontroller. This particular controller has analogue-to-digital pins
on PORTA (pins RA0, RA1, RA2, RA3)
Also included on this diagram are some LEDs which can be turned on and off to display
the current “state” of the device (i.e. which inputs have recognised a drop in light
source, representing the presence of a shadow)
These LEDs are not included in the BuildBrighton kit as they are optional (the device
works without them) but can be added easily at a later date. As you can see, there are
many free pins on the microcontroller – these can be used for additional functions in
future developments.
Instructions and Assembly Guide
Below is a diagram showing the PCB (as shown from the bottom, left) and the component
layout (from above, right). You should be able to use these as a guide for assembling your
Invisible Instrument Kit. The microcontroller should be supplied ready-programmed and
although it can be soldered directly to the board, it is common practice to use a DIP chip-
socket. Solder the chip socket to the PCB, then push the microcontroller into the socket.
This allows the microcontroller to be removed and re-programmed for future
development.
Note that most microchips have a small circle in the top left-hand corner, indicating
pin1. Most “DIP style” chips (long thin ones with spider-legs) also have a small semi-circle
moulded into the casing. This indicates the “top” of the chip.
Instructions and Assembly Guide
After assembling the PCB and testing that the device shows up as a USB device on your
PC, the last thing to do is to remove any “cross talk” between the sensors.
Because each LDR responds to the total amount of light it receives rather than the
direction of the light, we need to introduce a way of “funnelling” the light onto the
sensor. A simple way to do this is to use a darkened tube over each LDR.
When using a darkened tube, each LDR can only “see” a small section of the ambient
light around it. We can trigger “hits” on the device by casting a shadow over the opening
of each of these tubes. A video of this working simple prototype can be seen on YouTube
http://www.youtube.com/watch?v=HMBmudFf_H0