Introduction: $3 Bluetooth HID Module (HC05 With RN42 Firmware)

Picture of $3 Bluetooth HID Module (HC05 With RN42 Firmware)

Bluetooth HID (human interface device) modules will let you create bluetooth peripherals that can pair with mobile devices out-of-the-box (like bluetooth keyboards, gamepads, mice, etc.).

If we're looking to build our own bluetooth HID device, the hefty price of a single HID module can spike the budget of a project (like the BlueSMiRF HID for $40 USD, or the BlueFruit EZ-KEY HID for $20 USD).

An inexpensive bluetooth serial module commonly used by hobbyists, the HC-05, sells for $3 USD, but is not HID capable by default. With a bit of a firmware hack though, we can turn this cheaper module into a bluetooth HID module.

It may look like there's a lot of steps below, but it's actually just a very thorough guide. The flashing process of the HC-05 itself takes no longer than a minute after we have extracted the firmware from the RN-42 once.

Step 1: Watch the Video!

Check out this quick video, for a run-through all the steps below from start to finish.

Click here to watch on YouTube

Step 2: A Comparison of the Two Modules

Picture of A Comparison of the Two Modules

This cheaper module is the HC-05 and sells for around $3 on ebay.

By itself, this module isn't HID capable. But luckily, this module actually uses the same chip (the BC417) as the RN-42 bluetooth module, which also powers the $40 BlueSMiRF HID modules.

The only differences between these modules are the firmware and the location of the pin outs.

So here's the plan - to make our $3 module HID enabled, we'll just have to copy over the firmware from the RN-42 chip to the HC-05.

It's as simple as that!

Where to buy

SOLDERING GEAR:

TEST GEAR:

Step 3: Get the BlueSuite Tools

Picture of Get the BlueSuite Tools

The chip manufacturer, CSR, has made their tools publicly available.

Head over to this link:

https://www.csrsupport.com/document.php?did=31600

to download the manufacturer's BlueSuite toolset, which is what we'll be using to dump the module's firmware using the parallel port of a PC.

The download will require a quick, free of charge registration.

Step 4: Building the Programmer

Picture of Building the Programmer

For the chip to communicate with our PC, we'll need to connect the SPI pins into these pins of the parallel port.

We'll need use a few resistors to create voltage dividers that will step down the parallel port's 5v transmission levels to the chip's 3.3v levels.

The MISO pin will transmit to the parallel port at 3.3v, which the PC will still recognize.

We'll simply add an 100ohm resistor here to prevent the the module from being overloaded.

We'll also need an external 3.3v power source to power the chip.

Step 5: Get a Parallel Cable

Picture of Get a Parallel Cable

Here's the parallel cable I'll be using, the male end will connect to the PC and the female end will connect to the chip.

Paper clips will fit snugly inside the slots of the female end, so we'll cut up a few pieces and solder them to some loose wires so that we can connect it to our breadboard.

Step 6: Put Together the Voltage Dividers

Picture of Put Together the Voltage Dividers

Here are the voltage dividers I made from salvaged resistors, as per the schematic in step 4.

The values of the resistors used in the voltage dividers don't have to be the same, as long as the two resistors in each voltage divider has a 2:1 ratio.

Step 7: Connect the RN-42 Pins

Picture of Connect the RN-42 Pins

Here is the RN-42 module that we'll need to extract the firmware from.

We'll need to access the SPI (MOSI,CLOCK,MISO,CSB) pins, as well as the VDD and GND pins.

If you want to make your life easier, you could get a breakout board instead of actually soldering wires to the pins.

If you do solder the pins directly, make sure you keep the wires separated with a bit of tape so nothing shorts unintentionally.

Step 8: Power Up the Chip

Picture of Power Up the Chip

Now we're going to plug everything into our breadboard, and power up the chip.

I'll be using my regulator to output a 3.3V supply to the chip.

If you hook up an LED on PIO5, you can check the status of the module. When the chip is just turned on, you should see the LED blink.

Step 9: Install BlueSuite

