Hey, Im using the Adafruit QT Py ESP32-S2 and MCP4725 but Im having problems getting the output voltage to change, Im using the default triangle wave sketch but i keep getting a constant 1.6V output. I have the two modules attached using the STEMMA QT connectors. I have attached a picture of the code and wire setup.
Note: I added the VL53L4CX cause i want to take the value from the VL53L4CX and output a voltage using theMCP4725.
Thank you for your help.
Adafruit QT Py ESP32-S2 and MCP4725
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- CodeHax23
- Posts: 5
- Joined: Wed Jun 07, 2023 1:02 pm
Adafruit QT Py ESP32-S2 and MCP4725
- Attachments
-
- Circuit Image
- Screenshot 2023-06-07 122236.png (666.37 KiB) Viewed 186 times
-
- Triangle default Code
- Screenshot 2023-06-07 120530.png (82.54 KiB) Viewed 186 times
- dastels
- Posts: 15827
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
How are you measuring the output voltage?
Dave
Dave
- CodeHax23
- Posts: 5
- Joined: Wed Jun 07, 2023 1:02 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
Im using a multimeter and a oscilloscope.
- dastels
- Posts: 15827
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
The multimeter isn't of much use here IMO, it'll average the signal. What do you see on the 'scope? A flat lime?
Dave
Dave
- CodeHax23
- Posts: 5
- Joined: Wed Jun 07, 2023 1:02 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
Yeah, I see a flat line of ~1.6V. Ive tried changing the values a bit where instead of 0-5V its 0-3V but i still get the same result.
I used an I2C checker program and i can see that I have two modules 0x62 (DAC) and 0x29 (TOF).
I used an I2C checker program and i can see that I have two modules 0x62 (DAC) and 0x29 (TOF).
- dastels
- Posts: 15827
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
Any different if you add a delay in your loops to lower the frequency of the waveform?
Dave
Dave
- CodeHax23
- Posts: 5
- Joined: Wed Jun 07, 2023 1:02 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
It still does the same thing where it stays around ~1.6V straight line even with the delays.
- dastels
- Posts: 15827
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
You're using the STEMMA-QT connector? Try using Wire1 instead of the default Wire since it's the secondary I2C bus. See https://learn.adafruit.com/adafruit-qt- ... or-3107922.
Dave
Dave
- CodeHax23
- Posts: 5
- Joined: Wed Jun 07, 2023 1:02 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
Yes im using the STEMMA-QT connecton. after looking into the code for the triangle there was no reference of the wire command. so I looked into the Adafruit_MCP4725.h file and changed the &wire to &wire1 (see picure)
- Attachments
-
- Screenshot 2023-06-08 152055.png (63.6 KiB) Viewed 50 times
- dastels
- Posts: 15827
- Joined: Tue Oct 20, 2015 3:22 pm
Re: Adafruit QT Py ESP32-S2 and MCP4725
You're better off passing it as the second argument to the begin method, rather than changing the library. If you update, your change will be lost.
Dave
Dave
Please be positive and constructive with your questions and comments.