Hello all.This thread was a huge help when doing this, But i found the information disjointed and confusing sifting through so many posts, I'm hoping i can give everyone a rocksolid "how to" To get this working.viewtopic.php?f=122&t=43883

Ordering, Configuring and setting up the HC-05 Bluetooth unit for tuning the MS-ECU with Tuner studio.

Edit:Note: The MS-ECU uses 5v Level TTL, while the HC-05 Uses 3.3V TTL. There have been zero failures as far as i know, and many people run these HC-05 off the MS-ECU's 5v TTL. My 2 devices are communicating with each other flawlessly so far. So i am not really sure how much of an issue this really is. If anyone experiences any issues with Comms or the HC-05 failing outright, and you think it could be due to the TTL levels, please let us know. At the bottom of this guide is a quick top on a mod for a voltage divider, You can incorporate this into the 5v TTL (only the HC/05's RXD pin needs this mod) if you wish.The risk is, the MS-ECU could possibly have coms issues triggering from a 3v level if it's looking for 5v. And the 5V from the MS-ECU could damage the input to the HC-05. But the devices have been communicating flawlessly to this point, and no one has reported any failures due to the 5v TTL, so I don't see any reason worth complicating the bluetooth mod. But I leave it up to you. See the bottom of this guide for a voltage divider mod to drop the 5v TTL to around 3.3v/Edit.

USB-RS232 TTL converter:https://www.google.com.au/search?q=usb+ttl+converter&source=lnms&tbm=isch&sa=X&ved=0ahUKEwjmupCD_d_TAhVIEbwKHch_B84Q_AUICigB&biw=1782&bih=990It's purpose is to emulate a serial com port. When you plug it into the computer and install the drivers it will operate as a RS232 over USB, It's intention is to be "Invisible" In other words the computer treats it as a normal serial port. It should (and i encourage you to check this) ouput TTL voltage level which is 3.3v on its RXD/TXD pins. This is important, The HC-05 will not communicate with a 5v or 12v serial connection.There are several types available and to my knowledge they should all work as long as they are 3.3v (TTL) and have drivers, Some install automatically, some need the drivers downloaded form a 3rd party. I use a PL2303 (type that in ebay) based unit.

