Hi, I would like to ask you (already search for that on this forum and on many google pages) and I would like to ask you for advice what I am doing wrong (please, be constructive).
First at all, my home simple project is about using ESP-01 to control light (let stripes).
How to control? By button and by wifi. (button, not switch).
Using DC 9V adapter + stepdown on 3.3V for ESP-01 + button + MOS module. Programming over programer module with extended button for "writing code".
So I am using StepDown on 3.3V to power my esp01, but step down have Vo- (output minus). Didnt find better way than just switch it with gnd to make it positive (its looking very very ugly, but can someone provide better solution?) Because this one one works (I have +3.3V)
Trying to implement simple code which every 0.5s check if button is pressed, if yes = turn on MOS module. If in next checking will be button pressed again - its mean that user want to turn off the light = MOS module off. But didnt handle pins as GPIO/2 well because it do nothing. Can someone look on that scheme and code and say me what I am doing wrong?
The connections on the step-down converter are very strange. Can you post a link to the spec for it?
Have you established that your uploaded sketch is running on the esp when on the breadboard? I suggest uploading the standard blink sketch and attaching an ordinary led (+series resistor) to an output, to prove to yourself that the sketch has uploaded correctly and is running on the breadboard.
I suspect, even if it is being powered correctly, that the sketch is not running. To get the sketch to run, several pins on the esp-01 must be pulled high: CH_PD, RESET must be pulled high full-time and GPIO0, GPIO2 must be pulled high at power-on/reset. I don't see anything in your circuit to achieve that.
Also I suspect the pin that the button is connected to is floating. When the button is pressed, it is connected to Vcc, but when not pressed, it is connected to nothing, and will not necessarily read LOW as you might be expecting. You should pull the GPIO pin to Vcc with, for example, 10K, and have the button pull the GPIO pin to ground when pressed.
Problem is that when I have V0- output it give me negative 3.3V, ground is common. But when I switch Vo- and Gnd, I will get positive 3.3V.
At least everything is shining (esp). That was my part of question that I am getting negative -3.3 V if I connect multimeter on Vo- and Gnd.
So it's a negative DC converter? This is a specialist part intended for use where a negative output voltage is required for a circuit. You may be able to power the esp with it by swapping the wires as you have done, but I do not think your MOSFET module will operate correctly like this. The MOSFET module is designed to switch a positive voltage with a positive control voltage. Your control voltage will be negative, so I do not think the MOSFET module will switch on and may even be damaged by this.
You should replace your DC converter with a normal one which outputs a positive voltage.
As you can see from the above, in order to get the esp-01 to boot from flash memory and run your uploaded sketch, you need CH_PD and RESET connected to 3.3V. You can connect these with 10K resistors or simply use wires.
By the way, if you wanted to add an extra button to reset the circuit, you would need to connect the RESET pin to 3.3V with 10K (not a wire) and connect a button from RESET pin to ground.
For GPIO0 and GPIO2, you need a 10K pull-up to 3.3V to get the esp-01 to boot into the correct mode. You can connect your on/off button from GPIO2 to ground. You will need to change your code to check for a LOW reading when the button is pressed, and to output LOW to GPIO0 in setup() to switch the MOSFET module off. Unfortunately, this does mean your light may flash on briefly at startup.
The smaller programmer board: by manual I connect over button GND and GPOI0. Which I need to press during connecting USB. After that I release button and succesly upload code. (In another case it search for connection during uploading code). After that it ask me to push reset button (don't have any button around), So I unplug it and plug it without pressing any button.
In that moment I open serial monitor and see that my code was uploaded correctly because my code is printing loop (also read that serial print is on the same channel as diod so it always blink blue diode in moment of printing text).
These are the two proper programmer boards for the ESP-01: Aliexpress item
At least, that is the manual switching version; here is the automatic version which while it does have the reset button, initiates the programming directly from the Arduino IDE: Aliexpress item