This web page contains working assumptions, detail discussion concerning software preparations, a collection of helpful images with comments, and an endnote detailing changes required to accommodate substitution of the Uno Arduino board.
At this point in the project we assume
Ultrasonic Speed Gun Software Aspect of Project
There are at least two software approaches for this project. Both approaches use programs called IDE(integrated development environment). In the author's opinion there is the hard-way "Arduino IDE" and the not-so-hard-way "Sloeber: Arduino-Eclipse-Plugin". Below are two sets of links for obtaining the Arduino IDE and and one for the Sloeber IDE.
A collection of libraries is required to execute this project. The each required libraries (or suitable substitutes) must be must be available from within the selected IDE before the project will successfully execute.
Next install the Required Libraries as library components from the zip file or download them from the Internet. The user will need to create an appropriate new Project or Arduino sketch project container. The user will then need to create the linkage between the required libraries suitable for the users environment.
A list of required libraries and links to their suggested download sources is given further below. The exact sequence of actions required to install is the same for both IDE-s. These required libraries need to be placed in the ..../Arduino/libraries folder. That folder location will vary from user to user depending the installation of Arduino employed by the user. But the typical locations are provided further below along with a tutorial from SparkFun regarding installation for Windows and Mac environments. Finally the the further assistance for including the required libraries in the project is also given further below.
Just when you think it is safe to go into the water, there is another step needed to make the libraries available to Ultrasonic Speed Gun project (formally called a031_speed_gun_004). For the Arduino IDE the task is call "including". For the Sloeber IDE the task is call "adding".
|The source files are commonly called header files and sketch files. The source files associated with this Instructable can be downloaded from the GITHUB: https://github.com/trooker/a031_speed_gun_004. The source files will arrive as a zip package a031_speed_gun_004-master.zip. Once the content of this bundle has been extracted they can be directly file copied into the project folder. Then the project needs to be refreshed or restarted depending upon the IDE selected to have sources file reflected in the project.|
Both approaches also demand that a specific set of values be registered with the IDE of choice, Arduino IDE or Sloeber IDE. That set of values insures proper USB connectivity to user's Arduino board.
|Fresh Sloeber workbench||A newly created Sloeber IDE workspace awaiting the user's inputs.||Create New Project||Image displays annotation for creating a new project/sketch.|
|Board type and port Sloeber IDE||Both the Sloeber IDE and Arduino IDE require that the board type and USB port be defined in the project properties.|
|Board type Arduino IDE||Arduino IDE board type definition.|
|Port specification Arduino IDE||Arduino IDE USB port definition.|
|Adding Software Components||The project software components copied from the project code bundle.|
|Detail: Create project resource files||Create a container for the new project resource file.|
|Detail: Rename file||Provide the proper *.ino or *.h file name for the project component.|
|Required Libraries||Libraries necessary to compile the project as shown from the Sloeber IDE. These must be loaded to the project after downloading.|
For Sloeber IDE
For Arduino IDE
Set Libraries to select
Download and install library to system Arduino folder.
Then "add" for the Sloeber IDE project.
Then "include" for the Arduino IDE project.
|Project Components Loaded to Sloeber||Various software components loaded to the project and ready for verification/uploading. Observe that the a031_speed_gun_004.ino file content is displayed with the comment section compressed and early definitions displayed.|
|Open Serial Communication Sloeber IDE||Prior to uploading the program to the Arduino board, solid USB communication must be established between the IDE and the board. For Sloeber this is done by adding a new connection while in the "Serial monitor view" tabsheet.|
|Open Serial Communication Ardurino IDE||To start the Serial Monitor select it from the Tools menu.|
|Common buttons||Both IDE's have a verify and an upload button.|
|Successful verify operation||A successful verify results in a notification that the build finished with zero errors.|
|Upload program to Arduino board||Given that the USB connection has been setup, a proper upload should result in a message that the avrdude is done.|
|Upload begins a cycle||If the upload is successful and the "serial monitor view" is active then that tab should reflect message similar as shown. It it fails the message will not show|
|1> Substituing Uno Arduino Board|
|The default Arduino board type for this project is Mega256. If the Arduino Uno board type is used two changes will be required. First the aapMbot.aapBase.h will need to have the Arduino board type change in this header file. The second place will be in the Arduino IDE or the Sloeber IDE. Both the Arduino IDE and Sloeber IDE require this change in the project specification phase.|
|For Uno Arduino boards||Shows the two significant changes that must be made to the aapBase.h header file. Then the default board type must be changed for the project within the IDE from mega256 to Uno.|
|2> Substituting Trigger and Echo Pins Ultrasonic Sensors|
|The default ultrasonic sensor type for this project is a sensor which has one pin for both the trigger and echo signal. The a031_speed_gun_004.ino will need to be changed to use a sensor with separate pins for triggering and echo signals.|
|Single Signal Pin||Typical trigger/echo single pin Ultrasonic sensor|
|Separate Signal Pins||Typical Ultrasonic sensor with separate trigger and echo pins.|
|Separate Pins/Signals Definitons||Switch the trigPin identifier to 2 and uncomment the echoPin identifier line.||Separate Pins/Signal Pin Modes||The pin mode and duration for the echo signal must be uncommented. The trigger durration must be commented-out.|