HC-05 Bluetooth module:(search that on ebay, I recommend the one with the button like i got, circled in the pic above, as this makes programming easier)These modules are designed to operate as an invisible serial link. Meaning when configured correctly, the computer and the connected device see a RS232 connection. You put serial in one end, it communicates that over a blutooth connection. i recommend the HC-05 (http://www.ebay.com/sch/i.html?&_from=R40&_trksid=p2386202.m570.l1313.TR11.TRC1.A0.H0.Xhc-05.TRS0&_nkw=hc-05) as it can be configured to operate as a Master (seeks out and establishes bluetooth connections), Or a slave(passively awaits a connection attempt). They can be easily configured to different Baud rates to support MS1, or MS2. I'm assuming MS3 as well but I have not done this. Make sure you get HC-05 (type that in ebay) and I recommend getting the units that have the small tactile momentary switch (circled in the pic above) This switch makes programming the unit easier.I recommend purchasing 2 of these units, You should be able to do it for under $15. Then you can configure a master and slave device, And establish a secure connection to the megasquirt in tuner studio in around 5 seconds after MS-ECU boot. That is not a joke, it's that fast!

A terminal application:I use realterm: https://sourceforge.net/projects/realterm/If you use this app, The first thing you should do is ensure the following is ALWAYS SET. (If you use any other application, you'll need to figure it out yourself)Display tab - Select half duplex (this shows what you type, otherwise you'll have no idea)Port tab - Parity = None, Data bits = 8, Stop bits = 1, Hardware flow control = None, Baud = 38400 (this is the baud rate that the HC-05 will operate on when in programming mode), Port = Select the port your USB-RS232-TTL device is installed as. Then ensure you click the "change" button and check the detail on the bottom right match those you've just selected.Send tab - In the "EOL" section ensure "CR" and "LF" are checked (this lets the HC-05 know when the command is finished, otherwise it will lock up and stop responding)While in the "Send" tab, you will be typing your commands into the empty boxes on the left, And clicking "Send ASCII"

Setting up and programming the HC-05 via USB-TTL converter

Once you get your USB-TTL converter, Plug it into your PC. Ensure it installed correctly. If it does not, Find and update the drivers. Ensure it is installed and recognized as a COM device.Once your happy it's installed, You can test you have everything set right. Get a jumper and connect the TTL converter's RXD and TXD pins together, creating a feedback loop. Then open your terminal program and test the connection. Make sure you have it set up as described above, and anything you send, Should be be echoed back. In the series of screens below, The first shows the successful feedback, In green is what i sent on TXD, and in yellow is what the TTL converter received on RXD. Hence, you've made a communication loop.

Now unplug the TTL converter and connect the HC-05 to the header pins on the back:HC-05 <> USB-TTLVCC <> 5vGround<>GroundRX <>TXTX <>RX

Programming the HC-05 to work with MS-ECU:

If you purchased the unit with the small tactile button, this is where you hold the button down. If not, you need to connect 5v to the "Key" header pin. If the breakout board does not have a Key header pine, you may be able to find a pinout for the HC-05 chip and sort it out that way.While holding down the button, Plug the USB-TTL into the computer. The status led on the HC-05 will start to flash a 2 second on-off cycle/Let the button go and launch your terminal application. Ensure the settings are correct. If using Realterm, set it up as instructed and get ready to send the following commands.Note:When setting the blutooth name, you will not be able to confirm it. If you send the "AT+NAME?" queary to the device, it will not reply with the name. This is a limitation with the HC-05 and is documented in it's manual. To confirm the name you need to unplug the USB-TTL and (Do NOT hold the button on the HC-05) plug it back in. The device should boot and start blinking quickly, showing it is in search mode. Wait a few seconds then search using a blutooth device (such as a mobile phone) to see if the HC-05 appears in the list of available bluetooth devices. The default name is "HC-05"

For MS1 set board speed to 9600, For MS2 set board speed to 115200Set blutooth name and a password (for example "My fully sick car" and "1234")Set to Slave

Note: Ensure all commands are entered in CAPITALSThe commands are below, followed by a ">" and the expected reply from the HC-05.AT > OKAT+NAME=My Cool Car > OK (note: You cannot query the device name with a HC-05. It will reply with "OK" and you must just trust it has updated. You can only check later by searching for the device via bluetooth)AT+UART=115200,0,0 > OK (Where "115200" you put the msecu's baud rate. 115200 for MS2 and 9600 for MS1)AT+UART? > +UART=115200,0,0 > OK (this step confirms the current set baud speed. There will be 2 replys, the first gives the baud speed, the second is the acknowledgement "ok")AT+ROLE=0 > OK (Setting role to 0=slave and 1=master, You want the MS-ECU's bluetooth to be a slave device)AT+ROLE? > +ROLE=1 > OK (confirming the setting)AT+PSWD=1234 > OK (Where "1234" you put the bluetooth password you want to protect the MS-ECU with)AT+PSWD? > +PSWD=1234 > OK

Now remove the HC-05 from the TTL device, Put it aside and mark it so you know it is to the MS-ECU device. We will call it the Slave.

Programming a second device to connect to the Megasquirt:

If you have a second HC-05, connect it to the TTL. We will be using this device as the Master You can skip this step for now, and come back to it after installing the 'Salve' HC-05 onto the MSECU.Re enter programming mode and follow the logic you learned for the first device:For MS1 set board speed to 9600 (for the Master, whatever you set the baud speed to, Tuner studio must also be set to, so it is easiest to set it to the same as you MSecu version)For MS2 set board speed to 115200 (for the Master, whatever you set the baud speed to here, Tuner studio must also be set to, so it is easiest to set it to the same as you MSecu version)Set to Master (AT+ROLE=1)Set password, Use same password as before.Set name (name can be anything, does not need to be same as before)Your second HC-05 is now a dedicated MS-ECU communicator. Unplug it, and plug it back in (without holding the button) and it will boot into search mode.Open Tuner studio and point it towards the COM port for the TTL device.

Installing the Slave HC-05 onto the MSECU V3.0 mainboard:

Now you need to get your hands dirty on the MSECU.Get Your Slave HC-05. You need to solder it onto the board. It needs to go between the processor and the RS232 IC U6. Connect the following to the U6 IC on the MS board:VCC <>Pin 16Ground <>Pin 15TX <> Pin 12RX <> Pin 11

You should add a toggle switch to the VCC wire. So you can power down the bluetooth. You will need to power the bluetooth down to connect a serial connector to the DB9 on the megasquirt. This is needed to flash firmware, or if there is a problem with bluetooth.You cannot and should not attempt to communicate with both DB9 and Bluetooth at the same time.

I recommend using the underside of the U6 chip directly, as showen in this pic, i used a 4 pin header connector I robbed off some other electronics, making it eazy for me to remove the HC-05 off the board if needed.

Now, power up the MS ecu.If everything worked correctly, The master HC-05 (If it is still plugged into your computer and powered up?) will connect to the HC-05 slave in less than 5 seconds, and tuner studio will start communicating with the megasquirt. If you don't have a second HC-05 setup, you can now search for the MS-ECU with your bluetooth laptop/phone and attempt to connect to it.

I hope this guide was eazy to follow and somewhat fool proof. Feedback is welcome!

EDIT:ME-ECU 5v TTL Mod - Optional

Since the MS-ECU uses 5v TTL, and the HC-05 uses 3.3v TTL, Some people have expressed concerns that the HC-05 may fail due to the higher voltage on it's RXD pin. While no one could conform if this risk has ever eventuated in a failed unit, below is a simple fix to put your mind at ease if you choose. This only needs to be carried out on the RXD pin of the HC-05.You will need a couple of resistors. We will be building a simple voltage divider. The goal is to get around 3.3v at the RDX pin. I used a 1kohm and a 3.9kohm which when checked with an oscilloscope, gave me 3.4vTo setup the circuit we will have 2 resistors. R1 and R2. You can use whatever 1/4w or 1/8w resistors you have kicking. R1 should be somewhere between 1k and 10k.R2 should be 3.5-3.9x the value of R1 (This is a figure i made up from testing. and should give you between 3.2-3.4v signal. This might not add up to 5v for those of you plugging this through ohms law, But remember the 5v TTL will be as close to the CPU's VCC as it can be, but it will not actually reach 5v.)

