Proteksi firmware ATmega dengan Nomor Seri

Menggunakan bantuan 1-Wire device, dengan jenis yang bermacam macam, misal: DS1820

#include <OneWire.h>
#include <EEPROM.h>

#define DEBUG 1

OneWire  ds(A1);  // This is where DQ of your DS18B20 will connect.
bool validity = false;
void setup(void) {

#ifdef DEBUG
  Serial.begin(9600);
#endif

  validity = getDeviceAddress();
}

bool getDeviceAddress(void) {
  byte i;
  byte addr[8];
  bool valid = false;

  unsigned long upper = 0;
  unsigned long lower = 0;

#ifdef DEBUG
  Serial.println("Getting serial number...\n\r");
#endif
  while (ds.search(addr)) {
    if ( OneWire::crc8( addr, 7) != addr[7]) {
#ifdef DEBUG
      Serial.print("CRC is not valid!\n");
#endif
      return;
    }

    for (byte i = 0; i < 4; i++) {
      upper = upper << 8;
      upper = upper | addr[i];
    }
    for (byte i = 4; i < 8; i++) {
      lower = lower << 8;
      lower = lower | addr[i];
    }

    unsigned long result = upper & lower;
    Serial.println(result);

    bool initsn = false;
    if (EEPROM.read(0) == 0xFF) initsn = true;

    //initsn=true;
#ifdef DEBUG
    if (!initsn) Serial.println("Checking serial number...\n\r");
    else Serial.println("Writing serial number...\n\r");
#endif

    valid = true;
    for (byte i = 0; i < 4; i++) {
      byte e = EEPROM.read(i + 1);
      byte r = result & 0xff;
      if (initsn)
        EEPROM.write(i + 1, r);
      if (e != r) valid = false;
      result = result >> 8;
    }
    if (initsn) EEPROM.write(0, addr[7]);

#ifdef DEBUG
    if (valid) Serial.println("Good serial number...\n\r");
    else Serial.println("Bad serial number...\n\r");
#endif

  }
  ds.reset_search();
  return valid;
}


void loop(void) {
  // do nothing
}

Mengubah USB ISP menjadi USBASP

USBISP berbeda dengan USBASP. USBISP tidak dapat dioperasikan dengan AVRDude, namun harus menggunakan PROG ISP. USB ISP menggunakan uC ATmega88, dengan skema mirim USBASP namun bedanya adalah pin D- pada USB dihubungkan ke PD3, jadi PD3 harus diubah menjadi pin INPUT.

Agar dapat berfungsi jadi USBASP, maka download firmware dari https://www.fischl.de/usbasp/usbasp.2011-05-28.tar.gz dan ekstrak.

Buka file bin/usbasp.atmega88.2011-05-28.hex menggunakan notepad++ atau wordpad.

Lihat pada baris 100B8000,

:100B8000D9F77A9589F708951BB815B88BEF8AB90C

ubah menjadi :

:100B8000D9F77A9589F708951BB815B880EF8AB917

ubah ldi pada DDRD 8BEF menjadi  80EF

dan ubah checksum dari  0C  menjadi  17

Buka kemasan USBISP dan hubungkan via (lubang) yang ditandai <– UP –> menggunakan kabel kecil.

Upload dengan USBASP atau Arduino yang telah dijadikan Arduino as ISP.

Note:

# TARGET=atmega8 HFUSE=0xc9 LFUSE=0xef
# TARGET=atmega48 HFUSE=0xdd LFUSE=0xff
# TARGET=atmega88 HFUSE=0xdd LFUSE=0xff

gunakan HEX berikut, jika uC yang digunakan adalah ATmega8:

