Jump to content
Electronics-Lab.com Community

Search the Community

Showing results for tags 'bluetooth'.

  • 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 6 results

  1. Hey there, future Bluetooth Jedi! 🌟 Welcome to an electrifying project where we combine the magic of Web Bluetooth, the flashy brilliance of NeoPixels, and the awesome power of the Seeed Studio Xiao nRF52840 Sense. By the end of this journey, you'll be able to control a strip of NeoPixels right from your web browser. Yep, no more complicated apps or cables—just pure wireless awesomeness. 🎮✨ So, grab your soldering iron, a cup of coffee (or tea ☕), and let’s light things up! 🛠️ What You’ll Need: Before we dive into code and soldering, let's check if you have all the necessary gadgets to make this magic happen! 1. Seeed Studio Xiao nRF52840 Sense ⚡ Why this? It’s like a pocket-sized superhero! 💪 It's BLE-capable, has a built-in IMU, microphone, and is powered by the ARM Cortex-M4 processor. Small but mighty! 2. NeoPixel LED Strip 🌈 These RGB LEDs are the stars of our show. They can display millions of colors and are individually addressable. We’ll be using them to dazzle our friends (or just our cat 🐱). 3. Web Browser with Bluetooth Support 🌐 For this project, we need a web browser that supports Web Bluetooth API. Chrome, Edge, or Chromium-based browsers are perfect. Sorry, Firefox lovers... you'll have to switch sides for this one! 😅 4. Jumper Wires, Soldering Kit, and USB-C Cable 🔌 Standard build-essentials. These will help you hook up everything without blowing things up (which we totally don’t want). 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. Step 1: Setting Up Your Xiao nRF52840 Sense 📦 First, we need to make sure your Xiao is ready for action. Time to upload some code! Install the Development Environment: Install Arduino IDE from the official website if you already have it. Next, install the Seeed nRF52 boards in Arduino: Go to File > Preferences. Add this URL to Additional Boards Manager URLs: https://files.seeedstudio.com/arduino/package_seeeduino_boards_index.json Now head to Tools > Board > Boards Manager, search for Seeed nRF52 and install the package. Install Libraries: You’ll need to grab a couple of libraries to work with NeoPixels and BLE: Adafruit NeoPixel Library (to handle our shiny lights 💡) ArduinoBLE Library (for Bluetooth communication) Head to Tools > Manage Libraries and search for these to install them. Step 2: Wiring it Up 🧑‍🔧🔌 Alright, it's time to connect the Xiao to the NeoPixel strip. Don’t worry, this part is easier than figuring out which wire your headphones use! 🎧 Connect the NeoPixels to Xiao: Power (VCC): Connect this to the 3.3V pin on the Xiao. Ground (GND): GND to GND (these two are like peanut butter and jelly 🥪—inseparable). Data In (DIN): Hook this up to Pin D0 on the Xiao. Everything wired up? Awesome! Now the fun begins. 🧙‍♂️✨ Step 3: Code Time! ⌨️💻 Let's dive into the code that will make your Xiao and NeoPixels dance to your commands (remotely via Bluetooth!). 🕺💃 Here's the plan: The Xiao will advertise itself as a Bluetooth device. Your browser (with Web Bluetooth) will connect to it and control the NeoPixel strip by sending color commands Here's the Arduino Sketch: #include <ArduinoBLE.h> #include <Adafruit_NeoPixel.h> #define NEOPIXEL_PIN 0 #define NUM_PIXELS 64 Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_PIXELS, NEOPIXEL_PIN, NEO_GRB + NEO_KHZ800); BLEService ledService("19b10000-e8f2-537e-4f6c-d104768a1214"); BLEByteCharacteristic ledCharacteristic("19b10001-e8f2-537e-4f6c-d104768a1214", BLEWrite | BLERead); void setup() { Serial.begin(115200); if (!BLE.begin()) { Serial.println("starting BLE failed!"); while (1); } BLE.setLocalName("XIAO-LED"); BLE.setAdvertisedService(ledService); ledService.addCharacteristic(ledCharacteristic); BLE.addService(ledService); ledCharacteristic.writeValue(0); strip.begin(); strip.show(); BLE.advertise(); Serial.println("Bluetooth device active, waiting for connections..."); } void loop() { BLEDevice central = BLE.central(); if (central) { Serial.print("Connected to central: "); Serial.println(central.address()); while (central.connected()) { if (ledCharacteristic.written()) { uint8_t ledState = ledCharacteristic.value(); if (ledState == 1) { digitalWrite(LED_BUILTIN, HIGH); // Turn LED on for (int i = 0; i < NUM_PIXELS; i++) { strip.setPixelColor(i, strip.Color(255, 255, 255)); strip.show(); } } else { digitalWrite(LED_BUILTIN, LOW); // Turn LED off for (int i = 0; i < NUM_PIXELS; i++) { strip.setPixelColor(i, strip.Color(0, 0, 0)); strip.show(); } } } } Serial.print("Disconnected from central: "); Serial.println(central. Address()); } } What Does This Code Do? 🧐 BLE Advertising: Your Xiao advertises itself as "NeoPixelController" via Bluetooth. BLE Service: We create a custom Bluetooth service that listens for commands (color changes) from a web browser. NeoPixel Control: Based on the color data sent by the browser, the NeoPixel LEDs change colors accordingly. Step 4: Build the Web Bluetooth Interface 🌐 Now we move to the browser side, creating a simple webpage that will scan for your Xiao and send color commands via Bluetooth. Here’s a basic HTML + JavaScript setup: <!DOCTYPE html> <html> <head> <title>Web Bluetooth LED Control</title> </head> <body> <button id="connect">Connect</button> <button id="on">Turn On</button> <button id="off">Turn Off</button> <script> let ledCharacteristic; document.getElementById('connect').addEventListener('click', async () => { try { const device = await navigator.bluetooth.requestDevice({ filters: [{ name: 'XIAO-LED' }], optionalServices: ['19b10000-e8f2-537e-4f6c-d104768a1214'] }); const server = await device.gatt.connect(); const service = await server.getPrimaryService('19b10000-e8f2-537e-4f6c-d104768a1214'); ledCharacteristic = await service.getCharacteristic('19b10001-e8f2-537e-4f6c-d104768a1214'); console.log('Connected to device'); } catch (error) { console.error('Error:', error); } }); document.getElementById('on').addEventListener('click', async () => { if (ledCharacteristic) { try { await ledCharacteristic.writeValue(Uint8Array.of(1)); console.log('LED turned on'); } catch (error) { console.error('Error turning on LED:', error); } } }); document.getElementById('off').addEventListener('click', async () => { if (ledCharacteristic) { try { await ledCharacteristic.writeValue(Uint8Array.of(0)); console.log('LED turned off'); } catch (error) { console.error('Error turning off LED:', error); } } }); </script> </body> </html> How This Works: The page contains a button to connect to the Xiao via Bluetooth. Once connected, you can use the on and off buttons to control the LED. Step 5: Time to Shine! ✨💡 Now for the moment of truth: test your project! 🚀 Upload the Arduino code to your Xiao nRF52840 Sense. Open the HTML file in a supported browser (like Chrome). Click the "Connect to Xiao" button, and select the device from the Bluetooth device list. Slide the color picker, and watch the magic happen! 🪄✨ Your NeoPixels should change colors as you adjust the slider. Wireless LED control, baby! Step 6: Add Your Own Magic ✨ Congrats, you've just controlled a strip of NeoPixels via Web Bluetooth! 🎉 But why stop there? Here are some ways to level up: Add color animations: How about some rainbow patterns or breathing effects? 🌈 IMU Integration: Use the onboard IMU to control the lights based on motion. You can dance and let the LEDs react to your moves! 🕺 Build a Web Dashboard: Make the webpage more interactive by adding buttons for pre-defined light patterns (disco mode, anyone?). Conclusion: The Wireless Wonderland 🎆 With Web Bluetooth and the Xiao nRF52840, you’ve unlocked the secret to controlling LEDs without touching a wire! 🎮 Whether you're jazzing up your living room, building smart home gadgets, or just flexing at your next tech meetup, you're officially in control of the light show! 👨‍💻👩‍💻 So go on, experiment, and make your project shine brighter than a disco ball at a retro party! 💃✨ Happy hacking, and keep shining! 🌟
  2. In this article, will see how we can integrate the Beetle ESP32 C3 with home assistance. Beetle ESP32 C3 The Beetle ESP32-C3 is based on the ESP32-C3, a RISC-V 32-bit single-core processor. Despite its tiny size (only 25×20.5 mm), it packs a punch with up to 13 IO ports broken out, making it ideal for various projects without worrying about running out of IO options. Key Features: Ultra-Small Size: The Beetle ESP32-C3 measures just 25×20.5 mm (0.98×0.81 inch), making it perfect for space-constrained projects. Built-in Lithium Battery Charging Management: Safely charge and discharge lithium-ion batteries directly on the board. No need for additional modules, to ensure application size and safety. Easy Screen Connectivity: The matching bottom plate simplifies project assembly and screen usage. Dual-Mode Communication: Supports Wi-Fi and Bluetooth 5 (LE). Reduces networking complexity. Compatible with both Bluetooth Mesh and Espressif WiFi Mesh for stable communication and extended coverage. 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. Installing ESP Addon in Home Assistance First, we need to add the ESP addon to our Home Assistance system. Open the home assistance. Next, navigate to the settings and open the add-ons. Here selects ESP home and install it. Then open the web ui. ESPHome on the Beetle ESP32 C3 ESPHome is an open-source firmware that allows you to configure and manage your ESP devices easily. Open the ESP home web UI and add a new device. Then open the ESPHOME web and follow the instructions to flash ESP Home firmware. Next, connect Beetle to the PC and select then burn. Wait until it finishes. Next, enter the WiFi credentials to configure with WiFi. Then click visit device, you can see this kind of web page. Connecting Beetle ESP32 C3 to Home Assistant Once your FireBeetle ESP32 C3 is online with the ESPHome firmware, Home Assistant will automatically discover it. You can see the device under the settings menu. Next, open the ESP home and add a new device Then enter all the details, and next select the wireless option. You can see the device status as Online. Here you can edit the beetle behavior. Controlling Devices and Automation With the Beetle ESP32 C3 integrated into Home Assistant, you can: Control smart switches, lights, or other devices connected to your Beetle. Set up automation based on sensor data (e.g., turn on lights when motion is detected). Monitor temperature, humidity, and other environmental factors using Beetle sensors. With the Beetle ESP32 C3 integrated into Home Assistant, you can: Control smart switches, lights, or other devices connected to your Beetle. Set up automation based on sensor data (e.g., turn on lights when motion is detected). Here is the simple code snippet to control the onboard LED on the Beetle. switch: - platform: gpio name: "test_lights Onboard light" pin: 10 inverted: True restore_mode: RESTORE_DEFAULT_OFF Here is the complete sketch. Then install it. Next, open the devices again and select the esp home. Here you will see your device details and it will show the switch status. From here you can control the onboard LED. Troubleshooting and Tips If you encounter issues: Check your ESPHome configuration for errors. Verify that your Beetle ESP32 C3 is connected to the correct Wi-Fi network. Use Home Assistant’s logs and developer tools to debug any problems. Conclusion Integrating the Beetle ESP32 C3 with Home Assistant expands your smart home capabilities. Whether you’re building custom sensors, controlling lights, or automating tasks, this combination empowers you to create a personalized and efficient home environment. Happy tinkering! 🏡🔌
  3. One of my teammates is working on an open Hardware Project that I thought to share. The product they’re developing is a bee hotel for native bees (not honeybees)! At the SF Climate hackathon, they integrated the Particle Argon onto a PCB with solar panels, MPPC, and a PWM PIR sensor for the bees. Here’s the link to the schematics, layout and 3D. I'll add a 3D screenshot at the bottom of the post. "A little bit of background, a native bee hotel houses sedentary bees which lay their eggs in tube structures, like hollow plant stems. We want to use PIR sensors along the tubes to get bee traffic data and build a country-wide bee traffic map. Solar Cells I’ve bumped into the IXYS KXOB25 series before and loved them for their reflowability. I wanted to connect them in parallel so the only constraint was that their output voltage is less than 5V, which is the maximum input voltage of the energy harvesting IC. Energy Harvesting I chose the LTC3105EDD 15 because I’ve seen it used to maximize solar cell power output in some nanosatellite projects I’ve browsed in the past. Although it doesn’t have an actual MPPT algorithm, it has a very attractive 250mV startup voltage which can potentially increase the times of day our device will provide power (dawn, dusk, cloud cover). All this needs real world testing which is coming next week. PIR Sensors These are paired infrared transmitters and receivers. As seen in the 3D view, we’re using 2 of them per bee tube to determine which direction the bees are going (in or out of the tube). Of course, this would need to be done in firmware. To save power (because these PIR diodes are super power hungry, we added a low side MOSFET that switches all three strings of PIR diodes (they are strung in series to get 1.1V drive from a 3.3V source). In theory, we can decrease the PWM duty cycle to as low as the PIR’s rise time and set the frequency to 1Hz which would save so much power. Future Steps Here are the unknowns that we’ll be researching. I already see some good answers in the forums, but please feel free to chime in! I’ve played with Edge Impulse in the past and we want to run a small tflite model on particle hardware that would determine what type of bee is in the hotel based on a short audio sample. We also want to send this data to a central server hosted by particle; in your experience how many weeks/months would it take to setup particle cloud to get up to 100 provisioned devices sending about 50 bytes of data to a central server? It would be awesome if we can get that done quickly."
  4. Materials AmebaD [RTL8722 CSM/DM] x 2 Example Introduction BLE connections use a server client model. The server contains the data of interest, while the client connects to the server to read the data. Commonly, a Bluetooth peripheral device acts as a server, while a Bluetooth central device acts as a client. Servers can contain many services, with each service containing a some set of data. Clients can send requests to read or write some data and can also subscribe to notifications so that the server can send data updates to a client. In this example, a basic battery client is set up on the Ameba Bluetooth stack. The client connects to another Ameba board running the corresponding BLE battery service to read the battery level data. Procedure On the first Ameba board, upload the BLEBatteryService example code and let it run. For the second Ameba board, open the example “Files” -> “Examples” -> “AmebaBLE” -> “BLEBatteryClient”. Upload the code and press the reset button on Ameba once the upload is finished. Open the serial monitor and observe the log messages as the Ameba board with the battery client scans, connects, and reads data from the Ameba board with the battery service. Highlighted in yellow, the Ameba board with the battery client first scans for advertising BLE devices with the advertised device name “AMEBA_BLE_DEV” and the advertised service UUID of 0x180F representing the battery service. After finding the target device, the Ameba board with the battery client forms a BLE connection and searches for a battery service on the connected device, highlighted in blue. With the client connected to the service, the battery client begins to read data using both regular data reads and notifications, highlighted in green. Code Reference BLEClient is used to create a client object to discover services and characteristics on the connected device. setNotifyCallback() is used to register a function that will be called when a battery level notification is received. BLE.configClient() is used to configure the Bluetooth stack for client operation. addClient(connID) creates a new BLEClient object that corresponds to the connected device. For more resources: If you need additional technical documents or the source code for this project. Please visit the official websites and join the Facebook group and forum. Ameba Official Website: https://www.amebaiot.com/en/ Ameba Facebook Group: https://www.facebook.com/groups/amebaioten Ameba Forum: https://forum.amebaiot.com/
  5. A BLE beacon broadcasts its identity to nearby Bluetooth devices, to enable the other devices to determine their location relative to the beacon, and to perform actions based on information broadcast by the beacon. Example applications of beacons include indoor positioning system, location-based advertising and more. From the definition of its purpose as a broadcast device, a BLE beacon thus cannot be connected to, and can only send information in its Bluetooth advertisement packets. There are several BLE beacon protocols. The Ameba BLEBeacon library supports the iBeacon and AltBeacon protocols.
  6. I have just started with the youtube channel, so I decided to make a Bluetooth controlled robotic car. As am an electronics engineer I have knowledge about electronics. but I don't know how to build a custom android application. so Before making the project I learn about MIT app inventor and try to make one app which was a great success it is quite easy to do. In this article, we will learn how to make a custom Android application and how to configure the Bluetooth module with Arduino. Hardware requirements: Arduino Uno Bluetooth HC-05 l298n motor Driver acrylic sheet wheels x2 geared dc motor x2 mini breadboard 4.7k, 2.2k resistor jumper wires 12v battery 9v battery switch Step 1: Building Chassis I used an acrylic sheet length of 18cm and width of 13cm. First, I positioned all parts that going to be mounted on the chassis. then I used a hot glue gun to stick the parts to acrylic you can use spacers or screws. after mounting all parts I stick the caster wheel at the bottom of the chassis. Step 2: Connection Make the connection according to the circuit diagram. we can use separate power for Arduino. Motor driver and 12v battery connected through the switch. As we can see in the circuit diagram there is 2.2k and 4.7 k resistor connected to the pins of the bluetooth module. the main reason for this is the HC-05 Bluetooth module uses a logic level of 3.3v. While transmitting data from HC-05 to Arduino there is no problem because Arduino is capable of receiving data from 3.3v logic, but while receiving any data from Arduino to HC-05 Arduino uses 5v logic which may damage our Bluetooth module, to convert 5v logic level to 3.3v we use a voltage divider method. Make sure that there is common ground between motor driver and Arduino otherwise motor not work. Step 3: Programming /* Author:DIYelex date: 3/8/2019 */ #include <SoftwareSerial.h> // TX RX software library for bluetooth SoftwareSerial mySerial(2, 3); // Connect the TXD pin of BT module to pin 2 of the Arduino and the RXD pin of BT module to pin 3 of Arduino. int Rightmotor1 = 4; //pin 1 of Rightmotor int Rightmotor2 = 5; //pin2 of Rightmotor int leftmotor1 = 6;//pin1 of leftmotor int leftmotor2 = 7;//pin2 of leftmotor int en1=9; //enable pin for Rightmotor int en2=10; // enable pin for leftmotor String readString; void setup() { pinMode(Rightmotor1,OUTPUT); // attach Right Motor 1st wire to pin 4 pinMode(Rightmotor2,OUTPUT); // attach Right Motor 1st wire to pin 5 pinMode(leftmotor1,OUTPUT);// attach Right Motor 1st wire to pin 6 pinMode(leftmotor2,OUTPUT);// attach Right Motor 1st wire to pin 7 pinMode(en1,OUTPUT); //attach motor drivers rightmotor enable pin to PWM pin 9 of arduino pinMode(en2,OUTPUT);//attach motor drivers leftmotor enable pin to PWM pin 10 of arduino Serial.begin(9600); //Setup usb serial connection to computer mySerial.begin(9600);//Setup Bluetooth serial connection to android } void loop() { while(mySerial.available()){ delay(50); char data = mySerial.read();//store the data come from bluetooth to char data readString+=data; } if(readString.length() > 0) { Serial.println(readString); ///Print the data to serial monitor which is given by bluetooth if(readString == "Forward"){ //if forward received do following digitalWrite(Rightmotor1, HIGH); ////////////FORWARD //////////////////////// digitalWrite(Rightmotor2, LOW); digitalWrite(leftmotor1, HIGH); digitalWrite(leftmotor2, LOW); analogWrite(en1,200);// for controlling speed of Rightmotor vary the value from 0 to 255 analogWrite(en2,200);// for controlling speed of leftmotor vary the value from 0 to 255 } if(readString == "Back"){ //if Back received do following digitalWrite(Rightmotor1, LOW); ////////////BACK///////////////////////////// digitalWrite(Rightmotor2, HIGH); digitalWrite(leftmotor1, LOW); digitalWrite(leftmotor2, HIGH); analogWrite(en1,200); analogWrite(en2,200); } if(readString == "Left"){ //if left received do following digitalWrite(Rightmotor1, HIGH);/////////////LEFT//////////////////////////// digitalWrite(Rightmotor2, LOW); digitalWrite(leftmotor1, LOW); digitalWrite(leftmotor2, HIGH); analogWrite(en1,80); analogWrite(en2,80); } if(readString == "Right"){ //if Right received do following digitalWrite(Rightmotor1, LOW);/////////////RIGHT//////////////////////// digitalWrite(Rightmotor2, HIGH); digitalWrite(leftmotor1, HIGH); digitalWrite(leftmotor2, LOW); analogWrite(en1,80); analogWrite(en2,80); } if(readString == "Stop"){ //if stop received do following digitalWrite(Rightmotor1, LOW); ///////////stop///////////////// digitalWrite(Rightmotor2, LOW); digitalWrite(leftmotor1, LOW); digitalWrite(leftmotor2, LOW); } readString = ""; } } Step 4: Android App Now we have to build Bluetooth applications that would be capable of controlling your robot car. If you wish to download my application you can download it from github: The Bluetooth car How I created this application was through App Inventor 2, The images above show both the "Designer" & "Block" view of my application so you can build and change thing up if you wish! Steps for configuring bluetooth First turn on the switch of robot car Go to setting Click on the Bluetooth TabTurn Bluetooth on Wait for your phone to find the HC-05 Bluetooth module Once it has been found click it and input the password by default it should be either "1234" or "0000" Now open the application Bluetooth car Application and click the " Bluetooth image" button You should see the HC-05 Module (If not re-try the steps above) click on the Module The Application will then return automatically to the main screen and you can see the green text "connected" At this point, the HC-05 Modules Red LED should now be constantly on instead of pulsing meaning a device is currently connected. Conclusion Thanks for Reading watch this project video on youtube https://youtu.be/iC7P9nyFu9I
×
  • Create New...