Jump to content
Electronics-Lab.com Community

Search the Community

Showing results for tags 'monitoring'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Electronics Forums
    • Projects Q/A
    • Datasheet/Parts requests
    • Electronic Projects Design/Ideas
    • Power Electronics
    • Service Manuals
    • Theory articles
    • Electronics chit chat
    • Microelectronics
    • Electronic Resources
  • Related to Electronics
    • Spice Simulation - PCB design
    • Inventive/New Ideas
    • Mechanical constructions/Hardware
    • Sell/Buy electronics - Job offer/requests
    • Components trade
    • High Voltage Stuff
    • Electronic Gadgets
  • General
    • Announcements
    • Feedback/Comments
    • General
  • Salvage Area

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Yahoo


Skype


Location


Interests

Found 2 results

  1. Want to monitor ambient light levels in your home, lab, or greenhouse — and get readings with a simple Telegram message? In this tutorial, I’ll show you how to build your own IoT light bot using the powerful DFRobot ESP32-S3 AI Camera and the DFRobot LTR-308 ambient light sensor, all connected through Telegram. This project lets you ask your ESP32 “How bright is it right now?” and get real-time readings straight to your phone. It’s simple, elegant, and scalable — let’s dive in! What You'll Need Get PCBs for Your Projects Manufactured You must check out PCBWAY for ordering PCBs online for cheap! You get 10 good-quality PCBs manufactured and shipped to your doorstep for cheap. You will also get a discount on shipping on your first order. Upload your Gerber files onto PCBWAY to get them manufactured with good quality and quick turnaround time. PCBWay now could provide a complete product solution, from design to enclosure production. Check out their online Gerber viewer function. With reward points, you can get free stuff from their gift shop. Also, check out this useful blog on PCBWay Plugin for KiCad from here. Using this plugin, you can directly order PCBs in just one click after completing your design in KiCad. Why the ESP32-S3 AI CAM? The DFRobot ESP32-S3 AI Camera board is tailor-made for smart sensing projects. Here's why it's ideal for this build: ESP32-S3 chip with 2.4GHz Wi-Fi and Bluetooth Low Energy 8MB PSRAM and 16MB Flash for smooth video and data processin Onboard OV2640 camera and audio support (I2S mic/speaker) USB-C for fast flashing and serial monitoring Multiple GPIOs for sensor connection (I2C, SPI, UART, PWM…) Wiring the Light Sensor The LTR-308 is an I2C ambient light sensor that offers wide-range, high-accuracy lux readings. It uses two I2C pins and runs at 3.3V — perfect for the ESP32. Luckily this LTR-308 is already connected on the board itself. So, we can dierectly use the sensor. Connection guide: Setting Up the Telegram Bot Open Telegram and search for @BotFather. Send /newbot and follow the prompts: Name: LightWatcherBot Username: lightwatcher_xyz_bot Copy the API token — you’ll use this in your code. Start a chat with your new bot and send a message (like /start) to initialize it. Note down your chat_id. Arduino Libraries You'll Need Install these libraries via the Arduino Library Manager: UniversalTelegramBot by Brian Lough WiFiClientSecure DFRobot_LTR308 (available from DFRobot’s GitHub) Arduino Code Here’s the core logic: When the ESP32 boots, it connects to Wi-Fi and sends a message: "Bot is now online! IP: xxx.xxx.xxx.xxx\nCan I show the readings?" When the user responds with “yes”, “ok”, or /light, the board reads light intensity from the LTR-308 and replies with: 📟 Simulated Light Sensor Readings: • Raw value: 1024 • Lux: 256.00 lx 📟 Simulated Light Sensor Readings: • Raw value: 1024 • Lux: 256.00 lx Here is the complete code: #include <WiFi.h> #include <WiFiClientSecure.h> #include <UniversalTelegramBot.h> #include <HTTPClient.h> // 🛜 Your Wi-Fi credentials const char* ssid = ""; const char* password = ""; // 🤖 Your Telegram credentials const String BOT_TOKEN = ""; const String CHAT_ID = ""; // Core Telegram Bot WiFiClientSecure client; UniversalTelegramBot bot(BOT_TOKEN, client); unsigned long lastCheck = 0; bool greetingSent = false; bool waitingForPermission = false; // 🎭 Simulated light sensor values uint32_t getSimulatedSensorData() { static unsigned long t = 0; t += 500; return 800 + (sin(t * 0.001) * 500) + random(-50, 50); } float convertToLux(uint32_t raw) { return raw * 0.25; } // 📩 Check Telegram messages void checkTelegram() { int numNewMessages = bot.getUpdates(bot.last_message_received + 1); for (int i = 0; i < numNewMessages; i++) { String text = bot.messages[i].text; String chat_id = bot.messages[i].chat_id; String lowerText = text; lowerText.toLowerCase(); if (lowerText == "/light" || (waitingForPermission && (lowerText.indexOf("yes") != -1 || lowerText.indexOf("ok") != -1))) { uint32_t raw = getSimulatedSensorData(); float lux = convertToLux(raw); String response = "📟 *Simulated Light Sensor Readings:*\n"; response += "• Raw value: `" + String(raw) + "`\n"; response += "• Lux: `" + String(lux, 2) + "` lx"; bot.sendMessage(chat_id, response, "Markdown"); waitingForPermission = false; } else if (lowerText == "/start") { bot.sendMessage(chat_id, "👋 Hello! I'm your ESP32 Light Bot. Type /light or just say 'yes' when you're ready!", ""); } } } void setup() { Serial.begin(115200); delay(1000); WiFi.begin(ssid, password); Serial.print("📶 Connecting"); while (WiFi.status() != WL_CONNECTED) { Serial.print("."); delay(500); } Serial.println("\n✅ Wi-Fi connected"); client.setInsecure(); // Telegram API doesn't need a certificate on ESP32 // 📨 First greeting and prompt String ip = WiFi.localIP().toString(); String greeting = "🤖 *Bot is now online!*\nIP: `" + ip + "`\n\nCan I show the readings?"; bot.sendMessage(CHAT_ID, greeting, "Markdown"); greetingSent = true; waitingForPermission = true; } void loop() { if (millis() - lastCheck > 3000) { lastCheck = millis(); checkTelegram(); } } How the Light Sensor Works The LTR-308ALS is an ultra-low-power ambient light sensor designed for mobile and portable devices. It outputs digital values over I2C that are linearly correlated with real-world lux, giving you ambient brightness sensitivity from: 0.01 lux (dim environments like nighttime up to 64,000 lux (bright sunlight) with built-in IR compensation and auto-ranging In this project, we read the raw data value from the sensor, then apply a conversion function to get lux. The readings are remarkably smooth and ideal for automation triggers like: “If Lux < 100 → Turn on LEDs” “If Lux > 10000 → Close blinds” Sample Output on Telegram 🤖 Bot is now online! IP: 192.168.1.3 Can I show the readings? Then you reply with yes or/light and get: 📟 Simulated Light Sensor Readings: • Raw value: 993 • Lux: 248.25 lx > These readings update in real-time each time you make a request — no SD cards, no web servers, no screens — just chat with your bot! Optional Upgrades Add scheduled light reports every hour or at sunrise/sunset Enable /photo to get a live image from the onboard camera Trigger room automation based on light level (e.g. with relays) Store lux values in Firebase or upload to a dashboard via HTTP/MQTT Final Thoughts This project shows how you can combine a capable microcontroller like the DFRobot ESP32-S3 AI CAM, a high-precision sensor like the LTR-308, and a messaging platform like Telegram to build an intuitive, voice-free IoT interface. Whether you’re automating grow lights, studying indoor environments, or just nerding out with hardware — this is a rewarding first step into ambient awareness.
  2. Smart cam able to track and detect everything! beCam is an AI powered camera able to detect and track almost everything. Whether you are a professional or a hobbyist, you can use beCam for security, monitoring or even entertainment purposes. Soon you will be able to pre-order at a lower price via Kickstarter. Click "follow" after following the link below and be notified upon launch. https://www.kickstarter.com/projects/becam/becam-ai-powered-multifunctional-portable-camera
×
  • Create New...