Difference between revisions of "How to use ESP32 as a webserver"
Jump to navigation
Jump to search
Nicholas w (talk | contribs) |
Nicholas w (talk | contribs) |
||
Line 13: | Line 13: | ||
* this is the URL to type: "https://dl.espressif.com/dl/package_esp32_index.json" | * this is the URL to type: "https://dl.espressif.com/dl/package_esp32_index.json" | ||
* Then [https://www.youtube.com/watch?v=ApGwxX6VVzk this video] [https://randomnerdtutorials.com/esp32-web-server-arduino-ide/ and link] give you code to make the webserver. | * Then [https://www.youtube.com/watch?v=ApGwxX6VVzk this video] [https://randomnerdtutorials.com/esp32-web-server-arduino-ide/ and link] give you code to make the webserver. | ||
+ | |||
+ | ==temperature sensor== | ||
+ | * go got some lM35DZ chips (50p each from china). They seem to return roughly 2.5v (with 3.3v input). 2.4v was in the freezer, and 2.5 under a mug of tea. I could not get the esp32 to read anything useful. | ||
+ | * as per [https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html#overview | ||
+ | the ESP32 docs], you can only use ADC (analogue to digital converter) channels form "bank 1" (ADC1 not ADC2), if you're using the wifi. So I used pin 32. | ||
+ | * [https://randomnerdtutorials.com/esp32-adc-analog-read-arduino-ide/ this page] has [https://i0.wp.com/randomnerdtutorials.com/wp-content/uploads/2019/05/ADC-non-linear-ESP32.png?w=768&ssl=1 this graph] which shows the analogue response to various voltages. I read elsewhere (cant find) that above 2.5v the chip can't see much. Though [https://www.reddit.com/r/esp32/comments/gg0ic6/esp32_with_lm35_temperature_sensor/ this reddit post] seems to say you can just use the LM35DZ straight on the ESP32. But, [https://microcontrollerslab.com/lm35-temperature-sensor-with-esp32-web-server/ this page] suggests you need a separate chip to read it. I didn't manage to get anywhere. |
Revision as of 11:53, 29 September 2020
£10 ESP32 is a 240mhz dual-CPU computer (with 4mb ram or 512kb not sure) and can run a webserver - so can be controlled from your phone/computer. Amazing. also amazingly, you can run nintendo NES games on it
These are the steps I took to get it working:
- download current arduino IDE from arduino.cc
- the one I bought from the Hackspace shop was this one:
- CANADUINO ESP32 Devkit Wi-Fi Bluetooth BLE - Ultra Low
- the IC chip (which controls the USB interface with the computer?) is: CP2104
- my mac, is running an older system, so I needed this driver for the CP2104:
- after that, in the arduino IDE, you need to add a URL to the preferences in order to download the ESP32 board:
- as per this youtube video
- this is the URL to type: "https://dl.espressif.com/dl/package_esp32_index.json"
- Then this video and link give you code to make the webserver.
temperature sensor
- go got some lM35DZ chips (50p each from china). They seem to return roughly 2.5v (with 3.3v input). 2.4v was in the freezer, and 2.5 under a mug of tea. I could not get the esp32 to read anything useful.
- as per [https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/peripherals/adc.html#overview
the ESP32 docs], you can only use ADC (analogue to digital converter) channels form "bank 1" (ADC1 not ADC2), if you're using the wifi. So I used pin 32.
- this page has this graph which shows the analogue response to various voltages. I read elsewhere (cant find) that above 2.5v the chip can't see much. Though this reddit post seems to say you can just use the LM35DZ straight on the ESP32. But, this page suggests you need a separate chip to read it. I didn't manage to get anywhere.