Picture of Install BlueSuite

On the PC side, the BlueSuite tools have been reported to work best on a Windows XP machine, so that's what I'm using here.

Install the package we downloaded earlier - and check the box in the installation dialog to install the LPT device driver and also set the debug transport to LPT.

Reboot when prompted, then head into the BIOS to make sure that the Parallel port mode is set to ECP.

Step 10: Some Possible BlueSuite Errors

Picture of Some Possible BlueSuite Errors

I've seen two errors from BlueSuite before, and they're not very descriptive as to what's actually wrong.

Here's how I solved both these errors:

1) Legacy Plug and Play detection not enabled (first picture)

  • Go to System Properties (right-click My Computer)
  • Under the Hardware tab, go to the Device Manager
  • ECP Printer Port, go to its properties
  • Under port settings, check Enable legacy Plug and Play detection
  • Hit OK and reboot

2) Chip not detected (second picture)

  • Either the chip is not powered, under powered, or there's a faulty connection
  • Check the wiring and try again

Step 11: Dump the RN-42 Firmware

Picture of Dump the RN-42 Firmware

If everything went well, then you should be access to access this dialog.

If you hit Stop Processor, you'll get an acknowledgement that the chip is recognized.

The Firmware ID button will let you see what firmware version your chip currently has.

But for now, we'll hit Dump and choose a location to save our firmware.

Fortunately, we only ever have to do this once. As long as you keep this dump, you'll be able to flash any HC-05 chip with this HID firmware.

When that's done, you'll have two files. Tuck them away, and fire up PSTool.

Step 12: Dump the RN-42 Config

Picture of Dump the RN-42 Config

PSTool will let us manage the settings of the chip, like bluetooth address, baud rate, etc.

We'll need to make a dump of all these settings too. Goto File > Dump, then choose a location to save the config file.

Once we have the three files (two from the firmware dump, one config file), we're done with the RN-42 chip.

Step 13: Prepare the HC-05

Picture of Prepare the HC-05

Here's our $3 module, the HC-05.

This one comes with a breakout board for some of the pins. We'll need to cut away the shrink wrapped housing to access the SPI pins.

If we look at the pin out of the HC-05, we'll notice that the pin placement is different from the RN-42. For the HC-05, the SPI pins are conveniently grouped together on the bottom.

Step 14: Make a Clothespin Programmer

Picture of Make a Clothespin Programmer

We'll want an easier way to flash these chips in the future so we don't want to be soldering wires to the pins directly.

And here's what I came up with - a clothespin with pins and wires attached. All we need to do is clamp it onto the chip and plug it into our breadboard.

Step 15: Prepare to Flash the HC-05

Picture of Prepare to Flash the HC-05

First, make a dump of the HC-05 following the exact same steps as we did with the RN-42 module, for safe-keeping.

When we flash the HC-05, all the settings of the chip will be overwritten by the RN-42 settings.

We need to preserve the bluetooth address and antenna settings of the HC-05, so open up the HC-05 config file in a text editor, and preserve the three entries: PSKEY_BDADDR, PSKEY_ANA_FTRIM, PSKEY_ANA_FREQ. Save this config file as another file.

Step 16: Flash the HC-05

Picture of Flash the HC-05

Now we're going to flash the chip.

Run BlueFlash, stop the processor, hit Choose File, select the RN-42 dump, and hit Download.

Step 17: Revert a Few HC-05 Configs

Picture of Revert a Few HC-05 Configs

We'll need to revert the bluetooth address and antenna settings of the HC-05.

So open up PSTool, go to File > Merge, and select the config file containing the three entries, PSKEY_BDADDR, PSKEY_ANA_FTRIM, PSKEY_ANA_FREQ, that we saved from step 15.

That's it! We're done!

Step 18: Conclusion

This might seem like a long process, but after doing it once, it'll take you no longer than a minute to flash a chip.

I'd like to thank Robin Gross (and his blog, Byron's blog) for being one of the first to document how to build a programmer for the BC417 chip.

