| GP2D12 to Handyboard Example |
Last Modified: 2006-10-25
In this example, the Sharp GP2D12 detector provides range detection and is interfaced to the commonly used Handy Board . The routine used to read the value from the analog output of the GP2D12 detector is a test routine included with the (Interactive C) IC libraries for the Handy Board.
Modifying the Handyboard
Because the Handy Board uses pullup resistors on all the analog inputs, it is necessary to modify the board to disable the pullups on any ports being interfaced to the Sharp GP2D12 detector. These pullups are provided by a resistor pack that sits in the middle of the 3-port connector for each analog port. There are two ways to modify the board to disable the pullup(s).
This technique will work on all analog input pins except 3 and 6. The reason for this is the way the PCB is layed out for the Handy Board.
Cut individual legs off the resistor pack. If you are building a Handy Board from scratch, you can clip off the legs of the resistor pack for each analog port you want to modify for use with the Sharp GP2D12 detector. When doing this, care must be taken to avoid any contact with the stub of the lead on the resistor pack with the PCB pad it was originally intended to mate with. This technique can also be used if you desolder and remove the resistor pack on an assembled Handy Board.
Examples showing port 0 and port 2 pullups disabled.
Cut Traces To The Pullups. If you already have an assembled Handy Board, you can eliminate the pullup by cutting the trace on the PCB that provides the pullup resistance. While this may seem drastic, the cut trace can easily be bridged later with a solder joint to reinstate the pullup. The trace is covered with solder mask so you will need to first cut through this (the green film) and then the copper trace as well. When you are done, use a continuity tester or Ohm meter to verify that the connection has been cut.
Back of board showing red traces that are cut for each analog port used.
This circuit is very simple and involves just direct wiring of the Sharp GP2D12 to the Handy Board's analog port.
Example Interface to Analog Port 0.
The software is very easy to use in this example. The call: analog(3); would return the current distance reading from a detector connected to port 3 with the pullup removed. The routine in hbtest.c called testanalogs() can be used to continuously monitor the analog ports for diagnostics and to verify operation.
If you are wishing to drive a few Sharp GP2D12 detectors, you may want to consider the Handy Board Expansion Kit. This board multiplexes analog port 0 to provide 8 additional analog ports. This means that if you modify port 0 to operate with the Sharp GP2D12 detectors, you can then add and expansion board and have 8 ports that are compatible (on the expansion board analog ports) with the Sharp GP2D12.
| voice: 720-564-0373, email: email@example.com, address: 4822 Sterling Dr., Boulder CO, 80301-2350, privacy |
© Copyright 1994-2012 Acroname, Inc., Boulder, Colorado. All rights reserved.