Send generic values over I2C

36 views
Skip to first unread message

Daniel Bednarz

unread,
Apr 17, 2020, 9:51:51 AM4/17/20
to TasmotaUsers
Hi, is it possible to send generic values over I2C? I just want to send values between 0 and 255 to another microcontroller. MQTT -> I2C like a I2C-Bridge. Or do I have to program my own I2C module?
Thanks
Daniel

Cory Barrick

unread,
Apr 23, 2020, 10:41:03 PM4/23/20
to TasmotaUsers
I thought I replied to this once already?
Maybe I wrote something and got sidetracked before posting...

Anyway, I've been looking at i2c for communicating with several arduinos.
There are several i2C devices already supported in Tasmota. I thought about emulating one of them with an arduino.
And then I saw how easy it is to send/receive serial messages instead.

I don't know if this helps in your use case, but I'm now thinking of having an Arduino digest the serial commands.
It will run a program that uses i2c to read or write several *other* arduinos then.
If your remote device has a serial port and you're only talking to one device, I think you should really investigate using serial instead of i2c.

I'm trying to add 4 analog moisture sensors and 4 servos to one esp8266.
It already reads an analog tank level sensor, operates a valve, and cycles a pump.
I've simply run out of pins. Even if I emulate existing i2c devices, I can't add multiples of them in the firmware.
No support for more than one address of the same device type, near as I can tell.

Philip Knowles

unread,
Apr 23, 2020, 11:31:44 PM4/23/20
to TasmotaUsers, Cory Barrick
Sometimes it's easier if you explain why you want to do it. It MAY be possible but unless we know WHY we're only guessing.

Sent from Outlook Mobile


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Cory Barrick <coryba...@gmail.com>
Sent: Friday, April 24, 2020 3:41:03 AM
To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Re: Send generic values over I2C
 
--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
To view this discussion on the web, visit https://groups.google.com/d/msgid/sonoffusers/77e1005e-7415-4f70-b12e-a540d8ec1ad6%40googlegroups.com.

Philip Knowles

unread,
Apr 24, 2020, 12:05:36 AM4/24/20
to TasmotaUsers, Cory Barrick
Cory my reply was aimed at Daniel but have you looked at the DS2450? It's a quad Analogue to 1-wire converter and may solve some of your issues if you can make it work with ESP8266.

Regards

Phil K

Sent from Outlook Mobile


From: Philip Knowles <knowles...@gmail.com>
Sent: Friday, April 24, 2020 4:31:38 AM
To: TasmotaUsers <sonof...@googlegroups.com>; Cory Barrick <coryba...@gmail.com>

Cory Barrick

unread,
Apr 24, 2020, 8:32:27 PM4/24/20
to TasmotaUsers
I did see something about a supported analog-to-i2c chip in the list of devices. I don't remember what the part number was.
The approach I'm thinking of using may be more convoluted by comparison. But it uses parts I have on-hand and I think it'll be easier to expand if I want to add a 5th sensor or more GPIO.
I suspect I'm going to need an arduino at the sensor end anyhow. Analog doesn't like being carried over un-shielded runs of wire. Very easy to pick up stray voltage/current. I'm hoping i2c will be more reliable.
To unsubscribe from this group and stop receiving emails from it, send an email to sonof...@googlegroups.com.

Fred

unread,
Apr 25, 2020, 3:13:04 AM4/25/20
to TasmotaUsers
...also look at the ATTiny range of micros instead of an Arduino...an ATTiny85 will handle analog sensors and i2c quite well.

Daniel Bednarz

unread,
May 5, 2020, 3:50:58 AM5/5/20
to TasmotaUsers
I have a dimmer module for my dimmable LED bulbs. https://www.tindie.com/products/bugrovs2012/ardutex-trailing-edge-i2c-ac-led-light-dimmer/

The module expects I2C to communicate. Otherwise I have to modify the module-firmware to communicate via serial. But I'm not sure if that causes timing issues regarding the AC zero crossing.

Philip Knowles

unread,
May 5, 2020, 8:52:42 AM5/5/20
to TasmotaUsers, Daniel Bednarz
According to the product page they are using a UNO and open-source code. It may be worthwhile looking at the code on GitHub. Interestingly there is also an ESP8266 ino there too.

Regards

Phil K

Sent from Outlook Mobile


From: sonof...@googlegroups.com <sonof...@googlegroups.com> on behalf of Daniel Bednarz <daniel....@gmx.de>
Sent: Tuesday, May 5, 2020 8:50:58 AM

To: TasmotaUsers <sonof...@googlegroups.com>
Subject: Re: Send generic values over I2C
I have a dimmer module for my dimmable LED bulbs. https://www.tindie.com/products/bugrovs2012/ardutex-trailing-edge-i2c-ac-led-light-dimmer/

The module expects I2C to communicate. Otherwise I have to modify the module-firmware to communicate via serial. But I'm not sure if that causes timing issues regarding the AC zero crossing.

--
You received this message because you are subscribed to the Google Groups "TasmotaUsers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonoffusers...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages