-
-
Save glmnet/49ca3d6a9742fc3649f4fbdeaa4cdf5d to your computer and use it in GitHub Desktop.
// this gist is no longer needed, | |
// see https://github.com/glmnet/esphome-components/blob/main/docs/arduino_port_extender.md | |
// for up to date information |
// this gist is no longer needed, | |
// see https://github.com/glmnet/esphome-components/blob/main/docs/arduino_port_extender.md | |
// for up to date information |
Hi, do you know about the Problem, that neighborhood Analog Inuts have wrong values.
I want to read some of those Sensors: https://de.aliexpress.com/item/1005004819365767.html
Reading a single Sensor has no problems (eg A0). But if I add a second one to A1, the voltage is much higher as its really is.
I have no really solution.
On some Formthreads, they write, that you have to read the ANalog Pin twice and only use the second result:
https://forum.arduino.cc/t/analog-input-affected-by-its-neighbor/88758
or
https://forum.arduino.cc/t/cross-voltages-from-neighbor-analog-input/178708
That’s interesting. Didn’t know
you can try using update interval: none on the sensor s so you disable automatic polling. Then write an interval script which will call component update on the sensors, eg call it twice in A0 and the pick the value on the second call then call twice A1
Do you have a small example for me? I will test it shortly.
This does disables polling and calls to update explicitly
https://github.com/glmnet/esphome_devices/blob/master/my_home/eh-energia.yaml
You might want to create another template sensor which you’ll set the value you read the second time
Thank you,
I think I got it.
I added a dummy analogRead() to the arduino Script before the reading for publishing.
Also I found a thread: firmata/arduino#334 (comment)
I also have added a interval Script to my yaml, to read the Analog Sensors in the correct sequence
- interval: 60s
then:
- component.update: analog_input_3_humidity
- delay: 1s
- component.update: analog_input_3_voltage
- delay: 10s
- component.update: analog_input_4_humidity
- delay: 1s
- component.update: analog_input_4_voltage
- delay: 10s
- component.update: analog_input_5_humidity
- delay: 1s
- component.update: analog_input_5_voltage
- delay: 10s
- component.update: analog_input_6_humidity
- delay: 1s
- component.update: analog_input_6_voltage
- delay: 10s
- component.update: analog_input_1_humidity
- delay: 1s
- component.update: analog_input_1_voltage
- delay: 10s
- component.update: analog_input_2_humidity
- delay: 1s
- component.update: analog_input_2_voltage```
Now I will test it for a couple of Days :-)
Hola buen dia. Existe la manera de usar el sensor dht11 conectado en arduino. Soy nuevo en esto y no he encontrado la manera.
Hello i am trying to use Arduino Port Expander in my home project where reliability is really important .
As a test, temporary I braked the i2c line between the port expander and the esp device. I got a following error immediately (which is good) :
[E][component:112]: Component was marked as failed.
And never recovered (that is not good).
I wonder how can this made more robust? eg. after the transient is gone should recover by them self.
Thank you
Hello everyone,
I have a little dumb question, I have it all working (the first version was working for me here),
but .... if the i2c bus hangs for some reason, I know the command to reset the ESP8266 ---> "- platform: restart",
but not the NANO (in my case) ... (so the i2c bus won't reset), is there a easy way to reset the NANO too in that same command ?
GreetingZzz
lol ... I see it now, @balazs111 has the same question :-)
Hello,
here is the solution: https://community.home-assistant.io/t/arduino-port-expander-i2c-connection-not-recover-after-failure/745984
In the end decided to use modbus because i needed to breach a longer distance what i2c was not able to handle
Hi @glmnet,
any chance you make a version for Arduino Mega 2560?
I've been using a modified version from @thebradleysanders in the last years, but with the migration from custom to external components I've lost the possibility to update my devices with the latest versions of esphome.
Thanks. Bye,
Vito
I forgot to mention here I created a new repo for this. See here
@fran6120 thats a nice story but the end was predicted. If you’re short on pins you can try to use the expander for simple io pins, eg relays switches and save internal gpio for sensors which requiere fast io pins. (And also switching pin mode from input to output quickly)