Bruh multisensor

ive follwed the tutorial the awesome @bruhautomation has on his github for the multi sensor and all is working wonderfully…except the PIR and light sensor

I bought all the components listed on the git page, but the PIR doesnt seem to read anything?

It always reads “standby”

and the light sensor seems to work inverted, i,e. the lighter it is the lower the reading, as it gets darker the value increases?

has anyone else experienced this?

ive hooked up a known working PIR and that also does not register?

What is working well, if the sensor is not working, nothing​ is working…??

I built 2 (still waiting on my PIR components to arrive from China) and the light sensor works fine on both. Since I don’t have the PIR wired in I’m not sure if it matters but they both show ‘motion detected’.

No, you miss-read
The rgb led is working
The DHT22 is working

The light sensor works but in the opposite way to logical thinking, i.e. I was assuming a high value means more light.
But in my case, as light levels increase, the value decreases.

And the pir sensor is not registering any movement. It is constantly reading “standby” in the front end mqtt sensor component.

Strange, we both use the same code and setup but have different results.
If I remove the pir completely I still get nothing other than “standby”

Most likely the input pin for the PIR is in an indeterminate (floating) state when the PIR is removed. This means it can show as either state, by chance or component variation. One way to solve this is to enable the internal pull up/pull down resistors in the chip, but it’s kind of irrelevant in your case.

How can I rectify this?

Most PIR sensors need pull up resistors, so assuming you’re using the code from here, change line 140 in bruh_mqtt_multisensor_github/bruh_mqtt_multisensor_github.ino to:

 pinMode(PIRPIN, INPUT_PULLUP);

That said, it really is a very minor issue, since in normal operation you would have the PIR connected and that appears to be working fine.

Good Luck, let me know if you run into issues.

I have done one of this with esp8266 12e which were laying around. I made my light sensor from LDR and resistor. even I had the same issue when the light is on it goes high (1024) and when it’s off it goes down. in my case issue was I had connected the power wrong polarity. changed positive to positive and negative to negative then it worked fine.

instead of led I used 12v RGB strip with transistors connected to pin 16,14,12.

have you got it working?
I have the same issue.

im afraid not, was hoping someone would pop along to shed some light!

The PIR vcc must be connected to 3.3v instead of 5v as shown in the diagram at Ben’s Github page.
Now it is working for me.

Perfect!
It works now. Thanks a lot!

another question on the multi sensor…

i think i should be able to flash, fade and apply effects to the RGB LED?

Can anyone explain how to do this please?

I created an automation to make it light up when motion is detected but I have not moved any further than that.

ive kind of sussed it…
i have an automation that will flash the LED red if motion is detected and notify me. However, it does not remain red…it turns to the colour that i last selected via the frontend.
So, for example i select purple from the frontend RGB GUI selector, my automation then runs, it flashes red, but then sets to purple?
here is the automation:

- alias: 'Bedroom Motion Detected'
  initial_state: True
  hide_entity: False
  trigger:
    platform: state
    entity_id: sensor.sn1_pir
    from: "standby"
    to: "motion detected"
  action:
    - service: notify.pushbullet
      data:
        title: "Home Assistant"
        message: "Motion in bedroom"
    - service: light.turn_on
      data:
        entity_id: light.sn1_led
        color_name: red
        brightness: 255
        flash: long

On another note, i still have the problem with the light sensor, the values seem to be backwards, so a higher value is representing low light, and a low value is representing bright light levels???

1 Like

I used same code which Ben created… for pinout I had to check wemos data sheet to find the right pins for sensors

1 Like

Reverse your + and - power to the sensor and that should cause brighter to be higher and darkness to be lower.