News:

;) This forum is the property of Proton software developers

Main Menu

CH9141 Bluetooth module

Started by david, Nov 23, 2023, 07:48 AM

Previous topic - Next topic

david

Hello All,
A friend dropped off several tiny Bluetooth modules and asked if I could get one going to replace the HC-05 module widget I did for him.  The board is 1cm x 1cm and I eventually got it mounted on a small, pinned carrier board to plug in to the breadboard.
I can talk to it via the AT commands and it responds correctly.
I can detect it on my phone and pair with it so I know it's sending and receiving.
Baud rate is on 115200 which is the default and happens to be what I need.
But I can't connect with it.
Has anyone else played with these little boards? 
 https://www.aliexpress.com/item/1005005819533217.html?spm=a2g0o.productlist.main.1.3c72795d6zHSL9&algo_pvid=60b5c8b8-8683-4696-aacd-9631faae4d92&algo_exp_id=60b5c8b8-8683-4696-aacd-9631faae4d92-0&pdp_npi=4%40dis%21NZD%218.31%217.89%21%21%214.92%21%21%402101f04d17007254265841938eeeb3%2112000034463676156%21sea%21NZ%21916888149%21&curPageLogUid=48gJsA33tdZH
I'm unsure if they are BLE only or even if that should matter.  I just wanted to replace the HC-05 SPP module.

Cheers,
David

Mapo

hi, I did some tests, the CH9141 is a very low consumption BLE, Bluetooth module.  It doesn't communicate like normal Bluetooth, the phone needs an app created for communication with BLE

Mapo

david

Hi Mapo,
That's what I feared.  Thank you for sharing your experience with the module.
I will see if it's possible to change the phone app.

Cheers,
David

atomix

It is better to use these modules (JDY-33), they have dual UART and BLE protocol.

https://aliexpress.com/item/33055460468.html

david

That would make things easier but it's just a little bigger than we had hoped to get.  I think Bluetooth 3 and under will support Bluetooth Classic SPP and many later chips also - just not the one I'm playing with.
By downloading a BLE diagnostics app I did get to see my data being sent to my phone so I know the chip is working and my phone is not too old but as Mapo has indicated, I need a new app for the BLE and I don't think I'm up to developing that myself.

That's a really good price and it would save me from getting a new app....hmmmm.
Thanks for the heads up on that one.

Cheers,
David

John Lawton

I'm looking at implementing Bluetooth serial comms between a PIC based control board and an Android tablet. Could you give me an update on what module you used or perhaps would use from those available now, two years on?

John

charliecoutas

It looks as though they (JDY-33) are still available, at 0.76p each!


david

Hello John,
We didn't proceed past the Bluetooth Classic so I never fully tested the BLE modules I had.  Even with the Bluetooth Classic we found some phones worked while others didn't.  Asking others who had implemented Bluetooth connections on their products the experience was mixed with some indicating that their app sometimes failed after phone updates.  We eventually wimped out and simply added a small OLED display to the product so we could be independent of BLE app developers and avoid multi-platform support.  Hopefully others might have had a better experience.  The modules are cheap so you can arm yourself with a bunch to play with.  I struggled writing a phone app but eventually had it running nicely - just not on all phones and I could see this as an unwanted support problem.
Good luck.

Cheers,
David

John Lawton

Thanks.

Yes, the JDY-33 are really cheap, but I don't necessarily need to go bargain basement on this project, just affordable, reliable and available.

A display unit comprising a 5 - 7" touch screen graphical LCD with a PIC driver & BT might also be an option, but I was thinking that using a readily available Android tablet would mean I wouldn't need to develop the former.

So I'm currently considering an Android tablet display where I would be able to specify/supply particular models, so 100% compatibility over all other models shouldn't be an issue.

My hardware design is then just that of the control & I/O board with a BT module fitted.

So if I use an Android tablet for a fairly simple Bluetooth UART type application running full-screen with some nice graphics, (user operated rotary dials, bargraphs etc), any suggestions as to a nice development platform, bearing in mind I'm not an accomplished programmer?

John


atomix

I usually write a PWA app using the Quasar framework

And it can be run in the Chrome browser (Android) or Bluefy (iOS)

John Lawton

Thanks Atomix, I hadn't heard of progressive web apps till now, interesting.

John

JonW

#11
There is B4A John (Basic 4 Android) - I haven't used it personally but
it's low cost, relatively easy, and uses BASIC syntax, which should be
familiar to you.

Another option: Run Xojo on a low-end RPI with MBS plugins. The Pi
would handle your Bluetooth UART communication or Bluetooth direct, and you'd access the
interface from your Android tablet via browser (Pi runs a Xojo web app),
same as Atomix suggested.

MBS plugins are great for custom UI controls like rotary dials
and bargraphs and contains low level Serial, network and USB API. This
gives you more hardware to manage, but it is much easier UI development
if you're comfortable with Xojo.

Alternatively, you could skip the tablet entirely and use an HDMI LCD
directly connected to the Pi - simpler wiring, no WiFi needed, running
Xojo desktop apps.


EDIT:

Also consider the MIT App Inventor - this could be a quick platform
to test out the hardware and protocols, and then move on to a fancier app.
 

John Lawton

"...uses BASIC syntax, which should be familiar to you."

Ha ha, you understand me very well :) thank you all the leads.

I am looking a designing my own hardware/software system to compete with a commercial controller unit that I believe is Raspberry Pi based. It uses a separate HDMI screen and communicates with various Bluetooth sensors and has a number of relay control outputs.

This is for use in a vehicle so all is DC powered.

My unit would have a number of PWM power drivers instead of relays so could offer brightness control of lighting etc as opposed to just on/off. I'm not sure how many independent PWM outputs a Pi board has so I was going to use PIC hardware as I did in a previous lighting controller unit. But I could combine the two if needed.

I thought to use a commercial Android tablet as that hardware would come in a nice package suitable for panel mounting with built in battery & charger.

If I used an HDMI screen I assume I would have to design my own case etc for it, and if I used a Pi then I assume that would need some sort of battery backup for that to prevent data corruption, so quite a lot of extra hardware.

I'm a bit old school and if I had a decent size graphics display 5"-7" that was supported then I would be happy using that with a PIC based controller unit. No nasty OS or hard drives or memory cards to worry about.

Or should I get more up-to-date?

John

JonW

#13
Do what you think is right, John. Android tablets are affordable, highly portable and well-suited for the job. Still, app development can be pretty complex and expensive if you need to use external developers or buy a high-end platform.  I would take a look at B4A, I'm sure with AI assistance, you'll be up and running in no time. You could look at an embedded option but would think creating the Gui would be very time consuming and hard to customise.

EDIT:
There are some linux based tablets like PineTab2, you could then use XOJO to build an app and have connectivity, email, wifi etc