Playing with LEGO at Sun - Mentoring Projects
Introduction.
Last year I was given the opportunity to be a mentee in the SunSigma Engineering Mentoring program that started in March 2003. As I've been working for Sun for 17 years, have over 29 years of professional software programming experience and am being excellently mentored in specific areas by various people as part of my ongoing software duties, I decided to try something different.
I was inspired by the Technology and Courage paper by Ivan Sutherland.
I decided I'd like to try to increase my knowledge in an area I've just started getting interested in - electronics and hardware design. I want to combine this with fun projects, that I can share at a later date with my son as he grows up.
My aims included:
- Getting a better understanding of the basics of electronics (both analog and digital).
- Being able to use tools such as a soldering iron, multi-meter and oscilloscope, to prototype, construct and test small simple circuits.
- Complete several small projects that are useful not only to me, but to others.
- To generate an online document that not only chronicles this mentoring partnership, but which would include complete details on each project, and which could act as a great resource for others, (including countless links to other online information).
My mentor was Russ Mirov, a hardware distinguished engineer and all around great guy.
As electronics and hardware project construction were new to me, my primary goal was to try to be self sufficient in constructing new simple circuits by the end of the six month mentoring period. Follow-on work would be to try to fully understand the theory behind such circuits and then to try to gain enough knowledge to construct simple electronic circuits from scratch.
A secondary goal was to construct circuits that my son would be interested in playing with. To that end, after some initial simple radio circuits, the other projects were designed to work with his LEGO which he enjoys playing with tremendously.
I ordered the various parts needed for each project online from places like Jameco Electronics. The intention was to just develop DC circuits for this mentorship.
As part of the learning process, I did some background reading. The books I used were:
|
AM Radio Circuit.
|
The aim of this first project was to learn some basic skills. I already had built a Technokits MW IC AM Radio circuit kit. This uses a MK 484 Integrated Circuit. Initially I transferred this project over to a solderless breadboard with wire jumpers that I already had. As we would be prototyping several circuits in later projects it was good to learn how to do this sooner than later. There were some useful instructions on the web to help me learn how to do this. My first attempt didn't work, so I ended up having to double check each connection, and draw the results on a piece of paper. I had just one wire (one of the two wires to the crystal earphone) attached incorrectly. I adjusted that, and the circuit starting working nicely. |
I then started working towards moving the projects onto a printed circuit board. My first thought was to take the schematic for the circuit, and use a freely available CAD application such as CADint My mentor pointed out that as this was a simple schematic, it was easier to just do it by hand. I used a special PC board kit from Radio Shack.
Once the layout was drawn on the copper board in etch resistant ink, I created the PCB, following the instructions in the kit.
There are lots of great sites on the web for more detailed instructions on how to do this process. Here's one of them.
Holes had been drilled through the board for the placement of all the components. The next step was to solder them onto the PCB. I have special computer screen reading glasses, which are designed to work with me being about 18 inches from the object in focus. This made it hard to see what I was doing as I was attempting to solder for the first time. I then tried using the microscope they had in the hardware lab in MPK28, and this made it much easier. Because of this, I ordered a desktop magnifying stand and used this in conjunction with a bright lamp to do my soldering.
All the components were soldered to the board. I bought a Radio Shack AA battery holder and used a couple terminals to connect the crystal ear-piece, so that it could easily be used with other projects if so desired. There were a few places where the copper tracing was not continuous and debugging the circuit by "ohming around" found those. The simple fix was to just solder over them. If the break was too big, then a small piece of wire was soldered in place to bridge the gap.
The radio is now working nicely.
Along the way I've been learning how to use a multimeter. Eventually I'd like to learn how to use an oscilloscope to test the functionality circuits. Hopefully these are basic tools that I will need to master for most of the projects.
The circuit for this project can possibly be extended with an amplifier and loudspeaker. There are Technokits kits available (SK-201, SK-105 and SK-603) that have this functionality, but it would be nice to try to do this using the specification of the radio and these three kits, by buying individual components.
FM Radio Circuit.
|
The aim of this project was similar to the last project. It's to try to create a simple FM radio from an existing circuit diagram and instructions. Steps here were:
|
Various mistakes were made. They are listed here along with the action that was taken to fix the problem:
- Didn't remove the copper from the bottom of the PCB.
The simplest solution in hindsight would have been to use a single sided board. The solution I used was to use the Dremel to clear away the copper on the bottom of the board where the components were to be soldered so that no short circuits occured. - Drilled holes incorrectly.
Two problems here. Rather than drill the hole directly on the copper track, I should have drilled them slightly to the side so that continuity wasn't lost and it would be easy to solder the component to the board. The other problem was that the instructions were confusing and I drilled more holes than were really needed. The fix thare was to solder small bits of wire over those holes to the copper traces on either side. - Lost continuity on the copper traces.
Several places on the copper traces were broken and had to be soldered over. For future projects, I will use larger tracks and not try to pack the components so tightly. - Broken on/off switch.
Luckily my mentor spotted this problem very quickly and just wired the connection closed (using the terminal connections on the end of the battery as a temporary on/off switch. - The wires from the variable capacitor were too long.
I initially soldered wires here that were much too long and therefore caused too much inductance. The fix was to have almost a direct connection from the "legs" on the variable capacitor to the tracks on the PCB.
The radio then working nicely.
After this project was almost finished another web site was found that had a very similar circuit but much more detailed information on how to put it all together. If I was doing this project again, these would be the instructions I would use.
Soldering practice with kits.
One thing was clear from doing the two radios and that was that I needed more practice with a soldering iron. I also needed a better soldering iron - something with a finer tip. I went to Fry's and purchased a Hakko Model N454JN-V12 plus a fine tip for it.I then ordered a couple of kits from Jameco:
|
Both of these kits were straight forward. I did all the soldering by viewing the board and components to solder through the desktop magnifying glass. It helped a lot. Here's the results of the Rocket Robet soldering, top and bottom. In both cases the soldered circuit board would not work the first time. For the metal detector, I forgot to strip the ends of the enamelled wired used for the coils, so there weren't good soldered joints there. For the Rockit Robot, I'd missed or poorly done some of the joints. My mentor went over everything, found and quickly fixed the flaws.
Simple Radio Control Circuit (for LEGO).
|
Radio control cars are getting to be very inexpensive nowadays. There are toys available such as KG Racer and Tedco Micromites that are under $20.00. My original goal with this project was to have an R/C LEGO "brick" that will work with the motors that LEGO make available, and which can be driven by a separate simple 2 channel R/C transmitter. It could then be made to work with any LEGO vehicle. |
As a first step, I took the circuit board out of the KG Racer car. My intention was to replace the two motors with connections that would drive standard LEGO motors. The problem here was that the KG Racer receiver circuit was designed to work off 3 volts. After looking at a document describing performance characteristics of the various LEGO motors, it was clear that the ones I have couldn't be driven off 3 volts.
So I photocopied and enlarged the circuit board, labeling all the components. From this my mentor was able to work out where a small cut could be made in the board such that the motors could be powered off a 9 volt battery, and the rest of the circuit would work off a 3 volt battery.
I made the changes needed, replacing the small motors that came with the kit with LEGO style leads so they can be attached to the standard LEGO motors. It worked superbly. I then put all the various parts inside a large LEGO "brick". This brick can now be used as part of a LEGO R/C vehicle.
A couple things to note here:
- The 9 volt battery is exhausted pretty quickly. An alternative might be to use the 9 volts coming from the 6 AA batteries in the Mindstorms RCX brick.
- A problem at the moments is that the R/C vehicles tend to come apart if they hit something too hard. The R/C "brick" that I created should really have been built with Technics LEGO beams on the sides so that it can be better attached to the rest of the vehicle.
A future project here might be to start from scratch and take circuit diagrams of a a simple toy car receiver and transmitter, and generate the equivalent circuit boards, using the various techniques learnt in the previous projects, making sure that they work with 9 volts. The plan would be to then put the receiver inside a specially created LEGO brick, and hopefully achieve something that is much smaller.
AC/DC battery replacement idea.
I had an idea for a simple AC to DC universal converter battery replacement project that I discussed with my mentor. This was greatly simplified by just buying a 500 mA Universal AC/DC adapter for this. It allows you to set the DC voltage to 3, 4.5, 6, 7.5, 9 and 12 volts. It's model 900-052 on this page.
Note that for appliances that require more than one battery, that the batteries are in series, so this battery replacement only needs to connect up the two ends (one negative and one positive).
The next step here is to construct some "fake" battery inserts using dowel and metal sheet. I would then need some advice on how to do the socket connections between the AC/DC adapter and the battery leads.
Proximity sensor (for use with LEGO Mindstorms).
|
Now we come onto projects to work with LEGO Mindstorms. This kit includes touch and light sensors that are rather simplistic. My aim here was to try to generate new custom made sensors that are more useful, and will provide more fun projects. |
|
The first one is a proximity sensor. This sensor has been made and attached (in as small as possible space) to half of a RadioShack dual mini board. |
Some points of note here:
- My mentor had to help me with some of the soldering here. In particular the use of a small 47 uF surface mounted capacitor instead of the relatively large one that I was originally intending to use here (including directly soldering it to the leads of the IC).
- I initially attached the Sharp IS471F optical IC the wrong way around. We had to use an oscilliscope here to debug the circuit and determine this.
- I wrote a simple NQC (Not-Quite-C) program to drive the sensor. I actually did this on my Solaris S9U3 Ultra 60, with the LEGO IR tower attached to one of the two serial ports.
- We had to support the IR-LED with a "protective covering" to stop the IC continually detecting it.
The next step was to trim the mini board to it's smallest possible size. Rather than place it inside a LEGO "brick" (which is beyond my current miniaturisation skills), the sensor was just taped to the front of the test LEGO robotic vehicle. The first choice of vehicle (the Acrobot) was unsuccessful as the vehicle moved to fast and the sensor did not have time to react quickly enough. The second choice was a Roverbot with tracks (and a gearing mechanism to slow it down). Apologies for the quality of the pictures. A slightly more sophisticated NQC (Not Quite C) program was written that would drive the robot vehicle, and when the sensor detected an object nearby, reversed one of the motors for 2 seconds.
The program looks like:
#define IS_ON 100
task
main()
{
int i;
SetSensor(SENSOR_1, SENSOR_LIGHT);
PlaySound(SOUND_UP);
OnFwd(OUT_A);
OnFwd(OUT_C);
while (true) {
SelectDisplay(DISPLAY_SENSOR_1);
if (SENSOR_1 == IS_ON) {
OnRev(OUT_C);
PlaySound(SOUND_LOW_BEEP);
Wait(200);
OnFwd(OUT_A);
OnFwd(OUT_C);
}
}
}
This was simple and effective.
Short Wave Radio Circuit.
|
I purchased a short wave radio kit from American Science Surplus. I put it together and with a final bit of help from my mentor (who noticed that there wasn't a wire going to the coil!), this radio is now working. The plan here was to buy a project box from Radio Shack, solder all the components onto a small board, and put them inside the box to try to build a nicely finished radio. More on this project to come... |
Possible future projects.
Sound locator sensor (for use with LEGO Mindstorms).
This project is a sound sensor. The intention here would be for the robot to use this sensor, and the proximity sensor from the previous project, to come when called. Circuit building tasks here would be similar to the last project. It is expected that the software needed to drive the robot to perform the desired task will be much more complex.
Simple Voice Recognition Circuit (for use with LEGO Mindstorms).
Now we come on to something that has the potential to be great fun for kids. This is to interface a simple speech recognition circuit to the LEGO Mindstorms robotic kit. Again, I'd like to take this project in two steps.
Initially I'd use an already existing Speech Recognition Kit such as the Voice Direct(TM) 364 from Sensory Inc. This would be attached to one of more LEGO bricks, and interfaced to the RCX brick. As before, an appropriate robot and the software to run it would be constructed. An interesting one to try would be something like MIBO
Next would be to try to create a simpler speech recognition circuit that would be LEGO brickable, and be able to be driven via RCX software. Sensory Inc. provide an IC Selection Guide that should be able to help us here.
Other Mindstorms projects.
Depending upon time, it might be possible to also complete some of these projects:
( Jun 16 2004, 01:10:44 PM PDT ) [Listen] Permalink






















