Open rajdeep-engineer opened 6 days ago
Yes, the code has been tested.
Please upload the wiring details between the modules, the relevant parts of the sketch, and the outputs/errors.
Also please specify the module of ESP32 used.
I used the Mikroe Ultrasonic 2 Click board https://www.mikroe.com/ultrasonic-2-click with an ESP32 (DOIT ESP32 DEVKIT 1). In the Ultrasonic 2 Click, I replaced the default transducer with "PUI Audio UTR-1440K-TT-R".
The hardware connections are as follows:-
I ran the "GetDistance" example from your repository. This is what I get in the terminal.
There is a mistake in the readme where I have not mentioned the proper UART port to use. This not not the issue here because the port used in your setup is the correct one.
I'll probably write a change later on where you can pass a UART port when initialising the PGA460 object later.
On to the main issue, I've just tested the same example with a DOIT ESP32 DEVKIT 1
and a module that I've created using the ESP32-S3. The PGA460 module I used is the Texas Instruments PGA460PSM-EVM. Both setups worked fine for me.
The thing to note is that the PGA460PSM-EVM requires a 5V input to power, not 3.3V. Seeing that the module you are using is also transformer based, I would suggest that the MikroE module also requires a 5V input.
Alright, so I just went through the documentation for the MikroE module. There is a minor mistake in the silkscreen labeling for the pins (TST has a 16 above it when it should be 1), but otherwise the pin descriptions seem fine.
There is an EN pin connected to the TLV61046A that should be driven high to enable the board. Please check if you have tied that pin to the 3V3 pin.
I test with a PGA460PSM-EVM.
Here are the hardware connections:-
I am still not getting anything. Can you confirm if the hardware connection mappings are ok?
Yes, those hardware connections are correct. I do have additional pull ups for the UART lines (1k5 resistors).
If you are still only getting the output that had been posted previously, then the ESP32 has not connected to the PGA460 at all. My library does not currently check for a positive connection.
This lack of connection is usually because the PGA460 has not been powered properly, or a fault in the UART lines.
Notice the timestamps show immediate return of data after the separation line.
Notice the timestamps now show a ~2 second delay after the separation line - this is due to the UART timing out.
ok thanks for the screenshots.
I have checked the power pins of PGA460 and it seems fine. So, I am clueless why it's not working on both PGA460PSM-EVM and Mikroe Ultrasonic Click 2.
I am purchasing a BOOSTXL-PGA460 evaluation kit to study this further.
I had earlier written code for STM32 microcontroller to interface with PGA460. The strange thing I found is that PGA460 generated checksum is wrong (the checksum returned by PGA460 for against commands from MCU/controller). So, there is no way to tell if the data returned by PGA460 is correct or not.
The Energia code written by "Whitehead" also doesn't validate the checksum returned by PGA460.
Good luck, and please do get back if you figure out the issue. I'll also try to improve the library in the mean time to allow configuration of serial ports and connection detection.
And yes, the main motivation I had behind writing this library was how obfuscated the Energia library was. You'll see that I've actually separated the checksum process - not too great for speed, but then again, this is an Arduino library.
Sure, I will keep you posted.
I have tried to run this code using ESP32 and Ultrasonic 2 click from Mikroe. But the code doesn't work, even basic temperature reading also doesn't seem to work.