These are chat archives for esp8266/Arduino

23rd
Jan 2017
Victor Tseng
@Palatis
Jan 23 2017 19:07
the datasheet say that you have to leave TOUT floating for measuring internal VCC
and, the datasheet says ADC is inaccurate when WiFi is on...
Orce MARINKOVSKI
@orcema
Jan 23 2017 19:24

@everslick thanks for your advise i finally found the origin of my problem. I tried to change the ESP8266WifiMulti.cpp in order to be able to match substring in SSID and this change was responsible for my problem. I can't figure out what is the problem in my modification. Here below the modified version

                    bool known = false;
                    for(uint32_t x = 0; x < APlist.size(); x++) {
                        WifiAPlist_t entry = APlist[x];

                        if(ssid_scan.indexOf(entry.ssid)!=-1) { // SSID match
                            known = true;
                            if(rssi_scan > bestNetworkDb) { // best network
                                if(sec_scan == ENC_TYPE_NONE || entry.passphrase) { // check for passphrase if not open wlan
                                    bestNetworkDb = rssi_scan;
                                    bestChannel = chan_scan;
                                    memcpy((void*) &bestNetwork, (void*) &entry, sizeof(bestNetwork));
                                    sprintf(bestNetwork.ssid,"%s",ssid_scan.c_str());
                                    memcpy((void*) &bestBSSID, (void*) BSSID_scan, sizeof(bestBSSID));
                                }
                            }
                            break;
                        }
                    }

and the original version

               bool known = false;
                    for(uint32_t x = 0; x < APlist.size(); x++) {
                        WifiAPlist_t entry = APlist[x];

                        if(ssid_scan == entry.ssid) { // SSID match
                            known = true;
                            if(rssi_scan > bestNetworkDb) { // best network
                                if(sec_scan == ENC_TYPE_NONE || entry.passphrase) { // check for passphrase if not open wlan
                                    bestNetworkDb = rssi_scan;
                                    bestChannel = chan_scan;
                                    memcpy((void*) &bestNetwork, (void*) &entry, sizeof(bestNetwork));
                                    memcpy((void*) &bestBSSID, (void*) BSSID_scan, sizeof(bestBSSID));
                                }
                            }
                            break;
                        }
                    }
donnib
@donnib
Jan 23 2017 20:12
Hi, i am controlling a 5m 5050 led strip with the esp8266 and i use a N channel FET and the brightness of the LEDs are dimmer when running them thru the FET compared to the power supply dirrectly
I also tried to use a TIP31C transistor together with a 100ohm resistor but still way to far away from full brightness
any ideas what might be wrong ?
Me No Dev
@me-no-dev
Jan 23 2017 20:14
make sure the FET fully opens below 3 volts
and that you actually give full 3.3V to the gate
donnib
@donnib
Jan 23 2017 20:16
I am using analogWrite(pin, 255) which i pressume whould be full brightness
Gate-Source Threshold Voltage VGS(th) VDS=10V,ID=250uA 1.0 - 3.0 V
is that not what VGS means above ?
i am not sure i look at the correct stuff
if i measure the Voltage between Drain and Source i get a voltage of 12,5V which seems good
Me No Dev
@me-no-dev
Jan 23 2017 20:20
yes, that should work
and you have 36mOhm resistance when open
donnib
@donnib
Jan 23 2017 20:22
the resistence is measured between ?
Me No Dev
@me-no-dev
Jan 23 2017 20:22
0.43 Volts drop on the FET
drain and source when the fet is fully on
donnib
@donnib
Jan 23 2017 20:23
sorry i mean the voltage drops to 10.6v with the load
from 12,5v
32mOhm
but it keeps coming and going
Me No Dev
@me-no-dev
Jan 23 2017 20:24
the voltage drop is expected when you have load on the system
donnib
@donnib
Jan 23 2017 20:24
so everything seems ok but the drop is bigger
Me No Dev
@me-no-dev
Jan 23 2017 20:25
those 12.5 volts are on open system
donnib
@donnib
Jan 23 2017 20:25
yes i know
should i try to gain the power supply ?
Victor Tseng
@Palatis
Jan 23 2017 20:25
emm wait is esp8266 duty 255 100%?
Me No Dev
@me-no-dev
Jan 23 2017 20:25
what is the current through?
Victor Tseng
@Palatis
Jan 23 2017 20:25
i thought it's 1023??????
Me No Dev
@me-no-dev
Jan 23 2017 20:25
@Palatis might be onto something
Victor Tseng
@Palatis
Jan 23 2017 20:25
or i mistaken with esp32?
donnib
@donnib
Jan 23 2017 20:25
i dunno, maybe that is the problem
i can try
Me No Dev
@me-no-dev
Jan 23 2017 20:26
I think this one is also 10 bit, let me check
#define PWMRANGE 1023
yup
10bit
Victor Tseng
@Palatis
Jan 23 2017 20:26
so
255 is ~25% duty
Me No Dev
@me-no-dev
Jan 23 2017 20:27
yup
donnib
@donnib
Jan 23 2017 20:27
ok so let me try that :smile:
yup made a change :D
thx for that :D
Victor Tseng
@Palatis
Jan 23 2017 20:28
so, it's not because of the FET, nor the gate drive level
it's because you COMMANDED it to run at 25% duty XD
donnib
@donnib
Jan 23 2017 20:28
@Palatis nope it was just doing what it was asked to :D
Victor Tseng
@Palatis
Jan 23 2017 20:28
LOL
Me No Dev
@me-no-dev
Jan 23 2017 20:29
@Palatis good reading on your side
donnib
@donnib
Jan 23 2017 20:29
ohh well for the tutorials you read online and now knowing it is different for ESP
Victor Tseng
@Palatis
Jan 23 2017 20:31
dunno, the voltage reading is strange, tho
does it reads ~12v now?
donnib
@donnib
Jan 23 2017 20:32
i didn't measure but there was no doubt to me this made a huge change on the brightness
Me No Dev
@me-no-dev
Jan 23 2017 20:32
I'm more wondering what is the current through the system
Victor Tseng
@Palatis
Jan 23 2017 20:32
yeah
human eyes don't respond to brigntness to pwm cycles linearly
it's more like a curve
donnib
@donnib
Jan 23 2017 20:33
yeah but when it's such a big difference
Victor Tseng
@Palatis
Jan 23 2017 20:33
double the duty cycle doesn't mean double the brightness (to your eyes)
Me No Dev
@me-no-dev
Jan 23 2017 20:34
scope or logic analizer can show what is going on
donnib
@donnib
Jan 23 2017 20:37
with load i get 11,2V now
i went back to transistor TIP31C and a resisotr of 47ohm
with the FET i got 11.8v so the voltage drop is better with the FET
actually with the FET i cannot see any difference in brightness from power supply or thru FET
donnib
@donnib
Jan 23 2017 21:36
i have a uint8_t data, how do i convert to char s ?
uint8_t* data to char *s
Me No Dev
@me-no-dev
Jan 23 2017 22:03
char * c = (char *)data;
Michael Miller
@Makuna
Jan 23 2017 23:21
WOW, I would have thought the normal is that analogWrite takes a value between 0-1023 as analogRead returns one between 0-1023; but the Arduino docs state its only 0-254. That is so inconsistent. For both; the Esp8266 analogWrite (it should only take 0-254 for compatibility) and that the original Arduino API was so poorly constructed.
Michael Miller
@Makuna
Jan 23 2017 23:36
Ahh, there is a bug here; I added esp8266/Arduino#2895 to track it.