This is my make-through for the week's assignment. Grab a cup of coffee!
this days our world suffer from energy problem
many companeis try to make best solutions to get energy from renewable sources ... but not all solutions fit all area
so we need to have in details the weather information in any area
-
Step 1:We get all required component (DHT11, BMP180, NODE MCU)
connect DHT11 GND and VCC to VIN PIN (as node didn't get 5v out)
connect data pin to D5 in node MCU
Step2:connect BMP180 VCC 3.3v and GND
Connect SDA,SCL to node mcu as it works over i2c protocol
now we need to have a virtual server and database client installed to start send and store data
after some times in search, we found WAMP it's a windows application that has apache server and mysqlserver and phpmyadmin all required package to make your own server
wamp installation is very easy as any standard setup (also there's a silent installation version ... just double click)
Step1: we Created Table Called BME or any other name you prefer
Step 2 : we need 6 columns (ID,temp,hum,pressure,altitude,timestamp)
ID Act as refernce key for each record it should be unique and auto increment
timestamp also should be auto to prevent any lag or time shifting and to decrease received data size we can make it default time from server
any other column data type should be float as we recived
Step1: downloading and importing required library
Step2: as any basic input we need to read data and store it in variables to print it on a serial monitor
Here's the problem there's no library to send data directly as they are different platfrom
the solution is to create PHP API to receive data from HTTP request that nodemcu can handle and insert the received data to MySQL database
now and after receiving data on database we have a major problem
our device is an outdoor operator and should have it's own power source as we can't power each node externally and also there's may no power source in our area like if we put it to collect data from desert
Step1: connecting 3.7V LIPO Battery with battery holder to charging module
we found two problems
the power consumption for node mcu is less than 0.07 ma which less than what charging module sence and make the module turned off
it only take about 18 hours to totally discharge battery whish is not long enough
Step1 : adding 6V/4.5 Solar Panel To charge Battery
the problem here is charger have limit input to 5.5v max and solar cell output up-to 7 v in extreme light so we put zener daiode as voltage limitation to 5 v
Step2: connecting battery direct to vin pin instead of charging module to prevent under sensing limit for charging module
Problem 2 : we still can only run battery for about 18 hours
For now every thing is working fine but we need to extend run time with out charging
after search we found that nodemcu have Deepsleep mode that turn off wifi and any other running services and set cpu to standby mode and it can only consume 20 µA
we have 2 way to wake up node
first way using external action like pressing push button and the way that can't used because our product need to run remotely without human interaction
second way based on delay timer which is perfect for us as we need to run to read sensors values and sleep for 10 min then wake up again
ESP.deepSleep is a built-in function to go to sleep modes
Step1: first we need to import external library for nodemcu as it's not built-in in Autodesk eagle
Step2:adding all part and start connecting nets
Step3:Creating board layout and routing air wires
the milling procces is running perfect the problem here is about node mcu footprint the pads didn't fit so I tried to edit foot print
after editing the footprint trying to re-fabricate pcb again and every thing goes fine
not we will solder component board
Final Result
Step1: creating a basic table to read last 100 row from database
Step2: Style the table to be responsive in any mobile tablet or any screen
the second section is to visualize the data in graph to make easier to read
used bootstrap temnplete as responsive design
we used Cavischart js Module to view data from database
Step1: Creating Basic Box MDF 3mm with T-joint
Step2: Creating opens to fit sensors
After Testing and Troubleshooting every thing works fine inside the box
In this video we will see device wake-up and connected to pre-set wifi network
then trying to connect to server that contain API file
and after receiving HTTP response that mean it's connected and data parameters send ok
then when check database table to find the inserted row at the same time stamp
then check retrieve page and chart to ensure it's reading data correctly
Our Project conslusin is
we built our own weather station that can collect data from some sensors and send this data over wifi to web server
so you can retrieve this data any time for weather analsys in this area or you can view it remotle as chart that help session makers
our device can also run forever thanks to device deep sleep technique to allow battery to work for more than 200 days without charging
and also no need to charge or replace battery thank to solar cell that can charge battery to 100% every 5-7 days
-------------------------------------------------------------------------------------
in this project i learned many things
the main thing I learn is how to optimize power to consume little energy to work for a longer time
also, I learnt how to use solar cells it's my first time and to charge the battery from it using a charging module to make my device work at night