:100000003BC09FC554C053C052C051C050C04FC028
:100010004EC04DC04CC04BC04AC049C048C047C08C
:1000200046C045C044C0040309041C0377007700A0
:1000300077002E00660069007300630068006C00A2
:100040002E00640065000E0355005300420061005D
:100050007300700012011001FF000008C016DC05DB
:1000600003010102000109021200010100801909C7
:10007000040000000000000011241FBECFE5D4E002
:10008000DEBFCDBF10E0A0E6B0E0E0EAFDE002C0D8
:1000900005900D92A236B107D9F710E0A2E6B0E0C4
:1000A00001C01D92A73AB107E1F702D077C6A8CFE9
:1000B00012BA18BA11BA8FEF87BB17BA93E094BB84
:1000C0008EEF85BB93BF08D478940DD4FECFFF92FA
:1000D0000F931F93CF93DF939C01F62E80916200C4
:1000E000813021F4E90110E000E078C08430D1F3E0
:1000F0001FEF77C080916200813079F580917300A5
:100100009091740020916F003091700040917100C7
:1001100050917200892B31F4CA01B901488121E064
:1001200088D321C0CA01B901488120E082D38091DF
:1001300076008150809376008823A9F460916F0047
:10014000709170008091710090917200488126D367
:10015000809173008093760006C080916F0090912B
:1001600070006881F7D280916300909164000197DC
:100170009093640080936300892BD9F410926200FD
:100180008091750081FF14C08091760090E02091ED
:100190007300309174008217930751F060916F00E3
:1001A0007091700080917100909172004881F6D238
:1001B00011E080916F0090917000A0917100B0915A
:1001C00072000196A11DB11D80936F009093700085
:1001D000A0937100B09372000F5F21960F1508F481
:1001E00089CF812FDF91CF911F910F91FF900895BB
:1001F0000F931F93CF93DF939C01062F8091620092
:100200008250823010F00FEF32C0E90110E029C0B7
:1002100080916200823051F460916F0070917000A3
:10022000809171009091720043D205C080916F005F
:100230009091700071D2888380916F0090917000CE
:10024000A0917100B09172000196A11DB11D809323
:100250006F0090937000A0937100B09372001F5FC5
:1002600021961017A8F2083010F410926200802F27
:10027000DF91CF911F910F910895CF93DF93EC0100
:100280008981813061F49A9902C085E002C0809131
:1002900065001FD110926600A99879D104C0823000
:1002A00021F496D1A99A20E0F7C0833011F5E091AE
:1002B0007800F09179008A81099580936700E09138
:1002C0007800F09179008B81099580936800E09126
:1002D0007800F09179008C81099580936900E09114
:1002E0007800F09179008D81099580936A0024E06F
:1002F000D3C0843011F580916600882391F49B81EE
:1003000080E02A8130E0822B932BAA2797FDA095CD
:10031000BA2F80936F0090937000A0937100B093F8
:1003200072009F8180E02E8130E0822B932B90938E
:1003300064008093630082E090C0873011F5809163
:100340006600882391F49B8180E02A8130E0822B33
:10035000932BAA2797FDA095BA2F80936F009093B7
:100360007000A0937100B09372009F8180E02E8195
:1003700030E0822B932B909364008093630083E0A2
:100380006CC0853021F451D18093670084C08630E1
:10039000D9F580916600882391F49B8180E02A81C1
:1003A00030E0822B932BAA2797FDA095BA2F80933C
:1003B0006F0090937000A0937100B09372008C81D5
:1003C0009D81292F2F7020937500492F50E0407F89
:1003D000507094E0440F551F9A95E1F7480F511D56
:1003E000509374004093730020FF02C04093760046
:1003F0009F8180E02E8130E0822B932B90936400CC
:100400008093630081E029C0883059F580916600AF
:10041000882391F49B8180E02A8130E0822B932B0A
:10042000AA2797FDA095BA2F80936F009093700034
:10043000A0937100B0937200109274001092730038
:10044000109275009F8180E02E8130E0822B932BEB
:10045000909364008093630084E0809362002FEFA8
:100460001BC0893081F481E0809366008A819B8182
:10047000AC81BD8180936F0090937000A093710058
:10048000B093720010CF8A3009F00DCF8A8180932B
:1004900065001092670021E087E690E090938C0061
:1004A00080938B00822FDF91CF910895382F90E0B9
:1004B00006C022B782B7821B8C33E0F39F5F93178D
:1004C000C0F3089580917B008DB980917A008EB938
:1004D0000895282F882311F42AE002C0883028F1DB
:1004E00080E193E0909379008093780010927A00F5
:1004F0002930A9F02A3018F4283051F412C02B30DA
:1005000029F02C3029F481E080937A0081E50AC03B
:1005100082E580937B0081E080937A00089582E5F4
:1005200001C083E580937B00089580EF92E0909373
:100530007900809378002430B1F0253038F42230EF
:10054000B1F0233090F42130C9F415C0263031F0D9
:10055000263038F0273091F483E00AC020937C00E5
:1005600008958CE005C088E103C080E301C080E607
:1005700080937C00089580EC80937C00089522B7DE
:1005800090917C0082B7821B8917E0F3089587B3AE
:100590008C6287BBC298C59892B720917C0082B7C5
:1005A000891B8217E0F3C29A92B782B7891B821720
:1005B000E0F3C29880917800909179008051934047
:1005C00031F480917B008DB980917A008EB90895C5
:1005D00087B3837D87BB88B3837D88BB1DB80895AF
:1005E000482F50917C0020E030E047FF02C0C39AC2
:1005F00001C0C398220FB4992F5FC59A92B782B7F2
:10060000891B8517E0F3C59892B782B7891B8517B8
:10061000E0F33F5F383011F0440FE7CF822F0895A9
:100620008FB9779BFECF8FB108950F931F9300E290
:1006300039C0E0917800F09179008CEA0995E09159
:100640007800F091790083E50995E0917800F091C8
:10065000790080E00995182FE0917800F0917900F9
:1006600080E00995133511F480E01FC01DB8C59ACC
:1006700092B720917C0082B7891B8217E0F3C5985E
:1006800092B782B7891B8217E0F38091780090912E
:1006900079008051934031F480917B008DB9809135
:1006A0007A008EB9015028F681E01F910F910895CC
:1006B000EF92FF920F931F937B018C01862F817025
:1006C000880F880F880FE0917800F09179008062A0
:1006D0000995D801C70129E0B695A7959795879503
:1006E0002A95D1F7E0917800F09179000995169557
:1006F0000795F794E794E0917800F09179008E2DBA
:100700000995E0917800F091790080E009951F91BA
:100710000F91FF90EF9008950F931F938C01E0913C
:100720007800F091790080EA0995E0917800F091E5
:100730007900812F0995E0917800F0917900802F60
:100740000995E0917800F091790080E009951F917A
:100750000F910895FF920F931F938C01F62EE09155
:100760007800F091790080EC0995E0917800F091A3
:100770007900812F0995E0917800F0917900802F20
:100780000995E0917800F09179008F2D09958EE11F
:100790008DDE80E01F910F91FF900895CF92DF9240
:1007A000EF92FF920F931F936B017C01142FE09146
:1007B0007800F09179008CE40995D701C60149E0F1
:1007C000B695A795979587954A95D1F7E0917800CA
:1007D000F09179000995D701C601B695A79597952F
:1007E0008795E0917800F09179000995E091780083
:1007F000F091790080E009951F3F19F48FE056DEF3
:1008000007C002B71EE1C701B60152DF8F3F11F0EA
:1008100080E008C082B7801B8D33A8F302B7115067
:1008200091F781E01F910F91FF90EF90DF90CF90B3
:100830000895CF92DF92EF92FF920F931F936B0177
:100840007C01042F122F862F8170880F880F880F4C
:10085000E0917800F091790080640995D701C60194
:1008600069E0B695A795979587956A95D1F7E09138
:100870007800F09179000995D701C601B695A79542
:1008800097958795E0917800F09179000995E0912E
:100890007800F0917900802F09951123A9F00F3786
:1008A00019F48FE003DE10C002B71EE1C701B601E4
:1008B000FFDE8F3749F482B7801B8D33B8F302B760
:1008C0001150A1F781E001C080E01F910F91FF90CE
:1008D000EF90DF90CF90089585B7836085BF8BB789
:1008E00080648BBF08951F93CF93DF9360918D0039
:1008F000635067FDA3C080918A00CCE0D0E0C81BA4
:10090000D109CF56DF4F809189008D3209F084C024
:10091000683009F091C083EC80937D008AE5809374
:100920006000109277008881807639F0CE01A5DCD6
:10093000282F8F3F09F45FC065C09A81109286000E
:100940008981882321F41092870022E04DC08530F0
:1009500019F490938E0047C08630B1F58B818130B9
:1009600019F484E590E004C0823041F486E690E01A
:1009700090938C0080938B0022E122C08330F9F4A5
:100980008A81882341F486E290E090938C008093E2
:100990008B0024E015C0813041F48AE290E090930E
:1009A0008C0080938B002CE10BC0823041F486E4F4
:1009B00090E090938C0080938B002EE001C020E0AB
:1009C00080E4809377001EC0883021F421E080E924
:1009D00090E00CC0893019F49093900004C08A30E4
:1009E00011F421E001C020E086E890E090938C00B3
:1009F00080938B0007C0888187FD2E8180E88093DB
:100A0000770006C08F81882319F48E81821708F041
:100A1000822F8093610010C08091770087FF0CC007
:100A2000CE0155DB8F3F21F48EE18093600004C03E
:100A3000882311F01092610010928D008091600067
:100A400084FF58C0809161008F3F09F453C0182F74
:100A5000893008F018E0811B8093610080917D004F
:100A600098E8892780937D00112391F18091770088
:100A700087FF08C08EE790E0612FBADB182F89301E
:100A800098F526C020918B0030918C0086FF0DC018
:100A9000AEE7B0E080E090E0F901E80FF91FE491E3
:100AA000ED9301961817C1F708C0912FD901EEE711
:100AB000F0E08D9181939150E1F71150812F90E0FA
:100AC0001F5F0196820F931F90938C0080938B0081
:100AD0008EE790E0612F31D0612F6C5F6C3041F078
:100AE0008FEF8093610004C08FEF809361006EE10F
:100AF0006093600094E186B3837031F49150D9F72C
:100B000010928E0010928800DF91CF911F9108956E
:100B1000A82FB92F80E090E041E050EA60956F5F28
:100B200058F42D9138EF82279795879510F08427F8
:100B300095273F5FC8F3F3CF0895EADF8D939D9328
:100B40000895CF93CFB7CF93C395B09BE9F7B09BF0
:100B500009C0B09B07C0B09B05C0B09B03C0B09B51
:100B600001C0A1C0DF93C0918A00DD27CF56DF4FBF
:100B7000B09B02C0DF91EBCF2F930F931F9306B36F
:100B80002FEF00FB20F94F933F9316B34FEF012750
:100B900000FB21F93BE031C04E7F012F16B32160ED
:100BA00028C0102F4D7F2260000006B329C04B7F64
:100BB0002460012F000016B32BC016B3477F2860B6
:100BC0002AC04F7E06B320612CC04F7D16B3206231
:100BD0002FC04F7B06B3206432C0422706B349932F
:100BE0004FEF0000102710FB20F916B31370C9F166
:100BF000297F91F2012700FB21F906B3237F89F2B7
:100C0000315058F1102710FB22F916B3277E79F2E4
:100C1000012700FB23F92F7C81F206B3102710FB7C
:100C200024F92F7971F200C016B3012700FB25F9D2
:100C30002F7359F200C006B3102710FB26F922309B
:100C400040F200C016B3012700FB27F9243028F634
:100C50004F77206816B30000F9CF10E41ABF0027C1
:100C600017C03B503195C31BD04010E41ABF088118
:100C7000033CE9F00B34D9F0209188001981110F61
:100C80001213EDCF093641F10D3211F0013E39F763
:100C900000938F003F914F911F910F912F91DF9102
:100CA000CAB7C6FD51CFCF91CFBFCF911895209134
:100CB0008F00222379F310918D00112311F5343028
:100CC00012F130938D002093890010918A003BE04F
:100CD000311B30938A0017C000918D0001308CF4D5
:100CE0000AE53091600034FD10C000936000CDE74C
:100CF000D0E00FC02795A8F45150A9F4220F0000AE
:100D0000F9CF4AE503C042ED01C0432FC4E1D0E072
:100D100032E017B31360C09A17BB08B320E413E0A6
:100D20005F93012756E008BB279520F4515021F42A
:100D3000220FF9CF012756E000003B5A08BBD0F242
:100D4000279528F4515029F4220F0000F9CF0127EC
:100D500056E0279508BB20F4515021F4220FF9CF1B
:100D6000012756E02991332308BB21F60C7F10910F
:100D70008E00110FC651D04008BB11F010938800AF
:100D800010E41ABF016017B31C7F402F4C7F5F91A6
:100D900000C000C008BB17BB48BB7CCFF894FFCF96
:020DA0005AFFF8
:00000001FF

