Go Down

Topic: Wemos Lolin ESP32 OLED Module For Arduino ESP32 OLED WiFi + Bluetooth (Read 39776 times) previous topic - next topic

HermannSW

On the robot I wanted to power the ESP32 from a Lipo different to the 1000mAh 25C 3S Lipo used to power the motors. So I tried a 3.8V loaded Lipo with male micro connector I soldered for Raspberry PIs with this 0.36$ USB-5-P-Port-Male-Plug-Socket-Connector:
https://www.aliexpress.com/wholesale?SearchText=Right+Angle+Micro+USB+5+P+Port+Male+Plug

While even 3.4V from Lipo are enough to power a Pi Zero, 3.8V did not make Lolin ESP32 module boot.

So I remembered that I have a Polulu 5V step-up converter
https://www.pololu.com/product/2562

and decided to create a female/male micro USB plugin between ESP32 module and Lipo micro USB connector I already had. And it works, from the 5.09V generated by step up converter when not connected to ESP32 module I can measure 4.77V between GND and 5V pins of ESP32 module when connected as in this photo:


P.S:
Lolin ESP32 module found new home as wireless motor control for testing new steering omni wheel robot:
https://forum.arduino.cc/index.php?topic=462107.msg3236016#msg3236016
http://stamm-wilbrandt.de/en/Raspberry_camera.html

HermannSW

I did connect two unidirectional MOSFETs that were mounted on robot already to the three 1500rpm gear motors (two back wheels are controlled from same MOSFET). I could have used the Lipo for powering the ESP32 module, but for testing cable was fine for me.

This is wireless test start (robot is jacked on Lego platform):
Code: [Select]
Login succeeded!
Type "help()" for more information.

>>> p12 = machine.Pin(12); pwm12 = machine.PWM(p12); pwm12.duty(0)
>>> p13 = machine.Pin(13); pwm13 = machine.PWM(p13); pwm13.duty(0)
>>> pwm12.duty(512)
>>> pwm12.duty(0)


Unidirectional motor controller is OK for two back wheels, but steering wheel motor will need a bidirectional controller:
https://www.youtube.com/watch?v=h-C2UAxJ_kw


P.S:
This robot already has weight 533g, and Raspberry Pi Zero with camera for high framerate (≥180fps) video processing is yet missing ...

P.P.S:
"So this is kind of another level of debugging, not single pins anymore, but motor functionality."
https://www.esp32.com/viewtopic.php?f=2&t=3476&p=19087#p19096
https://forum.arduino.cc/index.php?topic=462107.msg3236016#msg3236016
http://stamm-wilbrandt.de/en/Raspberry_camera.html

HermannSW

I wanted to use a (Bluetooth) BLE remote gamepad to controll the robot ESP32 module:


But I found out that (Bluetooth) BLE support is unlikely to be available in ESP32 MicroPython or ESP32 Arduino IDE in the near future.

