It started at the market looking for the componentes, at the time I only had the idea and nothing else so I went fishing for some breadboards, resistors, transistors and sensors but luckily at that place I found myself in front of a programmable board and some sensors that worked out-of-the-box with that board, the first set of components included:
- Mega, I picked this specially because of the number of analog and digital ports it had, didn’t know I wasn’t going to need all of them but more on that form factor later
- NodeMCU V3, this was a happy surprise since I asked for a wifi module and they give this at a very low price
- Photoresistor
- Temperature and Humidity Sensor (DHT11)
- Rain Sensor, This module is also called Hygrometer, the only thing that changes is the sensor
- Two LiPo Batteries 3.7v-1000mAh
- Step Up DC-Dc Converter XL6009
- Solar Panel 5v-100mAh
- TP4056 Battery Charging module
- Battery Charger Indicator
Connecting the sensors was pretty straight forward, I found some internet tutorials that walked me through the entire process:
- Test the Mega, Install the IDE, in my case it was on a MacOS, connect the Mega, open the blinking led test, there was some issues regarding the drivers for the serial connection, mac always have issues with drivers but some internet browsing revealed the solution, upload the sketch, and voila, your first project on the mega
- Connect the DHT11 Sensor, this is a digital sensor so you just read the temperature and humidity data and that’s it, eventually you will have adjust it but you can code this
- Connect the Photoresistor to an analog input, this gives you a reading from 0 to 1023 depending on the resistance so it is just a matter of plug it, test it, read its value, understand its behavior and fix your code if you didn’t get it right the first time, like me (1023 – readings())
- Connect the rain sensor, the same as above
At this time I had the first stage of the process, the mega was reading the values from the sensors and was printing them in the serial monitor, this was, at least for me, a huge happiness, this was the first step of a very big project, but The Station is the easy part, we will continue with the server and the wifi connection in the next posts.