Electronic components tips for my circuit

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Electronic components tips for my circuit

Postby Nespressif » Tue Nov 14, 2017 1:28 pm

Hi guys, as I mentioned in another post I'm doing a small project with exactly this plate and https://es.aliexpress.com/item/ESP-32S- ... 0.0.DW8aye.

The project is basically responsible for recording the movements detected with a PIR sensor, the keystrokes of a button and 7 touchpad that the esp32 has integrated. My initial idea was to feed it by the micro usb but seeing that it gave me some faults I decided to feed it with a source of MB102 protoboard and so I have the two voltages available 3.3v for the esp and 5v for some sensor that requires it.

I open this thread to see if anyone can give me some advice of electronic components to add to improve the stability of the circuit, since in some documents I have read recommend adding some things.

For example:

a) The button is connected between the pin marked VIN and the D4 (which has pull up and down resistors activated) but I have added another external pull up of 4.7k between the D4 and ground to avoid spurious values, this is correct?

b) In another document I have read how I put in the other post that it is very convenient to place a capacitor between the positive and negative that feed the plate at 3.3v. That is to say, the cables connected to the pins marked as 3.3v and GND. Could I power the board through the VIN pin instead of the 3.3v, would it work the same way? Which capacitor should I place? I think they recommended 10 microF, I have 10 microF and 50v, are these good for this application?

c) the capacitive touch pads on this board work well, but they talk about the possibility of creating parasitic tension, I think, they could be brought to earth, should we put a capacitor or something? The cables go straight from your touch pad pin to a plate where you can touch it with your finger.

And any other advice would be of great help to me in the electrical section, since I don't have any knowledge in that area.

Greetings,

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Electronic components tips for my circuit

Postby ESP_Angus » Tue Nov 14, 2017 10:09 pm

Nespressif wrote: a) The button is connected between the pin marked VIN and the D4 (which has pull up and down resistors activated) but I have added another external pull up of 4.7k between the D4 and ground to avoid spurious values, this is correct?
If the resistor is connected between D4 and GND then it's a pull-down resistor not a pull-up resistor. But this is fine, the resistor will pull the pin down to ground through the resistor normally and then when the button is pressed it will be "pulled high" by the connection through the switch.

Don't activate the GPIO 4 internal pull-up resistor at all in this case.

You can possibly use the internal pull-down resistor instead of adding an external pull-down resistor but the external resistor is fine.

However, you should connect the other side of the switch to 3.3V not VIN. I don't have the schematic for the board you linked, but VIN is probably 5V and the ESP32 only has 3.3V logic. Connecting the pin to 5V when the button is pressed will exceed the maximum voltage.
Nespressif wrote: b) In another document I have read how I put in the other post that it is very convenient to place a capacitor between the positive and negative that feed the plate at 3.3v. That is to say, the cables connected to the pins marked as 3.3v and GND. Could I power the board through the VIN pin instead of the 3.3v, would it work the same way? Which capacitor should I place? I think they recommended 10 microF, I have 10 microF and 50v, are these good for this application?
If you're using the development board that you linked then it already has onboard capacitors, so you should not need to add any.

If you are feeding 3.3V into the board then you should feed it into the 3.3V pin not into the VIN pin.
Nespressif wrote: c) the capacitive touch pads on this board work well, but they talk about the possibility of creating parasitic tension, I think, they could be brought to earth, should we put a capacitor or something? The cables go straight from your touch pad pin to a plate where you can touch it with your finger.
I don't quite understand your question, but if capacitive touch is working in your application then you probably don't need to change anything.

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: Electronic components tips for my circuit

Postby Nespressif » Wed Nov 15, 2017 11:47 am

Thank you very much for your reply.
I'm testing two identical boards, like the link board, the first one powered by a MB102 protoboard source and the second one with a micro usb cable and 2A wall adapter.

Now I have problems with the button, the pir and touch pads work. I have activated the internal pull down resistor and disable the pull up resistor on pin 4 and set the isr to anyedge (I have removed the external resistor). On the board powered by the protoboard power supply, if I connect the button between the positive of the 3.3V power supply, the same one from where I take the current to power the board by pin 3.3V and gnd, and the other button cable I connect it to pin 4. The board does not send, the blinky task works but the sending task does not work.

On the second plate powered by the micro usb, connect one end of the button to pin 3.3v of the plate and the other to pin 4, and send perfectly but the button does not work.

Maybe it's code problem, although configuring the gpio and its isr is quite simple and I've done it other times without problems, in fact the PIR sensor is the same and works well.

Greetings,

ESP_Angus
Posts: 2344
Joined: Sun May 08, 2016 4:11 am

Re: Electronic components tips for my circuit

Postby ESP_Angus » Wed Nov 15, 2017 11:49 pm

If you measure the voltage at the ESP32 pin with a multimeter (measure between IO4 and GND), do you see it swap between 0V and 3.3V when you press the button?

Nespressif
Posts: 76
Joined: Tue Sep 12, 2017 11:25 am

Re: Electronic components tips for my circuit

Postby Nespressif » Sat Nov 25, 2017 4:48 pm

Sorry for the delay in answering, I've been running a lot of tests. Yes, when I connect the button to pin 3.3v and D4, it works correctly. That is to say, when I press the button, 3.3v hits the pin.

The problem was in the code, adapting the example of esp-idf/gpio didn't work for me. However, by configuring the two pin I use (one for a motion sensor and one for the button) each with its traffic light, it works correctly. The PIR sensor also feeds it from the VIN pin and everything seems to be working correctly.

Thank you for your interest and attention.

Who is online

Users browsing this forum: Bing [Bot] and 72 guests