ESP32
If I put a jumper from 3v3 to "pin 33" and run the code, shouldn't I get 4095? I get 0.
VLT = ADC(33)
wlog VLT ' gives me 0
Am I missing something?
Thanks
Zim
how to read module 3v3 on ESP32
- PeterN
- Posts: 392
- Joined: Mon Feb 08, 2021 7:56 pm
- Location: Krefeld, Germany
- Has thanked: 184 times
- Been thanked: 220 times
- Contact:
Re: how to read module 3v3 on ESP32
Hi Zim
I would expect that too ... and it did work for me at gpio33 within my levitation project - but with lower input voltage at around 1.7V. [Local Link Removed for Guests]
There seems to be a general need and ability to attenuate the input: https://docs.espressif.com/projects/esp ... s/adc.html
But that attenuation is set to the maximum in Annex32 as far as I see.
So a voltage above 2.45V should return 4095
I would expect that too ... and it did work for me at gpio33 within my levitation project - but with lower input voltage at around 1.7V. [Local Link Removed for Guests]
There seems to be a general need and ability to attenuate the input: https://docs.espressif.com/projects/esp ... s/adc.html
But that attenuation is set to the maximum in Annex32 as far as I see.
So a voltage above 2.45V should return 4095
Re: how to read module 3v3 on ESP32
Zim,
I did the same and it works for me.
wlog ADC(33) ' Read voltage from pin33
VLT = ADC(33)
wlog VLT ' gives me 0
wlog: 4095
4095
LOLIN D32 PRO ESP32 WROVER
Annex32 CAN 1.49.2
Jan
I did the same and it works for me.
wlog ADC(33) ' Read voltage from pin33
VLT = ADC(33)
wlog VLT ' gives me 0
wlog: 4095
4095
LOLIN D32 PRO ESP32 WROVER
Annex32 CAN 1.49.2
Jan
-
- Posts: 143
- Joined: Mon Feb 08, 2021 10:10 pm
- Location: Scotland
- Has thanked: 47 times
- Been thanked: 51 times
Re: how to read module 3v3 on ESP32
Likewise...
You do not have the required permissions to view the files attached to this post.
Re: how to read module 3v3 on ESP32
Hi Gentlemen;
Found the issue. The ESP32 s2 mini has a different pin layout than conventional ESP32. Its also 13bit sar on the ADC's.
3.3v gives me 8191.
Thanks for all of your replies
Zim
https://www.espressif.com/sites/default ... eet_en.pdf
Attn: Electroguard. I know you got some of these too!
Found the issue. The ESP32 s2 mini has a different pin layout than conventional ESP32. Its also 13bit sar on the ADC's.
3.3v gives me 8191.
Thanks for all of your replies
Zim
https://www.espressif.com/sites/default ... eet_en.pdf
Attn: Electroguard. I know you got some of these too!
- Electroguard
- Posts: 860
- Joined: Mon Feb 08, 2021 6:22 pm
- Has thanked: 276 times
- Been thanked: 323 times
Re: how to read module 3v3 on ESP32
Hi Zim, I dealt with the confusion of different device pinouts a while ago by creating a 'standard pin assignment block' for my scripts, and creating an S2 pinout chart to show what S2 pins correspond to the ESP8266 data pins (see below).
By using the Wemos D1 Mini D0 to D7 pin convention, it is possible to assign the relevant D? pins for any devices, thereby allowing the same script to be used with different devices simply by changing the esp$="device_type" variable for something relevant for the device.
The snippet below comes from an early development stage of a script I was developing for a colour-changing mood light that doubles as a battery-backed-up emergency light with audible alert in event of a power fail. I was only interested in the S2 device I was using at that time, so the pin assignments of the other devices were included for future use and are probably incorrect, and just included to illustrate the idea.
esp$="s2"
select case esp$
case "12E": D0=16:D1=5:D2=4:D3=0:D4=2:D5=14:D6=12:D7=13:D8=15 ' ledpin=15:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=33:
case "s2" : D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=35: ledpin=15:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=D4:
case "w32": D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=3: ledpin=2:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=33
case "t32": D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=3: ledpin=22:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=D4
case "t16": D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=3: ledpin=22:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=D4
end select
pin.mode ledpin,output:ledoff=0:pin(ledpin)=ledoff: ledflash=1
pin.mode relaypin,output:relayoff=0:pin(relaypin)=relayoff
pin.mode buzzerpin, output:pin(buzzerpin)=1
The diagram should be fairly self-explanatory...
By using the Wemos D1 Mini D0 to D7 pin convention, it is possible to assign the relevant D? pins for any devices, thereby allowing the same script to be used with different devices simply by changing the esp$="device_type" variable for something relevant for the device.
The snippet below comes from an early development stage of a script I was developing for a colour-changing mood light that doubles as a battery-backed-up emergency light with audible alert in event of a power fail. I was only interested in the S2 device I was using at that time, so the pin assignments of the other devices were included for future use and are probably incorrect, and just included to illustrate the idea.
esp$="s2"
select case esp$
case "12E": D0=16:D1=5:D2=4:D3=0:D4=2:D5=14:D6=12:D7=13:D8=15 ' ledpin=15:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=33:
case "s2" : D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=35: ledpin=15:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=D4:
case "w32": D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=3: ledpin=2:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=33
case "t32": D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=3: ledpin=22:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=D4
case "t16": D0=5:D1=35:D2=33:D3=18:D4=16:D5=7:D6=9:D7=11:D8=12:A0=3: ledpin=22:ledoff=0: relaypin=2:relayoff=0: buzzerpin=35: neopin=D4
end select
pin.mode ledpin,output:ledoff=0:pin(ledpin)=ledoff: ledflash=1
pin.mode relaypin,output:relayoff=0:pin(relaypin)=relayoff
pin.mode buzzerpin, output:pin(buzzerpin)=1
The diagram should be fairly self-explanatory...
You do not have the required permissions to view the files attached to this post.