This assignment will introduce you to using the oA2D object available on the OOPic. The oA2D object is an 8-bit analog to digital (A/D) converter. You will use the A/D converter with the Sharp GP2D12 IR or Sharp GP2D120 IR ranging module. This sensor takes a continuous distance reading and reports the distance as an analog voltage with a distance range of 10cm (~4") to 80cm (~30") for the GP2D12 and 4cm (~1.5") to 30cm (~12") for the GP2D120. The interface is 3-wire with power, ground and the output voltage.
Materials
Hookup Diagrams
Setup for the OOPic and GP2D12[0] is shown in the figures below.
Connections
The setup uses one of the OOPic I/O ports (3) and the +5-volt and ground connection. The relation between the ports and pins are as follows:
|
|
|||||||||||||||||
Assignment Part A
Using the GP2D12[0] Communications Example below, you will accumulate some data characterizing the response of the IR detector. A form is available here to record you results. Use a meter stick and solid surface to assess the IR sensor at different distances.
Assignment Part B
Using the GP2D12[0] Communications Example as a starting point, modify the OOPic and VB programs to perform the following task:
Save the OOPic program as assign13.osc and the VB project as assign13.
GP2D12[0] Communications Example
This example has an OOPic program and a Visual Basic program. By using these programs together you can assess the response of the Sharp IR sensor. The VB program communicates with the OOPIc and displays the voltage values associated with the sensor.
Serial Communications
This is a simple example that may be used to troubleshoot PC and OOPic communications.
What Youll Turn In
The form from part A and a diskette with your name, course number, assignment number. The diskette should contain
the files assign13.osc and the VB project as assign13..