recently project : 31 may 2005
---------------------------------
WIKI :
different crystal :
http://www.maxim-ic.com/app-notes/index.mvp/id/2154
LCD, cek on LCD in sparkfun
LCD use :, HITACHI JHD 162A
pins :
1 gnd
2 +5V
3 mid pot , other pot to +5v and ground
4 --12
5 gnd
6 ---11
16--gnd
15--3,3V
14-12---5-2
software :
#include
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd( 12,11, 5,4,3,2);
void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("hello, Jason!");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(0, 1);
// print the number of seconds since reset:
lcd.print(millis()/1000);
}
Utility, cek on LCD in sparkfun
-------------------------------------
programming without arduino
using 7404 as stated by website : http://www.imagearts.ryerson.ca/sdaniels/physcomp/tutorials/arduino_serial/ard_serial.html---> gagal, cek to bookmarked ebook
try use this : http://rapidshare.com/files/399343172/Arduino_-_StandaloneAssembly.pdf.html
or try this : making things talk page 54
if
programming without arduino succed with inverter, added to existing eagle files ats amf.
data logger http://www.ladyada.net/make/logshield/lighttemp.html
yg kurang
skematik :http://rapidshare.com/files/399345595/logger_v1.0.sch.html
sd card holder
mcp equivalen to mic2941awt atau lm2941
or buy yg udah langsung jadi---> futurlec 6,9 usd + 5 shipping
or sparkfun 17,96usd +9usd
update sdcard logger , by adafruit
sd card holder beli di sparkfun
level shifter 74ahc125n
3,3v regulator mcp1700-330
RFID reader success
use of RDM630 bought on indorobotika.com
hardware setup : P1= 1, pin 4 arduino ; P1=2 ;pin 5= arduino ;pin 4 =gnd ; pin 5 = 5vdc
p3=1 led ; pin 2 =5vdc ; pin 3 = gnd . P2 = antena
software :
/**
* RFID Access Control Single
*
* This project implements a single stand-alone RFID access control
* system that can operate independently of a host computer or any
* other device. It uses either an ID-12 RFID reader module from ID
* Innovations or an RDM630 RFID reader module from Seeed Studio to
* scan for 125KHz RFID tags, and when a recognised tag is identified
* it toggles an output for a configurable duration, typically 2
* seconds. The output can then be used to control a relay to trip an
* electric striker plate to release a door lock.
*
* Because this project is intended to provide a minimal working system
* it does not have any provision for database updates to be managed
* externally from a host, so updates to the accepted cards must be
* made by changing the values in the code, recompiling the program,
* and re-uploading it to the Arduino. It does however report card
* readings (both successful and unsuccessful) via the serial
* connection so you can monitor the system using a connected computer.
*
* Some of this code was inspired by Tom Igoe's excellent RFID tutorial
* which is detailed on his blog at:
* http://www.tigoe.net/pcomp/code/category/PHP/347
* And also from the ID-12 example code on the Arduino Playground at:
* http://www.arduino.cc/playground/Code/ID12
*
* Copyright Jonathan Oxer
* http://www.practicalarduino.com/projects/medium/rfid-access-control
*/
// Set up the serial connection to the RFID reader module. The module's
// TX pin needs to be connected to RX (pin 4) on the Arduino. Module
// RX doesn't need to be connected to anything since we won't send
// commands to it, but SoftwareSerial requires us to define a pin for
// TX anyway so you can either connect module RX to Arduino TX or just
// leave them disconnected.
#include
#define rxPin 4
#define txPin 5
// Create a software serial object for the connection to the RFID module
SoftwareSerial rfid = SoftwareSerial( rxPin, txPin );
// Set up outputs
#define strikePlate 12 // Output pin connected to door lock
#define ledPin 13 // LED status output
#define unlockSeconds 2 // Seconds to hold door lock open
// The tag database consists of two parts. The first part is an array of
// tag values with each tag taking up 5 bytes. The second is a list of
// names with one name for each tag (ie: group of 5 bytes).
char* allowedTags[] = {
"0104F5B523", // Tag 1
"04146E8BDD", // Tag 2
"0413BBBF23",
"2500B205D7",
// Tag 3
};
// List of names to associate with the matching tag IDs
char* tagName[] = {
"Jonathan Oxer", // Tag 1
"Hugh Blemings", // Tag 2
"Dexter D Dog",
"Melyana", // Tag 3
};
// Check the number of tags defined
int numberOfTags = sizeof(allowedTags)/sizeof(allowedTags[0]);
int incomingByte = 0; // To store incoming serial data
/**
* Setup
*/
void setup() {
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, LOW);
pinMode(strikePlate, OUTPUT);
digitalWrite(strikePlate, LOW);
Serial.begin(9600); // Serial port for connection to host
rfid.begin(9600); // Serial port for connection to RFID module
Serial.println("RFID reader starting up");
}
/**
* Loop
*/
void loop() {
byte i = 0;
byte val = 0;
byte checksum = 0;
byte bytesRead = 0;
byte tempByte = 0;
byte tagBytes[6]; // "Unique" tags are only 5 bytes but we need an extra byte for the checksum
char tagValue[10];
// Read from the RFID module. Because this connection uses SoftwareSerial
// there is no equivalent to the Serial.available() function, so at this
// point the program blocks while waiting for a value from the module
if((val = rfid.read()) == 2) { // Check for header
bytesRead = 0;
while (bytesRead < 12) { // Read 10 digit code + 2 digit checksum
val = rfid.read();
// Append the first 10 bytes (0 to 9) to the raw tag value
if (bytesRead < 10)
{
tagValue[bytesRead] = val;
}
// Check if this is a header or stop byte before the 10 digit reading is complete
if((val == 0x0D)||(val == 0x0A)||(val == 0x03)||(val == 0x02)) {
break; // Stop reading
}
// Ascii/Hex conversion:
if ((val >= '0') && (val <= '9')) {
val = val - '0';
}
else if ((val >= 'A') && (val <= 'F')) {
val = 10 + val - 'A';
}
// Every two hex-digits, add a byte to the code:
if (bytesRead & 1 == 1) {
// Make space for this hex-digit by shifting the previous digit 4 bits to the left
tagBytes[bytesRead >> 1] = (val | (tempByte << 4));
if (bytesRead >> 1 != 5) { // If we're at the checksum byte,
checksum ^= tagBytes[bytesRead >> 1]; // Calculate the checksum... (XOR)
};
} else {
tempByte = val; // Store the first hex digit first
};
bytesRead++; // Ready to read next digit
}
// Send the result to the host connected via USB
if (bytesRead == 12) { // 12 digit read is complete
tagValue[10] = '\0'; // Null-terminate the string
Serial.print("Tag read: ");
for (i=0; i<5; i++) {
// Add a leading 0 to pad out values below 16
if (tagBytes[i] < 16) {
Serial.print("0");
}
Serial.print(tagBytes[i], HEX);
}
Serial.println();
Serial.print("Checksum: ");
Serial.print(tagBytes[5], HEX);
Serial.println(tagBytes[5] == checksum ? " -- passed." : " -- error.");
// Show the raw tag value
//Serial.print("VALUE: ");
//Serial.println(tagValue);
// Search the tag database for this particular tag
int tagId = findTag( tagValue );
// Only fire the strike plate if this tag was found in the database
if( tagId > 0 )
{
Serial.print("Authorized tag ID ");
Serial.print(tagId);
Serial.print(": unlocking for ");
Serial.println(tagName[tagId - 1]); // Get the name for this tag from the database
unlock(); // Fire the strike plate to open the lock
} else {
Serial.println("Tag not authorized");
}
Serial.println(); // Blank separator line in output
}
bytesRead = 0;
}
}
/**
* Fire the relay to activate the strike plate for the configured
* number of seconds.
*/
void unlock() {
digitalWrite(ledPin, HIGH);
digitalWrite(strikePlate, HIGH);
delay(unlockSeconds * 1000);
digitalWrite(strikePlate, LOW);
digitalWrite(ledPin, LOW);
}
/**
* Search for a specific tag in the database
*/
int findTag( char tagValue[10] ) {
for (int thisCard = 0; thisCard < numberOfTags; thisCard++) {
// Check if the tag value matches this row in the tag database
if(strcmp(tagValue, allowedTags[thisCard]) == 0)
{
// The row in the database starts at 0, so add 1 to the result so
// that the card ID starts from 1 instead (0 represents "no match")
return(thisCard + 1);
}
}
// If we don't find the tag return a tag ID of 0 to show there was no match
return(0);
}