Home>

ESP32-DevKitC-32D,
Or connect the sensor with ESPr Developer 32
I have just started developing IoT using WiFi.
I am an amateur in the field of telecommunications and I am still a beginner with a month of electronic work experience.

The sensor i am trying to use
The power supply voltage is DC12V to DC24V.
To run this sensor on an ESP32 or ESPr
What should I do?
Do I have to add some parts to raise the voltage?

Also, the output voltage of this sensor is
It is "1V to 5V ladder output".
It is divided into 30 steps and fluctuates at 133 mV per step.
Can such output be read by ESP32 or ESPr?

In the textbook (IoT Development Start Book/Gijutsu-Hyoronsha)
"The return value of the analogRead function is 0 when the input is 0V and 4095 when the input is 3.3V."
Can't read (or break down) after inputting 5V?

I suddenly decided to do electronic work at work, and for the past month, according to the textbook,
I've been using temperature and humidity sensors, but I can't understand it on my own.
Also, I don't have any acquaintances who are familiar with electronic work.
I'm really an amateur, so I'm sorry, but I would appreciate it if you could teach me.

  • Answer # 1

    Many mechatronic sensors have a 12 to 24V power supply.

    As a power supply device, I think the most common configuration is to prepare one 12 to 24V power supply, and since the voltage difference is large, create 3.3V with a switching type step-down converter and supply it to the ESP.

    It is okay to boost the voltage, but I think that boosting is more complicated than stepping down = the price goes up and the conversion efficiency tends to go down (the buck-boost in that area will be a modular one. Probably).

    1V-5V ladder output

    I'm not sure about the ladder output, but does it mean that it is received by the PLC (it seems that there is a 1 to 5V mode when looking at the PLC specifications)? There is also a resistance ladder type DAC, but how about it? what do you want.

    It depends on what happens to the circuit on the output side of the sensor, but the easiest way is to divide the voltage with a resistor and reduce it to 3.3V or less when the voltage on the sensor side is 5V.

    When 5V comes out from the sensor, 5 * 3.3/(3.3 + 2.2) = 3V comes out, so I will push this into the ADC of the microcomputer. If the sensor output is a high frequency signal or the output impedance is low, you may need to receive it with an op amp that runs at 24V.

    If you put 5V into the AD of the ESP32, at least you can't get the correct data, but check the data sheet to see if there is a possibility of failure (probably clipping to the maximum value). Certainly it is an operation that should not be done.