How i built my own irrigation controller
-
Upload
shree-kumar -
Category
Engineering
-
view
103 -
download
3
description
Transcript of How i built my own irrigation controller
![Page 1: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/1.jpg)
How I Built My Own Irrigation Controller
Talk Outline for DroidCon 2014
![Page 2: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/2.jpg)
Background
• Wearables & IOT are huge– Huge opportunity for connecting all sorts of
devices– Much of the hype is around glasses and watches• Appliances are slowly picking up• Emerging standards, e.g. AllSeen
• The maker revolution lets everyone play a role in this
![Page 3: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/3.jpg)
My Own Journey
• Bitten by the maker revolution a couple of years ago– Explored Arduino, MSP430, Raspberry PI &
BeagleBone• Made an irrigation controller with off-the shelf
components first– AC operated, Water at specific times of day– Many shortcomings
• Soon, pushed myself to make this a product
![Page 4: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/4.jpg)
I am Here Now !
Battery Operated
(10 years + life)
LCD Display with Backlight
User Buttons
Bluetooth (Classic)
Shell being finalized… - will be “unvelied” in the conference
![Page 5: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/5.jpg)
Design Parameters
• Battery operated, long life• Least cost device• Easy to produce in small quantities• Controllable easily, and via other devices– Users must not need a new phone
![Page 6: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/6.jpg)
Design Choices
• Low power TI MSP430 for device processor• Latching valve for max battery life• Nokia 5110 LCD, 2 user button• Bluetooth Serial connectivity– future path to Bluetooth LE
![Page 7: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/7.jpg)
TI MSP430 Microcontroller
• Microcontroller family– MSP430G2553 used in this project
• 512 bytes of RAM, 16 KB flash. (Yes, that’s BYTES)
• Low Power – Sleep current < 1 uA– Years of battery life, limited by self discharge.
• Easy to get started– Simple and intutive hardware design
![Page 8: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/8.jpg)
Bluetooth Serial
• Serial Interface over Bluetooth• Trivial to implement on Android & elsewhere• Low cost modules available – e.g. JY-MCU• But don’t use your regular serial protocol– \r\n based protocols store the whole line in
memory– RAM is the most precious resource
![Page 9: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/9.jpg)
Protocol Design
• Character Based• App sends a byte of data• Device processes and outputs– Same byte if OK– Error byte on bad character
• App terminates command with \r\n• Packet based format for device response• Ease of use over serial terminal• RAM requirement
![Page 10: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/10.jpg)
Examples
Turn ON valveApp Device Comments
O O
\r \r
\n \n
0,3,S 3 bytes in response. S represents success
Set Timer
App Device Comments
aHHMMSShhmmssNNN
aHHMMSShhmmssNNN
NNN is repeat duration in days
\r \r
\r \n
0,5,S,0,7 5 bytes in response. 07 is the timer ID
![Page 11: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/11.jpg)
Protocol Implementation
• Protocol supports– Version identification– Add, modify, remove timers– Get/set current time– Direct valve control– Firmware update is TBD
• Implemented in a single source file• Open Source (will be)– Users can make their own apps– BT exposes extra controls
![Page 12: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/12.jpg)
Bluetooth Based User Control
• Widely usable Android App • App provides common functions– Richer UI than possible on the LCD
• App can sync with the device– Statistics
• BT consumes lot of power– Device can turn BT ON periodically to help sync
with app– Low RTC drift aids sync
![Page 13: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/13.jpg)
Steps Along the Way
• Making a device is a lot of work!• Schematics for Electronics • Board Design, Fabrication, Board Assembly• Software Development, Debugging, Reliability• Enclosure Design• And I haven’t even spoken about actual
production!
![Page 14: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/14.jpg)
Open Source Tools
• KiCAD for PCB schematics, layout, gerber generation, and even cool 3D views
![Page 15: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/15.jpg)
Open Source Tools
• FreeCAD for mechanical assembly…
< Picture Placeholder >
![Page 16: How i built my own irrigation controller](https://reader035.fdocuments.in/reader035/viewer/2022081404/55906cbe1a28ab49488b474c/html5/thumbnails/16.jpg)
Conclusion
• Connected devices will be all around us soon• You can create them with reasonable effort,
and low capital• The Maker Revolution puts all the right tools
in your hand• So, go build the future!