OldMan and Bluetooth3
So this Lazy Old Geek (L.O.G.) finally got a Bluetooth HC05 and was able to talk to an HC06 module.
https://www.instructables.com/id/OldMan-and-Blueto...
https://www.instructables.com/id/OldMan-and-Blueto...
So one of my goals is to make battery-powered Arduino projects that can talk wirelessly to either another Arduino or a PC.
I’ve been working on a EEG project along with another Instructabler, lingib.
https://www.instructables.com/id/EEG-AD8232-Phase-...
He just released his EEG Monitor:
https://www.instructables.com/id/Mind-Control-3-EE...
This is an excellent Instructable and his coding is better than mine. This seems like a good project to make wireless. So here we go:
Well I tried to use an HC06 to a PC Bluetooth dongle like this:
https://www.instructables.com/id/Cheap-2-Way-Bluet...
The computer dongle (I tried a couple of them) would pair up with my HC06 but Processing didn’t work. So I tried a different approach.
Design: Make the EEG with an HC05 to send the data via Bluetooth to a HC06 connected to a computer running Serial Monitor or Processing.
Step HC05 and HC06 Setup
The way I set these up is discussed in:
https://www.instructables.com/id/OldMan-and-Blueto...
The HC05 and HC06 need to be bound to each other. I assume what that means is that they can only talk to each other with Bluetooth and their baud rates are the same. I chose 115,200 baud rate.
NOTE: This baud rate has to match up with the Arduino sketch, the Serial Monitor and the Processing code.
Using HC05
I happened to have a working EEG Arduino setup. It uses a 3.3V Micro Pro. This Arduino has two advantages over the Arduino UNO. First, it’s a 3.3V device so you don’t have to worry about voltage incompatibilities with the HC05 (and the AD8232). Second, it has a separate (from USB) serial port.
The schematic shows the essentials for this test. My actual setup contains a TFT display.
For the HC06, leave the CP2102-HC06 setup available.
Software:
The existing software sends data at 115,200 baud out the USB connector which is connected to my PC which runs a Processing program. The programs are in:
https://www.instructables.com/id/Mind-Control-3-EE...
I used: fix_FFT_EEG_DC_32Hz.ino and fix_FFT_EEG_2.pde for Processing.
I only had to add two lines.
For the Pro Micros, the USB serial is called Serial, the hardware serial is Serial1.
So wherever the code has Serial, I just duplicated it with Serial1.
Serial.begin(115200);
Serial1.begin(115200);
Serial.println(message);
Serial1.println(message);
NOTE: if you use an Arduino UNO, you can do the same thing using SoftwareSerial.
So what this does is whenever the code writes to the USB, it also writes to the HC05 which sends it to the HC06.
Operation:
How I do this is as follows:
Plug the USB from the Micro Pro into PC.
Open up Arduino and figure out what Com port it’s on. (Com12)
Plug the CP2102_HC06 into PC.
See which Com port it’s on. (Com20)
See if the Micro Pro sketch is printing out data via USB and Bluetooth:
Open Serial Monitor set to Com12, then Com20, they will both be receiving data.
If you’re using Processing, the serial list will look something like pictured.
In my case I tried [3], then [4], they looked the same. See picture.
Comments on the two methods:
1. HC05/HC06 to PC Bluetooth
Advantage: if PC has Bluetooth only an HC05 or 6 is required
Disadvantages: requires Bluetooth pairing and (in my case) doesn’t work
2. HC05 to HC06
Advantage: Easier operation (no pairing)
Disadvantages: Harder to setup devices, more hardware.
So for now I will be using the 1st option and the next step will be to make the EEG battery operated.