Before we start: How solder joints should look.
These were done by someone (Julie, my wife) who practiced soldering for about 20 minutes. They are not perfect but they work. Your solder joints need to have a smooth shiny appearance. If they are dull grey or rough, they might not work. You can reflow the joint by heating it again and applying a little more solder.
You need ENOUGH solder but not big massive blobs.
We’re using “dead bug” style construction. We turn the PIC upside down so its legs stick up in the air like a dead bug.
Basic project consists of these parts.
PIC 10LF322 is an 8-bit microcontroller made by Microchip.
The piezo speaker bends when voltage is applied to it, bend it fast enough and it makes a sound.
Resistors are devices that limit current.
A photoresistor is a special resistor that can detect light and varies its resistance.
Each resistor has a color code to tell you what its value is in ohms. For the cricket we need two, 1K = 1000 ohms and 22K = 22,000 ohms.
There is a program preloaded into the PIC microcontroller that makes everything work.
Using “dead bug” construction will make this project cheap and quick to build. The downside is, it’s easy to break pins off the PIC and hard to reuse parts.
To reduce the chances of messing up, we will build parts first into 2 subassemblies, then attach those subassemblies to the PIC.
The first subassembly is the speaker.
We have to attach a wire to one lead of the speaker and the 1K (RED-BLACK-BROWN-GOLD) resistor to the other lead.
It’s easiest to solder the resistor to the speaker and then the wire to the speaker as two steps.
Step 1, resistor.
Step 2, wire lead.
The second subassembly is the light sensor.
Together, the photoresistor and the 22K resistor form a circuit known as a “voltage divider”.
When we’re done, the photoresistor goes to the + side of the battery and the resistor to the – side.
The wire lead goes to the input on the PIC controller. Put the three parts together (wire + 2 resistors) then solder.
Next The sensor gets attached to the battery. DON’T SOLDER YET. There are more wires to add.
Add a wire to each terminal on the battery holder. Use a light color (I used yellow) for “+” and a dark (purple) for “-“.
The battery holder has a little “-” in a circle near the “-” terminal. If you get the wires backwards, nothing will work.
If they don’t fit through the hole attach them near the terminals on the resistor leads.
Now solder everything. Solder should flow over the whole joint, you need more here than anywhere else in the project.
The PIC controller has eight pins. Pin 1 is marked by a little dimple.
From the top…
As a dead bug… upside down
You HAVE to keep track of pin 1 once you turn things upside down else NOTHING WILL WORK!!!
The way I did this was by putting a DOT on the can with a marker,
then gluing the PIC down so that PIN 1 is NEAR the DOT.
Use hot melt glue, and do this QUICKLY — the cold metal can will cause the glue to glob up and harden fast.
If that happens just peel off the glue and try again. You DON’T want the PIC to fall off in the next step, so use a good size blob.
Now attach the leads for the speaker assembly to the PIC.
6 3 ———– speaker
5 4 ———– 1k resistor
After soldering, carefully bend leads to position the speaker inside the lid. It has to be far enough inside so the lid can still close.
Then glue the speaker down. This will just help keep everything together so it won’t get broken as easily.
Don’t short out the metal connections to the can.
Mount the battery in the can.
Some of these cans have paint on them but to be on the safe side, put a piece of tape down to insulate the battery terminals from the metal.
Then glue the battery to the tape. Pin 2 on the PIC gets the “-” wire and pin 7 gets “+” so position the battery / sensor assembly to make it
convenient to hook the wires up.
After the glue has set, carefully bend each wire around and attach them to the PIC. Solder.
Again that’s PIN 7 = YELLOW (“+”)
and PIN 2 = PURPLE (“-“)
Normally RED = “+” and BLACK = “-” but I did not have red and black. The electrons only care if the wires are hooked up correctly.
All the wiring is now done.
Pop in a button battery with the “+” side UP (visible when in the holder).
The cricket should start chirping immediately. If not it might be too bright. It wants to be in dark places.
To be less annoying (and to make the battery last longer) if the
lighting is not changing then the cricket will stop in a few
minutes. Waving a light at it or shading the sensor (any significant
change in lighting) will wake it up.