Esp8266 to drive emontx shield

wondering if anyone tried using esp8266 to drive emontx
in the purpose to scale down my GTI limiter project. and making a wifi remote node for my normal GTI limiter driven by an arduino i was wondering if anyone has tried a esp8266 and a 74HC4051 CMOS analog multiplexer it give the esp8266 8 analog ports afterwards - and I realize there will be a reduced resolution. But it does not look like it would be to hard to do. though space on the esp8266 may become an issue

no one tried- oh okay. I have to wait for my multiplexers to come in I ordered them today it will be a few weeks I ordered some 8 channel and some 16 channel. (20 cents each including the shipping ) , currently rewrote emonLib.cpp a little bit. it should work i think but with out the IC to proof it i I am uncertain it working . it was not hard I just modified the analogRead to pull data from the multiplex instead…-- would be pretty nice to pull info off 16 CTs. with a esp8266, but I guess technically i could use 1 ardruino uno and 2 possible 3 16 channel multiplexers and do 32 - 48 CTs at once if one wanted

I am curious about your plan. I don’t have enough knowledge to help you out, but keep us posted on your progress.

Thanks,
Ryan

1 Like

well if someone wants to try the emonlibESP they are welcome to it should works on both esp and arduino boards , I am still waiting for analog multiplexers but i have tested the software as much as i can currently and it is doing what it is suppose to do, it set up to work with 4-16 channel multiplexers it starts from pin7 to 0 . so if you use a 4 channel you would use digi pin 7 and 6 , if an 8 channel 7, 6 and 5 and if a 16 channel 7,6,5 and 4 you can expand it to use a larger multiplexer you just have to expand the “truth table” found with in emonlib.cpp. there are example for each current, voltage and current and the txshield

to reassign digi pin you just need to adjust DDRD = B11111111; found in the sketch to DDRD = B11110000; or initialize 7, 6, 5 and 4 or DDRD = B10101100; to set to 7,5,3, and 2

if someone finds an error you can report it here if they like
oops uploaded wrong one
EmonLibESP_1.zip (9.5 KB)

though this fritz is not 100% accurate or complete as I did not have a template of the arduino mega shield that i used and left out some to reduce confusion, but it will give you a reasonably representation.

buy this arduino mega proto shield
cost $1.60 on aliexpress.com what nice about them their pins are staggered

buy this 8 channel multiplexer
cost $1.90 if sourced from aliexpress

and wemos d1
cost $3.50 on alliexpress

when you buy the arduino mega proto shield buy one that not put together yet, but if you can not find it you just have to de-solider some headers if you want but not necessary. all you really have to do is cut the analog trace between the the two header blocks A0- A5

once your done that and the 8 channel chip is installed on arduino mega proto shield , just attach the webmos d1 to the bottom of the shield and the emontx shield to the top. program it webmos di using the above library and hopefully all should work accordingly ( though I still waiting for my multiplexers to arrive to verify )

for a total cost $7.00. it not a that terrible (not including the emontx shield)

if you wish to addin the extra 3 CTs. just follow the wiring pattern described here

for the 16 channel multiplex I was going to connect analogue it the 40 pin header on the mega proto shield . then 15 port ct base that connect by cable for easier positioning

the nice thing about using the the webmos d1 or linknode d1 the entire above shield is swappable with an arduino uno and you end up with a some open analog ports to boot