look attach file.
This is a board which name call DSI5168 development baord.
And kernel is used by RAK473(RTL8711AM).
and is used DAP_FW_Ameba_V12_1_3-2M Firmware.
and it is support used arduino code to edit this board.
and i use analogRead to read analog Voltage.
but when i connect to gnd i get value of 134 or 137...
when i have pull up or push down , the result is same.
and A2 always have level voltage almost by 1.2 voltage.
if connect to Gnd, it always get 134.
but connecotr to VCC(3.3) , I get 1023 of value.
now i don't know why i can't measure the reference gnd of zero voltage.
it seems the 134 is the min value of this level....
please help me
PCB_schematic.pdf (63.2 KB)
DAP_FW_Ameba_V12_1_3-2M.zip (22.4 KB)
If you connect a wire between the input and the ground pin of the ADC, you should get zero reading. If not, your ADC is probably faulty.
If you use another point of your circuit as ground reference, it may be at a different voltage due to poor wiring or other circuit issues.
OK, So what problem can cause adc value is not zero?
Because i don't have example code.
maybe i think this is software problem
Terry_chen:
Because i don't have example code.
Then what code do you run that gives you that value? Do post it here.
My code maybe like this.
#include <HttpClient.h>
#include <WiFi.h>
#include <WiFiClient.h>
#include "wifi_data.h"
#include "DHT.h"
#define DHTPIN 6
#define DHTTYPE DHT22
#define PHOTO_PIN A2
int LUX;
float temp_r;
int status = WL_IDLE_STATUS;
WiFiClient client;
DHT dht(DHTPIN, DHTTYPE);
unsigned long time_count;
unsigned long previous_time = 0;
void setup()
{
pinMode(PHOTO_PIN,INPUT);
dht.begin();
Serial.begin(9600);
Serial.println("START");
// Serial.println(WL_CONNECTED);
while ( status != WL_CONNECTED) {
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
status = WiFi.begin(ssid, pass);
// wait 10 seconds for connection:
delay(1000);
}
Serial.println("Connected to wifi");
previous_time = time_count;
}
void loop()
{
LUX=analogRead(PHOTO_PIN);
Serial.print("LUX=");Serial.println(LUX);
delay(2000);
}
Terry_chen:
My code maybe like this.
We need actual code. Not maybe code. That's a waste of time. And posted between code tags, of course (it seems you forgot or simply didn't bother to read the "How to use this forum" sticky, where this is clearly explained).
this is actual code.
Sorry , my english is not good.
that is language Narrative error