Good day, Chris again at Core Electronics. Today I want to look at the Bluetooth that comes with the PyCom microcontrollers and it's a feature you might not have thought you could integrate into your project.
It's a very fast way to get, either communication between wireless devices, that are close to each other so imagine a serial cable, but you know fairly long. It's also an effective way to add extra capability on to your project. You may not have thought that the fastest way to get GPS on your project, is to use an old GPS Bluetooth device, that might be lying around. If you have a project that you want to integrate with your car and show data from the engine management system. You can add a little Bluetooth obd2 device in under the dash and then your plaque on the device can talk to it with Bluetooth and do whatever you like with it, put a nice little OLED display on that and show fuel mixture or something interesting.
One thing I haven't shown in previous videos is, the fact that there is a single antenna available from PyCom that are used for various applications. One of them is, on our normal PyCom devices, all of them have an antenna connector. I'm just going to try and get that closer to the camera. There we go, an antenna connector on this corner, it's very small and it's well it is gold plated is literally gold and it's quite a tricky thing to get onto. So, the WiPy here has one antenna connector because it just has Wi-Fi and Bluetooth on that one antenna. Here I have a LoPy it has three connectors, I'll try to bring that up to the camera again but it's a little puzzle for the coordination system, at the bottom corner here is the Wi-Fi and Bluetooth antenna here is the 400 MHz LoRa, Sigfox, it’s not a Sigfox, it's a 400 33 megahertz LoRa antenna and the one at the top here is both LoRa and Sig Fox that is Sub-1 GHz
Alrighty, so these antennas that are available on the website, there is just one kind of antenna that used for all these applications, except for cellular data. There's a patch antenna that looks like a flat printed circuit board with a cable tail hanging out of it, that one's just for cellular data, but basically, all the other applications can use this little duck antenna. So, the trick is when you're trying to put the two together, you need to be very careful, you can damage this connector easily and they are very tiny, very secure once it's connected but getting the two connected is a bit of a trick. So again I'm going to try and bring this up to the camera so you can see right on the corner here is the connector and the cable on its underside has a tiny little press, stud if you grew up in the 70s you remember what that is and put that face down on top, what I like to do is align it and then hold my fingers front and back and push it together. Once it's on it should be able to rotate around but it shouldn't pop off and you should find it's secure once it's there. Again, it's a bit of a trick to get that off if you want to pull it off I generally try to put a fingernail either side of the plug and there's just enough tab to be able to squeeze that out with your fingernails, oops I'm pulling it off camera again there we go.
So, if you are using Bluetooth or Wi-Fi for that matter also works for LoRa and Sigfox, you can increase the range of your device just by putting an external antenna on. The little white patch antenna that's there, is built-in for Wi-Fi and Bluetooth and the Bluetooth specification says that you can get up to a 100m range on Bluetooth, however that's kind of optimistic, that assumes that you're basically standing at one end of a football field and the device is at the other end of the football field, there are no players, there are no microwave ovens, there's no Wi-Fi in the area, it's nice and radio quiet, as well as being what we call line-of-sight, you can literally see from one device to the other and you know there is no interference there's nothing in the way. So, you can get up to 100 meters range on this but that would have to be in kind of ideal circumstances but maybe you haven't thought of adding Bluetooth to your applications, as usual, we have documentation attached to this video at the bottom.
I want to bring your attention to the very bottom of that I found three various sources for code samples that I can use with Bluetooth. One of them is in the plaque on libraries that comes from GitHub the other two are in the documentation. So, there's some code written into the documentation there. So, have a play with that Bluetooth is a wonderful way to add all sorts of capabilities to a project, I'm considering using it now as an ibeacon so that I can have a PyCom device understanding its physical location in the world based on Bluetooth low-energy broadcasters (beacons). They are physically stuck in place and my PyCom device should be able to measure its position in a room using those three beacons.
All right, so I hope you got something out of that and I'll see you next time.
Makers love reviews as much as you do, please follow this link to review the products you have purchased.