Driver PL2303HX untuk Windows 10 64bit

Pernah beli alat USB to Serial Converter murah, dengan IC PL2303. Saat dipasang di komputer, ternyata butuh driver. Alhasil menemukan driver di situs produsen IC namun ada catatan :

Windows 8/8.1/10 are NOT supported in PL-2303HXA and PL-2303X EOL chip versions.

Untungnya ada situs yang baik hati (lupa dimana) memberikan file hasil modifikasi driver Windows 7 agar bisa dipasang di Windows 10.

Link: http://latiful.hayat.web.id/file/PL2303HX-edit.zip

Semoga bisa bermanfaat

Memprogram AT89S52 dengan Arduino

Programmer AT89S51 biasanya membutuhkan koneksi serial, namun laptop tidak memiliki port serial. Karena Arduino menggunakan port serial, maka bisa dimanfaatkan menjadi programmer AT89S52.

 

Siapkan arduino dengan kode berikut:

lalu upload ke arduino.

 

Siapkan rangkaian sesuai skema berikut:

 

Lalu gunakan applikasi file uploader untuk upload file

Kalibrasi MPU6050

MPU6050 adalah sensor sudut dan percepatan atau biasa disebut gyrometer. Sama seperti kebanyakan sensor lain, MPU6050 perlu dikalibrasi sebelum digunakan. Kinerja gyrometer ini sangat terpengaruh terhadap suhu, jadi pastikan suhu stabil terlebih dahulu sebelum melakukan proses kalibrasi. Beri jarak waktu antara 3 sampai dengan 5 menit setelah power on agar suhu stabil. Hasil proses kalibrasi pun akan berbeda saat dilakukan di suhu ruangan dibandingkan dengan kalibrasi di luar ruangan. Pastikan dikalibrasi pada suhu ruangan yang sama, atau setidaknya hampir sama, dengan dengan suhu dimana alat akan digunakan.

