Friday, February 25, 2011

complete standalone arduino - with programming usb

based on ITP Physical computing
http://itp.nyu.edu/physcomp/Tutorials/ArduinoBreadboard

Saturday, November 20, 2010

Ir remote control

Decoding your remote control
kaki kiri resistor 220 pin 11
kaki tengah ground
kaki kanan 5v


/*
* IRhashdecode - decode an arbitrary IR code.
* Instead of decoding using a standard encoding scheme
* (e.g. Sony, NEC, RC5), the code is hashed to a 32-bit value.
*
* An IR detector/demodulator must be connected to the input RECV_PIN.
* This uses the IRremote library: http://arcfn.com/2009/08/multi-protocol-infrared-remote-library.html
*
* The algorithm: look at the sequence of MARK signals, and see if each one
* is shorter (0), the same length (1), or longer (2) than the previous.
* Do the same with the SPACE signals. Hszh the resulting sequence of 0's,
* 1's, and 2's to a 32-bit value. This will give a unique value for each
* different code (probably), for most code systems.
*
* You're better off using real decoding than this technique, but this is
* useful if you don't have a decoding algorithm.
*
* Copyright 2010 Ken Shirriff
* http://arcfn.com
*/

#include

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

void setup()
{
irrecv.enableIRIn(); // Start the receiver
Serial.begin(9600);
}

// Compare two tick values, returning 0 if newval is shorter,
// 1 if newval is equal, and 2 if newval is longer
// Use a tolerance of 20%
int compare(unsigned int oldval, unsigned int newval) {
if (newval < oldval * .8) {
return 0;
}
else if (oldval < newval * .8) {
return 2;
}
else {
return 1;
}
}

// Use FNV hash algorithm: http://isthe.com/chongo/tech/comp/fnv/#FNV-param
#define FNV_PRIME_32 16777619
#define FNV_BASIS_32 2166136261

/* Converts the raw code values into a 32-bit hash code.
* Hopefully this code is unique for each button.
*/
unsigned long decodeHash(decode_results *results) {
unsigned long hash = FNV_BASIS_32;
for (int i = 1; i+2 < results->rawlen; i++) {
int value = compare(results->rawbuf[i], results->rawbuf[i+2]);
// Add value into the hash
hash = (hash * FNV_PRIME_32) ^ value;
}
return hash;
}

void loop() {
if (irrecv.decode(&results)) {
Serial.print("'real' decode: ");
Serial.print(results.value, HEX);
Serial.print(", hash decode: ");
Serial.println(decodeHash(&results), HEX); // Do something interesting with this value
irrecv.resume(); // Resume decoding (necessary!)
}
}

#define LEDPIN 13
void blink() {
digitalWrite(LEDPIN, HIGH);
delay(200);
digitalWrite(LEDPIN, LOW);
delay(200);
}

// Blink the LED the number of times indicated by the Philips remote control
// Replace loop() with this for the blinking LED example.
void blink_example_loop() {
if (irrecv.decode(&results)) {
unsigned long hash = decodeHash(&results);
switch (hash) {
case 0x322ddc47: // 0 (10)
blink(); // fallthrough
case 0xdb78c103: // 9
blink();
case 0xab57dd3b: // 8
blink();
case 0x715cc13f: // 7
blink();
case 0xdc685a5f: // 6
blink();
case 0x85b33f1b: // 5
blink();
case 0x4ff51b3f: // 4
blink();
case 0x15f9ff43: // 3
blink();
case 0x2e81ea9b: // 2
blink();
case 0x260a8662: // 1
blink();
break;
default:
Serial.print("Unknown ");
Serial.println(hash, HEX);
}
irrecv.resume(); // Resume decoding (necessary!)
}
}

Wednesday, November 10, 2010

BURNING ARDUINO WITHOUT BURNER

based on http://www.geocities.jp/arduino_diecimila/bootloader/index_en.html#top


koneksi bitbang
1 kiribawah
2 tengah kanan
3 tengah kiri
4 kanan atas


step satu, cek wiring , read FUSE, ok

cek speed, delete -B 4800 , read FUSE, ok

mulai burning, read LOCK BIT, ok , Erase LOCK BIT

Write FUse bit area dgn isi sbb :
DA
FF
05
0F

preparing bootloader di Flash Area,
klik erase-write-verivy

Lock bit diset 0F, klik write

Done

Saturday, October 9, 2010

temperature sensor

display LCD use NOKIA 3310 --- Philips PCD8544 (Nokia 3310) drive
http://www.arduino.cc/playground/Code/PCD8544

use LM35
kiri basis +5V
tengah collector analog in 0
kanan emitor ground

LCD 1---g
2 ---5v
3----360ohm---g
4 ----pin 7
5----- g
6----pin 8
16----g
15---5v
14----pin12
13----pin 11
12---pin10
11---pin9

CODE :
/*
LiquidCrystal Library - Hello World

Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.

This sketch prints "Hello World!" to the LCD
and shows the time.

The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)

Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe

http://www.arduino.cc/en/Tutorial/LiquidCrystal
*/