Then I wanted to use the other ESP32+Oled module I had to connect an Arduino joystick and send telnet commands to the MicroPython on robot ESP32 module in order to be able to remotely control the robot. But this time my soldering was bad and I killed the 2nd ESP32 module :-(  Immediately after that I did order 2 new ESP32+Oled modules with free shipping for <10$ each from banggood.com (because there shipping time is only 7-20 days).


Next I remembered that I do have two Wemos D1 modules (ESP8266 in Arduino Uno form factor):



While waiting for the new ESP32+Oleds modules I decided to give the D1 modules a try (did cost 6.50$ with free shipping two years ago, now 3.50$). Most important thing I had to remember was to use "D5" in sketch instead of "5" for Arduino pin D5 ...

First I installed a temperature and humidity sensor in a location of interest in our house and connected to a D1 module over 3m of three thin cables. I only modified one function of "Examples->ESP8266WebServer->HelloServer" and used DHT11 library for the sensor:
Code: [Select]
void handleRoot() {
  digitalWrite(led, 1);
  String message = "<head><meta http-equiv='refresh' content='5'></head>DHT11, \t";
  int chk = DHT.read11(DHT11_PIN);
  switch (chk)
  {
    case DHTLIB_OK:  
    message += "OK,\t";
    break;
    case DHTLIB_ERROR_CHECKSUM:
    message += "Checksum error,\t";
    break;
    case DHTLIB_ERROR_TIMEOUT:
    message += "Time out error,\t";
    break;
    default:
    message += "Unknown error,\t";
    break;
  }
  // DISPLAY DATA
  message += String(DHT.humidity);
  message += "% r.F.\t";
  message += String(DHT.temperature);
  message += "&deg;C [" + String(millis()) + "]";
  server.send(200, "text/html", message);
  digitalWrite(led, 0);
}  


Surprisingly easy, now I have my 1st IOT device in our house, and it refreshes every 5 seconds in browser:
DHT11, OK, 66.00% r.F. 18.90°C [16381020]

(r.F. is German for r.H. or relative humidity).

Now I try to get "Examples->Ethernet(esp8266)->TelnetClient" to connect to robot ESP32 module wirelessly for robot remote control.


Bad news first on the steering omni wheel robot. I played with telnet commands "right()" and "sbrake()" with maximal speed "pwmb.duty(1023)". While the robot turned quite fast on carpet, I tried on floor tiles and the results was really bad. Turning on floor tile without moving forward just does not work well (unclear whether it is as bad with moving forward).

Then I tried to run robot "blind" across big free space in our living room. And that with maximal forward speed, timed and with full brake after one second:
Code: [Select]
pwma.duty(1023)
forward();  time.sleep(1); brake();


Braking distance was something in 5-15cm range only. And the robot had to accelerate from stand still. Despite that the robot moved 10 tiles forward and 4 tiles to the right, with 31.5cm tile lenght. This demonstrated an average robot forward speed of 3.4m/s of >12km/h already!!
Code: [Select]
$ bc -ql
sqrt(10^2+4^2)*0.315
3.39265382849473753968
sqrt(10^2+4^2)*0.315*3.6
12.21355378258105514284



All three motors are 12V 1500rpm gear motors, back wheel diameter is 65mm ➫ in theory 5.10m/s maximal robot forward speed:
Code: [Select]
$ echo "pi=4*a(1); 1500/60*pi*0.065" | bc -ql
5.10508806208341401246
$
https://forum.arduino.cc/index.php?topic=462107.msg3236016#msg3236016
http://stamm-wilbrandt.de/en/Raspberry_camera.html

mikerr

I got some of these a while back,  and keep one on my keychain as a ssid scanner, here's my code:



https://github.com/mikerr/arduino-oled

Joennuh

I recently bought and recieved a Wemos Lolin32 OLED Module board. It took me a lot of effort to put the little online documentation together but I got it all working.

Now it runs a little webserver with DS18B20 temperature server. It displays the startup proces on the display and at the end of the startup proces it displayes the associated accespoint and IP-adres. On the little internal website I got the ability to read the temperature and operate the attached red power-led and green activity-led.

In the future I want to add UI cards with the temperature, access point, IP-adres, digital clock and analog clock.

While searching for information about the board I discovered this topic. It is nice to see the information about the board and DIY projects of others.

This pos got my attention:
I got some of these a while back,  and keep one on my keychain as a ssid scanner, here's my code:



https://github.com/mikerr/arduino-oled
These sketches seems to be very usefull. Thank you for sharing! I definately will try them sometime!

One last thing: can anyone tell me whether it is possible to connect one or more buttons to this board? And if so: does the board have internal pullup or pulldown resistors? If not: what would be the steps to do this by my self.
At the moment I only have a little experience with a Teensy 2.0 which has internal pullups resistors and a nice Bounce library to nicely interact with momentary push buttons.

I too am beginning my planning for an altimeter for my PPC. The additional features are quite interesting also. Please be so kind as to send any info on your success with your altimeter, etc project.

HermannSW

This is a bit off topic, but I posted on using MicroPython with that ESP32 and Oled before in this thread.
It is even possible to redirect the MicroPython REPL (Read, Evaluate, Print, Loop) to the OLED.
Yes, a bit small, but for me 16x8 console is really impressive:
https://esp32.com/viewtopic.php?f=2&t=7069&p=31710#p31710


This is from matching "screen" session, the posting is from thread on keyboard missing to make this ESP32 with Oled a full blown computer when running from lipo:
Code: [Select]
...
>>> import sys
>>> sys.implementation
(name='micropython', version=(1, 9, 4))
>>> 5**4**3
542101086242752217003726400434970855712890625
>>>


This is my fork that makes the for Raspberry FBConsole usable for ESP32 again:
https://github.com/Hermann-SW/micropython-raspberrypi#fork-mission-statement

A colleague told me that V-USB project is the way to go to connect a USB keyboard, have not tried that.
This would be the (5$) USB wireless keyboard I would connect:
https://forum.arduino.cc/index.php?topic=462107.msg3236016#msg3236016
http://stamm-wilbrandt.de/en/Raspberry_camera.html

marcobinz

I ordered one of these boards (hasn't arrived yet) but I couldn't find a spec sheet or something that could tell me how to power it from something else than the USB port.

I see it has some pins named 3V3, 5V and Vin. Since it can be run from USB (5V) but seems to use 3.3V internally, I assume it has an onboard voltage regulator. Is it safe to connect a battery to Vin? What's the allowed range of the voltage connected to Vin? Is it possible to connect a 1 or 2 cell LiPo?

Go Up