# BlueTooth on Pi Pico W - WORKING!

**URL:** <https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371>\
**Category:** Support\
**Created:** [June 17, 2023, 3:37pm UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371 "2023-06-17T15:37:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [June 17, 2023, 3:37pm UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/1 "2023-06-17T15:37:30Z")

</div>

BlueTooth now working on Pi Pico with MicroPython. See here:

> **[New functionality: Bluetooth for Pico W - Raspberry Pi](https://www.raspberrypi.com/news/new-functionality-bluetooth-for-pico-w/)**
>
> Raspberry Pi Pico W, our wireless-enabled variant of our Pico platform, built around our RP2040 microcontroller, now has Bluetooth support.

Unfortunately, the code has been printed with line numbers so a great deal of line number editing out is required. Good news it that it works.

I’ve got my phone receiving data from the Pico via Bluetooth.

 ![Blurtooth_1](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/1/1944558aa88cf1ed2652415d426480f3c6bd0a09.jpeg)

 ![Blurtooth_2](https://us1.discourse-cdn.com/flex016/uploads/pimoroni/original/2X/a/a62982ea544751723b4e2655575850f4187c77a5.jpeg)

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [June 18, 2023, 3:38am UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/2 "2023-06-18T03:38:20Z")

</div>

I’ve found the official files on-line and they can be downloaded from here:

> **[pico-micropython-examples/bluetooth at master ·...](https://github.com/raspberrypi/pico-micropython-examples/tree/master/bluetooth)**
>
> master/bluetooth

Give it a try - works really well.

Help needed. How can we send/receive text strings of different length instead of just a pair of bytes?

---

<div class="post-metadata">

**Author:** ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)\
**Post date:** [June 19, 2023, 2:39pm UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/3 "2023-06-19T14:39:33Z")

</div>

Well, BLE is more than a data-transmission protocol, it is a complicated stack of things they call profiles, services, characteristics, central devices, peripherals, servers, clients and so on. It took me quite some time to figure out the language BLE is using. After that, I began to understand the example programs you find in the internet.

I think what you are looking for is NUS, the “Nordic UART service”. This implements a serial connection over BLE. With it you can send and receive arbitrary data. Although this is against the design of BLE. But it is very practical and lets you port old stuff easily.

I did some BLE programming with the Pi and the nRF52840 ([XIAO nRF52840](https://shop.pimoroni.com/products/seeed-xiao-ble-nrf52840-supports-arduino-micropython-bluetooth5-0-with-onboard-antenna)) using CircuitPython and it was not that complicated (they have good libraries and sample code).

So I am waiting until the Pico-W port of CircuitPython supports BLE, and the all these programs will just run on.

You can find my uart-examples here: [GitHub - bablokb/ble-playground: Bluetooth Low Energy Playground](https://github.com/bablokb/ble-playground)

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [June 20, 2023, 7:21am UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/4 "2023-06-20T07:21:21Z")

</div>

Thanks. I’ve used those with a Pi at Pi Jams. Just want to try the latest offerings.

I’ve just found these examples:

> **[micropython/examples/bluetooth at master · micropython/micropython](https://github.com/micropython/micropython/tree/master/examples/bluetooth)**
>
> master/examples/bluetooth

It helps to start with something that works. These are less complicated - fewer looping delays and flashing LEDs.

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [June 20, 2023, 9:54am UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/5 "2023-06-20T09:54:44Z")

</div>

Got the basic stuff working - LED brightness controlled by potentiometer on another PiCow.

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [June 24, 2023, 12:27pm UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/6 "2023-06-24T12:27:47Z")

</div>

Just finished a Pico W project. Data from 3 potentiometers on one Pico W sending data to a second Pico W to control colours on a NeoPixel stick.

Watch the video here:https: [//youtu.be/V7spAtwrQIY](https://youtu.be/V7spAtwrQIY)

All done with MicroPython.

---

<div class="post-metadata">

**Author:** ![bablokb](https://avatars.discourse-cdn.com/v4/letter/b/ee59a6/32.png) [@bablokb](https://forums.pimoroni.com/u/bablokb)\
**Post date:** [June 26, 2023, 10:05am UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/7 "2023-06-26T10:05:08Z")

</div>

Do you have any power-measurements? BLE should be up to a factor 1000 less than WLAN, but this assumes that the WLAN-part of the cy43439 is turned off and I am not sure how this is implemented in MicroPython.

---

<div class="post-metadata">

**Author:** ![Tonygo2](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.pimoroni.com/tonygo2/32/7814_2.png) [@Tonygo2](https://forums.pimoroni.com/u/Tonygo2)\
**Post date:** [June 26, 2023, 11:22am UTC](https://forums.pimoroni.com/t/bluetooth-on-pi-pico-w-working/22371/8 "2023-06-26T11:22:03Z")

</div>

Hi Bernhard  
Sorry, but that is a tad too technical for me as I trained as a mathematics/physics teacher in the early 60’s and converted to Computer Science soon after. I did a MSc in Computer Education in the 80’s at Loughbrough University, mainly programming. I’ve only got a soldering iron, side-cutters and a multi-meter! All my electronics knowledge is self taught.  
The picture above from my phone records -50dBm.

The code and instructions to my project can be found here if you would like to try it:

> **[Pico W - Bluetooth Communication](https://www.instructables.com/Pico-W-Bluetooth-Communication/)**
>
> Pico W - Bluetooth Communication: In this Instructable I am going to demonstrate how to send live, dynamic data from one Pico W to another using the built-in Bluetooth (BLE) modules. I will read RGB colour data from three potentiometers connected to...
