Skip to content

Commit

Permalink
RFID documentation (#101)
Browse files Browse the repository at this point in the history
* Initial outline of RFID documentaion

Still need to test the circuit, add a circuit diagram, and outline how
to test the circuit.

* Example commands for rfidscanner

* fix slide switch png

* added rfid circuit image

* added assembly instructions, troubleshooting, and functionalities sections

* added assembly instructions, functionality, and troubleshooting sections

* renamed images folder back to img

---------

Co-authored-by: Ruthvik Mannem <[email protected]>
  • Loading branch information
SwindleA and ruthvikm authored Nov 7, 2023
1 parent 8f37c4d commit f508ed2
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,71 @@
==== RFID Scanner

[.text-right]
[.text-right]
https://github.com/oss-slu/Pi4Micronaut/edit/develop/micronautpi4j-utils/src/docs/asciidoc/components/inputComponents/rfidScanner.adoc[Improve this doc]

===== Overview
This section provides information regarding the RFID scanner component and its circuit, including assembly instructions.


===== Components

* RFID-RC522
* RFID key fob
* 9 x Jumper Wires
* Breadboard
* Power source (3.3V)




===== Assembly Instructions

* Put RFID scanner on breadboard as shown in the diagram below.
* Connect the RFID ground to the ground on the Pi, and connect the 3.3V pin of the RFID scanner to the 3V3 pin of the Pi.
* Connect the rest of the RFID pins to the corresponding pins on the Pi.


===== Circuit Diagram
Model:

image::../../img/rfid_circuit.png[]

===== Functionality
The two main functions of the RFID scanner are to read RFIDs and to write to them. What is written to the RFID will vary depending on the intended use for the scanner.

===== Troubleshooting

Make sure everything is connected to the correct pins.

===== Testing the Circuit:

To write to the RFID fob: `curl -X POST http://localhost:8080/rfid/write/{message}`

Example:
[source]
----
$ curl -X POST http://localhost:8080/rfid/write/HelloThere
----
Scan the key fob to write the message to the fob.

To read from the RFID fob: `curl http://localhost:8080/rfid/read`

Example:
[source]
----
$ curl http://localhost:8080/rfid/read
----
Scan the key fob and the message on the fob will be printed.
[source]
----
HelloThere
----

===== YAML
The RFID scanner as it appears in the application.yml:

include::../../../../../../components/src/main/resources/application.yml[tag=spi]


===== Constructors

[source, java]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,30 @@ This section provides the details of the Slide Switch circuit, including its com
* 7 x Jumper Wires
* Power source (appropriate voltage, typically 3.3V or 5V)

===== Assembly Instructions
1. Place the slide switch and the capacitor vertically in the same column on the breadboard.
2. Connect the middle pin of the slide switch to the bottom pin of the capacitor.
3. Place the resistor so that one side is in the same row as the middle pin of the slide switch with the wire from step two between, and the other side to the top pin of the resistor.
4. Power the slide switch by connecting the 5V pin from the pin to the positive column of the breadboard and connecting the bottom pin of the slide switch to that column.
5. Connect the top pins of the slide switch and the capacitor to the negative column of the breadboard. Connect the GND pin of the Pi to that column.
6. Connect the GPIO18 pin of the Pi to the middle pin of the slide switch so that the resistor and the connection to the capacitor are between.

===== Circuit Diagram
Model:

image::https://github.com/oss-slu/Pi4Micronaut/tree/main/micronautpi4j-utils/src/docs/asciidoc/img/slideSwitch_circuit.jpg[]
image::../../img/slideSwitch_circuit.jpg[]

===== Functionality
Making a request to the switch will return whether the switch is on or off, flip the switch to change the state.

===== Testing the Circuit:

Use: `curl http://localhost:8080/slideSwitch/switch1` to test the switch. This will either return true,if the switch is on, and false if the switch is off. Flip the switch and run the command again to see the opposite result of the first call.

===== Troubleshooting

Verify that all connections are correct and that the order of components in a row are correct.

===== YAML
The slide switch as it appears in the application.yml:

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f508ed2

Please sign in to comment.