Berikut kode kalibrasi dari Luis Ródenas denga sedikit modifikasi:

Pastikan sudah melakuan instalasi librari I2Cdev dan MPU6050 dan hubungkan MPU6050 dengan skema berikut

 

Taru MPU6050 pada bidang datar, semisal meja dan jangan digerakkan sampai proses kalibrasi selesai.  Selanjutnya, untuk proses kalibrasi, buka dengan serial monitor dengan baud rate 115200 dan kirimkan satu huruf (bebas) lalu tekan send atau klik tombol enter. Tunggi hingga daftar offset muncul dengan ditandai tulisan ‘Your offsets:’

Arduino: ATMega8535 & Arduino IDE

Arduino Uno, merupakan salah satu varian yang saat ini banyak digunakan untuk praktisi dan hobbi elektronika. Arduino adalah pengendali mikro dengan prosesor Atmel AVR dan softwarenya memiliki bahasa pemrograman sendiri. Memiliki library yang cukup komplit serta didukung forum yang ramai, sehingga memudahkan untuk membangun proyek sistem kendali. Library arduino memiliki hampir semua interface dan sesor.

Arduino Uno use widely by electronic practical and hobbyist. Arduino consist of microcontroller which have its own Integrated Development Environtment based on Processing. It has plenty of library supported by many discussion forum, so it will be make easier to build control system projects.