You can check out his blog here: http://byron76.blogspot.ca/

---

That's all I have for you today!

In an upcoming project, I'll be showing you how to build an actual device with this chip, so come back and don't miss it!

If you liked this Instructable, then perhaps you'll like some of my other projects!

You can check them out over at my YouTube channel.

Thanks guys! I'll see you next week!

Comments

silpakc made it! (author)2017-10-06

Hai

I have tried to do the firmware upgradation of HC-05 module with Rn-42 firmware.I have used FTDI for that purpose.I was able to dump the files of HC-05 successfully and done all the steps mentioned in the above blog .I downloaded the Rn-42 firmware to HC-05 using Bluesuit.That step was also successfull but after when i tried to communicate with the PStool , an error is occouring like

"The application was unable to find the entries in the look-up table on chip.Please use an alternative transport ,update the firmware to a version that support BCCMD/SPI, or if using a version of the firmware significantly newer than this software ,update this software" . This is the error in the dialogbox.

I have tried this with BlueSuite 2_6_2 and BlueSuite 2_6_8 versions. Can anyone help me to solve this issue.

witnessmenow (author)silpakc2017-10-09

Did you start the processor after flashing it with the Rn-42 firmware?

I've written up an instructable using the FTDI board for this too, maybe its worth checking out to see if there is a step you are missing?

https://www.instructables.com/id/Upgrade-Your-3-Bluetooth-Module-to-Have-HID-Firmwa/

silpakc (author)witnessmenow2017-10-09

Hai

Thanks for the reply , I have gone through your blog and done almost the same steps like

Flashing the firmware


  • Open up Blueflash
  • Click the Stop Processor button
  • Click the Choose File button and select the RN42.xpv
  • Click the Download Button
  • When finished, click the Start Processor button and close BlueFlash

After this step when I tried to open the PSTool the Error message was displayed.

"The application was unable to find the entries in the look-up table on chip.Please use an alternative transport ,update the firmware to a version that support BCCMD/SPI, or if using a version of the firmware significantly newer than this software ,update this software"

After downloading the RN42 files the HC-05 module was not responding .The led of HC-05 won't blink.So again I tried to download the original HC-05 files that I keep it as a backup file using Blueflash , then the module start working, (led blinks). Then the module is communicating with the PSTool but after downloading the RN-42 file the module will not respond to PSTool.

How to solve this issue.

witnessmenow (author)silpakc2017-10-10

In the rn-42 firmware the blue led remains constantly on. So it sounds like the correct firmware was on it.

First thing I would try is to get a new dump of the rn-42

If that works the same, Maybe try using the command line tool after the firmware is loaded

https://github.com/lorf/csr-spi-ftdi/blob/master/README.md#useful-commands

spilz (author)2017-09-04

