Oricom Technologies
www.oricomtech.com

Return to:
AppNotes page.
Tips + Hints

Index:
|> Getting things to work
|> Piezos and modified servos
|> Getting a good solder joint

This page has a few practical hints about designing and building hardware-software systems, plus some general this-and-that.


<| Getting things to work

Getting anything to work - especially hardware-software systems - is always a challenge, and seems to be governed by Murphy's Laws as much as anything. However, a useful guideline is to take things one step at a time, and not try to do too many things at the same time. If you design+build the hardware, write a large software routine to operate it, and integrate the routine into a large program, all in one step without taking intermediary steps ... it will never work the first time, and you might spend days trying to figure out where the problem is - ie, bad design, hardware doesn't work, software has bugs, software doesn't control hardware correctly, hardware timing issues, software timing issues, on and on. Murphy knows. One step at a time.

ITEM 1 - General approach (to just about anything):
1. first, get it to work.
2. then, get it to work correctly.
3. then, get it to work efficiently.
4. then, get it to work cheaply (if a commercial item).
ITEM 2 - Hardware-software integration:
1. first, get the hardware tested and working on its own, using a scope or meter.
2. then, write a simple software routine, separate from the main program, to exercise the new hardware.
3. then, integrate the hardware and its software driver into the main program.
ITEM 3 - Software in general:
1. write software as small modules, get the modules to work separately, and then integrate into the larger program.
2. Test, test, and re-test, after every change. If you do too many things in a row without testing along the way, it takes a lot longer to track down all the flaws.
3. Follow ITEM 1 above.
ITEM 4 - Giving a seminar (what they told us to do):
1. first, tell them what you're going to tell them.
2. then, tell it to them.
3. then, tell them what you told them.
In other words, preview, present, then summarize.


<| Piezos and modified servos

Just a strange thing we found when operating a piezo beeper (external-drive kind) from a microcontroller that was also controlling servos modified for continuous operation. What we found was that beeping the piezo caused the servos to move for the duration of the beeps. The servos were powered, but no control pulses were being sent to them by the controller.

To a first-order approximation, piezos act like capacitors with capacitance in the 1-2 nF range. When driving the piezo straight from the microcontroller pin (PIC 16F876), the piezo will put spikes onto the ground buss, and these will be picked up by the servos and they will move. Apparently, what is happening is that the servo (in this case, Parallax continuous rotation servos) internal electronics is being partially reset by the spikes, so the servos glitch. Probably not unlike how servos always glitch when power is first applied to them.

We found 2 solutions to the problem. One was to move the piezo ground connection far away from the servo ground buss. Secondly, by inserting a small series resistor (330 ohms) in the piezo lead, the spikes were suppressed. Eg, from Icap = C * dv/dt, if dv ~ 5v, dt ~ 0.1 usec, and C = 2 nF, then a 100 mA current spike is produced, and this causes a voltage spike on the ground buss, which is large enough to affect the servos. The series R limits the capacitance current to 5v / 330 ohms = 15 mA tops, and slows the charge rate to about R * C = 330 * 2 nF = 0.7 usec. The piezo is still plenty loud enough with the series R in there.


<| Getting a good solder joint

Besides having clean leads on the components being soldered, the single best way to get a good solder joint is to first heat the component lead, and then touch the solder to the lead on the opposite side to the soldering iron tip. When the soldering iron is at the correct temperature, it should only take 2-5 seconds to heat the lead and create a good solder joint. A good solder joint will look shiny and smooth, and not blobby. Blobby means there wasn't enough heat. In our experience, chisel-point, rather than pencil-point, soldering iron tips work best for applying heat. Keep the tips clean by wiping on a damp songe.


<| TOP


© Oricom Technologies, Oct 2004