R1 connects on lead to pin 11 and the other to R2, R2's other lead then connects to Proto ground.At the junction of R1 and R2, you connect RX from the HC-05

This is how i installed it on the board:

Last edited by Crazy2287 on Mon May 15, 2017 1:39 am, edited 4 times in total.

Some people expressed concerns of the 5V level TTL of the CPU talking to the 3.3v TTL of the HC-05No one could confirm that they had ever had an actual failure of the HC-05 or issues with comms because of this. Originally I thought the CPU was a 3.3v TTL but it turns out it's not.I've devised an easy method for stepping the RX into the HC-05 from 5v to 3.3 with a simple voltage divider. It can be found at the bottom of the original post.It is entirely up to you if you want to use this, In all reported cases, connecting directly to pin 11 has never resulted in a failure of a HC-05 nor has it caused communication issues.

Nice write-up! Two comments, just to stick my oar in. The 4-way connector is available at Mouser, M20-1060400; the 6-way is M20-1060600. The terminals are M20-1160042. These are readily available, and pretty cheap at 10-30 cents each.

The other is addressed more to those who build and sell MS and other units. The HC-05 and friends are NOT approved / certified / whatever by the FCC. For the average person installing an accessory in their own equipment, this is fine, it doesn't matter. As soon as you accept a PENNY to do it for someone else, that transmitter had better have an FCC ID number, or you are looking at HUGE fines and possibly time in jail. This counts in Canada and the EU, as well; most things FCC'd are also licensed for use up here, but the EU has its own mess of regulations. If you're a builder looking to add a feature, there is unfortunately nothing that I've found in the past 1-2 months of looking that is as easy & convenient as the HC series. The RN-42 and SPBT3.0DP2 are good options, but have to be mounted on a carrier board with power supply etc.

I got all the way to the last steps of installing the HC-05 to the underside of the U6 chip (without the resistors) but I can't find it on my phone or laptop from there. I could find it on both when connected to the USB-RS232 TTL converter. Is the HC-05 supposed to blink quickly like it did when plugged into the USB-RS232 TTL converter? Mine doesn't. I am getting 4.4v at the VCC and 2.5v at the RXD. I know you said that it should have about 3.3v at the RXD. I did use an on-on toggle (P/N 35-004) if that makes a difference?

When you provide power to the HC-05 it will boot and search for a connection. Regardless of weather or not RXD/TXD is connected. Ensure the HC-05 is getting 5v on VCC and 0v/Earth/Ground on the ground pin. Once power is established the led on the HC-05 unit should blink quickly, until a connection is established, then it will blink slowly.

If this is not happening, remove the HC-05 from the Megasquirt and inspect the board, Make sure you didn't damage anything when soldering. Ensure there are no stray component legs or solder drops shorting anything out. Double check the pins on U6 were the correct ones. Connect it back to the USB-RS232 and ensure the HC-05 is still working.

