An obvious advantage is that it's a powerful ESP32 with 16Mb flash and 8Mb PSRAM, resulting in Annex having > 13MB file storage and > 8Mb System RAM.
And for anyone interested in the onboard neo-pixel, it is already connected wih gpio48
It also has the advantage of onboard DC skt and regulator allowing it to be conveniently powered by mains adapters from 7v to 12v.
But perhaps the most obvious advantage is the UNO footprint, which allows simple plug-in access to a wide range of UNO shields.
For instance: UNO proto shields offer a big stable platform for mounting sensors, or mini breadboard, or perhaps AnnexVGA resistors and VGA connector.
But I am starting this thread with a very practical example of an Annex 4 relay USB switcher for controlling up to 4 other usb items.
The N16R8 may be overkill for this, so you can save a couple of quid by using the black D1 R32 4Mb esp32 UNO clone for use with the relay shield.
Both esp32 UNO clones run Annex perfectly, but they operate with 3.3v gpio's instead of the arduinos 5v, although the 4 relay shield operates ok from 3.3v.
ESP 3.3v pins are 5v tolerant anyway, so receiving 5v logic levels from a shield should not be a problem.
But for any shields that only operate from 5v inputs, the esp 3.3v outputs may be too low, requiring use of cheap logic voltage level converters.
They can conveniently be mounted on a protoshield, but be aware that not all shields are stackable, and some may use long-pins headers going straight through from top to bottom, therefore how and where to insert input and output of level converters may need a bit of thought. For instance, the blue protoshield has UNO footprint lower pins for plugging on top of an UNO, but the top female headers are narrower, and just for plugging in dupont cables.
Whereas the red screw protoshield uses staggered bottom pins and top headers, making it stackable on top also. And because the left and right side by side pins and female headers are offset, it is possible to carefully cut the required track joining pin and header to insert logic level converters.
This is not necessary for the 4 channel relay shield shown below, because the relays are already suitable for operating directly from 3.3v gpio's.
I would not feel comfortable switching mains voltage with the relay shield, so I would probably use 3v input SSD relays to control mains devices.
But a lot of things nowadays are powered by 5v USB, so the relay shield and a single 5v 3a to 5a supply could be used to control up to 4 USB devices.
Here is a simple script with individual relay controls plus all on and all off controls.
Code: [Local Link Removed for Guests]
'ESP UNO 4 Relay shield
title$="Annex ESP UNO 4 Relay shield"
'uncomment your Esp UNO type
uno$="esp32"
'uno$="s3"
select case uno$
case "8266": a=7: b=6: c=5: d=4
case "esp32": a=14: b=27: c=16: d=17
case "s3": a=14: b=3: c=20: d=19
case else: wlog "esp UNO type not recognised"
end select
pin.mode a,output: pin(a)=0
pin.mode b,output: pin(b)=0
pin.mode c,output: pin(c)=0
pin.mode d,output: pin(d)=0
ledA=1: ledB=1: ledC=1: ledD=1
onhtmlreload webpage
gosub webpage
wait
webPage:
cls
autorefresh 1000
gap=2
a$ = ""
a$ = a$ + "<br><br>"
a$ = a$ + "<div id='div' style='display: table; margin-right:auto;margin-left:auto;text-align:center; '>"
a$ = a$ + cssid$("div", "xfont-sizex:1.5em; xtransform: scale(1.3);")
a$ = a$ + "<h2>" + title$ + "</h2>" + "<br>"
a$ = a$ + led$(ledA) + string$(gap," ") + button$("A",toggleA) +"<br>"
a$ = a$ + led$(ledB) + string$(gap," ") + button$("B",toggleB) +"<br>"
a$ = a$ + led$(ledC) + string$(gap," ") + button$("C",toggleC) +"<br>"
a$ = a$ + led$(ledD) + string$(gap," ") + button$("D",toggleD) +"<br>"
a$ = a$ + "<br><br>"
a$ = a$ + button$("All ON", allON) + string$(gap," ") + button$("All OFF",allOff) +"<br><br>"
html a$
a$ = ""
return
toggleA:
if pin(a)=0 then ledA=0: pin(a)=1: else ledA=1: pin(a)=0
return
toggleB:
if pin(b)=0 then ledB=0: pin(b)=1: else ledB=1: pin(b)=0
return
toggleC:
if pin(c)=0 then ledC=0: pin(c)=1: else ledC=1: pin(c)=0
return
toggleD:
if pin(d)=0 then ledD=0: pin(d)=1: else ledD=1: pin(d)=0
return
allOn:
pin(a)=1: pin(b)=1: pin(c)=1: pin(d)=1
ledA=0: ledB=0: ledC=0: ledD=0
return
allOff:
pin(a)=0: pin(b)=0: pin(c)=0: pin(d)=0
ledA=1: ledB=1: ledC=1: ledD=1
return
end '------ END --------