NodeMCU

Daj siฤ™ poznaฤ‡ / Get noticed – summary

Time is almost over but we have so much more work to do! Of course, we won’t stop our work but let’s summarise was has been done during competition.

The main goal was to build a control node that can gather and display information from different sources/sensors. This node is the Doton project.


But before we could create it we have to do two other projects: a GfxLCD python library, NodeOne sensor and improve one: NodeMCU boilerplate. So, in fact, we have done four projects ๐Ÿ™‚

(more…)

Node One – a multi-purpose node

Today we combine the power of HLK-PM01, PIR HC SR-501, DHT11 and a light detector.
Together they create a nice looking multipurpose Node One. I wanted to do it for some time but the last piece was missing. I didn’t have an idea how to create a box for components.
Few days ago I found a perfect case named Z27. It has all I wanted, socket, plug and enough space for NodeMCU v3.
Python code @ GitHub
LUA code @ GitHub
(more…)

Powering NodeMCUv3 with 5V from power grid via HLK-PM01

Our little devices require a power. Mostly 5V DC. How to deliver it? The power grid is 230V so it is too much ๐Ÿ™‚ and additionally, it is AC.
What can we do?
We can use a phone charger. It is easily affordable and does its job. But it looks bad and often we have power so close that it is a waste to use something with a long cord. We want to have a nice, small and compact device. What can we do?

(more…)

NodeMCU event handlers – 18b20 as good start

We have a nice NodeMCU server for LCDs. But there is one catch. We can control one LCD or all connected LCDs. But imagine that we have two LCDs and we want to display different content on each.

In message we can set node name but not device connected to it. So there is case with 1+ screens or broader with many devices connected to one Node.

Another problem: we start LCD server and we want lets say start a server with temperature sensor. We cannot. Lcd would take port and that is all. To do something with this we will introduce event handlers and listers. Big and useful change.
Each module would have an event handler, a function that gets message and do something with it. Returns true when it can handle this event and false when not.

I mention temperature sensor, currently we have none so first lets create one.
(more…)

NodeMCU LCD connected to CharLCD package – part 2: something useful

Last part was strange, we wrote a direct driver that has no real usage. We done it only because we kept compatibility. This time we will do something more useful, WiFi content driver. We will try and do in such way that only content is send. This is more friendly for network and sanity ๐Ÿ˜›

(more…)

NodeMCU LCD connected to CharLCD package – part 1: a whaaat ?

This time my two projects, CharLCD and NodeMCU boilerplate join forces in endless effort to display something somewhere ๐Ÿ™‚

What does it mean? It means that we will add another driver to CharLCD. This will allow us to use remote LCD with Raspberry Pi and later with any application in Python. It should be possible to use it with LCD Manager package and this is something very interesting ๐Ÿ™‚

As a remote LCD we will use HD44780 (40×4) hooked to NodeMCU via i2c (but we know that we can plug any LCD via gpio or i2c ๐Ÿ˜› ) and it will listen to broadcast messages.

Rpi (with CharLCD and driver) will broadcast UDP messages into network.

Lets get started.

(more…)

NodeMCU and HD44780 โ€“ part 4: drivers, i2c and double E

Time to take another step with NodeMCU and HD44780. This time we will separate driver logic from lcd logic. Why? Because it is much more flexible for our lcd (direct and bffered) to have general write, set_xy and move wiring specific logic to driver. This way we can just swap gpio with i2c without any problems.
This imply that we will also write i2c driver ๐Ÿ™‚
Another matter is hooking screens with size 40×4. In fact they are two smaller lcds, 40×2, with shared all signals except E1 and E2. How it works? You set required signals and select top screen with E1 or bottom with E2.
Lets get to work.
Code is available in boilerplate
(more…)

NodeMCU and light detector – part 1

We have a small problem at the office. This problem is only one toilet. Additionally not all rooms can see it and know if it is busy or not. So quite often someone runs and slams into closed door.
Such runner has two options, form or join queue and wait or go back to desk and return later.
It would be much better for all of us if we could check toilet status from our desks.
How to do it? Simplest way is to detect if light is enabled. Hopefully this would be enough. If not I have another idea ๐Ÿ™‚
As light detector I’m going to use lm393 light sensor and as the brain NodeMCU v3.

Download code
(more…)