[vc_row][vc_column width=”1/1″][vc_column_text]In this tutorial we are going to demo how to use arduino and cottonwood to read UHF RFID.[/vc_column_text][vc_tour][vc_tab title=”Hardware:” tab_id=”1396492655-1-30″][vc_column_text]
- [bigcommerce link=”/arduino-uno-compatible-usb-board-r3/” target=”_blank”]Arduino UNO[/bigcommerce]
- [bigcommerce link=”/cottonwood-long-range-uhf-rfid-reader-uart-iso18000-6c-epc-g2/” target=”_blank”]TTL UART UHF RFID Reader (Cottonwood)[/bigcommerce]
- [bigcommerce link=”/5dbi-pcb-uhf-rfid-902-928m-antenna-5cm-x-5cm/” target=”_blank”]RFID Reader Antenna[/bigcommerce]
- [bigcommerce link=”/wall-adapter-power-supply-5vdc-2a/” target=”_blank”]5V/2A DC Wall Adapter[/bigcommerce]
[/vc_column_text][/vc_tab][vc_tab title=”Wiring Diagram:” tab_id=”1396492655-2-50″][vc_column_text]
- Pin 3 of Arduino UNO is connected to Cottonwood’s TX.
- Pin 4 of Arduino UNO is connected to Cottonwood’s RX.
- GND of Arduino UNO is connected to Cottonwood’s GND
[/vc_column_text][/vc_tab][vc_tab title=”Sample Code” tab_id=”1396494045127-2-3″][vc_column_text]
#include <SoftwareSerial.h> #include <LiquidCrystal.h> #define RXPIN 3 #define TXPIN 4 char command_scantag[]={0x18,0x03,0xFF};//const int incomingByte; SoftwareSerial myserial(RXPIN,TXPIN) ; void setup() { Serial.begin(9600); myserial.begin(9600); } void loop() { // turn on antenna while(Serial.available()) { incomingByte = Serial.read(); if(incomingByte='r') { myserial.print(command_scantag); } } delay (1000); while (myserial.available()) { incomingByte = myserial.read(); Serial.println(incomingByte,HEX); } } The sample Arduino code can be downloaded from:
[/vc_column_text][/vc_tab][vc_tab title=”Test” tab_id=”1396497503938-3-2″][vc_column_text]Now, in X-CTU, by pressing ‘r’.
And you can see “0x19 0x03 0x00”.
That means your cottonwood is working properly.[/vc_column_text][/vc_tab][/vc_tour][/vc_column][/vc_row]
Leave a Reply
You must be logged in to post a comment.