hello,
I did it with an FTDI as SPI programmer, I was able to dump the files and the setings of the HC-05, I flashed the files of the RN42 given in message below, I did the merge. Everithing seems to have be done correctly, Bu when I try to use it, nothing appends :(
do the output pins of the breakout board are still right ? specially RX TX ?
how can I test the RN42 functions ? I tryed sending $$$ but got no responses
what is the baud defautl value ? I tryed 115200 and 9600 but nothing works

thanks

witnessmenow (author)spilz2017-10-02

I think the instructable has a mistake at the $$$ part, in the video Evan mentions that before you send $$$ you need to select "No line ending" in the serial monitor settings.

After you input $$$ and get the message CMD back, you then change it back to "Newline"

JarosławM5 (author)witnessmenow2017-10-03

The command mode is not entered even without the line ending (and in several other terminal apps).

witnessmenow (author)JarosławM52017-10-03

Do you have any devices connected to the module (via Bluetooth)? I found I couldn't go into config mode when my phone was connected.

Here is the sketch I used (I'm using an esp8266 and software serial running at 115200)

https://github.com/witnessmenow/simple-esp8266-software-serial-sketch

JarosławM5 (author)witnessmenow2017-10-03

It has not occurred to me to access the module with Bluetooth. As I understand, it should be visible after the firmware upgrade and restart? Well, it is not. Which is strange, given that the BlueFlash shows that the processor is running and verifies the firmware is correct.

witnessmenow (author)JarosławM52017-10-03

Yeah I'm pretty sure it was broadcasting some Bluetooth name when I was finished with the process

I'll Pm you a link to a video I've been working on for this very topic, sounds like you have the majority of it working, but maybe the flashing, merging and testing process might be useful for you

spilz (author)JarosławM52017-10-03

When I had the merge issue, the module was not visible.
When merge is ok, the module is visible for me.

JarosławM5 (author)spilz2017-10-02

I have exactly the same problem. I have tried it with two chips, the firmware is loaded correctly and I can verify it afterwards. I have done it twice to be sure. No response whatsoever from the module... Any solution is very welcome!

spilz (author)JarosławM52017-10-03

For me the issue came from the merge, PSKEY_BDADDR was not merge properly. I set it manually and it works well. Check the 3 values after merge part

JarosławM5 (author)spilz2017-10-03

Thanks, I will check it out!

alan.phan1 (author)2017-07-30

http://www.kcwirefree.com/docs/BlueSuite_2.6.2.zip

alan.phan1 (author)2017-07-30

Hi all,

I can't get the

BlueSuite v2.6.2 can you please supply a download link to free program

ironsmiter (author)2016-03-24

Now, where did I put that old desktop that still had a parallel port....

awesome project! :-)

kcender (author)ironsmiter2016-03-26

I haven't tried it with this firmware, but you can use an FTDI USB adapter to flash the HC-05 as well. (I know it works when flashing HC-05 firmware to HC-06 modules.) You have to install the DLL in the BlueSuite directory and make a few other changes, but it works just as well as the Parallel Port solution. (Still get the same error sometimes.)

https://github.com/lorf/csr-spi-ftdi

alan.phan1 (author)kcender2017-07-29

Hi all,

Anybody tried this

FTDI USB adapter to flash rn-42?

Memol_47 (author)2017-05-21

I don't have RN-42 but my friend sent me the firmware. the problem is despite all my efforts i could't start the blueflash (No SPI Trasnports found! ), Fixed legacy mode too.
is it possible to start the program without connecting the actual RN-42?
I tried both Win XP and 10 RS2 pro. im pretty sure my connections are OK.
can anyone help me with that?

mcxitosa (author)2017-03-20

hello, i'm trying to flash the firmware...

i could not get the LPT port connection to work so i tried the FTDI
connection with the custom drivers but now when it is connected the blueflash is not openning

azigta (author)2016-07-28

Hi, first of all thank you so much for the tutorial, but I have a question. The ground of the voltage divider and the ground of the 3.3v source have to be connected together? Thanks

jessekey7 (author)azigta2017-01-01

yess

azigta (author)jessekey72017-01-01

thanks

Ruim5 (author)2016-05-31
Romninja (author)Ruim52016-06-16

Just wanted to say that I appreciate you sharing this, Thank you. Will test it out once i'm done using my BT module for a school project.

John T MacF Mood (author)2016-03-27

Good work, BUT, a lot of work to save 17 dollars. And the firmware on the RN-42 may be copyrighted, and that could lead to legal issues.

How is there a copyright infringement? From what I can tell the firmware comes from Qualcomm directly and is being flashed right back on an identical Qualcomm chip. On top of that the CSR's motto is "Push every boundary". I think this instructable is fallowing the manufactures motto

If you or anyone uses code they did not write to make a new chip, a duplicate of the chip written by another person or company, it's copyright infringement.

Thats the thing; the modules are different manufactures but the chips sets are the same and the firmware comes from the chip manufacture (which is patented) not the module manufactue from what I can tell. My understanding is firmware is not covered under copyright laws. It would be covered under patents and trade secret laws to protect an embedded algorithm. And with the firmware publicly available from the chip manufacture.... I dont think think the firmware is protected by either. Even If it is protected some how the firmware was still writen by the chip manufacture for that chip set. If anyone was infringing on a patent it would be the module manufacture of the HC-05. Right?

russnelson1 (author)Mumbles12016-05-26

Firmware is just software. Software can be copyrighted. This software *IS* copyrighted.

Funny, that's what I've been saying all all along. Thanks russnelson1

What you call "firmware" is software written to an EEPROM. If you "vampire" that software, then write it to a chip, you've circumvented the company that makes the written chip their rights to make a profit from writing the software to a chip and selling it. It is a copyright violation. And possibly a patent violation (if the company filed one).

The HC-05 maker is merely providing a blank programmable EEPROM on a board that can be incorporated into projects where you write your own software if you're so inclined. The person copying someone else's work and re-writing it to a blank EEPROM is the person who could have trouble.

That's silly. Besides, who cares.

The US Federal Code of Laws does not see it as "Silly", nor does the manufacturer of the chip being copied.

NickD93 (author)Mumbles12016-04-19

as I told you - the firmware is designed by Roving Networks.... NOT Qualcomm...

How do I know?.... Look me up on LinkedIn

NickD93 (author)John T MacF Mood2016-04-19

it is - looks at the RN42 datasheet

bhoffmanxvii (author)2016-03-28

A lot of comments about copyrights. For the firmware to be protected by copyright, there must be a copyright notice within the firmware binary. If it's a proper notice, then it can be protected, otherwise not.

This same issue enabled AMD to create a multibillion dollar company when Intel made some of it's work product available without such copyright notice.

russnelson1 (author)bhoffmanxvii2016-05-26

Uh, no. Under the Berne convention, everything is copyrighted as soon as you put pen to paper or hands to keyboard. Just google "Russ Nelson" if you doubt me.

Mumbles1 (author)bhoffmanxvii2016-03-28

??

SherylinRM (author)2016-05-14

I do not have a parallel device or port on my computer. Is there another way to flash the device?

If you already answered this I apologize.

[Had trouble getting through all the flamers].

VERY nice job by the way :)