Mikrokontroler arduino bermacam macam, untuk lebih jelasnya dapat dilihat di wikipedia. Kebanyakan menggunakan mikrokontroler Atmel AVR, namun untuk Arduino Yun, Arduino Due dan Arduino Zero menggunakan arsitektur ARM.

Arduino has vary variant depending on its microcontroler, it can be seen through wikipedia. Most of it use AVR, and Atmel Microcontroler. There is also 3 variants using ARM mikrocontroller such as Arduino Yun, Arduino Due and Arduino Zero.

Arduino UNO memiliki pin I/O yang cukup memadai, sekitar 14. Jilka memerlukan pin yang lbih banyak, dapat menggunakan Arduino dengan mikrokontroler jenis ATMega2560 atau jenis ARM yang memiliki I/O 54 pin. Namun sayang sekali memerlukan biaya yang cukup mengusras kantong 😀

Arduino UNO has 14 pin can be used as I/O. If more pin needed, Arduino which employ ATMega2560 or ARM architechture are more elegible to use. Those variant have 54 I/O pin, of cource more expensive than Arduino UNO.

Pada komponen rack yang saya miliki hanya tersedia IC AVR jenis ATMega8, 328, 8535 dan ATTiny2313. Padahal project kali ini membutuhkan I/O sejumlah 20 pin. Mau tidak mau harus mengoprek ATMega8535 yang memiliki 40 pin (32 pin I/O) agar dapat diprogram menggunakan library Arduino. Oke, sekedar sharing ilmu, berikut langkah dan hasilnya :

