Pete's Blog BH1750 ambient light sensor to Tasmota WemosD1

Blog posts by pete_c

pete_c

Guru
This is a cross post from Homeseer.

Here have always tinkered with Weather Stuff -
1 - AAG 1-Wire weather station in the 1990's
2 - Davis Instruments Weather station in the 2000's
3 - NOAA - weather map downloading - RPi and SDR
4 - Lightning sensor - RPI project


fetch



fetch

References:

BH1750 ambient light sensor Tasmota
Wemos D1 Mini to Tasmota

Wemos D1 Mini ESP32 Development Board

Build a Multisensor Shield for ESP8266 *

Release binaries for Tasmota firmware 12.5.0 on ESP8266

Tasmotizer

Tasmota Timezone Table

Tasmota commands

* Optional


Hardware utilized

1 - BH1750 light sensor - pair purchased on Amazon for $11.39 USD

HiLetgo 2pcs BH1750 BH1750FVI Digital Light Illumination Sensor Light Intensity Sensor Module Light Intensity Ball for Arduino DC 5V

2 - Wemos D1 Mini - 5 purchased on Amazon for $15.99 USD

ACEIRMC ESP8266 ESP-12 ESP-12F NodeMcu Mini D1 Module for WeMos Lua 4M Bytes WLAN WiFi Internet Development Board Base on ESP8266 ESP-12F for Arduino,Compatible with WeMos D1 Mini (5pcs)

2 - might also purchase a multiple sensor "hat" for the WeMos D1 and a weather proof case for outside use.

Configuration:

1 - updating the WeMos with Tasmota-sensors bin
  • Using Tasmotizer in Linux here....IE: python3 tasmotizer.py
  • update D1 mini with current version of Tasmota
  • configure device with your home WLAN
  • upload minimal tasmota.bin to D1 Mini then upload tasmota sensor bin to D1 Mini
  • use generic configuration 18 for D1 Mini

2 - tasmota configuration and testing light sensor

Basic Tasmota configuration used here on all of my Tasmota devices
  • Configure time using Tasmota time zone table ==> Chicago
  • Code:
    Backlog0 Timezone 99; TimeStd 0,1,11,1,2,-360; TimeDst 0,2,3,1,2,-300
  • Configure NTP servers ntpserver1, ntpserver2 and ntpserver3
  • Code:
    [*]ntpserver1 xxx[*]ntpserver2 xxx[*]ntpserver3 xxx[*]
  • configure longitude and latitude
  • Code:
    [*]longitude xxx[*]latitude xxx[*]


Testing using 4 pins with ambient light then testing with flash light. Note once configured it sees the BH1750 light sensor as a device.

The following is using blakadder tasmota template

Code:
{"NAME":"Wemos D1 Mini ESP32","GPIO":[0,0,1,0,1,1,0,0,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0],"FLAG":0,"BASE":1}

fetch
 
Last edited:
BH1750 ambient light sensor to Tasmota Wemos D1 - Outdoors installation - Solar charging

References:

Power ESP32/ESP8266 with Solar Panels (includes battery level monitoring)

Hardware:

MakerFocus 10pcs TP4056 Charging Module with Battery Protection 186 50 BMS 5V Micro USB 1A 186 50 Lithium Battery Charging Board - Amazon $7.99
The TP4056 lithium battery charger module comes with circuit protection and prevents battery over-voltage and reverse polarity connection.


5V 1.2W Solar Panel X 2 - Amazon or Ebay - less than $10 each
The solar panels we’re using have an output voltage up to between 5V to 6V. If you want your battery to charge faster, you can use several solar panels in parallel. In this example we’re using two mini solar panels as shown in the following figure.

3.7V 5800mAH Lithium Li-ion Rechargeable Battery Batteries with 1 Slot Charger - Ebay ~ $12

Voltage Regulator - Low-dropout or LDO Regulator MCP1700-3302E -

esp32-solar-powered-ff.png


With battery monitoring circuit

esp32-solar-powered-battery-monitor.png


  1. The solar panels output between 5V to 6V with direct sun.
  2. The solar panels charge the lithium battery through the TP4056 battery charger module. This module is responsible for charging the battery and prevent overcharging.
  3. The lithium battery outputs 4.2V when fully charged.
  4. You need to use a low dropout voltage regulator circuit (MCP1700-3302E) to get 3.3V from the battery output.
  5. The output from the voltage regulator will power the ESP32 through the 3.3V pin.
Sunday, May 07, 2023 status and side note:
Configured two light sensors. This week will test one outdoors. Off the main topic also configured two additional Wemos D1 devices to replace two old Tasmota Sonoff basic (modded) that I was using for 4 1-wire sensor devices. It is just hot swapping these devices and only three wires using for the 4 temperature 1-Wire networks.

Tuesday, May 09, 2023 status and side note 2:
Liking the easy Wemos D1 devices switched my two old Sonoff Basic - Tasmota - 1-wire devices (to four temperature sensors) over to the Wemos D1. Originally had Espurna firmware on these and something still remains after wiping firmware which makes it so that I cannot upgrade these anymore unless I JTAG them. Performance is much better and footprint is tiny. I mentioned here on a post that I am also tinker with the new ITead (Sonoff) THR316 (Sonoff TH Origin). I am having issues with the developmental Tasmota firmware on these two devices. I also have the second generation models (Sonoff TH) and never have had any issues with them.

Friday, May 19, 2023 status:
Going to use the two configured sensors in two rooms with skylights. TV Room skylights on a sunny day washes out the TV.
Tested integration with Home Assistant today. Works fine.

Today installed one in the master bathroom with one skylight. It is cloudy and raining today. Two LED flat lamps which replaced the two cans on either side of the skylight. When two LED spots are on illumination goes to 200 plus.

Saturday, May 27, 2023 status:
One of the two sensors will be used in the TV room with skylights and maybe shades. The second one will be mounted on the Davis weathermast in a weather proof case. Purchased a multifunction weather hat for the Wemos D1.

fetch


BH1750-1.jpg
This is the BH1750 in the TV Room - Great room with two skylights.

BH1750-2.jpg
 
Last edited:
Back
Top