Hello!
Today’s post we expand on our by adding proximity sensing to our robot. In this example we use the proximity sensing capabilities of PSoC 4 to detect when a Human is close to touching it. When it detects proximity it begins to drive away. For this example you will need the following hardware:
- PSoC 4 Pioneer Kit
- Ladyada Motor Shield Kit
- Digilent Robot Chassis
- AA battery pack
- Long wire for Proximity
Forum Post Attachments:
At the bottom of this post we are including the following items:
- Example Project Zip File
- Zip File of Images
- Project Schematic
- Component Configurations
Components Used:
The user can download the example project at the bottom of this post. The project uses the following list of Creator Components:
- PWM
- CapSense
- SPI
- CyClock
- CyPin
The components are configured by right clicking on the component in your Top Design schematic view and selecting Configure. Please enable the following selections in the Configuration windows for the listed components above.
Firmware Description:
The main.c firmware is included in the example project. Please review the commented sections for more details.
In this example we make use of the motor control APIs included in files that were part of . Please make sure you include those files in this example.
In this example we’ve added a CapSense proximity detector. The firmware will detect the proximity sensor and then drive the robot away. The example also drives the RGB led to indicate if there is a proximity detection.
Hardware Connections:
The connections for this project are the same as . In this example we have added a long wire that will be used as our proximity detector. This wire is wrapped around a small plastic boom that is connected to the Robot Chassis. The wire is then connected to the PSoC 4 through Pin P2[0].
Test Your Project:
Connect all of your shield boards like in of and connect the proximity wire to P2[0] on the PSoC 4 using either the shield board common connectors or directly to the Pioneer kit connector. Program the PSoC 4 and then place the robot down on the ground. Connect the AA battery pack to the robot and stand back. Attempt to pick up the robot to see that it drives away.
We have posted a video describing this example in the following post:
I hope this example can help you in your design.
Best,
Matt
Well, we'll not risk another frontal assault. That robot’s dynamite.