mruettgers / SMLReader

ESP8266 based smart meter (SML) to MQTT gateway
GNU General Public License v3.0
289 stars 67 forks source link

How to activate internal pull-up resistor when using more than one sensor? #56

Open GreaseMonkey88 opened 1 year ago

GreaseMonkey88 commented 1 year ago

Excuse my question, but I'm not too deep into programming. If I add another sensor, like in the circuit below, it will always pull both pins to ground as soon as one sensor opens. So my approach would be to activate the internal pull-up resistors to the sensor pin. But how?

Bildschirm­foto 2022-11-15 um 16 51 56
hamster65 commented 1 year ago

Your circuit is wrong. Do not connect D5 to D2. You have to use two external resistors between the Pins and 3,3V. Or activate the internal pull up resistors on both pins.

GreaseMonkey88 commented 1 year ago

Ok, I´ll try a different circuit. But where in the code would I activate the internal pull up resistors on both pins?