Sunday, June 10, 2018

SG90 / MG90S / MG995 Tutorial

Arduino IDE Reference:

https://www.arduino.cc/en/Reference/servo



Sample Code for Arduino:

GND - GND

Vcc - 5V

Orange - D9




Friday, June 8, 2018

Analog / Digital Sample Code

Sample Code for Arduino using Any Analog / Digital Sensor



Because all analog input sensor use 0-1023 to represent data between 0V - 5V (or 3.3V), digital sensor use threshold level,

these code simply display the value it reads into serial monitor and LCD 1602 I2C display.



Connect

  • Vcc - 5V

  • GND   - GND

  • A0 - A0

  • D0 - D1   (Don't use D0 Pin in Arduino, otherwise "avrdude stk500_getsync() not in sync resp=0x30" error occured)



Code To Display Using Serial Monitor:






Thursday, June 7, 2018

MQ Sensor Sample Code

MQ Sensor Sample Code for Arduino





MQ-2 煙霧氣敏傳感器 (甲烷/液化氣/可燃氣體)

MQ-3 酒精乙醇傳感器模塊 酒精氣敏檢測報警

MQ-4 天然氣、甲烷傳感器模塊

MQ-5 液化氣 天然氣 城市煤氣傳感器模塊 氣體傳感器

MQ-6 丙烷 / 丁烷 / 液化氣傳感器模塊

MQ-7 一氧化碳 / 氣敏傳感器檢測報警模塊

MQ-8 氫氣傳感器檢測報警模塊

MQ-9 一氧化碳 可燃氣體傳感器檢測報警模塊

MQ-135 空氣質量傳感器模塊 有害氣體檢測傳感器報警模塊 空氣污染



Connect

  • Vcc - 5V

  • GND   - GND

  • A0 - A0



Code To Display Using Serial Monitor:






Code To Display Using I2C LCD 1602