In my component rack, there are only ATMega8, ATMega328, ATMega8535 and ATTiny2313. I’d tried to use ATMega8535 because I need 20 I/O pin. ATMega8535 has 32 I/O pin. To make ATMega8535 can be used with Arduino library, it can be done by add several line on arduino/hardware/arduino/board.txt as follow:

Tambahkan pada file arduino/hardware/arduino/board.txt dengan baris berikut:

##############################################################

arduino_atmega8535.name=Stumpino-Atmega8535-8Mhz arduino_atmega8535.upload.protocol=stk500v2 arduino_atmega8535.upload.maximum_size=7168 arduino_atmega8535.upload.speed=38400 arduino_atmega8535.bootloader.low_fuses=0xE4 arduino_atmega8535.bootloader.high_fuses=0x98 arduino_atmega8535.bootloader.extended_fuses=0xFD arduino_atmega8535.bootloader.path=atmega arduino_atmega8535.bootloader.file=stk500boot_v2_notdefined.hex #arduino_atmega8535.bootloader.unlock_bits=0x3F #arduino_atmega8535.bootloader.lock_bits=0x0F arduino_atmega8535.build.mcu=atmega8535 arduino_atmega8535.build.f_cpu=8000000L arduino_atmega8535.build.core=arduino arduino_atmega8535.build.variant=stumpinomega40 ##############################################################

arduino_atmega8535-16.name=Stumpino-Atmega8535-External 16Mhz arduino_atmega8535-16.upload.protocol=stk500v2 arduino_atmega8535-16.upload.maximum_size=7168 arduino_atmega8535-16.upload.speed=38400 arduino_atmega8535-16.bootloader.low_fuses=0xEF arduino_atmega8535-16.bootloader.high_fuses=0x98 arduino_atmega8535-16.bootloader.extended_fuses=0xFD arduino_atmega8535-16.bootloader.path=atmega arduino_atmega8535-16.bootloader.file=stk500boot_v2_notdefined.hex #arduino_atmega8535-16.bootloader.unlock_bits=0x3F #arduino_atmega8535-16.bootloader.lock_bits=0x0F arduino_atmega8535-16.build.mcu=atmega8535 arduino_atmega8535-16.build.f_cpu=16000000L arduino_atmega8535-16.build.core=arduino arduino_atmega8535-16.build.variant=stumpinomega40

Kemudian dengan bantuan header yang telah dibut oleh Eric Conner lalu taruh di folder arduino/hardware/arduino/variants/stumpinomega40

Using header that Eric Conner have made, place it in arduino/hardware/arduino/variants/stumpinomega40 folder

