Navigation

    MakerGram Logo

    MakerGram

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

    Read battery percentage using Arduino

    General Discussion
    arduino bluetooth
    2
    3
    371
    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.
    • V
      vijayvarghese last edited by

      Is it possible to read battery info of an Android with an Arduino via Bluetooth without an external app on the Android side .

      For example . Bluetooth connection to a cars media player shows battery life , signal strength ,etc....

      1 Reply Last reply Reply Quote 1
      • kowshik1729
        kowshik1729 last edited by

        @vijayvarghese The answer is "NO". If my guess is correct, you might have misunderstood the working of Classic Bluetooth and Bluetooth Low Energy(BLE). You cannot acquire battery percentages, RAM usage directly just by connecting HC-05 to Arduino and connecting it to mobile phones. Because our mobile phones don't share any characteristics to outside just through Bluetooth.

        The example of car which you have stated is just applicable to the automobile field. If you are able to read the battery percentage, signal strength kind of parameters that means that the car's BLE has been programmed with those characteristics to be displayed. To be simple, it means that the Bluetooth inside the car has been given permission to display those. It depends upon the BLE configuration used and security levels. You cannot access any parameters from mobile phone just with Arduino and HC-05 Bluetooth module.

        If you want to learn more about this please read the post in makergram named "Automatic pairing of ESP32 using BLE" where @salmanfaris has given a detailed explanation of how BLE works. If you want to work out how BLE's work, try connecting your MI Band(Or any smart wrist bands) to the nRF Connect Mobile app(Can be found in play store for free). Try seeing what parameters are displayed. please write back in case of queries.!!

        V 1 Reply Last reply Reply Quote 2
        • V
          vijayvarghese @kowshik1729 last edited by

          @kowshik1729 Thank you ..

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

          Recent Posts

          • Thanks for sharing @rafitc99 . Glad to know that it was solved.

            • read more
          • BaseType_t xQueueSendFromISR ( QueueHandle_t xQueue, const void *pvItemToQueue, BaseType_t *pxHigherPriorityTaskWoken );

            I was trying to pass a pointer. That was the issue.
            Reference

            • read more
          • Update!!
            I found the issue
            I created a Queue inside Rgpio.cpp and called a Funciton from main.cpp to check data in Queue. That worked well!!

            Reference to the #commit .

            • read more
          • I'm trying to pass a value into Queue from Interrupt Service Routine(ISR) using xQueueSendFromISR() <-- Reference

            But I'm getting this error and ESP restart immediately.

            Guru Meditation Error: Core 0 panic'ed (LoadProhibited). Exception was unhandled. Core 0 register dump: PC : 0x4021227c PS : 0x00000033 A0 : 0x4021c72e A1 : 0x3ffe8220

            Here is the gpio interrupt example which I'm following.

            Here is my code. I did some modification in this.

            Check 70th line of this location.

            static void main_power_isr_handler(void* arg) { xQueueHandle* main_q = (xQueueHandle*)arg; static main_q_payload_t msg; msg.hdr = E_MAIN_MSG_MAIN_POWER_STATUS; msg.bool_payload = gpio_get_level(GPIO_MAIN_POWER); //ets_printf("Someone Interrupted \n "); xQueueSendFromISR(main_q, &msg, NULL); //!!! THIS LINE }

            • read more
          • Curious to know how the social media giant went down for an unusual time?

            Read this article by Cloudflare explaining how complex the internals of the Internet is and what happened to Facebook and its affiliated services.

            https://canal.swalah.co/howfbdown

            #facebookdown #WhatsAppDown #Instagramdown #socialmedia

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