Claudio consists of just five (or six) components, the wiring between them and code. No resistors, capacitors, diodes… no discrete components apart from 3 five cents of € coins. 😉
List of components:
ESP32 Development Board: I’ve tested two different boards, and though they are very similar the results were not the same. ESP32 Development Boards Front ESP32 Development Boards Back Price: US $7 The first one was the one on the right side. It is a board I bought a year ago and it was working fine (for small tests) since then. When I first tried to put all the components together I noticed that ILI9341 TFT Display and WiFi connection were not good friends working at the same time. After 3 or 4 display operations (text, area fill, …) the screen went always blank and only when WiFi library was loaded. I tried multiple pin configurations, alternate libraries loading order. I tested voltage on each significant pin (D/C, CLOCK, MOSI) and no result. Finally, I decided to give a try one of the last boards I bought: the model on the left side. The result was successful. No blank screen. But, these boards have a bug design: they don’t allow uploading schemas directly from Arduino IDE (Error: Timed out waiting for packet header) and you have to ‘play’ with EN and BOOT buttons every time. Workaround: once Arduino IDE tries to upload the schema, press BOOT and without releasing it press also EN button, wait for a half second, release EN and when IDE stops waiting and starts the uploading you can release BOOT button.
ILI9341TFT Screen – SPI Again, the component I had at home was about one year old. The only difference is that the one you can find now implements a set of pins to control a touch panel (though they say at the product description “non-touch”). Anyway, I think the one is being sold now is perfectly compatible with the previous model. What we need for this design is a model with an SPI pin configuration. Sellers usually refer to these as “driven with at least four IO” Price: US $7 ILI9341 SPI TFT DisplaySample ebay.com link to ILI9341
DHT-11 Temperature and Humidity Sensor This is a low-cost sensor very easy to use. Though it has four pins, only three of them have a function (the other one is not connected). Simply connect ground pin to GND, VCC pin to 3V3 and Data Out pin to any ESP32 IO pin. Depending on the range of temperature/humidity you need to measure, you should take a look also to DHT-22 sensor (which implements a wider range and more accuracy), but in my case, 0-50ºC/20-80%R.H. is quite enough. Price: US $1 DHT-110 Temperature and Relative Humidity sensor
BH1750FVI Digital Light Intensity Sensor I think the best feature of this sensor is, apart from ease of use, the sensibility and stability. It measures ambient light and gives the result in Lux. It has 5 pins, but once again we can ignore one of them (ADD) by connecting it to GND. So, we only need two ESP32 IO pins to connect SDA and SCL sensor pins. GND and VCC pins go to GND and 3V3 ESP32 pins respectively. Price: US $1 BH1750FVI Ambient Light Sensorebay.com link to BH1750FVI search
Passive Piezo Buzzer The most basic part of the system. Just two pins (the middle one can be ignored), one goes to GND and the other one to an ESP32 IO pin. Price: US $0.2 Passive Piezo Buzzer
After trying several options that I found on the web, I chose this one as the better to connect an ESP32 to an ILI9341 TFT display.
ESP32
ILI9341
3V3
VCC
GND
GND
D15
CS
D2
RESET
D4
D/C
D23
MOSI
D18
SCK
Not connected
MISO
3V3 (***or D19)
LED
The code:
/**
* ILI9341 TFT libraries and resources
*/
const int TFT_CS = 15;
const int TFT_DC = 4;
const int TFT_MOSI = 23;
const int TFT_SLK = 18;
const int TFT_RST = 2;
const int TFT_LED = 19;
#include "SPI.h"
#include "Adafruit_GFX.h"
#include "Adafruit_ILI9341.h"
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC, TFT_MOSI, TFT_SLK, TFT_RST);
void setup() {
tft.begin();
tft.setRotation(3); //Landscape orientation
}
The reason for the two possibilities for the LED pin is the next:
If you connect LED pin directly to 3V3 you will get maximum brightness in your screen. LED pin controls the backlight of your TFT display.
In my case, I didn’t want to have max brightness but I wanted to control the intensity based on ambient light, so I decided to connect LED pin to any of the IO pins of the ESP32 (#19 in the showed example).
The code to control backlight intensity (once you have connected LED to pin D19) is as follows:
Inserting the code above allows you to set the backlight intensity at any point just invoking setBGLuminosity() function passing a value between 0 and 255.
Inside Hardware folder, you may find some hardware pictures and a wiring diagram (though this one will have its own post) and inside Box folder are the .obj files to 3d Print the box.
New blog and to tell you the truth, my first blog. No personal introduction, no sensitive content… 🙂
I made some basic tests with an ESP8266 a couple of years ago and I was very pleased with the board capabilities, the freshness of NODEMCU, the quick schema uploading… everything. But I didn’t like one aspect, in the same way, I didn’t like some years before about Arduino boards: connectivity.
The ESP32 arrived, WiFi and BLE connectivity, a bunch of IO pins, a lot of different pin working modes… and for someone with limited knowledge of electronic theory… a marvelous tiny thing.
Lately, I am having much more spare time that I used to have, so I decided to start doing things I always wanted to do but I never had the time to. I don’t like using my cellular for all purpose. I like WakeUp alarm clocks, but not the ones they sell. My last WakeUp alarm was a Sony, very nice, spectacular design but “who the hell designs an alarm clock supposed to be stopped while you are sleeping by pressing a tiny switch in the middle of a lot of more tiny switches? Yes, Sony” And what if I design my own Alarm Clock with that ESP32 Developer board I have? And that’s what I did.
The requirements:
Time visible in the dark, but not like a red UFO. Light intensity has to accommodate to room light.
No need for time adjustment. No need to change the hour every spring or autumn.
Minimal use of buttons, tiny buttons, micro switches… :S
If there’s enough room on the screen… some other indicators like temperature and relative humidity (these are enough important in the dry & hot Madrid nights)
If possible, some communication capabilities: remote configuration, remote alarm stopping, …
Easy to wire components between
The prototype:
I needed a box to fit all the components in. Perfect reason to buy my first 3D printer, and that’s what I did.
This is the screen design today… it’s evolving and probably will not be the same in a couple of days.
Claudio WakeUp Alarm Screen
The box is 11cm x 65mm x 65mm and though is a bit bigger than I expected it to be I think of it as a prototype and time will bring smaller designs.
Claudio Box
This has been only the introduction. Check out the rest of the posts to know more about the design, the code and the possibilities of ‘the creature’.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.AcceptReject
Privacy & Cookies Policy
Privacy Overview
This website uses cookies to improve your experience while you navigate through the website. Out of these, the cookies that are categorized as necessary are stored on your browser as they are essential for the working of basic functionalities of the website. We also use third-party cookies that help us analyze and understand how you use this website. These cookies will be stored in your browser only with your consent. You also have the option to opt-out of these cookies. But opting out of some of these cookies may affect your browsing experience.
Necessary cookies are absolutely essential for the website to function properly. This category only includes cookies that ensures basic functionalities and security features of the website. These cookies do not store any personal information.
Any cookies that may not be particularly necessary for the website to function and is used specifically to collect user personal data via analytics, ads, other embedded contents are termed as non-necessary cookies. It is mandatory to procure user consent prior to running these cookies on your website.