Ok, siap pakai. Buka Arduino lalu pilih menu Tool>Board>Stumpino ATMega8535-Eksternal16Mhz dan buka File>Example>01 Basic>Blink. Saya menggunakan downloader USBAsp, jadi saya pilih di bagian menu Tool>Programmer>USBAsp

OK, its ready to use. Open Arduino IDE than choose  Tool>Board>Stumpino ATMega8535-Eksternal16Mhz than open File>Example>01 Basic>Blink. I use USBAsp dwonloader, so I click on Tool>Programmer>USBAsp

Saatnya merangkai ATMega8535 dan ISP-pin di project board dan mencoba. Perlu diketahui, D13 pada ATMega8535 adalah di pin IC kaki 19, jadi tempatkan led di IC pin 19. Silahkan mencoba….

Its time to connect  ATMega8535 and ISP-pin in project board. Arduino D13 pin in ATMega8535 is pin 19. Happy trying…

SetUp ESP8266 as AP, WebServer

BAUD RATE 115200
AT

AT+UART_DEF=9600,8,1,0,0 //(CHANGE TO 9600)
AT+CWMODE=2 //AP MODE
AT+CWSAP?    //CEK SSID

AT+CWSAP=”AsepRemote”,””,1,0 //Set SSID
AT+CWDHCP=0,1 //set dhcp

AT+CIPAPMAC=”2c:aa:35:97:d4:7b” //set mac AP

AT+CIPAP? //cek ip
AT+CIPAP=”192.168.4.1″

AT+CIPMUX=1 //Enable multiple connections

AT+CIFSR //cek local ip

AT+CIPSERVER=1,80 //start server

Connection request is here, take a look at id (e.g: +IPD, 0)  –> 0 will be the connection id

AT+CIPSEND=0,40  //0 is the id and 40 is char length

<html><head></head><body>Hello from ESP8266 </body></html>

AT+CIPCLOSE=0  //0 is the ID

 

Arduino Code Example:

 

Another arduino Code Example:

sources: &nbsp
http://allaboutee.com/2015/01/20/esp8266-android-application-for-arduino-pin-control/ &nbsp
https://github.com/espressif/ESP8266_AT/wiki

Memprogram AT89S52 dengan Arduino

Programmer AT89S51 biasanya membutuhkan koneksi serial, namun laptop tidak memiliki port serial. Karena Arduino menggunakan port serial, maka bisa dimanfaatkan menjadi programmer AT89S52.

 

Siapkan arduino dengan kode berikut:

lalu upload ke arduino.

 

Siapkan rangkaian sesuai skema berikut:

 

Lalu gunakan applikasi file uploader untuk upload file

Kalibrasi MPU6050

MPU6050 adalah sensor sudut dan percepatan atau biasa disebut gyrometer. Sama seperti kebanyakan sensor lain, MPU6050 perlu dikalibrasi sebelum digunakan. Kinerja gyrometer ini sangat terpengaruh terhadap suhu, jadi pastikan suhu stabil terlebih dahulu sebelum melakukan proses kalibrasi. Beri jarak waktu antara 3 sampai dengan 5 menit setelah power on agar suhu stabil. Hasil proses kalibrasi pun akan berbeda saat dilakukan di suhu ruangan dibandingkan dengan kalibrasi di luar ruangan. Pastikan dikalibrasi pada suhu ruangan yang sama, atau setidaknya hampir sama, dengan dengan suhu dimana alat akan digunakan.

Berikut kode kalibrasi dari Luis Ródenas denga sedikit modifikasi:

Pastikan sudah melakuan instalasi librari I2Cdev dan MPU6050 dan hubungkan MPU6050 dengan skema berikut

 

Taru MPU6050 pada bidang datar, semisal meja dan jangan digerakkan sampai proses kalibrasi selesai.  Selanjutnya, untuk proses kalibrasi, buka dengan serial monitor dengan baud rate 115200 dan kirimkan satu huruf (bebas) lalu tekan send atau klik tombol enter. Tunggi hingga daftar offset muncul dengan ditandai tulisan ‘Your offsets:’