• ADC working terrible (defect modules?)

    LoPy adc lopy4
    9
    0 Votes
    9 Posts
    51 Views
    S
    The LoPy4 Pin-Out does not show other connections, but these may exist on an expansion board, like the VBatt divider at P16, the User Button at P14 and the Accelerator IRQ at P13. @robert-hh thanks for this reminder; it solved my troubles eventually. One of the LoPy seems to be defective, but on all others, everything is fine now after moving around some pins. Thanks!
  • Fipy ADC output for 11dB attenuation?

    FiPy adc output 11db fipy lora
    1
    0 Votes
    1 Posts
    8 Views
    No one has replied
  • ADC sensors on external PSU

    Discussion adc external sensor power supply 5v input
    12
    0 Votes
    12 Posts
    528 Views
    A
    @robert-hh said in ADC sensors on external PSU: @Alephus Connecting the sensor to the input should not raise the voltage measure at that connection. So it must be something else in the set-up. after a while i did a few more tests and found something: of all ADC1 pins, all behave properly except P19 and P20 (guess wich 2 i was using) a friend analized my problem as well and detected that those 2 pins where not "floating", and after analazing the datasheet he assumes its because they are the only ones with pullup/pulldown internal resistors. So for now i have a solution however i still dont understand is why, after all, they are tecnicaly valid Pins pins in the datasheet
  • ADC conversion values

    Discussion adc adc accuracy lopy4 sensor
    4
    0 Votes
    4 Posts
    271 Views
    robert-hhR
    @mrks-tsk The capacitor has to be placed between ADC input and GND. In your diagram at the VBATT side.
  • ADC and ML-020S-O Lux Sensor

    MicroPython luxsensor adc analog read
    2
    0 Votes
    2 Posts
    195 Views
    robert-hhR
    @tttadam If I understand the data sheet right, the orange should go to GND an the white to an Analog input, like P13 to P18. The uncovered one is shielding. You can put that to GND. The output range is small, 0-30mV, which means, that you will get no reasonable reading, because there is no reading at all below ~70mV. The value you read should mostly be 0. So you need to insert an amplifier. Edit: The ESP32 has an built-in amplifier. But that is not supported by the Pycom firmware and not by espressif itself.
  • 0 Votes
    11 Posts
    1k Views
    robert-hhR
    @arthurmed So what are the properties of the pulses to receive, and what kind of device is it that you want to connect? Edit: I just tested that: Even if you specify then number of pulses, it will not return until a timeout happens (and the documentation is still wrong, because pulses_get() does not accept any arguments).
  • About ADC Calibration and usage

    FiPy adc adc accuracy calibration adc precision fipy
    10
    0 Votes
    10 Posts
    1k Views
    N
    @cocoa Thank you for your answer
  • 0 Votes
    3 Posts
    838 Views
    robert-hhR
    @fedesilvi Just to give you an impression how bad the esp32 ADC is, I collected 10000 samples with the ESP32 ADC and an ADS7818 ADC taking values the same LM385 voltage reference. The absolute values differ, because of the different ranges (5V vs. 3.3V). The histograms are below: [image: 1538763982782-data_a7818.jpg] [image: 1538764779096-data_esp32.jpg] Edit: Adding a 10 nF capacitor close to the ESP32 ADC input and switching off WiFi improved the picture. The one above was WITH the capacitor. Without, the capacitor, it was worse (avg +/-100 readings)
  • ADC use to measure battery level / Vin level

    SiPy sipy adc vin measuring
    15
    0 Votes
    15 Posts
    3k Views
    A
    @andreas said in ADC use to measure battery level / Vin level: We are getting reasonable readings when using the 1 MΩ / 1 MΩ values as resistor values (matching v3.2) @MKO just measured the resistor values and confirmed [1] that it's also 1 MΩ / 1 MΩ for the Pycom Expansion Board v3.1, as supposed. [1] https://community.hiveeyes.org/t/batterieuberwachung-voltage-divider-und-attenuation-fur-microypthon-firmware/2128/42
  • WiPy ADC

    Discussion wipy adc pin
    5
    0 Votes
    5 Posts
    1k Views
    robert-hhR
    @b_rubble Here is a sample script using the ADS7818 with SPI: # Drive the ADS7818 ADC using SPI # Connections: # xxPy | ADS7818 # -----|------- # P10 | CLK # P11 | CONV # P14 | DATA # from machine import SPI, Pin from ubinascii import hexlify spi = SPI(0, SPI.MASTER, baudrate=4000000, polarity=1, phase=1, bits=16) buf = bytearray(2) vref = 2.493 # measured at the ADS7818 while True: # start a conversion and get the result back spi.write_readinto(b"\xe0\x00", buf) # extract the raw ADC value and derive Voltage value = ((buf[0] << 8) | buf[1]) & 0xfff volt = 2.0 * vref * value / 4096 print(hexlify(buf), value, volt) res= input("Next: ") if res == "q": break The conversion and reading back is done within the single spi.write_readinto() call. It is then easy to embed that in a small class. Note: Since the ADS7818 runs at 5V, insert a resistor of 3.3k to 10k into the data line back into the ESP32 to limit the current into the ESD diodes.
  • 0 Votes
    8 Posts
    2k Views
    robert-hhR
    @moewex The 4095 is the highest value of the 12 bit ADC. So you could try to call apin.value() instead of just apin, which seems to return the voltage value, which has to be calibrated beforehand. The noise and fluctuation will always be large. So you have to add some kind of lowpass or averaging. For the moisture application with ist slow change, using a digital lowpass filter/averaging is surely appicable. And you do not have to care for absolute precision, just consistency.
  • Pysense Output pins

    LoPy adc pysense output pinouts
    1
    1
    0 Votes
    1 Posts
    909 Views
    No one has replied
  • 0 Votes
    3 Posts
    740 Views
    N
    Actually I wanted to make home automation project in which I wanted to start and stop Fan wireless by interfacing Pycom and Xbee S2C module with Xbee S2C I am connecting ADC with Digital pressure sensor which help me to send the data to pycom device
  • Need help

    LoPy lopy lora adc sensors
    6
    0 Votes
    6 Posts
    1k Views
    M
    @livius I'm actually using this code, because I'm looking to get the blink of the meter. [image: 1522831409-sans-titre.png] Know I need to find when the led is blinking, because he send everytime the value. I want to know how to check the difference between this value and the last one.
  • Problem on ADC pin 19?WiPy 2.0

    WiPy 2&3 pycom wipy2.0 adc bug firmware
    1
    0 Votes
    1 Posts
    667 Views
    No one has replied
  • How to correctely use Analog input

    LoPy adc vref analog in
    6
    0 Votes
    6 Posts
    3k Views
    robert-hhR
    @pierrot10 Vref is an internal voltage independent from the supply voltage of the extension board. And it is, like @seb said, just used for correcting the values returned by the API. The default assumption about VRef is 1100 mV. You may also completely ignore it, and just use wm_1.value() to get the raw value; especially since your application does not seem to be a priori linked to any standard physical quantity. You have have to make your interpretation table of the returned values yourself, and it does not matter if that is mV -> humidity or number -> humidity.
  • ADC Pins Outputting Voltage?

    LoPy adc lopy voltage
    9
    0 Votes
    9 Posts
    2k Views
    C
    @robert-hh Sorry, I misunderstood. I didn't take the pin's voltage with the 1V connected, however I took the voltages of other pins without anything connected. I think the input-only pins were fine, as was pin 20 (and a few others) but some GPIO pins were outputting between 1-3 volts.
  • Lipo Rider V1.3 - measuring battery level

    Discussion lipo rider lipo battery adc
    4
    0 Votes
    4 Posts
    1k Views
    A
    @arthurlutz I'm using a Max17043 to read the State of Charge of a LiPo Battery, It sits between the battery and the charger or the wipy. (https://datasheets.maximintegrated.com/en/ds/MAX17043-MAX17044.pdf) sparkfun has a nice board for it (https://www.sparkfun.com/products/10617) It uses I2C to get the state. Even wrote a library for it (https://github.com/andrethemac/max17043.py). André