instruction
stringlengths
40
100
input
stringlengths
136
25.5k
output
stringlengths
207
10.3k
Generate a diagram.json code for Digital Voltmeter
#include <Wire.h> #include <LiquidCrystal_I2C.h> #define POT_PIN A0 LiquidCrystal_I2C lcd(0x27, 16, 2); // Change 0x27 to your LCD I2C address void setup() { lcd.begin(); lcd.print("Voltmeter"); } void loop() { int sensorValue = analogRead(POT_PIN); float voltage = sensorValue * (5.0 / 1023.0); lcd.setC...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "wokwi-arduino-uno", "id": "uno", "top": 0.6, "left": -0.6, "attrs": {} }, { "type": "wokwi-potentiometer", "id": "pot1", "top": -116.5, "left": 86.2, "attrs": {} }, { "type": "wokwi-lcd1602", "id": "lcd1",...
Generate a diagram.json code for Analog joy stick control using arduino-mega
#include <Adafruit_NeoPixel.h> #define PIN 6 // Pin connected to the Data In of the NeoPixel ring #define NUMPIXELS 16 // Number of LEDs in the ring #define JOYSTICK_X A0 // Analog pin connected to the joystick's VRx #define JOYSTICK_Y A1 // Analog pin connected to the joystick's VRy #define JOYSTICK_SW 2 // Digital p...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "wokwi-arduino-mega", "id": "mega", "top": 0, "left": 0, "attrs": {} }, { "type": "wokwi-analog-joystick", "id": "joystick1", "top": -173.4, "left": 168.6, "attrs": {} }, { "type...
Generate a diagram.json code for Digital thermometer using DHT-22 and arduino-uno
#include <Wire.h> #include <LiquidCrystal_I2C.h> #include <DHT.h> #define DHTPIN 2 #define DHTTYPE DHT22 DHT dht(DHTPIN, DHTTYPE); LiquidCrystal_I2C lcd(0x27, 16, 2); // Change 0x27 to your LCD I2C address void setup() { lcd.begin(); dht.begin(); lcd.print("Temp:"); } void loop() { float temp = dht.readTempe...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "wokwi-arduino-uno", "id": "uno", "top": 77.4, "left": -106.2, "attrs": {} }, { "type": "wokwi-dht22", "id": "dht1", "top": -114.9, "left": -24.6, "attrs": {} }, { "type": "wokwi-lcd1602", "id": "lcd1", ...
Generate a diagram.json code for LED Chaser using Arduino-mega
const int ledPins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11}; const int numLeds = sizeof(ledPins) / sizeof(ledPins[0]); void setup() { for (int i = 0; i < numLeds; i++) { pinMode(ledPins[i], OUTPUT); } } void loop() { for (int i = 0; i < numLeds; i++) { digitalWrite(ledPins[i], HIGH); delay(100); // Adjus...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "wokwi-breadboard-mini", "id": "bb1", "top": -135.8, "left": 352.8, "attrs": {} }, { "type": "wokwi-arduino-mega", "id": "mega", "top": 0, "left": 0, "attrs": {} }, { "type": "wokwi-led", "id": "led1", "top": -109.2, "...
Generate a diagram.json code for smart buzzer system using esp-32
#include <IRremote.h> const int irPin = 14; // GPIO pin connected to the IR receiver const int buzzerPin = 13; // GPIO pin connected to the buzzer IRrecv irrecv(irPin); decode_results results; void setup() { irrecv.enableIRIn(); // Start the receiver pinMode(buzzerPin, OUTPUT); // Set buzzer pin as output Seri...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} }, { "type": "wokwi-ir-receiver", "id": "ir1", "top": -97.35, "left": -78.58, "attrs": {} }, { "type": "wokwi-buzzer", "id": "bz1", ...
Generate a diagram.json code for Smart street light using LDR and arduino-uno
const int ldrPin = A0; // Analog pin connected to the LDR const int ledPin = 9; // Digital pin connected to the LED void setup() { pinMode(ledPin, OUTPUT); Serial.begin(9600); } void loop() { int ldrValue = analogRead(ldrPin); // Read the value from the LDR Serial.println(ldrValue); // Print the LDR value to ...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "wokwi-arduino-uno", "id": "uno", "top": 0, "left": 0, "attrs": {} }, { "type": "wokwi-photoresistor-sensor", "id": "ldr1", "top": -92.8, "left": 48.8, "attrs": {} }, { "type": "wokwi-...
Generate a diagram.json code for Touchless door bell using IR flame sensor,arduino-uno,buzzer
// Pin Definitions const int irSensorPin = 2; // Digital pin connected to the IR sensor output const int buzzerPin = 3; // Digital pin connected to the buzzer void setup() { // Initialize the IR sensor pin as an input pinMode(irSensorPin, INPUT); // Initialize the buzzer pin as an output pinMode(buzzerPin, OUT...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "wokwi-arduino-uno", "id": "uno", "top": 29.4, "left": -0.6, "attrs": {} }, { "type": "wokwi-flame-sensor", "id": "led1", "top": -81.8, "left": -16.6, "attrs": { "color": "red" } }, { ...
Generate a diagram.json code for Gas Leakage Detector – Gas Sensor + Buzzer + ESP32 Devkit V1
// Define the pin connections const int gasSensorPin = A0; // Analog pin connected to the gas sensor's AO const int buzzerPin = 13; // Digital pin connected to the buzzer void setup() { // Initialize the gas sensor pin as an input pinMode(gasSensorPin, INPUT); // Initialize the buzzer pin as an output pinMode(...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 38.4, "left": 14.44, "attrs": {} }, { "type": "wokwi-gas-sensor", "id": " ", "top": -74.1, "left": -31.4, "attrs": { "color": "red" } }, ...
Generate a diagram.json code for Gesture-Controlled LED Strip – MPU6050 + NeoPixel + Arduino Nano
#include <Wire.h> #include <Adafruit_NeoPixel.h> #include <MPU6050.h> // Pin definitions #define NEOPIXEL_PIN 6 // Data pin for NeoPixel #define NUMPIXELS 16 // Number of LEDs in the NeoPixel strip // Initialize the NeoPixel object Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUMPIXELS, NEOPIXEL_PIN, NEO...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "wokwi-arduino-nano", "id": "nano", "top": 0, "left": 0, "attrs": {} }, { "type": "wokwi-mpu6050", "id": "imu1", "top": -101.78, "left": 31.12, "attrs": {} }, { "type": "wokwi-led-ring", "id": "ring1", ...
Generate a diagram.json code for Obstacle Avoidance Robot – HCSR04 + Stepper Motor + ESP32 Devkit V1
// Include necessary libraries #include <Wire.h> // Define pin connections const int trigPin = 12; // GPIO pin connected to the HC-SR04 Trig pin const int echoPin = 14; // GPIO pin connected to the HC-SR04 Echo pin const int stepPin = 26; // GPIO pin connected to the A4988 STEP pin const int dirPin = 25; // GPIO ...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 28.8, "left": 14.44, "attrs": {} }, { "type": "wokwi-hc-sr04", "id": "ultrasonic1", "top": -104.1, "left": -52.1, "attrs": {} }, { "type": "wokwi-stepper-motor", ...
Generate a diagram.json code for WiFi Weather Dashboard – ESP32 Devkit V1 + DHT22 + SSD1306
#include <Wire.h> #include <Adafruit_SSD1306.h> #include <Adafruit_GFX.h> #include <DHT.h> #include <WiFi.h> // OLED display dimensions #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 // Declaration for SSD1306 display connected using I2C (SDA, SCL) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); ...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} }, { "type": "wokwi-dht22", "id": "dht1", "top": -114.9, "left": -82.2, "attrs": {} }, { "type": "board-ssd1306", "id": "oled1", ...
Generate a diagram.json code for IoT Home Security System– PIR Motion Sensor + Buzzer + ESP32
// Define the pin connections const int pirPin = 13; // GPIO pin connected to the PIR sensor output const int buzzerPin = 12; // GPIO pin connected to the buzzer void setup() { // Set up the PIR sensor pin as an input pinMode(pirPin, INPUT); // Set up the buzzer pin as an output pinMode(buzzerPin, OUTPUT); /...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 249.6, "left": 216.04, "attrs": {} }, { "type": "wokwi-pir-motion-sensor", "id": "pir1", "top": 138.4, "left": 50.22, "attrs": {} }, { "type": "wokwi-buzzer", ...
Generate a diagram.json code for IoT-Based Step Counter – MPU6050 + OLED SSD1306 + ESP32 Devkit V1
#include <Wire.h> #include <Adafruit_SSD1306.h> #include <Adafruit_GFX.h> #include <MPU6050.h> // OLED display dimensions #define SCREEN_WIDTH 128 #define SCREEN_HEIGHT 64 // Declaration for SSD1306 display connected using I2C (SDA, SCL) Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); // MPU6050 se...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 4.84, "attrs": {} }, { "type": "wokwi-mpu6050", "id": "imu1", "top": -34.58, "left": -84.08, "attrs": {} }, { "type": "board-ssd1306", "id": "oled1"...
Generate a diagram.json code for Soil moisture measurement using esp32
// Define pin connections const int soilMoisturePin = 36; // GPIO pin connected to the Soil Moisture Sensor's AO void setup() { // Start serial communication for debugging purposes Serial.begin(115200); // Initialize the soil moisture sensor pin as an input pinMode(soilMoisturePin, INPUT); } void loop() { /...
{ "version": 1, "author": "Vigneshwaran", "editor": "wokwi", "parts": [ { "type": "board-esp32-devkit-c-v4", "id": "esp", "top": 0, "left": 0, "attrs": {} }, { "type": "chip-soil-moisture-sensor", "id": "chip1", "top": -66.18, "left": -62.4, "attrs": {} } ], "connec...