Thank you :)

javi_el_largo (author)2016-05-12

Could you please share this firmware?

_Boltz_ (author)2016-04-10

Hello there, help me to program the module using another programmer rather than parallel port...... i dont have one.... please help

deswiger (author)2016-03-31

I started in computers back when we used "reel to reel" tape and "punch cards". I understood about 65% of what your video said. BUT, fortunately you did a great job of explaining things (calling your friend a nimnule for buying the expensive chip, breaking in all down, the nomenclature of the parts, where to get software, etc.). Great job.

meswanson (author)2016-03-27

This young man is obviously very bright. His video is very informative, with nice delivery and more entertaining than most. Folks, settle down and learn! Way too much chatter about everything, but the intent to share knowledge. Pay attention and there is plenty of knowledge to use in the future. Very well done, you can do what you want with this new skill or let your verbal output block your brains input. :-)

Gadget93 (author)meswanson2016-03-28

Yes. Well said, sir.

_Boltz_ (author)2016-03-28

and do i need a rn42 first to port the firmware ? or just i need an hc 05 module , that's it..... all pics connections are of rn42 i am not able to find hc 05 connection, please help

_Boltz_ (author)2016-03-28

i dont have a parallel port....... what to do ?

WannaDuino (author)2016-03-28

Hello, can not get the Bluesuite prggie

Do i have to make a account on that csr site? Or na!

Great ible btw

NickD93 (author)2016-03-27

Because its not Qualcomm's code... Its Roving Networks' (now Microchip)

It is certianly copyright infringement.

About This Instructable

81,685views

707favorites

License:

Bio: www.youtube.com/EvanKale91 === www.facebook.com/EvanKale91 === www.twitter.com/EvanKale91 === www.evankale.blogspot.ca
More by EvanKale:Pokemon Card DoorGuitar Cajon Mod (Internal Snare)Ratchet Knob (Unidirectional mechanism)
Add instructable to: