What it does
The initial idea for this design is to have an IOT pot which can monitor the plant condition and give some feedback to users.
The pot will be monitoring the temperature, moisture as well as the sunlight to the plant and rotate the pot to get evenly sunlight at each side of the plant if needed. Plant condition information will be transferred as well as any other plant warning or information that user need to know for their plant.
For the final implementation, the board is used to control an IoT fan which would read the current temperature and based on the device mode, control the fan output. There is three mode in the device: sleep mode, which the device turn off everything. Auto mode, which the device will control the fan base on the temperature reading, the higher temperature, the fast speed of the fan. Manual mode, this is a mode which the device is connected to another IoT device we developed, IoT Node. Te fan will be controlled manually by the node rotation input.
How I built it Video
To implement those functions, the board is built with the following parts:
- SAM W25 WiFi module: an easy implement a different interface, server or app.
- Temperature/Moisture sensing: I2C - Si7006 sensor
- Light density sensing: I2C -
- DC motor: rotate pot to give plant even sunshine
- Nokia 5110 LCD: device information print and message warning if necessary.
- USB micro chargeable: USB micro port with Schottky power rectifier to handle power switch.
- LiPo power: MCP73831T built lipo charging circuit and LM367 built switching regulator
Bootloader Implementation (reference from Justin post):
A bootloader was created using the various libraries including the HTTP downloader library supplied by Atmel. This allowed for a convenient Over The Air Firmware Update (OTAFU) instead of using the SWD.
- For the cloud connection, the device will send temperature data to the MQTT server at each second while the MQTT will take the temperature reading and plot a real-time based temperature chart to show the user current temperature. *Also the device will be sending current device status to tell the cloud what is the current device state so the user could know if the device is working or not. *The device will be receiving mode change input from a user by using which the device will switch mode between a sleep mode, auto mode and manual mode. *The MQTT server will also send device ID information, while the user chooses to use a lamp, the fan will be offline.
- For some reasons, the MQTT response very slowly on my device while it was very fast on Justin's device. I have checked my code and there is not too much delay in the loop. Maybe just because of the WiFi router or something in between delays the signal callback.
- For next design, first I would user smaller space on my PCB. For now, there is an empty area on my board which does nothing bu increasing the cost of manufacture. *Put a lipo charging indicator. For now, my device doesn't read the battery voltage level which would result in user charging the battery forever, such outcome may damage the battery or ever more. So for a future device, I should add a feature to detect battery level and maybe circuit to disconnect the charger when the battery is full.
- Maybe try to use some server than MQTT because it sometimes acts wired. *Try to implement a better UI on the blue mix.
Video of the device’s functionality:
*For full device functionality, please check this on YouTube here. This including the device functionality, sensor data streaming and actuation from the cloud.
Challenges I ran into
The first challenge I ran into is to develop the circuit board. I was using the Eagle for all of my design work and hobby work so getting into the Altium took me a long time to get through sometime. It is also hard sometimes to choose the right rule or the layout on the PCB board when doing the design, like how large the via should be, how long the trace should be to have the best signal passed or like why there should be a resistor etc.
Sometimes I found it really hard to understand the ARM chip. The ARM is good I think since I don't really need to read all the datasheet to get each register setting, many functions is already implemented with the library, but that is also the hard part that many time, I cannot find the correct way to set up the right pin mux or the sercom or whatever for what want to do.
Also, I'm not a very good programmer, coding took me a lot of time.
Accomplishments that I'm proud of
All the parts are working properly! That is the best thing after all those designs.
What I learned
- Design board with industrial standard software.
- Implementing bootloader with ARM chip.
- Implementing cloud control with MQTT and BlueMix
What's next for ESE680-Xin (cookieeeeee) Zhang
- Try implement more functions with the board!