How does it work
The main components of LiVduino are one Arduino Nano (or an Arduino Nano clone) and one NodeMCU.
Arduino Nano is connected over I2C to a couple of sensors (temp&humidity, light), an OLED screen and a RTC module. There are four push buttons whose state can be read by Nano. Based on the state of these buttons (ON/OFF), Nano will sound a buzzer or perform other actions (e.g. send messages over serial interface to NodeMCU so that Node MCU writes measurements to ThingSpeak and sends HTTP commands to Sonoff) NodeMCU is configured to connect to the local WiFi access point. Node MCU receives messages from Nano over serial, interprets them, and performs communication with end-points (sends reports to ThingSpeak and switch on/off commands to Sonoff). |
LiVduino is powered by a USB cable plugged into Nano. NodeMCU is powered by 5V VCC from Nano. A voltage convertor is used for serial communication between different voltage levels (5V and 3V3 respectively) on Nano and NodeMCU.
Both Nano and NodeMCU can be programmed with Arduino IDE.
Both Nano and NodeMCU can be programmed with Arduino IDE.
LiVduino's main loop on Nano works somethings like this:
- read date/time from clock module - read sensors - show page one: date/time - check alarm status and sound buzzer if alarm condition is found - show page two: measurements - read button state - show page three: display state of buttons - check state of ThingSpeak and Sonoff button: if ON, send appropriate messages over serial to NodeMCU - start new loop LiVduino's main loop on NodeMCU works somethings like this: - wait for messages on Serial - if message is received, decode message and check if it is a valid operation. If yes, send report to ThingSpeak or control message to Sonoff - start new loop |