Introduction: LinkIt ONE Bluetooth PWM LED Control

Picture of LinkIt ONE Bluetooth PWM LED Control

Hello!

In this Instructable, I am going to show you how to control an LED strip, using the PWM pin on the LinkIt ONE via Bluetooth. You will need to make the transistor switching circuit, using the TIP120, given in my previous Instructable “LinkIt ONE Bluetooth Solenoid Control”.

This is because the LinkIt ONE’s digital pins only provide 3.3v which is not enough to power a 12v LED strip. This LED strip controller can then be used in many different applications and the LED’s brightness can also be controlled using your phone itself.

Step 1: Materials Required

Picture of Materials Required
  • LinkIt ONE and usb cable to upload sketches
  • An Android phone with version 4.0.3 and above
  • TIP120 transistor
  • 2.2K resistor
  • 1N4001 diode

You can easily find the transistor and the components from Farnell or RS components, or even scavenge them from old electronics. Once you have collected the items listed above, move on to the next step.

Also, as always, your LinkIt must be already set up to successfully upload sketches.

Step 2: Make the Circuit

Picture of Make the Circuit

This simple circuit can be made using a couple of wires on a breadboard. I have attached the Fritzing diagram from my previous Instructable with this for your reference. You will attach your LED Strip in place of the solenoid in the Fritzing diagram, but keep note that the polarity must be correct as an LED will not work if it is plugged in the other way round, unlike a solenoid.

Note: This circuit is absolutely necessary and you cannot plug in the wires of the LED strip directly, as the LinkIt’s pins do not provide that much voltage.

Step 3: Download and Uploading the Code

Now download the attached code and upload it to your LinkIt ONE, selecting the correct COM port in the Arduino IDE. When done successfully, take out your Android phone, because the next step is based on that.

Step 4: Now to the Android Part

Picture of Now to the Android Part
  1. Here, download the attached Android .apk file and save it to your phones memory.
  2. Navigate to it using the file browser and click on it to install it.
  3. Make sure that you have enabled installing 3rd party applications in your phones settings, if it does not install.
  4. When installed successfully, move on to the next step.

Step 5: Working

Picture of Working
  1. Check if all the wires are attached in the circuit.
  2. Then give the LED strip its power (12v for me) and power up the LinkIt ONE via USB or battery, with its bluetooth/WiFi antenna also attached to it.
  3. Then take your android phone and open the application installed earlier.
  4. It will ask you to switch on Bluetooth if it is not already on. Allow it to switch bluetooth on.
  5. Press the settings button and there, press ”Make Discoverable”
  6. After doing that, go back and press the bluetooth icon next to settings icon. There, you will be able to see your paired or available devices.
  7. Find and click “My_BTServer” from the available or paired devices
  8. Hopefully, it will say “Connected to My_BTServer”. If not, then close the application and try again.

When successfully connected, you can use the slider to control the LED strip’s brightness. It also shows the history, what number you have sent before and ranges from 0 to 1023. And above the slider, you can also see the slider's current position too.

Step 6: Troubleshooting

I have tested this on a few phones and it works. If you have any problem, close the application and then try again, but as every phone is different, we cannot guarantee that the application works. Leave a comment if you have any problem and I will try my best to assist you.

Comments

GyroHeat (author)2015-12-22

Forgive me as I am new to this, I am trying to upload the file but I get the following error:

Arduino: 1.6.6 (Windows 10), Board: "LinkIt ONE"

Warning: platform.txt from core 'MediaTek ARM7 EJ-S (32-bits) Boards' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.

In file included from C:\Users\Eric\AppData\Local\Arduino15\packages\LinkIt\hardware\arm\1.1.17\libraries\LBT/LBT.h:21:0,

from C:\Users\Eric\Desktop\LinkIt_ONE_LED_PWM_Control\LinkIt_ONE_LED_PWM_Control.ino:1:

C:\Users\Eric\AppData\Local\Arduino15\packages\LinkIt\hardware\arm\1.1.17\cores\arduino/Arduino.h:38:19: fatal error: vmdcl.h: No such file or directory

#include "vmdcl.h"

^

compilation terminated.

exit status 1

Error compiling.

This report would have more information with

"Show verbose output during compilation"

enabled in File > Preferences.

abdullahsadiq7 (author)GyroHeat2015-12-22

I am not sure that the LinkIt ONE SDK works for Windows 10, but the Arduino IDE you are using is not compatible with the LinkIt ONE SDK. I would suggest you to uninstall that and download and install Arduino IDE 1.6.5. I also have that working but with Windows Vista. Then install the LinkIt SKD, following this guide here: http://labs.mediatek.com/site/global/developer_tools/mediatek_linkit/get-started/windows_os_stream/get_hardware_software/index.gsp
Please check this and tell me the results. I also want to know if it will work on Windows 10. Thanks for asking!

GyroHeat (author)abdullahsadiq72015-12-29

Sorry just noticed your reply....thank you so much for your time,...i will go try this over the weekend,...i have a great artistic piece that will require the board. Thank you again!