A few questions regarding firmware and the serial header

Started by kiafaldorius, July 04, 2019, 04:42:39 AM

kiafaldorius

Received my CurrentRanger a couple weeks ago, and the battery I ordered separately finally came (apparently it had to be shipped ground). I'll be trying it out this weekend...hopefully it all works and I don't do anything stupid during installation.

I'm thinking of connecting up an ESP32 at some point to the serial header, so I can get wifi and bluetooth. So have a couple questions regarding the firmware and hardware.

1. How much current can I expect from the serial header's 3.3v pin?

2. Can I use the ESP32's ADC (or a separate ADC module connected to the ESP32) to read the power source's voltage? My concern here is it'll be connected to the serial ground and input ground at the same time.

3. I know the Output Negative is not the same as Current Ranger's ground. So I'm assuming output negative should never be connected to current ranger's ground? (If so, how is your internal ADC reading it?)

4. Do I have to re-calibrate the ADC every time I flash firmware?

Thanks!

TomWS

Quote from: kiafaldorius on July 04, 2019, 04:42:39 AM
Received my CurrentRanger a couple weeks ago, and the battery I ordered separately finally came (apparently it had to be shipped ground). I'll be trying it out this weekend...hopefully it all works and I don't do anything stupid during installation.
I'm thinking of connecting up an ESP32 at some point to the serial header, so I can get wifi and bluetooth. So have a couple questions regarding the firmware and hardware.
don't plan on using both WiFi and Bluetooth on ESP32.  From what I've seen, either stack consumes too much resource to permit the other.
Quote
..
2. Can I use the ESP32's ADC (or a separate ADC module connected to the ESP32) to read the power source's voltage? My concern here is it'll be connected to the serial ground and input ground at the same time.
if you don't use the serial output and want to use the analog output, you'll need to add a differential amplifier to the front end of your ADC connection.  Both output pins from the Current Ranger are 'floating' with respect to the power supply.  Not a huge deal if you know what you're doing, but you won't be able to trivially connect to any MCU ADC input.

kiafaldorius

Quotedon't plan on using both WiFi and Bluetooth on ESP32.  From what I've seen, either stack consumes too much resource to permit the other.

Yes, I'm aware of the shared antenna issue. I have been able to get both of them working together---the trick is to avoid interfacing them both at the same time.

Quoteif you don't use the serial output and want to use the analog output, you'll need to add a differential amplifier to the front end of your ADC connection.  Both output pins from the Current Ranger are 'floating' with respect to the power supply.  Not a huge deal if you know what you're doing, but you won't be able to trivially connect to any MCU ADC input.

I assumed as such, just want to be double check before I go the complicated route without needing to.

Thank you Tom!

Felix

Hope you guys had an awesome Independence Day holiday,

The CurrentRanger is powered from a battery, through an MCP1703 LDO that provides up to 250mA at 3.3V output. The SAMD21 and other circuitry powered from the LDO uses around 25mA give or take, depending on whether you use the OLED or not.

The serial header and OLED headers have "3V" (which is 3.3v from the LDO) which can power anything that takes 3.3V, including the convenient recommended BT06 bluetooth logger, the OLED, perhaps a larger SPI TFT screen, or anything else you'd like. But you cannot power anything that takes more than 200mA, and I would not recommend it, because the 3.3V rail is not optimized to deliver that much current and also you don't want to upset the MCU, amplifiers which require a stable 3.3V.

So I would definitely not use a power hungry ESP device which has very high current peaks, unless you want to use it with very low TX power output, or perhaps turn off the Wifi entirely and just use the bluetooth.