The original project description described the target object as follows:
As discussed in class today (Wed., Feb. 27), I will allow groups to choose from one of the four following target objects:
Some characteristics of these target objects that you may wish to consider when selecting your target are:
The IR LED is highly directional and will be aimed at the ceiling. (The box claims that the viewing angle to half intensity is 45°, although my informal testing seemed to indicate it might be narrower.) This may be a disadvantage in that your robot may fail to sense the object from the side as it searches for it. Alternately, this may be an advantage because the orientation of the sensor to the target should be well known when (if) the target is found.
The range at which the robot can sense the IR LED using either the small "light sensors" or the IR proximity sensor is relatively short. This is probably a disadvantage.
The mini lamp is less directional than the IR LED but is still somewhat directional.
The range at which the robot can sense the mini lamp using the small light sensors is greater than the range at which the robot can sense the IR LED.
The halogen flashlight lamp puts out its brightest light in most of the 360° arc parallel to the ground plane (when the target is in an upright position) as well as through the top of the bulb. However, because of the odd shape of the bulb, there is a region between these two in which the light is much less intense.
The halogen flashlight lamp is much brighter than the mini lamp and can be sensed by the robot using the small light sensors from a much greater distance.
This target requires two batteries to power and is, therefore, much heavier than the previous two.
The krypton flashlight lamp is the least directional of the target light sources and produces relatively uniform light above the base.
The krypton flashlight lamp is notably brighter than the halogen flashlight lamp and can be sensed by the robot using the small light sensors from a greater distance.
This target requires four batteries to power and is, therefore, by far the heaviest of the targets.
If you would like to build your own targets for your robot and code development, here are the specifications for what I used for the official targets. (All catalog numbers are for RadioShack parts.)
High-output infrared LED (Cat. No. 276-143c).
AA battery holder (Cat. No. 270-401A).
Rectifier diode (Cat. No. 276-1653).
To battery holder positive lead, I soldered a rectifier diode (to help protect the LED). I have a package of 25 so I'd be happy to give a diode to any group that wants one. The positive lead was connected to the non-band end of the diode.
To band-end of the rectifier diode, I soldered the short lead to the IR LED. (The long lead is attached to the flat side of the LED.)
To the long lead of the LED, I soldered the negative battery holder lead.
Mini lamp (Cat. No. 272-1139A).
AA battery holder (Cat. No. 270-401A).
I soldered the battery holder leads to the lamp leads. (One to one, of course.)
Halogen flashlight lamp (Cat. No. 272-1190).
2 x AA battery holder (Cat. No. 270-401A).
Bayonet lamp base (Cat. No. 272-359).
It would have been easier to get a single holder for two AA batteries but the RadioShack on Main St. was out of them, so I connected two of the single AA battery holders together (connecting the negative from one to the positive of the other, other course).
Note: If you find a holder for two AA batteries, I would recommend also buying a nine-volt-battery-style connector (which will also nicely connect to the battery holder for two AA batteries) and soldering its leads to your lamp base (see below), rather than trying to solder wires to the connectors on the battery holder. This is because it is too easy to melt the plastic on the battery holder if you try to solder to its connectors. (Also note, however, that the RadioShack on Main St. is currently out of these as well.)
I connected the free leads from the battery holders to the connectors on the lamp base. (One to one, of course.)
Because the flashlight lamp is not intended to be used in a bayonet-style lamp base (and vice versa), I simply pinched in the open end of the lamp base a bit with a pair of pliers. This seems to hold the bulb in place well. You could, of course, solder the leads straight to the bulb but if the bulb gets broken or burns out, you need to re-solder things.
Krypton flashlight lamp (Cat. No. 272-1162).
Four AA battery holder (Cat. No. 270-383).
Bayonet lamp base (Cat. No. 272-359).
I soldered wires from the battery holder connectors to the connectors on the lamp base. (One to one, of course.)
Note: I would recommend buying a nine-volt-battery-style connector (which will also nicely connect to the battery holder for four AA batteries) and soldering its leads to your lamp base (see below), rather than trying to solder wires to the connectors on the battery holder. This is because it is too easy to melt the plastic on the battery holder if you try to solder to its connectors. (I would have bought one of these as well, except that the RadioShack on Main St. is currently out of them.)
Because the flashlight lamp is not intended to be used in a bayonet-style lamp base (and vice versa), I simply pinched in the open end of the lamp base a bit with a pair of pliers. This seems to hold the bulb in place well. You could, of course, solder the leads straight to the bulb but if the bulb gets broken or burns out, you need to re-solder things.
As noted above, the RadioShack on Main St. is out of some of the components recommended. They are trying to get their shelves restocked but are under staffed due to illnesses. I haven't tried any other stores in the area.
If you would like to make minor modifications to a target design to make it easier to pick up (such as adding a plate by which it could be lifted or metal to which a magnet could cling), you may do so and create your own target object for use in the official (graded) testing of the robot. You could also choose to use other color and/or blinking bulbs in your target object. You must get approval for any alternate target object before it may be used. Also, if you choose to create your own target object, I recommend soldering all connections, to make sure that they remain solid throughout each test.
Here is the code I was running today in class. It is a modification of the light testing code found in the test directory from your IC installation:
void main() { while (1) { float freq, duration; int startsens= filtered_light(6); printf("start= %d\n", startsens); freq = 20000.0 / (float) startsens; duration = 50.0 / freq; tone(freq, duration); } } int filtered_light(int channel) { int ret= analog(channel)+ analog(channel)+ analog(channel)+ analog(channel)+ analog(channel)+ analog(channel)+ analog(channel)+ analog(channel)+ analog(channel)+ analog(channel); return ret/10; }