MakerGram Logo

    MakerGram

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Popular
    • Tags
    • Users
    • Groups

    MakerChat 0x1A : How to build a Magic Wand πŸͺ„

    MakerChat
    4
    7
    657
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • MakerGram
      MakerGram last edited by

      43e42864-11cb-4c95-bb44-d8c34998bf17-Luma.png Luma.png

      Are you ready to unleash your inner wizard and create your very own Harry Potter-style magic wand?

      Join us for MakerChat0x1A, a fascinating journey into the world of technology and magic. In this enchanting event, you'll learn how to build a magical wand that would make even the great wizard himself, Harry Potter, proud!

      β€‹βœ¨ Event Highlights:

      ​TinyML and Seeed XIAO nRF52840 Sense: Discover the power of TinyML and the Seeed XIAO nRF52840 Sense microcontroller, the heart and soul of your magical creation.

      πŸ—£οΈ Create Magical Spells: Learn to code and program your wand to perform a variety of spells and tricks just like in the wizarding world.

      🎨 Unleash Your Creativity: Customize your wand with unique designs and features, making it truly one-of-a-kind.

      β€‹πŸ†“ Free Event: This magical experience is open to all and completely free, but seats are limited, so be sure to register early!

      ​Join us on November 4th, 2023, at TinkerSpace Kochi, for an enchanting afternoon of technology, creativity, and magic. Reserve your spot now and become a wizard of the modern age.

      ​Don't miss this opportunity to create your very own Harry Potter-inspired magic wand. We look forward to seeing you there! πŸ’«

      β€‹βš οΈ Limited Seats Available: To ensure a quality learning experience, we have limited seats. Register today to secure your spot at MakerChat 0x1A!

      Register here at - https://go.makerchat.co/0x1A

      MakerGram 1 Reply Last reply Reply Quote 1
      • MakerGram
        MakerGram @MakerGram last edited by MakerGram

        Resource : https://workshop.makergram.com/docs/tiny-ml-workshop/IntroductionToXiao

        Edge Impulse Project Page: https://studio.edgeimpulse.com/public/303675/latest/versions

        1 Reply Last reply Reply Quote 0
        • mkgrmAbhinand
          mkgrmAbhinand last edited by

          Have any simulator instead of Seeed XIAO nRF52840?

          MakerGram 1 Reply Last reply Reply Quote 0
          • MakerGram
            MakerGram @mkgrmAbhinand last edited by

            @mkgrmAbhinand Sorry, no simulators are available.

            1 Reply Last reply Reply Quote 0
            • A
              amalkrishnam3 last edited by

              I have been working on a similar project . In which I want to capture data using the PDM mic and trasmit it through the BLE available . I am new to hardware and these sensors so I am unable to make sense of the data I am reciving on the other side(central) that is my mobile device(iphone X) with BlueLight application. I am able to find a service and I am reciving some form of hex code,but I don't know how to convert it to wave files or don't know whether it's possible or not .

              If you guys have any idea or any resources that could help please do share.

              I am attaching my code below :

              #include <ArduinoBLE.h>
              #include <mic.h> //  microphone library 
              
              // Microphone Settings
              #define DEBUG 1
              #define SAMPLES 800
              
              mic_config_t mic_config = {
                .channel_cnt = 1,
                .sampling_rate = 16000,
                .buf_size = 1600,
                .debug_pin = LED_BUILTIN
              };
              
              NRF52840_ADC_Class Mic(&mic_config);
              int16_t recording_buf[SAMPLES];
              volatile static bool record_ready = false;
              
              // Updated UUIDs
              #define SERVICE_UUID "19B10000-E8F2-537E-4F6C-D104768A1214"
              #define CHARACTERISTIC_UUID_AUDIO "19B10001-E8F2-537E-4F6C-D104768A1214"
              
              // BLE Service and Characteristic
              BLEService audioService(SERVICE_UUID);
              // Corrected initialization with explicit value size and fixed length flag
              BLECharacteristic audioDataCharacteristic(CHARACTERISTIC_UUID_AUDIO, BLERead | BLENotify | BLEWrite, sizeof(recording_buf), true);
              
              void setup() {
                Serial.begin(115200);
                while (!Serial) delay(10);
              
                Serial.println("Initializing microphone...");
                Mic.set_callback(audio_rec_callback);
                if (!Mic.begin()) {
                  Serial.println("Mic initialization failed");
                  while (1);
                }
                Serial.println("Mic initialized.");
              
                Serial.println("Initializing BLE...");
                if (!BLE.begin()) {
                  Serial.println("Failed to start BLE!");
                  while (1);
                }
              
                BLE.setLocalName("SCT Audio");
                BLE.setAdvertisedService(audioService);
                
                audioService.addCharacteristic(audioDataCharacteristic);
                BLE.addService(audioService);
              
                // Corrected writeValue call with explicit casting
                audioDataCharacteristic.writeValue((uint8_t)0);
                
                BLE.advertise();
                Serial.println("BLE Peripheral is now advertising");
              }
              
              void loop() {
                BLEDevice central = BLE.central();
              
                if (central) {
                  Serial.println("Connected to central device");
                  
                  while (central.connected()) {
                    if (record_ready) {
                      // Plot the audio data in the Serial Plotter
                      for (int i = 0; i < SAMPLES; i++) {
                        Serial.println(recording_buf[i]);
                      }
              
                      // Transmit the audio data
                      audioDataCharacteristic.writeValue((uint8_t*)recording_buf, 2 * SAMPLES);
                      Serial.println("Audio data transmitted over BLE");
                      record_ready = false;
                    }
                  }
              
                  Serial.println("Disconnected from central device");
                }
              }
              
              static void audio_rec_callback(uint16_t *buf, uint32_t buf_len) {
                static uint32_t idx = 0;
                
                for (uint32_t i = 0; i < buf_len; i++) {
                  recording_buf[idx++] = buf[i];
                  if (idx >= SAMPLES){ 
                    idx = 0;
                    record_ready = true;
                    break;
                  } 
                }
              }
              
              

              My overall project capture the audio using the pdm mic and transmit it through the BLE and we will do a audio processing throguh api(fast api) calls . I don't know whether it's the right way to do this,but that's the overall idea .

              salmanfaris 1 Reply Last reply Reply Quote 0
              • salmanfaris
                salmanfaris @amalkrishnam3 last edited by

                @amalkrishnam3 Hi, Were you able to make any progress.

                A 1 Reply Last reply Reply Quote 0
                • A
                  amalkrishnam3 @salmanfaris last edited by

                  @salmanfaris No, still now , there is no improvements

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  Recent Posts

                  • A

                    @salmanfaris No, still now , there is no improvements

                    • read more
                  • @amalkrishnam3 Hi, Were you able to make any progress.

                    • read more
                  • A

                    I have been working on a similar project . In which I want to capture data using the PDM mic and trasmit it through the BLE available . I am new to hardware and these sensors so I am unable to make sense of the data I am reciving on the other side(central) that is my mobile device(iphone X) with BlueLight application. I am able to find a service and I am reciving some form of hex code,but I don't know how to convert it to wave files or don't know whether it's possible or not .

                    If you guys have any idea or any resources that could help please do share.

                    I am attaching my code below :

                    #include <ArduinoBLE.h> #include <mic.h> // microphone library // Microphone Settings #define DEBUG 1 #define SAMPLES 800 mic_config_t mic_config = { .channel_cnt = 1, .sampling_rate = 16000, .buf_size = 1600, .debug_pin = LED_BUILTIN }; NRF52840_ADC_Class Mic(&mic_config); int16_t recording_buf[SAMPLES]; volatile static bool record_ready = false; // Updated UUIDs #define SERVICE_UUID "19B10000-E8F2-537E-4F6C-D104768A1214" #define CHARACTERISTIC_UUID_AUDIO "19B10001-E8F2-537E-4F6C-D104768A1214" // BLE Service and Characteristic BLEService audioService(SERVICE_UUID); // Corrected initialization with explicit value size and fixed length flag BLECharacteristic audioDataCharacteristic(CHARACTERISTIC_UUID_AUDIO, BLERead | BLENotify | BLEWrite, sizeof(recording_buf), true); void setup() { Serial.begin(115200); while (!Serial) delay(10); Serial.println("Initializing microphone..."); Mic.set_callback(audio_rec_callback); if (!Mic.begin()) { Serial.println("Mic initialization failed"); while (1); } Serial.println("Mic initialized."); Serial.println("Initializing BLE..."); if (!BLE.begin()) { Serial.println("Failed to start BLE!"); while (1); } BLE.setLocalName("SCT Audio"); BLE.setAdvertisedService(audioService); audioService.addCharacteristic(audioDataCharacteristic); BLE.addService(audioService); // Corrected writeValue call with explicit casting audioDataCharacteristic.writeValue((uint8_t)0); BLE.advertise(); Serial.println("BLE Peripheral is now advertising"); } void loop() { BLEDevice central = BLE.central(); if (central) { Serial.println("Connected to central device"); while (central.connected()) { if (record_ready) { // Plot the audio data in the Serial Plotter for (int i = 0; i < SAMPLES; i++) { Serial.println(recording_buf[i]); } // Transmit the audio data audioDataCharacteristic.writeValue((uint8_t*)recording_buf, 2 * SAMPLES); Serial.println("Audio data transmitted over BLE"); record_ready = false; } } Serial.println("Disconnected from central device"); } } static void audio_rec_callback(uint16_t *buf, uint32_t buf_len) { static uint32_t idx = 0; for (uint32_t i = 0; i < buf_len; i++) { recording_buf[idx++] = buf[i]; if (idx >= SAMPLES){ idx = 0; record_ready = true; break; } } }

                    My overall project capture the audio using the pdm mic and transmit it through the BLE and we will do a audio processing throguh api(fast api) calls . I don't know whether it's the right way to do this,but that's the overall idea .

                    • read more
                  • @mkgrmAbhinand Sorry, no simulators are available.

                    • read more
                  • Have any simulator instead of Seeed XIAO nRF52840?

                    • read more
                  By MakerGram | A XiStart Initiative | Built with ♥ NodeBB
                  Copyright © 2023 MakerGram, All rights reserved.
                  Privacy Policy | Terms & Conditions | Disclaimer | Code of Conduct