Arduino MKR WiFi 1010 - DIYables Bluetooth App Digital Pins
Overview
In this tutorial, we are going to learn how to use the Bluetooth Pin Control feature with the Arduino MKR WiFi 1010. This example lets you toggle digital output pins and read digital input pins directly from your smartphone over BLE. The Arduino MKR WiFi 1010 operates at 3.3V logic, so keep that in mind when connecting external components — use level shifters when interfacing with 5V devices. The MKR WiFi 1010 exposes its pins on standard MKR-family headers, making it straightforward to connect to MKR shields or breadboard wiring for remote GPIO control.
Note: The Arduino MKR WiFi 1010 only supports BLE (Bluetooth Low Energy) for this library. It does not use Classic Bluetooth with this library. The DIYables Bluetooth App supports both BLE and Classic Bluetooth on Android, and BLE on iOS. Since this board uses BLE, the app works on both Android and iOS.

Features
- Output Control: Set digital pins HIGH/LOW remotely
- Input Monitoring: Read digital and analog pin states
- Named Pins: Assign friendly names to each pin (e.g., "LED", "Relay")
- Real-Time Updates: Push pin state changes to the app
- Up to 16 Pins: Control multiple pins simultaneously
- Works on Android & iOS: BLE is supported on both platforms
- No Pairing Required: BLE auto-connects without manual pairing
Hardware Preparation
| 1 | × | Arduino MKR WiFi 1010 | |
| 1 | × | Micro USB Cable | |
| 1 | × | Breadboard | |
| 1 | × | Jumper Wires |
Or you can buy the following kits:
| 1 | × | DIYables Sensor Kit (30 sensors/displays) | |
| 1 | × | DIYables Sensor Kit (18 sensors/displays) |
Additionally, some of these links are for products from our own brand, DIYables .
Arduino MKR WiFi 1010 Code
Detailed Instructions
Follow these instructions step by step:
- If this is your first time using the Arduino MKR WiFi 1010, refer to the Arduino MKR WiFi 1010 getting started guide.
- Connect the Arduino MKR WiFi 1010 board to your computer using a Micro USB cable.
- Launch the Arduino IDE on your computer.
- Select Arduino MKR WiFi 1010 board and the appropriate COM port.
- Navigate to the Libraries icon on the left bar of the Arduino IDE.
- Search "DIYables Bluetooth", then find the DIYables Bluetooth library by DIYables
- Click Install button to install the library.

- You will be asked for installing some other library dependencies
- Click Install All button to install all library dependencies.

BLE Code
- On Arduino IDE, Go to File Examples DIYables Bluetooth ArduinoBLE_PinControl example, or copy the above code and paste it to the editor of Arduino IDE
- Click Upload button on Arduino IDE to upload code to Arduino MKR WiFi 1010
- Open the Serial Monitor
- Check out the result on Serial Monitor. It looks like the below:
Mobile App
Note: The DIYables Bluetooth App supports both BLE and Classic Bluetooth on Android, and BLE on iOS. Since the Arduino MKR WiFi 1010 uses BLE, the app works on both Android and iOS. No manual pairing is needed for BLE — just scan and connect.
- Open the DIYables Bluetooth App
- When opening the app for the first time, it will ask for permissions. Please grant the following:
- Nearby Devices permission (Android 12+) / Bluetooth permission (iOS) - required to scan and connect to Bluetooth devices
- Location permission (Android 11 and below only) - required by older Android versions to scan for BLE devices
- Make sure Bluetooth is turned on on your phone
- On the home screen, tap the Connect button. The app will scan for BLE devices.

- Find and tap "Arduino_Pins" in the scan results to connect.
- Once connected, the app automatically goes back to the home screen. Select the Digital Pins app from the app menu.

Note: You can tap the settings icon on the home screen to hide/show apps on the home screen. For more details, see the DIYables Bluetooth App User Manual.
- You will see the list of enabled pins with their names and current states
- Tap output pins to toggle HIGH/LOW, and watch input pin values update

Now look back at the Serial Monitor on Arduino IDE. You will see:
Creative Customization - Adapt the Code to Your Project
Enable Pins
Handle Pin Write/Read/Mode
Push State Changes
Programming Examples
Relay Control with Button Monitor
Multi-LED Controller
Troubleshooting
Common Issues
1. Cannot find the device in the app
- Make sure the Arduino MKR WiFi 1010 is powered on and the sketch is uploaded
- Ensure your phone's Bluetooth is enabled
- On Android 11 and below, also enable Location services
2. Pin toggle not working
- Verify the pin is enabled with BT_PIN_OUTPUT mode
- Check that onPinWrite callback is set up
- Verify wiring connections
3. Input pins not updating
- Ensure updatePinState() is called when pin state changes
- Check polling frequency in the loop
4. Analog values not showing
- Use analogRead() in the onPinRead callback for analog pins
- Analog pins return 0-1023 values
5. Connection drops frequently
- Move closer to the Arduino (reduce distance)
- Ensure stable USB power supply
6. Upload fails or board not recognized
- Install the latest Arduino SAMD Boards package via Boards Manager (≥ 1.8.13)
- Try a different USB cable or port
Project Ideas
- Multi-relay control panel
- Button and switch monitor
- LED lighting controller
- Home automation switch panel
- Sensor input dashboard
Next Steps
After mastering the Bluetooth Digital Pins example, try:
- Bluetooth Slider - For analog value control
- Bluetooth Monitor - For text-based status feedback
- Bluetooth Table - For structured pin status display
- Multiple Bluetooth Apps - Combining pin control with other apps
Support
For additional help:
- Check the API Reference documentation
- Visit DIYables tutorials
- Arduino community forums