Gpy without Pymakr
-
A very basic question I guess. I am working on a project where we want to migrate from the Pymakr board to our own board due to limited space and making the platform more customized to our solution. The first test is just to run an DHT11 from a single battery. We tried the following setup to power the device
5V on the GPY goes to battery +
3.3 V on the GPY goes to battery +
GND goes to battery -The device starts but it seems to fail to read battery voltage. When using the Pymakr the BAT-jumper has to be connected. From what I understand we need to use a 115 kΩ resistor between the battery and VBAT input and another 56 kΩ resistor to tied it all together. Am I right? Do we need anything else, apart from the sensor, to make it work?
-
@Don-iot As said, that seems only to be a problem when using one of the various pycom expansion boards. I'm using Fipy and Lopy boards on a homebrew expansion board without a pull-up resistor at P8.
The issue seems to be caused by the PIC on Pycom's expansion board, which pulls P2 low when the device is powered by battery and the PIC is not powered. If then P8 stays low since it has an internal weak pull-down, the device does not boot.
-
@robert-hh Super. Our scope is to only use the GPY in real life, would we need the pull-up you recon?
-
@Don-iot GPY and WIPY only differ by the GTM modem attached to the ESP32. The external interface of both modules is the same, and more or less a plain vanilla ESP32. Just the I/O ports are named and numbered differently (Gxx or Pxx instead of GPIOxx) and some ports are already used for internal purposes.
P8/G15 is connected to GPIO2 of the ESP32. This is a so-called strapping pin, which should be pulled high for battery operation. That seems only to be a problem when using one of the various pycom expansion boards, and only with expansion board 3.0. But using a 4.7k or 10k pull-up does not hurt.
-
Thanks @robert-hh for the correction and awesome reply. I am just making noobistakes in terms of terminology :) I am the hardware guy, someone else does the coding.
Yes, I want to use something else than the Expansion board. I will add the MΩ resistors. To complicate, we are using two versions of the GPYs, and some Wipys, will the same apply to these? Would you be kind to explain this text "To use the battery, pull P8/G15 high (connect to 3v3)" on this page?
-
@Don-iot Assuming you mean "Expansion Board", when you talk of pymakr. "Pymakr" is in fact the name of a software plug-in for Atom and Code.
About the connection:5V on the GPY goes to battery +
GND goes to battery -Never connect the 3.3V to a power source. It is an output, not an input. Connecting it to the battery will damage the GPY.
Indeed, if you want to measure the battery voltage, you need some kind of voltage divider between the battery and the analog input of the GPY. The new boards use two times 1 MOhm: 1 MOhm between battery and analog in, and another 1 MOhm between analog in and GND. That will divide the input voltage by 2. Setting the attenuation to 11dB, that matches well with the 0-3V input range of the ADC. At Vin, you then have a range of 0-6V. Using higher values for the voltage divider is recommended, because it drains less current.