How to save sensor output from ESP8266 to MySQL Database (Part 1 – ESP8266 as a Microcontroller)

Today we’re going to learn how to connect ESP8266 to website that store the inputs to MySQL.

To help you, I have created the example website here. This tutorial focuses on storing the sensor output to website, while providing the website that already works. Next part would be building the website itself.

This tutorial uses ESP8266 as a microcontroller, for example NodeMCU and Wemos D1.

Wemos D1
NodeMCU

Code example on PasteBin.

  • Example above are modification of examples “Blink” in Arduino IDE. It will report to website when the LED is on and off every 1 second.
  • Make sure you also copy the include part if you’re going to use part of this program somewhere else.
  • Remember to change the SSID and Password to your wifi settings.
  • If you’re already connected, serial monitor will report your IP.
  • Notice the inputweb() function.
    • Usage : inputweb(identifier,sensor1,sensor2,sensor3,sensor4,sensor5,sensor6,char1,char2,char3)
    • identifier can be used to identify our input. This is public web, so think about something unique.
    • On the page ESP8266 Project Test, you can search your identifier using the search box above.
    • http://project.rinaldo.id/esp8266/input.php? can be replaced later. But we’re not going to build the website now. This tutorial focuses on building the microcontroller that sends output successfully to the website.
    • We’re using GET method to input to the website.
    • sensor1 to sensor6 receives input in decimal format. If you’re not going to use it, just replace it with zero, and the char part using empty quotes. Example : : inputweb("rinaldo.id",analogRead(A0),0,0,0,0,0,"","","");
    • this function can be used in other program, receiving proper variables. That’s why we’re making it into function.
Share

How to use 16×2 LCD with I2C on Arduino and Wemos

After we discussed how to install drivers and additional tool tools for Wemos Uno here, this time we will discuss how to program LCD in Arduino and Wemos.

It seems, this Eid Mubarak holiday will be wasted by writing tutorials.

Continue reading How to use 16×2 LCD with I2C on Arduino and Wemos

Share

WeMos D1 R3 Wifi Arduino Uno Compatible – Driver Installation and IDE

WeMos D1 is an IoT board that is compatible with Arduino Uno … they said. I bought this from Tokopedia for Rp 74,000 (approx US $ 6), and looks not too shabby.

Continue reading WeMos D1 R3 Wifi Arduino Uno Compatible – Driver Installation and IDE

Share

Laporan Praktikum Sistem Embedded Modul ARDX CIRC-03 – Transistor dan Motor

Apa yang kita lakukan 

Pin arduino bisa mengendalikan benda elektronik kecil seperti LED. Tapi, ketika bermain dengan sesuatu yang lebih besar (seperti motor mainan atau mesin cuci), kita perlu transistor external. Transistor berguna untuk menyambung dan memutus arus besar dengan arus yang kecil. Sebuah transistor punya 3 pin. Untuk transistor negatif (NPN), kamu menghubungkan load ke connector dan emitter ke ground. Lalu ketika arus kecil mengalir dari base ke emitter, arus akan mengalir dari transistor dan motor akan hidup (ketika pin Arduino disetel sebagai HIGH). Ada banyak jenis transistor, yang memungkinkan setiap situasi punya solusi tersendiri. Kita menggunakan transistor P2N2222AG. Alasannya adalah karena maksimum voltage (40v) dan maksimum arus (200 mA) sudah cukup besar untuk motor kita. (lebih lanjut ada di datasheet http://ardx.org/2222)

Continue reading Laporan Praktikum Sistem Embedded Modul ARDX CIRC-03 – Transistor dan Motor

Share

Laporan Praktikum Sistem Embedded Modul ARDX CIRC-09 – Foto resistor

Apa yang kita lakukan?

Mendapatkan inputan dari potensiometer bisa berguna untuk eksperimen yang dikendalikan manusia, tapi gimana kalau kita mau eksperimen yang dikendalikan lingkungan? Kita menggunakan prinsip yang hampir sama, tapi dibandingkan menggunakan potensiometer, kita pakai photo resistor (light dependent resistor / sensor cahaya). Arduino gak bisa merasakan resistansi langsung (dia merasakan voltage), jadi kita membuat voltage divider. 

Continue reading Laporan Praktikum Sistem Embedded Modul ARDX CIRC-09 – Foto resistor

Share

Instagram Video June 08, 2017 at 08:17AM

Next: Roland D-BEAM imitation using Passive Infrared Sensor, over MIDI.
#ArduinoUno #Arduino #IamPCRyourenext #ARDX #Controllerism #RolandSynth @arduinoorg @arduino.cc @roland_us

Video URL

Share

How much current can I draw from the Arduino’s pins?

What’s the maximum amount of current which I can draw from each of the Arduino’s pins without tripping any of the internal fuses? Is there a limit per pin as well as an overall limit for the whole board?

This is a bit complex. Basically, there are a number of limiting factors.

Continue reading How much current can I draw from the Arduino’s pins?

Share

Laporan Praktikum Sistem Embedded Modul 14 – Studi kasus LED (Arduino)

TUJUAN

Mahasiswa mampu mengimplementasikan animasi LED menggunakan Arduino

Continue reading Laporan Praktikum Sistem Embedded Modul 14 – Studi kasus LED (Arduino)

Share