// include the library code:
#include " < "LiquidCrystal.h""">" (" tanda aphrostrophe dihilangkan")

// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);
int pinlm = 0;
float temp = 0;
long val = 0;

void setup() {
// set up the LCD's number of rows and columns:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("temperature");
}

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:
val = analogRead(pinlm);
temp = (5*val*100/1024);

lcd.print(temp);
delay (5000);
}

Dimmer LED

use TIP 102
basis to PWM arduino
Colector to negativ LED, Pos LED to + LED'S power supply
emitor to ground

+5V to switch tactile , otherr pole to input digital pin 8,
digital in 8 to resistor to ground

one click will fade in and fade out, double click will on / off

code

// Project 8 - Mood Lamp
int x,state,lightval,dir;
int Led1 = 9;
int Switch1 = 8;
int varTime,TimerActive;
int DoubleClickTime,DClickState;
unsigned long idleTime,lastClick;

void setup()
{
Serial.begin(9600);
lightval=0;
x=0;
dir=1;
idleTime=0;
pinMode(Led1, OUTPUT);
pinMode(Switch1, INPUT);
varTime=1000; //switch direction after ms
TimerActive=0;
DoubleClickTime=300;
DClickState=0;

}

void loop()
{
lightval=x;
analogWrite (Led1, lightval);
state = digitalRead(Switch1);
if (state == HIGH) {
x = x+dir;
if (x >= 200) { x=200; dir=dir*-1;}
if (x <= 0) { x=0; dir=dir*-1;}
delay(20);
idleTime=millis();
TimerActive=1;
if (((idleTime-lastClick)0) && (DClickState==0)){
x=0;
dir=1;
lastClick=idleTime;
DClickState=1;
}
if (((idleTime-lastClick)0) && (DClickState==1)){
x=200;
dir=-1;
lastClick=idleTime;
DClickState=0;
}
}
else
{
lastClick=idleTime;
if (((millis()-idleTime)>varTime) && (TimerActive=1)) {
dir = dir*-1;
TimerActive=0;
}
}
}

Friday, August 20, 2010

ats amf project

suggestion from andry tantalus
use of DKG 509 by Datakom,

features : UVR 15 GEN, 30% PLN
OVR
UFR
OFR
Low Oil Pressure digital input NC, ok
H temp NO digital ,ok
Charge fail, analog input, ok
crank disconnect 5s max, ok
Fail to start 3x , ok
O current > 10%
RMS RST metering ,V,I,W
Display pressure oil, temp mesin --> R, analog input
Hour counter
Service hour
event log--- 300 event
input digital x3 , ok
output digital x3 , ok

DIsplay LCD
analog inpuut x 2 , 0-5v , ok

Saturday, June 5, 2010

Lantronix Wiport Project


Parts to be added :
Connector :
Recommended: Samtec FTMH-120-03-F-DV-ES (shrouded
header)
Alternative: Samtec FTMH-120-03-F-DV (not shrouded)
Alternative: Oupiin 2411-2X20GDN/017 (not shrouded)
The mating connector is
a 1mm micro header,
40 pins,
2 x 20.





interface for rs232 ????
SP3223UEA

according to arduino forum : http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1226499649/4
we can use only 5v-3.3V converter use of 74LVC126A or buy some kit from futurelec
futurlec.com/mini_logic.shtml

new tutorial from igoe : http://www.tigoe.net/pcomp/cobox/xport.shtml
this is real integration



not known the application..........
, connect via wired ethernet port (has been downloaded to mac)
http://ltxfaq.custhelp.com/cgi-bin/ltxfaq.cfg/php/enduser/fattach_get.php?p_sid=yFsL3F1k&p_li=&p_accessibility=0&p_redirect=&p_tbl=9&p_id=1440&p_created=1196985599&p_olh=0

parts needed :
rj45 with magnetics
http://www.bothhandusa.com/products/rohs/LU1T041C_43_LF_M__RevA1_051109.pdf <----preferable





or
magnetics
http://www.haloelectronics.com/pdf/ultra.pdf
rj45connector

Sunday, May 30, 2010

micro project

3,3 V voltage regulator = LM319


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);
}

Sunday, January 18, 2009

ITC project




Ada yg bisa kasih info, yg bisa buat kayak ginian. Jadi ini adalah showcase / rak utk counter di ITC. Siapa tau diantara teman2 ada yg bekerja dibidang konstruksi besi/ spesialisasi di bidang ini.

Friday, March 14, 2008

My first blog

Hello , this is my first blog
And I am an electrical engineer, but interesting in Apple products, especially their notebook line.

I have an 4 year old iBook G4. And dreaming to have Macbookpro 15".
I am a member of apple macintosh fans forum i.e : http://www.macclubindonesia.com/ and http://www.mac.web.id/ all this forums based in Indonesia my beloved country.

Recently Apple had launched their new product which is called Mac book air