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