HMC5883L

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

HMC5883L

Post by jgu1 »

Hi!

Again me :wink: It would be nice with the HMC5883L component I2C compass. Unfortunately I am not able to create one. I would be glad If
Somebody Will/could. Please.
Use it in my homebuild lawn

Thank’s in advance.

Br jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

No hope for me, ? please :(

Br.

Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

I'll have a look for you tomorrow.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

So nice Ben, thank¨s in advance...

Br jorgen.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

I'm out the office today but I've made the component for you, hopefully it should work well but let me know.

I'll push it to the update system tomorrow when I'm back in but here is the component file if you want to try it today.

Just copy the file into your "C:\ProgramData\MatrixTSL\FlowcodeV8\Components" folder and restart Flowcode. Note it's hidden by default in Windows explorer so just paste the address into the address bar.
HMC5883_Magnetometer.fcpx
(7.29 KiB) Downloaded 189 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!
Waow, what a service. One of the many reason I love Flowcode :lol: Thank´s Ben. I have tryed to test the new component, but I didn´t managed to get it work. I am sure I am doing something wrong. Please have a look on my test.

Thank´s in advance.

Jorgen.
Attachments
Compass.fcfx
(11.89 KiB) Downloaded 201 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

Try this instead.
Compass.fcfx
(11.89 KiB) Downloaded 204 times

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!

First seen this now. :D I make a test this this evening and you hear.

Again thank`s Ben

Br Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!

Sorry it doesn´t work. Nothing come out in the display It have two module none of them work, Not even a zero in display. :roll:
I have update....
But work fine in simulation.

Br Jorgen.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

Hmm,

There are no blocking functions in the component code but it may be the I2C CAL that is blocking. Do you have pull up resistors on the SDA and SCL traces? Internal pull up resistors may also be an option if your target device supports this.

Are you using software or hardware I2C? I believe software mode supports clock stretching which may account for the lock up if there are no pull ups?

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!


I change Channelmode from channel 1 to software mode, and now I see in the display for the X, Y, Z = -1, -1, -1 but no changes when I turn the compass.

Yes I have pullup resistor mounted.

These tiny module: https://www.ebay.com/itm/Magnétomètre-3 ... 2749.l2649

Any idea Ben, please.

Br Jorgen.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi again Ben!

Further investigation: Suddently, while I was surfing concerning the HMC 5883 I found out that there are two different type, and I have both. ?

On the PCB on the one type I see printed: GY- 271 and on the other GY- 273 but should be the same HMC5883 so why ??

FC8. If I perform the test with the GY - 273 I get the value -1 on X,Y,Z.

FC8. If I test the GY - 271 I get some random number when powering the Arduino up, and then it stop, nothing more happend.

I make a test from here with Arduino IDE "stolen" from here :wink: : https://www.instructables.com/id/Tutori ... duino-Uno/
With the GY-271 It work in Arduino IDE. But not with the GY - 273.??? For me, I would be glad if only one of them work in FC8.

(But I want in FC8 for implementing in a another project) :lol:


Maybe this help.

Br Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

I happened to buy one last week so it should hopefully arrive today and I'll be able to investigate why it isn't working for you.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!

Thank you very much.

Br Jorgen

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!

If you not have received the module yet, I can send you one. :D

Br Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

Sorry for the delay I had some time off to enjoy the nice weather :wink:

The module has now arrived, I'll have a go ASAP and let you know.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!

No rush Ben, enjoy the good weather 8) I have asked for help, and then I have to wait. I am glad you will create a component for me. Could be that the they forgot to send one for you.
Look forward to hear from you. :D
Br Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

I'm getting -1 too so I have sent off a question to the manufacturer to see if we can work out what is not working.
Comms.jpg
Comms.jpg (73.33 KiB) Viewed 8964 times
It could be that the datasheet is not quite right (there's not a lot of info there and what is there is a bit conflicting) so I might try and find a reference code library if I get some more time today.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!

Well, not so easy at all.
If it is to complicatet and need to long time, don`t spend more time on that, I know you are a busy man. :D

Br Jorgen

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

Hi Jorgen,

The eBay seller has admitted the sensor he sold to me is not actually the honeywell device and in fact is a similar Chinese device with a different I2C address and different register setup! I wonder if you've had a similar issue?

He's sending me the actual specifics for my device as well as a library so I will try and add this too.

I fond a library for the Honeywell device and my code looks like it should be ok so I'll push the updates I made today to the update system in the morning.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: HMC5883L

Post by Benj »

I've now pushed my changes to the HMC5883L component to the update system. Hopefully it will solve the problem you're having assuming you do actually have the HCM5883L sensor :wink:

My sensor ended up being a QMC5883L so I'll see if I can create a simple component to drive this now.

Edit, QMC5883L now complete and seems to be working nicely. I've already pushed this to the update system.

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: HMC5883L

Post by jgu1 »

Hi Ben!

I am really grateful, thank´s.

Follow up: Working nice.

FC8 component: QMC5883L I use hardware HMC5883L/GY273 Working perfect, Hmm... :wink: :D :D

FC8 component: HMC5883L I use hardware HMC5883L/GY273 Not working, Either with HMC5883/GY271.

I am more than happy with the result, now I know what I have to use in combination : FC8 component: QMC5883L ,hardware HMC5883L/GY273.

Again many thank´s Ben, now I can continue with my project where I have to use the compass, lawnmover. :lol:

Br Jorgen

Post Reply