ESP32 S2Mini

Annex for ESP32
User avatar
cicciocb
Site Admin
Posts: 2717
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 576 times
Been thanked: 1958 times
Contact:

Re: ESP32 S2Mini

Post by cicciocb »

[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Tue Jun 04, 2024 1:13 pm Ok, thanks. I had been dividing down my actual voltage (18.8V DC) with a margin, so 21V to 3.3. So instead, I need to divide down to 2.5V.

Are the attenuation options settable from Annex? (E.g., ADC_ATTEN_DB_11--which seems to be in effect for my S2Mini)
No, the attenuation is not settable and is fixed to the max range.
lyizb
Posts: 231
Joined: Fri Feb 12, 2021 8:23 pm
Has thanked: 118 times
Been thanked: 81 times

Re: ESP32 S2Mini

Post by lyizb »

It's now working as expected, other than that it is maxing out at 2.62V (on my voltmeter) with an ADC reading of 8191 (while at 2.6V the reading is 8161.

Of course, there's no guarantee that my voltmeter is accurate to a tenth of a volt.

I still have to calibrate to my voltage reading before the voltage divider 100K-o-12K, but I'm close to within a couple of tenths of a volt, which is more than good enough for my purposes.

Thanks very much.
lyizb
Posts: 231
Joined: Fri Feb 12, 2021 8:23 pm
Has thanked: 118 times
Been thanked: 81 times

Re: ESP32 S2Mini

Post by lyizb »

Another PCB for the ESP32-S2Mini. This is for the outer rows of pins, which means it will also work for an ESP8266-D1Mini and on the inner rows of pins on an ESP32-D1Mini.
S2Mini outer pins PCB V2.jpg
and fully populated: pin 39--DS18B20; 37--DS18B20; 35 I2C-scl; 33 I2C-sda (OLED); 16, 18, 11, 12--relay module; 3,5,7,9--LED module:
S2Mini outer pins PCB V2 populated.jpg
Here's a better (if blurry) view of the OLED:
S2Mini outer pins PCB V2 OLED.jpg
Here's a youtube video of the board with 5V LEDs, 12V LEDs, DS18B20s, and 128x64 OLED: https://youtu.be/WSGGTyC6Vwc

Here's the program I used to exercise the PCB in the video:

Code: [Local Link Removed for Guests]

' t1,bas
dim LEDstatus$(2)=" OFF"," ON "
dim pLED(4)=3,5,7,9
dim p12V(4)=16,18,12,11
for i=0 to 3
  pin.mode p12V(i),output
  pin.mode pLED(i),output
next i
dim pTmpr(4)=39,37,35,33
dim tmpr$(4)
gosub pinset
flagI2C=0
k=0
gosub setI2c
print "before DO",millis

do
  for i=0 to 3
    if i=0 or i=1 then
      tmpr$(i)=tempr$(pTmpr(i),1)
      if tmpr$(i)<>"-127" and tmpr$(i)<>"85" then
        ln$="Temp"+str$(i+1)+": "+str$(val(tmpr$(i)),"%3.1f")
      else
        ln$="Line "+str$(i+1)
      endif 
    else
      ln$="Line "+str$(i+1)
    endif 
    if flagI2c then ' or <>
      k=int(rnd(2))
      pin(p12V(i))=k
      pin(pLED(i))=1-k
      ln$=ln$+" pin "+str$(p12V(i))+LEDstatus$(k)
'    else
'      t1=millis/1000
      oled.print 0,i*16,ln$
'      t2=millis/1000
'      wlog "Lapsed time print: ",i,t1,t2,"lapsed: ",t2-t1," seconds"
    endif 
    wlog i+1,ln$,k
    pause 1000
'    print "before NEXT",i,millis
  next i
'  gosub pinset
  pause 2000
'  t1=millis/1000
  if flagI2C then
    oled.cls
  endif
'  t2=millis/1000
'  wlog "Lapsed time cls: "," ",t1,t2,"lapsed: ",t2-t1," seconds"
  pause 500
loop

pinset:
  print "pinset",millis
  for i=0 to 3
    pin(p12V(i))=1
    pin(pLED(i))=1 ' pin(5)=1: pin(7)=1: pin(9)=1
    pause 500
  next
  for i=0 to 3
    pin(p12V(i))=0
    pin(pLED(i))=0 ' pin(5)=1: pin(7)=1: pin(9)=1
  next
  return

setI2c:
  i2c.setup 33,35 ' 18,16 ' SDA,scl
  OLED.INIT 1 ',1 ' 0=normal orientation (,1->1.3" SH1106)
  OLED.CLS ' clear the screen
  OLED.FONT 1 '1=10pixels,2-16,3=24
  OLED.COLOR 1
  for i=0 to 3
    OLED.PRINT 0,i*16,"Line "+str$(i+1)
    pause 500
  next
  OLED.CLS ' clear the screen
  flagI2C=1
  return
Attached are the gerbers for ordering from JLCPCB. They're for V3. I fixed a spot where I had to gouge out a trace which had wandered without my noticing it, added a pin hole to make it easier to add an I2C port when the relay port is in use, and added some more labels.

When soldering pins to the S2Mini, I used a long pin in the 3V3 hole. That's to provide power to another PCB which will use the inner rows of pins. Coming soon.
You do not have the required permissions to view the files attached to this post.
Post Reply