i----------------------------------------
iBluetooth is easy
iFebruary 24th, 2018
i----------------------------------------
i
iI ran across a little demo project the other day showing how a $7
icomponent could connect an Arduino to any bluetooth device. It was
ia bit of a revelation for me. I had assumed that there was a lot
igoing on in Bluetooth land, and that it wasn't worth the effort
idiving into all the protocol nonsense. It turns out it's
ia glorified serial port.
i
iEnter the HC-05 and it's brother the HC-06. These little 4-pin
icomponents handle all the parts of Bluetooth you don't care about.
iHere's what you get: 5V input, Ground, Tx, Rx. Sound familiar?
i
iI plopped a Lucky Shield onto my Arduino so I had some sensors
igoing, ran the example Lucky Shield Test, which outputs a bunch of
idata from those sensors to the Serial debug panel, and plugged in
ia HC-06. I paired the HC-06 with my phone by entering the default
i1234 code. Then I opened up a serial debugger on my phone.
i
iI was pleasently greeted by a bunch of information about the
ilight, humidity, air pressure, and so on. No fuss, no muss. I love
iit when things just work.
i
iThe HC-05 and HC-06 are very similar in features and price. The
iHC-05 can do more, act as a master bluetooth device instead of
ia slave, and send some funky control stuff that I don't care
iabout. I got the HC-06 because I found one on Amazon Prime and
iI was impatient. I saw these in bulk on Alibaba for under $2.
i
iI'm going to rig up a little voltage divider circuit with
ia handful of push buttons, flash it onto an ATTiny85, and try to
idesign and print a PCB for the unit. It'll connect with the HC-06,
iand eventually I'll 3D print a case for it. I want a little
icomponent based, battery powered, bluetooth button controller that
iI can use for random acts of silliness.
i
iIn other, less fun, news, my latest raspberry pi zero w is
irefusing to play nice with the wifi. I set it up identically to
ithe last one which worked flawlessly, but nada. I'm going to bring
iit in to work and swap the SD card I have in the working one to
icheck if the problem is hardware related or software caused.
i
iMoops.
i