If you have any trouble when setting up your Arduino with these Bluetooth modules let me know about it in the comments below! If you found this useful be sure to leave a like on the video and subscribe to the channel!
I believe Android and PC works with either module but I believe only the HM-10 is compatible with iOS devices! There is a ton more that we could do with Arduino and remote connections in the future, so let me know if you're interested!
Let me know what you'd like to see on the channel next, and thanks for watching! Goodluck with your projects and see you next time!
hello and welcome back to Lemaster Tech
in today's video I'm going to show you
how to connect to an Arduino via
Bluetooth for iPhones Androids and
computers
[Music]
so this tutorial is going to cover how
to add a Bluetooth module to an Arduino
board that does not have intrinsic
connectivity built in there are options
of Arduino boards that come with Wi-Fi
and Bluetooth and I can link some of
those below as well but I'm going to
assume you already have an Arduino board
and now want to add a Bluetooth
connection module to it the good news is
this is pretty easy and pretty cheap so
if you want to control your board with
an Android device or a Windows laptop
the cheapest option that I have used is
the hc06 Bluetooth module but if you're
looking to connect your Arduino board
via iPhone the hc6 is not compatible the
most affordable module I've found that
can do that is the DSD Tech hm10 module
which has an app on the iOS store that
you use to connect your board now both
these modules are a four pin Bluetooth
send and receive module with a TX pin RX
pin voltage and ground pin the physical
hookup of either module is exactly the
same and it's extremely simple for this
video I have the TX and RX pins
connected to digital pins three and four
of the Arduino and then the voltage and
ground pins connected to the power
supply from the Arduino the only other
thing I've done for this demo is two
LEDs connected to digital pins nine and
ten and then fed through two 220 kilo
ohm resistors back to ground the reason
to not use the built-in TX and RX pins
on the Arduino is that for Bluetooth
communication which is really acting as
another form of Serial communication we
would not be able to connect to our
Arduino IDE via the serial cable to the
board and be connected to the Bluetooth
module at the same time if we use those
pins we would need to unplug the
Bluetooth module to connect via serial
cable and vice versa but if we use what
Arduino calls a software serial Port
using a different pair of digital pins
as we're doing in this example you can
both connect to the board via serial
cable and the Bluetooth module via
Bluetooth at the same time the sketch
for this this example which will be
linked below via GitHub as well starts
by including the software serial Library
which is necessary to repurpose a pair
of digital pins as a new serial
Communications path then create an
instance of the software serial object I
just called mine BT for Bluetooth and
then Define the TX and RX pins in that
order TX first mine is pin 3 and RX
second minus pin 4. then just Define a
character to store the value we want to
send over Bluetooth and Define my LED
pins as 9 and 10. in the setup function
we're just going to Define our LED pins
as outputs and do
bt.begin9600 which is defining the baud
rate or data transfer rate as 9 600 bits
per second the loop section of the code
just checks to see if any new data is
available from the Bluetooth source and
if it is we display the value in the
serial Communications window and if the
sent value is a one I'll turn on the
green light and off the red light and if
any other value is sent we'll flip those
light statuses then lastly just put a
delay of 100 milliseconds or so in there
so the program has some time to breathe
and we're ready to test this upload the
sketch to the board and with the board
powered up and the Bluetooth module not
yet connected to anything you should
have a blinking red light on either of
these modules for Windows connectivity I
found you have to change the Bluetooth
device's discovery option to an advanced
and away from default for these modules
to show up but then you can choose
connect to a device add device and
select Bluetooths and either device
should show up here
you can verify connection after
selecting the device by going to device
manager and under ports you should see
standard serial over Bluetooth Link com
ports now displayed I don't have a Mac
so I apologize if the steps are slightly
different for Mac users hopefully it's
very close now go back to the Arduino
IDE go to tools then ports and select
the com Port that is the same as the one
you just viewed from the device manager
select it and tell your IDE what device
it is then open the serial Monitor and
it should say connecting to your device
on your com port and then it should
connect and be waiting to receive your
commands and the communication light on
the Bluetooth module should go solid red
at that point for iPhone users you need
to get the DSD Tech bluetooth app from
the IOS app store which takes like three
seconds to install I believe the app is
named the same thing for Android users
and with your module powered up you
should see it as available right on the
front screen of the app once you allow
it to communicate via Bluetooth click on
it and once you get a check mark you're
connected click on that device again and
you enter the communication screen where
you can now send commands now try
sending a one to the board from either
your serial monitor screen on the
Arduino IDE or from the app on your
phone and you should see the green light
turn on and sending any other number or
letter will turn the red light on okay
so that is the basics of setting up
Bluetooth connection between an Arduino
and either your phone or your computer
there are so many things that you can't
possibly cover in one video around
Communications but drop any questions or
issues you're having or comments in the
comments below this video and I will do
my best to get back to you as soon as
possible if you'd like to see a
continuation on this video where we
build out some basic apps using like MIT
App Inventor or computer-based app just
let me know that in the comments below
as well and I can get working on that
content too thanks so much for watching
you can find all the hardware needed for
this project in the description of this
video below as well as a link to my
patreon if you'd like to become a super
supporter of the channel thank you so
much to my patreon subscribers Dale
topley and Philip Nunes you guys are
awesome thank you so much everyone who
leaves nice comments likes on the videos
subscribes to the channel the growth has
been outstanding thanks for watching
good luck with your projects see you
next time bye