i was a starving entrepreneur when i passed outside anca’s place on 14th street 6 years ago. the sight of all the food stopped me. the room was full of people talking among themselves and nobody was eating – i crashed the party. i still remember the desert fruit cake when i finally looked up to see where i was. in addition to the party the space was filled with computers, 3d printers, electronics everywhere and people working on complicated looking diy projects. then anca came said hi and many things took a new direction some. unknowingly i had crashed the tech liminal during it’s first anniversary/end of year party – on the weekly electronics hack night. i had not starting building electronics into farming yet and i was thinking of using zilog z80  class of microprocessors.  i learned machine code and assembly code programming using this instruction set, build my first single board computer using this and did many projects using this in early college.

ktn

anca kept mentioning arduino – and i kept asking arduwho. in the end she gave up and handed me a copy of the arduino handbook (and bag of  yummy leftovers). i did not sleep the entire night, i was at anca’s door at 8 am bumming for an arduino. again, on the following day, i was there at 8 am bumming another one as i literally smoked the first. on the next electronics hack night, i was flashing lamps, controlling heaters and fans at the techiminal with my first arduino demo.

i quickly found advantages and limitations of the arduino. i also found it easy to learn and challenging to use. i was discussing with anca when chris pointed me to jeff’s mightyohm wifi music project.

the integration of linux with the arduino was appealing as many of my applications were frequently in remote locations, often solving different problems, usually critical,requiring security

so after various versions e.g. v1, v1.1, v1.3, v1.5, etc. we are now on version 2. the older v1.3 controller is shown below.

v13

the v2 controller a combined linux, atmega2560 with multiple shields on the same board is the basis of the second generation platform. the v2 controller is shown below

4309_ukcblhhzcq

why is v2 really easy to use. well, first because i designed and built it. but mostly because the platform works by abstraction physical inputs an outputs so one can focus on how things relate to one another as compared to the details.

for instance, a google search for aquaponics returns something similar to the image capture shown

googleaquaponicimages

which in a flattering way shows, a sketch diagram from one of my presentations, a picture of my garden in my kitchen and 3 gardens straight from my creative space – all without credits.

still, from the google results it appears like aquaponics is technology, a little intimidating for someone trying to start growing food this way. so to automate this would be relatively easy as one can probably easily get sensors and shields for every component in such a system. the end result is a perfectly maker project

arduinoshieldstack

which is ok – but not ok … it is a byproduct of the way we think about technology .ie. focusing on the end as  compared to the journey.

i think aquaponics is really easy to understand as it mimics nature. i think modeling after nature is a better way of thinking about aquaponics as a problem for physical visualization or data driven applications that will eventually run and benefit from machine learning and AI. we need  more basic abstractions to be able to model using hardware and software efficiently. i think a better way to visualize such a process is as shown below

watercycle

from there it is very easy to extend it to here

watercyclemodel

and even easier to expand to here

growbedmodel

at this point really my concerns are what is digital, what is analogue and what is streaming with a timing of it’s own – rather than questions like what sensors are good for aquaponics. the v2 controller works on the idea that the first 3 data type concerns will be the same for every physical project, whereas the last question will change for every application. it means data collection, communications, security layers can be the same for different applications whereas data analysis and presentation are different and can be done later in the stack – infact in your phone

traditionally, one connects a sensor, say temperature to a pin and writes code that ties that pin to that particular functionality. then you connect another sensor say a photocell to another pin, you code that pin for a photocell. and you do the same for every peripheral on your board. combine the stack of hardware shield boards on the arduino shown above with software like this and you never have to spend another idle day depending on what you are trying to accomplish.

abstracting inputs into their basic forms also means that only raw data values are of interest rather than what they mean. so you can connect any sensor in any appropriate pin ie analogue sensors to any analogue pin, digital to any digital pin and streaming sensor to any of the streaming pins (1-wire, i2c, uart). streams are broken down into discrete values using their end of line (eol) characters.

the default program on the v2 atmega 2560 side polls the state of all pins and streams these as a json string to the ar9331 soc side of the v2 controller running openwrt linux. the data is processed for any immediate action and the  enriched data object is send to remote data servers for processing through the api.

a typical json object  data object string for the device manylabs is shown below.

{“baudRate”: 38400, “name”: “manylabs”, “uptime”: “3 days, 3:26:08.680000”, “pins”: {“temperature_0”: 69.69, “relay6”: 0, “D38”: 1, “D39”: 1, “D36”: 1, “D37”: 1, “D34”: 1, “D35”: 1, “D32”: 1, “D33”: 1, “D30”: 0, “D31”: 0, “humidity_temperature”: 18.0, “A15”: 322.0, “A14”: 284.0, “temperature_sensor_count”: 1, “A11”: 300.0, “A10”: 258.0, “A13”: 343.0, “A12”: 340.0, “relay8”: 0, “UART3”: 0, “A1”: 290.0, “A0”: 330.0, “A3”: 372.0, “A2”: 348.0, “A5”: 361.0, “A4”: 360.0, “A7”: 376.0, “A6”: 384.0, “A9”: 134.0, “A8”: 375.0, “D29”: 0, “D28”: 0, “nutrientTemp”: 20.94, “corizHumidity”: 0.2, “D23”: 0, “D22”: 0, “D25”: 1, “UART2”: 0, “D49”: 0, “D48”: 0, “corizCo2”: 2, “D43”: 1, “D42”: 0, “D41”: 1, “D40”: 1, “D47”: 1, “D46”: 0, “D45”: 1, “D44”: 1, “rtc”: “2000/1/4 5:4:10”, “humidity”: 22.0, “flow_rate_sensor”: 0.0, “D8”: 1, “D9”: 0, “D6”: 1, “D7”: 0, “D4”: 1, “D5”: 1, “D3”: 0, “corizTemp”: -99.8}, “version”: “v2.0.0”, “wlan0”: “192.168.1.79”, “initialize”: 0, “atmegaUptime”: “02:01:38:04”}

the data object then takes a trip into the internet for data logging through the kijani grows v2 api.

v2cloud

using the v2 api, it is very easy to query your raw data back for the device manylabs using a http call as shown.

curl http://api.kijanigrows.com/v2/device/get/manylabs

what remains is to tell the api which sensors are connected to which pins, so the useful data can be presented for visualization or further processing eg for alerts. the mapped data is the acted upon by the kj2arduino library. this takes raw data, runs the appropriate methods against it and returns the sensor data in human form – converted, units, icons, set points and other meta data.

the process for mapping sensors is as easy as selecting your board, choosing the pin and selecting what devices are connected to it using the api as shown

mappingsensorspng

the API can then be queried for the mapped data object eg using

curl http://api.kijanigrows.com/v2/device/sensors/json/manylabs

which can be presented further using dynamic icons as follows

 

mappedsensors

i just noticed that was the indoor irrigation system at many labs. if an aquaponic garden  it can be further visualized as an animation

gbanimation

or presented as trends

grafana

i ran out of my 9000 words

please let me know what you think and  get yourself a [url=http://kijanigrows.com/product/v2-smart-controller/]v2 smart controller board [/url]

[url=http://api.kijanigrows.com/v2/maps/list][img width=500 height=266]http://i2.wp.com/kijanigrows.com/wp-content/uploads/2016/11/v2maps.png[/img][/url]