-->
Page 1 of 2

ESP 01 pin 1 issue

PostPosted: Tue Nov 17, 2015 6:45 pm
by hakha4
I have setup where pin 2 is connected to DS1820 sensors and want to use pin 1 for relay output. Everything works ok reading temps but if I set pinMode(1, OUTPUT); in void setup it compiles ok but sketch won't run and only garbage after reset. I believe I've seen a workaround for this but I can't find it anymore. Can someone give a hint how to solve this ?
Regards Håkan

Re: ESP 01 pin 1 issue

PostPosted: Tue Nov 17, 2015 6:58 pm
by Barnabybear
Hi, the ESP8266-01 only has GPIOs 0 & 2 broken out. I'm sure GPIO 1 (in normal mode) is Tx or Rx cant remember which, but you can change it to use as a GPIO if you wish but I dont think thats what your wanting to do.
You can use GPIO 0 for the relay but it needs to be between Vcc & the GPIO or it wont boot correctly (this inverts the output) . Drive the GPIO high for off & low for on.

Re: ESP 01 pin 1 issue

PostPosted: Wed Nov 18, 2015 9:08 am
by martinayotte
Yes ! GPIO1 is the TX pin ...

Re: ESP 01 pin 1 issue

PostPosted: Wed Nov 18, 2015 3:58 pm
by hakha4
Thank's for reply,my fault,mixed up pin 0 and 1'! Compiles ok now.

Barnabybear wrote :
You can use GPIO 0 for the relay but it needs to be between Vcc & the GPIO

Should I use a pullup resistor to Vcc? Value ??
Regards Håkan