Blog
Write a new blog entry

Getting The RFID Reader Started
created: 19 Feb 2013 08:40
tags:
We attached the Parallax RFID reader to our Arduino UNO and were able to get it to read and print out the name of the ID Tag on the Serial Print monitor.

A late addition to our apparatus came in the form of a fun little buzzer that beeps each time an RFID tag is read.

Code was modified from "Getting Started With RFID" by Tom Igoe:

//RFID With Parallax Reader
#include <SoftwareSerial.h>
 
const int tagLength= 10;     
const int startByte= 0x0A;      //Start of Tag
const int endByte= 0x0D;        //End of Tag
 
char tagID[tagLength + 1];      //Array To Hold the Tag That's Read
 
const short Buzzer = 3;         
const int rxpin= 6;             //Pin 6 Recieves Data From RFID Reader
const int txpin= 7;             //Pin 7 does nothing in this sketch
SoftwareSerial rfidPort(rxpin, txpin);
 
void setup(){
  Serial.begin(9600);
 
  rfidPort.begin(2400);
  pinMode(Buzzer, OUTPUT);
}
 
void loop(){
  digitalWrite(Buzzer, LOW);
  if (rfidPort.available() > 0){
  if(readTag()){
    Serial.println(tagID);
    digitalWrite(Buzzer, HIGH);
    delay(100);
    }
  }
}
 
//Now read the tag, and return it to tagID above to print
boolean readTag(){
 
  char thisChar = rfidPort.read();
  if (thisChar == startByte){
 
    if (rfidPort.readBytesUntil(endByte, tagID, tagLength)){
      return true;
    }
  }
  return false;
}

Further tests will be conducted to determine how effective the RFID Reader is reading through different materials.
Comments: 0, Rating: 0

Serial Comm: ADK to 2 Nanos with LCD
created: 18 Feb 2013 08:37
tags:
We made a test based on serial communication between Arduino boards. The setup is shown below:

ADK%20to%20Nano%20Simple%20Sch.png

The goal was to display different LCD characters simultaneously with the information coming from the Mega ADK Board.
Here's the main loop of the main Mega ADK.

void loop() 
{
  Serial1.print("nano1YOW BRO!");
  delay(2000);
  Serial1.print("nano2Yeah!!");
  delay(2000);
 
  Serial1.print("nano1YOW BRO! 2");
  delay(2000);
  Serial1.print("nano2Yeah!! 2");
  delay(2000);
}

As both Arduino Nano boards receive the string simultaneously, we incorporated a "nano1" and "nano2" string at the start of every data that is sent by the main board. These strings (nano1 & nano2) act as a filter string, so that each nano would only display (on the LCD) the string that has its corresponding number.

Here's a part of the sketch for the 1st Arduino Nano board where it only reads the strings starting with "nano1", deletes it (using .substring function) and displays on LCD.

if (message.startsWith("nano1")) // display if msg starts with nano1.   
{
   message = message.substring(5); // erase nano1
   lcd.setCursor(0,0);
   lcd.print("                ");
   lcd.setCursor(0,0);
   lcd.print(message);
}

Same goes for the 2nd Nano board

if (message.startsWith("nano2")) // display if msg starts with nano2.   
{
   message = message.substring(5); // erase nano2
   lcd.setCursor(0,0);
   lcd.print("                ");
   lcd.setCursor(0,0);
   lcd.print(message);
}

VIDEO OUTPUT:

Here's the code for the 3 Arduino Boards and the LiquidCrystal_i2C library that was used for the LCD displays.
Sketch and Library
Comments: 0, Rating: 0

Extract Date and Time through Ethernet
created: 13 Feb 2013 10:11
tags:
Been working with ethernet module and figuring out how to extract the current date and time from it.

The code only works for IDE v1.x since the built-in library for Ethernet was changed (upgrade from IDE v0023 to v1.0.0).

What the program does is to make the Arduino Ethernet Board send an email to the DAYTIME server (serverAddress = 132.163.4.102).
The server would then respond the current date and time together with some additional information (provided that the server is online, as well as correct IP address is placed).

Ex. 56336 13-02-13 09:48:04 00 0 0 814.3 UTC(NIST) * - Where 13-02-13 is the date. 09:48:04 is the time.

The current time and date is then extracted (erasing all other information) using "index0f" function and is displayed back to the Serial Monitor.

Serial%20Monitor%20ScrShot.png

The MAC address can be set to any value. Though newer Ethernet boards have stickers on them for their specific MAC addresses.

Picture of Arduino Ethernet Board with PoE we have here at the lab.

MAC%20Sticker%20for%20Ethernet%20Board.png

Here's a working code using IDE v1.0.3:
*Note that the local IP address changes from time to time. Just yesterday, the IPaddress was 192.xxx.x.xx9. Now it's 192.xxx.2.xx3.

The concept for extracting day time code was based on Maik Schmidt's Arduino Quick-Start Guide Book.

Arduino%20Guide%20Book.png

Though this book assumes you use IDE version below than v1.0 - that's why some libraries (i.e. Ethernet library) won't compile when using IDE v1.x.
.
.

Sketch can be found here. TelnetDaytime Sketch
.
.
.
Comments: 0, Rating: 0

page 1 of 212next »