Hi!
First happy Newyear to all!
I am trying to connect a BH1750 ligth sensor to he BH1750 but when I compile I get an error 01? As soon I remove the BH1750 component I can compile.
I see in the Properties that there are two serieal channel, but no pin are shown. I change to "software" and are then able to choose pin for SDA and SCL, no matter which pin I choose, it wont work, error 01, any idea please?
Br Jorgen
ESP32 with BH1750!
-
- Posts: 777
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 670 times
- Been thanked: 175 times
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: ESP32 with BH1750!
Hi Jorgen
Happy New Year to you.
I've had good results with that sensor using a PIC, but I've not tried yet with any ESP.
I see though that the component doesn't automatically populate SDA/SCL pins, you need to select them as appropriate depending on channel. Are they correct for your channel?
I'll connect a sensor to an ESP when I get a chance and see what I get.
Regards
Happy New Year to you.
I've had good results with that sensor using a PIC, but I've not tried yet with any ESP.
I see though that the component doesn't automatically populate SDA/SCL pins, you need to select them as appropriate depending on channel. Are they correct for your channel?
I'll connect a sensor to an ESP when I get a chance and see what I get.
Regards
-
- Matrix Staff
- Posts: 1924
- Joined: Wed Dec 02, 2020 11:07 pm
- Has thanked: 623 times
- Been thanked: 645 times
Re: ESP32 with BH1750!
Hi Jorgen.
Happy new year to you and everyone else on the forums.
I have tried BH1750 with ESP32_DEVKITV1 target and it compiles for me with Channel1 for the sensor selected. Are all your components up-to-date?
If they are not and you do a full database update, don't forget to reload your project after.
In addition to chipfryer27 post, you will need to select the pins from SDA & SCL Remap pins.
When you first add the component it should state unconnected for both SDA & SCL pins.
You just select the pin from the Remap pin below, which will be blank for an unconnected pin.
Can you run ESP-IDF Command Prompt, which can be found on your desktop?
Alternatively, press your windows key and scroll down to ESP-IDF, select it, and you should see the ESP-IDF Command Prompt.
Type then the enter key
Then paste the reported version.
Happy new year to you and everyone else on the forums.
I have tried BH1750 with ESP32_DEVKITV1 target and it compiles for me with Channel1 for the sensor selected. Are all your components up-to-date?
If they are not and you do a full database update, don't forget to reload your project after.
In addition to chipfryer27 post, you will need to select the pins from SDA & SCL Remap pins.
When you first add the component it should state unconnected for both SDA & SCL pins.
You just select the pin from the Remap pin below, which will be blank for an unconnected pin.
Can you run ESP-IDF Command Prompt, which can be found on your desktop?
Alternatively, press your windows key and scroll down to ESP-IDF, select it, and you should see the ESP-IDF Command Prompt.
Type
Code: Select all
idf.py --version
Then paste the reported version.
Martin
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: ESP32 with BH1750!
Hi
Just a quick follow up. I did use the component with an ESP and a I2C display. I only have a deleted photo so I'm guessing I was just testing code. However it did work as expected.
Incidentally, when I add the component, the SDA and SCL pins default to Port B4 including both remaps, so you will probably need to set yours to something suitable.
Regards
Just a quick follow up. I did use the component with an ESP and a I2C display. I only have a deleted photo so I'm guessing I was just testing code. However it did work as expected.
Incidentally, when I add the component, the SDA and SCL pins default to Port B4 including both remaps, so you will probably need to set yours to something suitable.
Regards
-
- Posts: 777
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 670 times
- Been thanked: 175 times
Re: ESP32 with BH1750!
Hi Martin & Chipfreyer!
Thank´s for fast reply. Well my fault (of course) sorry
Of course I know *I have to go to the rigth side of the proporties panel and scroll down and choose the alternative pin number, forgot that, notice that when I saw your att. picture.
Now no problem with compiling and it work perfect.
By the way Martin, do you know when release of FC10 is it almost on the"corner"?
Br Jorgen
Thank´s for fast reply. Well my fault (of course) sorry

Now no problem with compiling and it work perfect.

By the way Martin, do you know when release of FC10 is it almost on the"corner"?

Br Jorgen
-
- Valued Contributor
- Posts: 1528
- Joined: Thu Dec 03, 2020 10:57 am
- Has thanked: 353 times
- Been thanked: 549 times
Re: ESP32 with BH1750!
Hi
Glad to hear it's working for you, it's a great little sensor.
So easy to overlook the simplest of things. Guess who reversed I2C pins yesterday and spent ages trying to figure out why things didn't work before resorting to the "sniffer"....?
Regards
Glad to hear it's working for you, it's a great little sensor.
So easy to overlook the simplest of things. Guess who reversed I2C pins yesterday and spent ages trying to figure out why things didn't work before resorting to the "sniffer"....?

Regards
-
- Posts: 777
- Joined: Thu Dec 03, 2020 8:25 pm
- Location: Denmark
- Has thanked: 670 times
- Been thanked: 175 times
Re: ESP32 with BH1750!
Hi Chipfreyer!
Yes, "So easy to overlook the simplest of things" Believe me, I have tryed this many times, but never give up, that´s how we learn best
And yes this BH1750 is a very reliable tiny component.
Do you know when FC10 will be released?
Again thank´s to you both.
Jorgen
Yes, "So easy to overlook the simplest of things" Believe me, I have tryed this many times, but never give up, that´s how we learn best

And yes this BH1750 is a very reliable tiny component.
Do you know when FC10 will be released?
Again thank´s to you both.
Jorgen
-
- Matrix Staff
- Posts: 1472
- Joined: Sat Dec 05, 2020 10:32 am
- Has thanked: 204 times
- Been thanked: 349 times