ADC sensors on external PSU
-
When using the 2 diferent power supplies, i did try with the ground conected betwen the board and the sensors, but again, in that scenario the sensor output jumps from about 0,5V (correct) to about 3,7V (wrong). ![alt text]https://imgur.com/a/b51djfw(image url)
-
@Alephus In case of two different power supplies you have to connect the GND wires. Otherwise it cannot work. And what you get is the consistent to the second scenario. Which sensor are you using? And where do you get the 0.5V?
-
i was using 2 sensores but reduced to just 1 for testing. The sensor is a SEN0219 Co2 sensor. It uses 5v and should output betwen 0 and 2v.
0,5v is a very accurate reading for the enviorement we are in however having an output of 3,7v when the max is 2V is... wrong.
Im not sure what im doing wrong.
-
@Alephus Which pin of the LoPy4 are you using?
-
Lopy4:
Vin : 5v input (5v @ 2A Usb wall charger)
GND : Ground (Gnd Usb wall charger)
P20 : sensor outputSEN0219:
- : 5v input (5v @ 2A Usb wall charger)
- : Ground (Gnd Usb wall charger)
Out: connected to P20 on lopy4
-
@Alephus What is the voltage at P20, taken with your multimeter, when the sensor is not connected, but the port is configured? It should be almost 0.
How did you configure P20? It should be something like:from machine import ADC adc = ADC() adc_c = adc.channel(pin='P20', attn=ADC.ATTN_11DB)You may also try other Pins in the range P13 up to P20
-
Regarding code, its exactly that since i know im reading up to 2v and normal adc without the attn only reads up to 1,1v
Regarding volts at the Pin im gonna read it and post here as soon as possible (had to leave for about 1, 2h)
In my head this situation makes no sense
-
@robert-hh the voltage is as you sayd, basicly 0. (0.06v) i literaly have no idea whats wrong. Is it the sensors? Is it the lopy? Even other pins do the same
-
@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.
-
@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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login