-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #269 from oss-slu/264-SpeedSensorDocumentation
Added Speed Sensor Documentation
- Loading branch information
Showing
4 changed files
with
108 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/speedSensor.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
:imagesdir: img/ | ||
|
||
ifndef::rootpath[] | ||
:rootpath: ../../ | ||
endif::rootpath[] | ||
|
||
ifdef::rootpath[] | ||
:imagesdir: {rootpath}{imagesdir} | ||
endif::rootpath[] | ||
|
||
==== Speed Sensor | ||
|
||
[.text-right] | ||
https://github.com/oss-slu/Pi4Micronaut/edit/develop/pi4micronaut-utils/src/docs/asciidoc/components/inputComponents/speedSensor.adoc[Improve this doc] | ||
|
||
===== Overview | ||
This section provides the details of the Speed Sensor circuit, including its components, assembly instructions, and functionality. | ||
|
||
===== Components | ||
* Speed Sensor | ||
* Bread Board | ||
* T-Extension Board | ||
* 7x Jumper Cables | ||
* Green LED Light Bulb | ||
* Red LED Light Bulb | ||
* 2x 220Ω Resistors | ||
* Power source | ||
|
||
===== Assembly Instructions | ||
. Ground (GND): Connect the GND pin on the speed sensor to the ground rail on the breadboard. | ||
. VCC: Connect the VCC pin on the speed sensor to the 5V pin on the Raspberry Pi GPIO header via the breadboard power rail. | ||
. Digital Output (D0): Connect the D0 pin on the speed sensor to GPIO 17 (Pin 11) on the Raspberry Pi GPIO header. | ||
. Connect the longer leg (anode) of the red LED to a row on the breadboard. | ||
. Place a 220-ohm resistor between the shorter leg (cathode) of the red LED and the ground rail on the breadboard. | ||
. Use a jumper wire to connect the same row as the anode of the red LED to GPIO 27 (Pin 13) on the Raspberry Pi. | ||
. Similarly, place the green LED on the breadboard. | ||
. Connect the longer leg (anode) to a free row. | ||
. Place another 220-ohm resistor between the cathode of the green LED and ground. | ||
. Use a jumper wire to connect the anode of the green LED to GPIO 22 (Pin 15). | ||
. Connect the ground rail on the breadboard to a ground pin (GND) on the Raspberry Pi GPIO header (e.g., Pin 6). | ||
. Connect the power rail on the breadboard to a 5V pin on the Raspberry Pi GPIO header (e.g., Pin 2). | ||
|
||
===== Circuit Diagram | ||
|
||
image::SpeedSensor-Circuit.png[] | ||
|
||
*Schematic Diagram:* | ||
|
||
image::SpeedSensor-Schematic.png[] | ||
|
||
===== Functionality | ||
|
||
===== Testing the Circuit: | ||
|
||
Use the below command to test the speed sensor. | ||
|
||
[source, bash] | ||
---- | ||
$curl http://localhost:8080/speedSensor/enable | ||
---- | ||
|
||
* `/enable` - Initializes the Speed Sensor | ||
|
||
[source, bash] | ||
---- | ||
$curl http://localhost:8080/speedSensor/speed/rpm | ||
---- | ||
|
||
* `/speed/rpm` - Returns the speed in RPM | ||
|
||
[source, bash] | ||
---- | ||
$curl http://localhost:8080/speedSensor/speed/disable | ||
---- | ||
|
||
* `/disable` - Disables the Speed Sensor | ||
|
||
===== Troubleshooting | ||
|
||
Verify that all connections are correct and that the order of components in a row are correct. | ||
|
||
===== YAML Configuration | ||
The speed sensor as it appears in the application.yml: | ||
|
||
[source, yaml] | ||
---- | ||
digital-input: | ||
speed-sensor: | ||
name: Speed Sensor | ||
address: 17 | ||
pulses-per-revolution: 20 | ||
provider: pigpio-digital-input | ||
debounce: 500 | ||
---- | ||
|
||
===== Constructors and Methods | ||
To see the constructor and methods of our SpeedSensorHelper class see our javadoc link:https://oss-slu.github.io/Pi4Micronaut/javadoc/com/opensourcewithslu/inputdevices/SpeedSensorHelper.html[here] | ||
for more details. | ||
|
||
===== An Example Controller | ||
|
||
====== This controller sets up Speed Sensor | ||
|
||
[source, java] | ||
---- | ||
include::../../../../../../components/src/main/java/com/opensourcewithslu/components/controllers/SpeedSensorController.java[tag=ex] | ||
---- |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.