Page 1 of 1

HMC5883L

Posted: Thu Jun 27, 2019 6:31 am
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

Re: HMC5883L

Posted: Tue Jul 09, 2019 3:49 pm
by jgu1
No hope for me, ? please :(

Br.

Jorgen

Re: HMC5883L

Posted: Wed Jul 10, 2019 4:21 pm
by Benj
Hi Jorgen,

I'll have a look for you tomorrow.

Re: HMC5883L

Posted: Wed Jul 10, 2019 7:40 pm
by jgu1
So nice Ben, thank¨s in advance...

Br jorgen.

Re: HMC5883L

Posted: Thu Jul 11, 2019 11:22 am
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 224 times

Re: HMC5883L

Posted: Thu Jul 11, 2019 6:24 pm
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.

Re: HMC5883L

Posted: Thu Jul 11, 2019 8:35 pm
by Benj
Hi Jorgen,

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

Re: HMC5883L

Posted: Fri Jul 12, 2019 5:43 am
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

Re: HMC5883L

Posted: Fri Jul 12, 2019 6:03 pm
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.

Re: HMC5883L

Posted: Fri Jul 12, 2019 8:24 pm
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?

Re: HMC5883L

Posted: Sat Jul 13, 2019 8:46 am
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.

Re: HMC5883L

Posted: Sat Jul 13, 2019 2:49 pm
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

Re: HMC5883L

Posted: Mon Jul 15, 2019 9:46 am
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.

Re: HMC5883L

Posted: Mon Jul 15, 2019 12:39 pm
by jgu1
Hi Ben!

Thank you very much.

Br Jorgen

Re: HMC5883L

Posted: Tue Jul 23, 2019 9:22 pm
by jgu1
Hi Ben!

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

Br Jorgen

Re: HMC5883L

Posted: Wed Jul 24, 2019 12:41 pm
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.

Re: HMC5883L

Posted: Wed Jul 24, 2019 3:29 pm
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

Re: HMC5883L

Posted: Thu Jul 25, 2019 10:50 am
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 10209 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.

Re: HMC5883L

Posted: Thu Jul 25, 2019 7:03 pm
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

Re: HMC5883L

Posted: Thu Jul 25, 2019 8:49 pm
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.

Re: HMC5883L

Posted: Fri Jul 26, 2019 10:27 am
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.

Re: HMC5883L

Posted: Fri Jul 26, 2019 3:51 pm
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