Hallo sobat Arduino Indonesia, pada kesempatan kali ini , kami akan berbagi tutorial bagaimana membuat alat pewaktu cuci tangan selama 20 detik dengan menggunakan servo sebagai indikatornya.
Alat ini bekerja jika tangan kita berada di dekat ultrasonic dengan jarak kurang dari 10 cm, maka servo akan bekerja counting selama 20 detik.
Bahan yang di butuhkan
• Arduino Uno • Sensor ultrasonic (untuk kali ini saya menggunakan SRF05) • Mini Servo • Projectboard • Kabel Jumper
Adapun skema rangkaiannya sebagai berikut
Untuk programmingnya adalah sebagai beriku, sebelumnya jangan lupa di masukkan library NewPing terlebih dahulu, baru di program.
Hallo Sobat Arduino Indonesia, di video diatas adalah merupakan salah satu inovasi yang mungkin bisa di aplikasikan pada kondisi saat ini yaitu pandemi covid 19, walaupun sekarang sudah masuk ke new normal, akan tetapi pencegahan virus covid 19 harus tetap dari sendiri, kita tau bahwa penularan covid 19 bisa terjadi lewat mukosa atau lewat hidung mata dan mulut. Kita sendiri paling sering menyentuh ke tiga bagian tubuh tersebut.
Maka dari itu kami membuat inovasi untuk peringatan dini ketika akan menyentuh mulut hidung dan mata.
Bahan yang di butuhkan antara lain,
- Arduino nano
- Sensor ultrasonic hcsr04
- Buzzer
- Potensiometer
- Batere 9v dan konektor baterenya
Arduino nano disini debagai otak dari alat ini, kemudian sensor ultrasonic untuk mendeteksi jarak tertentu, buzzer sebagai bunyi peringatan dan potensiometer sebagai pengatur jarak tertentu.
Tentukan pin pin yang akan di pakai untuk alat ini
sensor ultrasonic, sensor ultrasonic mempunyai 4 pin, yaitu vcc, ground, trigger dan echo. Untuk trigger kami menyambungkan dengan pin 6, Echo disambung ke pin 7.
buzzer mempunyai 2 pin yaitu pin positif dan pin negatif, untuk positif sambung ke pin 5 dan negatif sambung ke gnd
potensiometer, karena kami menyambungkan dengan pin Analog 1.
Nah setelah ditentukan, mari kita wiring ke board (pcb lobang-lobang) atau ke pcb yang sudah di desain sendir.
Berikut untuk pemrograman
yang perlu dilakukan sebelumnya adalah upload library new ping
Hallo Sobat Arduino Indonesia, Pada kali ini kami akan berbagai tutorial untuk membuat Scroll text atau running text atau tulisan berjalan pada TFT LCD 1.8" dengan menggunakan arduino Uno
TFT LCD (Thin film transistor liquid crystal display) adalah varian dari Liquid Crystal Display (LCD) yang menggunakan Transistor Film Tipis (TFT) teknologi untuk meningkatkan kualitas gambar seperti addressability dan kontras. TFT LCD matriks aktif LCD, berbeda dengan matriks pasif LCD atau sederhana, tampil dengan LCD dalam beberapa segmen.
TFT LCD digunakan dalam peralatan termasuk televisi, monitor komputer, ponsel, video game portabel, PDA/Tablet, sistem navigasi dan proyektor.
Adapun bahan yang dibutuhkan adalah sebagai berikut :
Arduino Uno
TFT 1.8"
Kabel Jumper male to male
Projectboard
Library yang di butuhkan dalam pemrograman ini
Adafruit_GFX
Adafruit_ST7735
Untuk wiring adalah sebagai berikut
Coding untuk scroll text / tulisan berjalan / running text sebagai berikut :
#include <Adafruit_GFX.h> // Include core graphics library
#include <Adafruit_ST7735.h> // Include Adafruit_ST7735 library to drive the display
#include <fonts/FreeSans9pt7b.h>
#include <fonts/FreeSans12pt7b.h>
#include <fonts/FreeSans18pt7b.h>
#include <fonts/FreeSans24pt7b.h>
// Declare pins for the display:
#define TFT_CS 10
#define TFT_RST 8 // You can also connect this to the Arduino reset in which case, set this #define pin to -1!
#define TFT_DC 9
// The rest of the pins are pre-selected as the default hardware SPI for Arduino Uno (SCK = 13 and SDA = 11)
#define BLACK 0x0000
#define BLUE 0x001F
#define RED 0xF800
#define GREEN 0x07E0
#define CYAN 0x07FF
#define MAGENTA 0xF81F
#define YELLOW 0xFFE0
#define WHITE 0xFFFF
#include <Fonts/FreeSerif18pt7b.h> // Add a custom font
int Variable1; // Create a variable to have something dynamic to show on the display
void setup() // Start of setup
{
// Display setup:
// Use this initializer if you're using a 1.8" TFT
tft.initR(INITR_BLACKTAB); // Initialize a ST7735S chip, black tab
tft.fillScreen(ST7735_BLACK); // Fill screen with black
//tft.setRotation(0); // Set orientation of the display. Values are from 0 to 3. If not declared, orientation would be 0,
// which is portrait mode.
tft.setTextWrap(false); // By default, long lines of text are set to automatically “wrap†back to the leftmost column.
// To override this behavior (so text will run off the right side of the display - useful for
// scrolling marquee effects), use setTextWrap(false). The normal wrapping behavior is restored
// with setTextWrap(true).
tft.setTextColor(ST7735_WHITE); // White on black
tft.setTextSize(5); // large letters
tft.setRotation(1); // horizontal display
//tft.println("Hello");
Halo Sobat Arduino, Barusan saya post di video tentang bagaimana cara mengambil data dari website penyedia API untuk sebaran pasien COVID-19 di Indonesia.
Kalau belum lihat videonya, berikut videonya
Oke bahan yang di butuhkan adalah sebagai berikut :
ESP8266 Modul IOT
OLED 1.3"
Kabel Jumper
Projectboard
Susun Seperti berikut ini
Dengan susunan pin sebagai berikut :
OLED --> ESP8266
GND -- GND
VCC -- 3V3
SCL -- D1
SDA -- D2
Untuk API nya bisa registrasi dahulu du web berikut
Serial.begin(115200); //Starting Serial Communication
WiFi.disconnect(true); //Disconecting the WiFi if we are previouly connected.
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64 | You can change this to 0x3C if your display doesn't work
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed, loop forever
}
//Intro Page - Change according to your needs
display.clearDisplay();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(40, 0);
display.println("DATA");
display.setCursor(20, 20);
display.println("SEBARAN");
display.setTextSize(2);
display.setCursor(5, 40);
display.println("INDONESIA"); // display Country name
display.display();
delay(2000);
WiFi.begin(ssid, password); // Connecting to the WiFi
while (WiFi.status() != WL_CONNECTED) { //Wait till we are connected
animate_oled_wifi(); // Animate it on the Screen
}
display.clearDisplay();
display.display(); //update the display
Serial.println("Connected to the WiFi network");
// Initialize a NTPClient to get time
timeClient.begin();
// Set offset time in seconds to adjust for your timezone, for example:
// GMT +1 = 3600
// GMT +8 = 28800
// GMT -1 = -3600
// GMT 0 = 0
timeClient.setTimeOffset(0);
}
if ((WiFi.status() == WL_CONNECTED)) { //Check the current connection status
HTTPClient http;
http.begin("http://covid.vinteq.in/api/get_data/?country=Indonesia"); //Specify the URL - You can change th country name as per your need to get the country specific data
http.addHeader("auth-key", "authnya dimasukkin sini"); //Insert your Auth-key here in quotes (as String)
int httpCode = http.GET(); //Make the request
if (httpCode > 0) { //Check for the returning code
String payload = http.getString();
// Serial.println(payload); //Print the Payload received
// Parse JSON object
DeserializationError error = deserializeJson(doc, payload);
if (error)
{
Serial.print(F("deserializeJson() failed: "));
Serial.println(error.c_str());
return;
}
root = doc.as<JsonObject>(); //Mapping the data to Json Object
}
http.end(); //Free the resources
}
// Handle the Data
for (JsonPair kv : root) {
if (String(kv.key().c_str()) == "history")
{
HISTORY = kv.value().as<String>();
}
}
//Removing Brackets
HISTORY = HISTORY.substring(0, HISTORY.length() - 1);
HISTORY = HISTORY.substring(1);
// Serial.println(HISTORY);
//We need the latest data - the first one
String DATA = HISTORY.substring(0, HISTORY.indexOf('}') + 1);
// Serial.println(DATA);
DynamicJsonDocument sub_doc(DATA.length() * 2);
DeserializationError error = deserializeJson(sub_doc, DATA); //Converting the Extracted Nested Data from String to Json
root = sub_doc.as<JsonObject>();
for (JsonPair kv : root)
{
//Finding specific keys and extracting their values in varibales
if (String(kv.key().c_str()) == "active_cases")
{
ACTIVE_CASES = kv.value().as<String>() ;
}
if (String(kv.key().c_str()) == "recovered_cases")
{
RECOVERED_CASES = kv.value().as<String>() ;
}
if (String(kv.key().c_str()) == "total_cases")
{
TOTAL_CASES = kv.value().as<String>() ;
}
if (String(kv.key().c_str()) == "deaths")
{
DEATHS = kv.value().as<String>();
}
}
getdate();
/*
This is the display rountine
What it does:
Shows the above extracted data on the OLED Display
Loops again as we need ot to display the same data for 1 minute before new data is fetched (You can change it according to your need)
dealy of 5 seconds x 4 display values = 20 seconds per loop - Repeating for 3 Times = 60 Seconds ~ 1 Minute
*/
for (byte i = 0; i < 3; i++)
{
display.clearDisplay();
display.setTextSize(2);
display.setCursor(8, 0);
display.println("INDONESIA");
display.setCursor(15, 25);
display.setTextSize(2);
display.println("COVID-19");
display.setCursor(30, 50);
display.setTextSize(1);
display.println(currentDate);
display.display();
delay(5000);
// Serial.println(ACTIVE_CASES);
// display.clearDisplay();
// display.setTextSize(2);
// display.setCursor(0, 0);
// display.println("ACTIVE:");
// display.setCursor(0, 30);
// display.setTextSize(3);
// display.println(ACTIVE_CASES);
// display.display();
// delay(5000);
// Serial.println(RECOVERED_CASES);
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0, 0);
display.println("SEMBUH:");
display.setCursor(0, 30);
display.setTextSize(3);
display.println(RECOVERED_CASES);
display.display();
delay(5000);
// Serial.println(DEATHS);
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0, 0);
display.println("MENINGGAL:");
display.setCursor(0, 30);
display.setTextSize(3);
display.println(DEATHS);
display.display();
delay(5000);
// Serial.println(TOTAL_CASES);
display.clearDisplay();
display.setTextSize(2);
display.setCursor(0, 0);
display.println("POSITIF:");
display.setCursor(0, 30);
display.setTextSize(3);
display.println(TOTAL_CASES);
display.display();
delay(5000);
}
}
Halo sobat Arduino Indonesia, gencar gencarnya cuci tangan pada saat ini guna menaggulangi virus corona atau covid-19. kami sendiri yang sering lupa untuk cuci tangan ketika masuk rumah, berinisiatif untuk membuat alat yang bisa membantu mengingatkan buat cuci tangan.
Bahan-bahan yang diperlukan adalah sebagai berikut :
Arduino nano
Sensor ultrasonic
Mp3 Player (DFPlayer mini)
Speaker
Breadboard
Kabel Jumper
untuk penyusunan pengkabelan bisa di lihat di video berikut :
Coding untuk Project Alat pencuci tangan Otomatis adalah sebagai berikut :
/* * Alat Cuci Tangan Otomatis * Sekolah Robot Indonesia */ #include "Arduino.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
#include <NewPing.h>
#define TRIGGER_PIN 6 // Arduino pin tied to trigger pin on the ultrasonic sensor.
#define ECHO_PIN 7 // Arduino pin tied to echo pin on the ultrasonic sensor.
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm.
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance.
SoftwareSerial mySoftwareSerial(4, 2); // RX, TX
DFRobotDFPlayerMini myDFPlayer;
void printDetail(uint8_t type, int value);
int data = 0;
void setup() {
mySoftwareSerial.begin(9600);
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results.
Serial.println();
Serial.println(F("DFRobot DFPlayer Mini Demo"));
Serial.println(F("Initializing DFPlayer ... (May take 3~5 seconds)"));
if (!myDFPlayer.begin(mySoftwareSerial)) { //Use softwareSerial to communicate with mp3.
Serial.println(F("Unable to begin:"));
Serial.println(F("1.Please recheck the connection!"));
Serial.println(F("2.Please insert the SD card!"));
while(true){
delay(0); // Code to compatible with ESP8266 watch dog.
}
}
Serial.println(F("DFPlayer Mini online."));
myDFPlayer.volume(30); //Set volume value. From 0 to 30
myDFPlayer.play(1); //Play the first mp3
}
void loop() {
delay(50); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
static unsigned long timer = millis();
Serial.print("Ping: ");
Serial.print(sonar.ping_cm()); // Send ping, get distance in cm and print result (0 = outside set distance range)
Serial.println("cm");
if(sonar.ping_cm()>1 && sonar.ping_cm() <6)
{
if (millis() - timer > 4500) {
timer = millis();
myDFPlayer.next(); //Play next mp3 every 3 second.
}
}
}
Sensor suhu contactless atau bisa kita sebut sensor suhu thermogun sekarang ini sangat langka, dan mahal harganya. maka dari itu kami dari Sekolah Robot Indonesia membuat produk baru dan dijadikan tutorial membuat sensor suhu contactless yang terhubung langsung dengan smartphone.
adapun langkah langkah pembuatannya bisa dilihat di youtube