frechem wrote:I got all the way to the last steps of installing the HC-05 to the underside of the U6 chip (without the resistors) but I can't find it on my phone or laptop from there. I could find it on both when connected to the USB-RS232 TTL converter. Is the HC-05 supposed to blink quickly like it did when plugged into the USB-RS232 TTL converter? Mine doesn't. I am getting 4.4v at the VCC and 2.5v at the RXD. I know you said that it should have about 3.3v at the RXD. I did use an on-on toggle (P/N 35-004) if that makes a difference?

Crazy2287 wrote:When you provide power to the HC-05 it will boot and search for a connection. Regardless of weather or not RXD/TXD is connected. Ensure the HC-05 is getting 5v on VCC and 0v/Earth/Ground on the ground pin. Once power is established the led on the HC-05 unit should blink quickly, until a connection is established, then it will blink slowly.

If this is not happening, remove the HC-05 from the Megasquirt and inspect the board, Make sure you didn't damage anything when soldering. Ensure there are no stray component legs or solder drops shorting anything out. Double check the pins on U6 were the correct ones. Connect it back to the USB-RS232 and ensure the HC-05 is still working.

Like I said, I am getting 4.4v at VCC when connected to the MS but no blinking. Nothing shorted out on the board or any stray component legs. Double checked the pins and they are the correct ones, I can post a pic if needed. I connected back to the USB-RS232 and the HC-05 is working as it should.

frechem wrote:Like I said, I am getting 4.4v at VCC when connected to the MS but no blinking. Nothing shorted out on the board or any stray component legs. Double checked the pins and they are the correct ones, I can post a pic if needed. I connected back to the USB-RS232 and the HC-05 is working as it should.

I re-soldered all of the connections and viola it is blinking! I tried to connect to my msdroid and had success so then I tried my laptop with no success. I noticed that my MSDroid was still connected so I closed that and tried my laptop again. I was finally able to connect with my laptop so I thought I would try and see what happens if I tried to connect my MSDroid while my laptop was still connected. No luck, I wasn't able to connect my MSDroid now so it seems like it can only be connected to one device at a time?

Correct. You will only be able to connect a single device at a time. Because it is 2 way communication over serial, if you tried to and successfully connected multiple devices you would likely crash the megaquirt.

---Photobucket has really screwed the online world with their greed action by leaving millions of images all over the net 'broken'.I hope some huge class-action suit will follow of this and make them either turn off their hotlinking-block again, or face going through some financially dire times.---

Hi,I would like to contribute something to this really good write up, just a warning.

Don't waste to much time when these cheap 3$ BT circuits don´t work, they may be dead when new. This is just my personal experience, but it might save you from loosing many hours valuable time, like me.

If you buy these little Bluetooth modules, don't expect them to work. I ordered from one eBay seller (Hong Kong) and received 3 not working samples.One was all dead, one showed a lit LED and one was transmitting it´s name (could see it on Smart Phone), but did not respond to any input. Seller returned money without further notice. Tell it PayPal and they do the rest.

Then I got two new ones that seem to work as expected, but I did not find the time to install them.

Today I got two "Bolutek" RS232 Bluetooth boards, both have no function at all. So it is a 5:2 chance to get something usable with Bluetooth from china, as far as my statistic tells. Maybe just order two from different sellers, they are so cheap it doesn't matter and a spare might be handy some time.Our Chinese friends sometimes sell objects that come from the garbage bin, because most western customers don´t start a fight because of such little money. Any one not returning the thing or expecting a 50% refund are a win for the man from China. He cares about you as much as you care about him- nil.

I´m really not an un-experienced electronics guy. My MS2extra install started with the first turn of the key (BMW 3.5l) with all hand build loom. I build many Audio Amplifiers that have worked for decades now. I know which side of the soldering iron gets hot. So no wrong handling with my BT boards to expect and not 5 times in a row., I read the manual first and try when I'm sure what I am doing.

For those, who think the TTL level is causing a problem: Try a 1N4148 diode on the Rx D line of the BT board, the ring at it pointing away to the receiver. This should make it see a 5 V signal instead of 3.3 V and may improve the connection. Worked on the Arduino with the BT module. I didn´t try it, but it may work here. May save you a wire, too.

Instead of putting the Bluetooth unit inside. Can it be connected to the external db9 serial port by soldering it to a connector, or will it not work that way. It's a pain removing all my ms3 from the car.