offset \ˈȯf-ˌset\ noun

a force or influence that makes an opposing force ineffective or less effective

Cuply - Hydroponics Greenhouse Cabinet Powered by Django Channels and Arduino - Overview

I'm in the process of making a greenhouse out of a glass cabinet that sits on our balcony. Inside it, there's to be a plethora of sensors and actuators hooked up to Arduino Due microcontroller, which is in turn connected to an old Raspberry Pi. The software stack is Django with Channels in the back-end, and React with some D3 in the front-end. It was a project long time in development, and this series of articles will explore it from the inception to the latest product.

  1. Overview ← You are here
  2. Hardware
  3. Back-end
  4. Front-end
  5. Conclusion

Since we started looking to buy an apartment back in 2018, we had in mind a south-facing balcony. In the end, we were lucky enough to buy just such an apartment and, even though the balcony is small, we got it to become a special corner of our living space. It doesn't have much, but you can sit there and enjoy the view of the treeline across, day and evening, have a drink or even a meal on the foldable table we installed. The previous owners had a water butt set up to pick up the drain water and a set of flowering plants that thrived on it. We wanted herbs we could use in the kitchen so we had to control the water quality. Because the balcony is small, we opted to try a vertical set-up instead of a horizontal one, and having a hydroponic loop made sense. Fast forward to 2022. We have an automated system, although that's still just the beginning.

Even though sunlight is abundant on south-facing balconies in the northern hemisphere, if there are no outside obstructions, Ireland is not ideal. To control the temperature better, we opted for a glass greenhouse to look nice and make use of the greenhouse effect. For that, we had to buy a glass cabinet because building one was hardly an option. No space for us to do it at home, and the hackerspace we know is not really near enough to reach conveniently without our own transport.

Whoever opts to build such a thing by themselves, by all means, go for it. Custom builds will always utilize the available space better.

We could've become members of a nearby community garden. It's looking lovely this year. But we'd definitely be too lazy to devote ourselves to maintaining it so the balcony greenhouse will have to do. And, to be fair, setting up hydroponics is more fun.

Of course, there are some drawbacks. The space is limited in general and we'll see how viable the plants will be (the pots are rather small), but it's an experiment driven project that is inconspicuous enough, but also decorative and useful; it enriches our balcony's environment, creates a separation from the neighbours and might yield fragrant herbs. Not to mention that it's a great opportunity to have a hobby.


/media/images/cuply-first-look.jpg

In the future articles, I'll go into more detail on how the thing was made. For now, it's a hydroponic loop that functions between two tanks. The lower one pumps the water into the upper one, and the gravity takes care of the rest. Because of the size, only six plants are able to be inside the cabinet. The other things are nifty add-ons that just make the whole thing a bit high-tech and agro-informatics driven. Whatever the case, I'll open-source it after I finish the articles and have a working cabinet, so whoever wants to explore a bit and implement a similar solution in their place, they're more than welcome to use it.

3D Printer Shenanigans

/media/images/3d-printing-setup.jpeg

Buying a 3D printer was a decision we postponed for a very long time. With Vesna delving deeper into DM-ing D&D, we were thinking that we could host some games IRL for friends. Heck, I could even make some cocktails because we got a cheap cocktail making kit. Having miniatures would be nice, printing them would save money. Having a 3D printer would be useful for other models like small hardware parts, gifts, fixing broken things, etc. In the end we decided to bite the bullet and opted for a high resolution resin printer because they have gotten affordable enough and the level of detail is amazing. Right now we have Phrozen Sonic Mini 8K resin 3D printer.

What surprised me the most was that people who tinker on their computers usually have a notion that 3D printing is still filament only. Having a spool of plastic thread melted and drawn with, layer by layer, is not the only way. The other type is resin based, where the build plate is submerged in a vat of photopolymer liquid resin. The resin gets exposed to UV light from the screen below the vat and hardens on the build plate, layer by layer. The model is pulled out of the vat upside-down. These printers are faster by design because they harden the entire layer at once instead of a single dot drawing. They also have a higher resolution and less visible ridges between layers, but are messier and one needs to deal with toxic chemicals. To understand resin a bit more, Brent, from Goobertown Hobbies, explains the resin from the chemist perspective better than I would ever do.

There's also a concern where the fumes from melted plastic are a health hazard that needs to be addressed, but also the evaporation from resin, which needs more study. That's why 3D printers should be kept in a well ventilated room and PPE should be used. The toxicity for the environment and recycling the waste are also a concern. We don't plan to print a ton of miniatures, but we still need to address the waste properly. Like any other dangerous chemical, resin needs to be treated with respect. UV curing the liquid form renders it inert because monomers eventually form polymer chains that are not as harmful to the environment. The outcome is the same, the waste needs to be properly disposed of.

We bought Artisan Guild Patreon subscription to get some really nice miniatures for D&D. Surrounding a campfire with some heroes is a good start. We aligned all the models we wanted that could fit the printer margins. This was done in Chitubox slicer tool and the presupported files had most of the planes under 45 degrees vertically to counter the effects of gravity. The presupported files are great, but Chitubox can do it automatically if your models don't come presupported. One needs to know why printing is done at an angle and align their models properly so the need for the supports is reduced and it's easier to print without ending up with bent model planes.

Chitubox also needs a profile for the machine so it knows the parameters like screen resolution for the printing and what kind of resin is used. Regarding the printer itself, the profile file can be picked up from the manufacturer's pages and loaded into Chitubox.

As for the resin parameters, we needed to consult resin documentation. The problem was that the parameters were provided on the assumption that we would be using the same manufacturer's printer as well. We had to dig a bit to find the correct parameters for our use case. Exposure times and lifting speed are paramount for a successful print. After they were set, we sliced the file and had it ready for printing.

The resulting sliced file was under 250 MiB with over 1000 layers and around 50 grams of resin would be used. The bottle is 1 KG so it wasn't a lot. With the correct settings (don't ask, we had to print twice and we found out about the proper instructions afterwards), the printing process would take around seven hours.

There are a few steps we also had to do:

  1. Upgrade the firmware. Phrozen has instructions for their printers so the resulting files from recent Chitubox versions can be compatible;
  2. Test the LCD. There's a button for it in the printer. Inspect the screen for any deformities;
  3. Calibrate the build plate. Also a button that gives out instructions. Align the build plate accordingly.

With the above done, and setting up the workstation and cleaning equipment (we used pet food trays to work on), it was time to print. PPE was used all the time: safety glasses, breathing masks, nitrile gloves. We also bought Elegoo carbon filters and put them in the printer chamber and turned them on. I know the melted plastic smell because I visited the plastic factory way too often when I was a kid. This one is not that bad, but still we'd like to play it safe. We then shook the bottle of resin for a minute and then opened it and poured the contents out in the resin vat. We covered the printer, inserted the USB memory stick with the file from Chitubox and kicked off the printing. Our window was also open so fresh air could circulate in the room with the printer.

When the printing finished, the resulting models were still dripping a bit, so we left them for a couple of minutes for the majority of liquid to drip away. It was time to wash and clean. With PPE back on (safety first), we removed the printer cover and transferred the build plate, with the printed models still attached to it, into the washing tub of our washing and curing station from Anycubic. We then filled the tub with tap water and covered it. We used the resin from Elegoo that is water washable because IPA (isopropyl alcohol) is tricky to handle and expensive to buy. That said, please have some. We bought a bottle in the local pharmacy because it is invaluable when cleaning the equipment after printing.

We covered the printer again with the lid to prevent the smell and the stray UV rays from reaching the resin in the vat and started a ten minute washing cycle in our washing/curing station. It has a lab type mixer so it was creating a vortex in the tub. After it was done, we removed the tub and pulled out the build plate from it.

It was time to remove the models with a spatula. They were really stuck. Safety equipment is especially necessary here because the crumbling resin supports start flying everywhere. After the models were dislodged, we immediately removed the rest of the supports by (gloved) hand and put the models on a paper towel.

We transferred the water from the tub into a separate container and left it to be cured by the sun. It must not just be poured down the drain because in uncured state it's still toxic to aquatic life. We used IPA to clean the tub, the grate, the build plate and left it all to dry. We then put the washing/curing station in the curing mode and put the models in it to cure for another two minutes. This is the general time for curing and it should dry them out. They were done, but we weren't.


/media/images/3d-printing-results.jpg

We uncovered the printer once more, turned off the carbon filters and took out the resin vat. We sieved the resin back through a funnel into the original resin bottle. Some people leave it in the vat, but we cannot afford that luxury because we don't have a dedicated workshop. We cleaned the vat with IPA soaked tissues since they're softer than paper towels and have a reduced risk of damaging the FEP film on the bottom of the vat. The vat needs to be cleaned after a failed print as well. FEP film on the bottom of the vat will wear out over time so it needs to be replaced eventually.

In the end, we left the used tissues and paper towels from cleaning the equipment (like spatula), the nitrile gloves from handling it all, etc., in a transparent bin bag in the sun. The dirty waste has to be left out a few days so the UV rays from the sun cure whatever is left of the resin particles.

The washing water could be reused for the next printing sessions until there's sludge in it collecting on the bottom. At that point, the sludge can be poured onto a plate so the sun evaporates the water and cures the rest of the resin so it hardens. The hardened resin is ready for waste disposal at that time.

As for the models... they had some post-processing left like filing and polishing where needed. I have to say that we're pretty satisfied with the overall outcome. What can be done with them later is painting them, but I'll leave it for another article. Of course, if something else needs printing, other than the miniatures, I'll be sure to mention it.

Open Science

We still have cases of infections and deaths, but people seem like they decided that the pandemic is over. The COVID-19 pandemic is not over. 2020 wasn't that long ago, when we didn't have any protection in terms of vaccines and the world was panic buying. One only needs to look at our world in data to see that the hospitalizations and spikes are still happening.

Today, most of the discourse revolves around Russia-Ukraine conflict instead of the danger in everyone's house. It's difficult for me to see how the world can be united. It's always in-group, out-group thinking that permeates the society.

Climate change and biodiversity loss haven't gone away either. The great bleaching of the coral keeps happening. The world is not in a good place. It's in a bad one.

Most of my last year was focused on automating things. It continues into this year as well. Just recently I got the standing desk (Ikea Idasen) automated (with ESP32) so it forces me to stand up because I made it switch the sitting/standing modes at certain times of the day. It turns out that before that I was really lazy to push a button, either the one on the controller or in the smartphone app and stand up. This way it just happens and I must adjust. Does wonders for my posture :)

I also installed sensors for windows and the entrance so I can turn off my heating usage if I'm airing the place. Other things, too, like security.

Days are getting longer. DST still wasn't abandoned though. We finally got to walk outside and have a coffee in the nearby park. The sun really ups our mood and the weight of the winter clothes are once again disappearing.

We got triple vaxxed and would go for the next one if needed in the future. There is an effort to find ways to expand vaccine usage quickly enough where normal distribution chains may prove lacking. This was argued with RaDVaC vaccine and it shows an interesting application of it; nasal instead of the regular injection. Also, the push towards opening the research is active with Open COVID Pledge spearheading some of the efforts. Body hacking can be cool.

Opening the science got some traction years ago with now defunct Science Commons. However, people still use Creative Commons licenses to get the research out to the interested parties. It's a noble goal and the civilization can only move forward with it. Scientists take to Twitter and other social media to get enough people to do peer review for them in unpublished pieces before they submit the work to a scientific journal. They need to get their work reviewed sooner rather than later. We really need a new form of peer review process.

There's a whole topic on Open Science about how we don't really have the access to the whole body of knowledge the civilization possesses. More often than not it's hidden behind paywall webs of scientific journals that, while doing a good job in peer review and quality control of the submissions, also get in the way of science proliferation itself.

According to the Universal Declaration of Human Rights, Article 27, Alexandra Elbakyan argues that

Everyone has the right freely ... to share in scientific advancement and its benefits

which is the reason she founded the Sci-Hub.


/media/images/Alexandra_Elbakyan_at_Sochi_in_2021_(cropped).jpg

It is a place where people can pirate scientific articles and see what's inside. When I was doing papers back in the university, I myself could've definitely used the opportunity to easily check something online without potentially paying for content that might turn out not relevant for what I was doing. I can deeply relate to the annoyance of the situation when resources are not readily available, and understand the reasoning to go about it the Sci-Hub way. In my time, there was no other option but to do some legwork and hit the libraries in hope that they had things one needed.

The problem from years ago, and I don't think it has changed, was that the majority of courses were based around the resources known to be previously available to students, rather than being on the bleeding edge of science. It's not that hard to imagine that we should be moving faster than we are.

Prepare In Advance

We've had a lot of time on our hands to get better at planing meals. Food rarely gets boring and humans usually eat several times every day so there's intrinsic motivation to become better at it. It's handy to have some pre-made ingredients at the ready when you're out of ideas or short on time. At some point we were buying, I think, some ready-made dough that came with a small jar of tomato sauce. We kept the jars so now we use them to store things like seeds and nuts, almond flakes, pine nuts. Roasted or raw, they are a great addition to all kinds of meal bowls. For some reason, Vesna gets really excited about storage containers, but if you have a variety of them, you can store all kinds of goodies beforehand:

  • icecubes with botanicals (for gin or some such)
  • the same tray can be used to freeze fresh herbs in olive oil to have a quick ready boost for meals that require those two. For instance, fresh basil in olive oil for tomato based sauces
  • bigger silicone trays or pots can house ready made frozen soups that you can thaw out
  • small jars look cute and can store flavoring oils like chili oil and black garlic oil
  • we've also made nut butters; Vitamix has a program to make those. Aside from pure butters (that we did), you can also make mixed (which we didn't try yet), as well as home made chocolate spread
  • jams, but you should do the ones that you usually cannot buy otherwise. For instance, we made carrot cake jam
  • pickling is also an option, we have a steady supply of ginger (gari), but we also pickled purple onion which looks quite decorative as well
  • jackfruit cashu picked up from Wil Yeung. It's very textured and involves draining the canned pieces, marinating them in a spicy mix and baking in the oven
  • vegan cheeses. Vesna usually makes them and I tag along. She uses cashews as a base with lactic acid and kappa carrageenan, which are easily available to order online
  • herbal teas. Of course, if you have a garden with things like mint, chamomile, rose hip, even better
  • mayonnaise with aquafaba. Don't throw away the water from the chickpea can. It can be used for various things like mayonnaise or vegan cheese
  • cold brew tea. Easily made by soaking green tea teabag per cup of cold water overnight and using it in quick drinks or as is
  • cold brew coffee, not much to say, I wrote about the ease of making it before
  • chili and curry pastes. These can store for some time and can be used when making, well, chili or curry

Here are two quick Vitamix recipes you can try:

Vegan white chocolate spread

Vegan white chocolate spread

Essentially this is a nut butter with white chocolate added in.

Ingredients:
  • 250 grams vegan white chocolate
  • 400 grams Roasted hazelnuts
  • 1 pinch salt
  • 1 splash vanilla extract
Instructions:

Melt the chocolate in a microwave. Put hazelnuts, a splash of vanilla and a pinch of salt in a blender. Put it to a nut butter program and blend. When it's done, add melted chocolate and pulse a few times. Store in a jar.

Grated vegan parmesan-like cheese

Vegan parmesan

You can put it on pasta or wherever the real parmesan would go.

Ingredients:
  • 0.5 cup cashews
  • 2 tbsp nutritional yeast
  • 0.5 tsp salt
  • 0.25 tsp garlic powder
Instructions:

Put all of it in a blender. Pulse on high a couple of times until it's powdery. Use the smallest Vitamix attachment since it's useful to make small amounts quickly.

2021 Recap

2021 came and went. I was thinking that it was going to hinder our plans, but it didn't. We managed to see our folks. Life was good in 2021. I got all twelve articles out which was a modest success for me. There's still a ton of stuff that will get carried over to 2022, but that's OK.

The new year started OK as well. It's January, but we already got the third shot of the vaccine (with the accompanying fever as expected). I even applied for the citizenship just recently. The process will take some time.


/media/images/citizenship-paperwork.jpg

Considering there's an ongoing pandemic, travel was limited, but in the small window of opportunity in the summer we visited our folks back in Croatia. Going there we also visited:

  • Italy, Venice, Dolomites, a slight detour via our old acquaintance, Trieste. All great looking and not as touristy at this time
  • Croatia, Pula, Brijuni National Park, Rijeka, Krk (actual place on the island of the same name), Zagreb and our respective homeplaces in Slavonia

I have to mention that we had six long six weeks to do this trip because we were able to work remotely, as well as take a lot of unspent days off. Venice is beautiful, so is Pula and Brijuni (that need much love).

Domestic travel suffered so we didn't travel much within Ireland, but we went to Dalkey again, this time with friends.

No events except one that we booked back in early 2020 before the pandemic hit so it was postponed several times:

I worked a lot on automating the household and bought some stuff to help me. Here's the big list:

ZigBee motor for the curtains
I decided to install another one for the angle change of the stripe curtains and it doesn't look too bad hidden in a corner
ZigBee inline switches
right now on the bathroom fan, but more to be installed for the lights. The problem is that the drywall is thin so there's difficulty installing it within the existing switch
Reolink cameras
monitoring the entryways for the peace of mind
ZigBee signal repeater
for the future projects with the extended ZigBee mesh
Chromecast
Disney+ is horribly buggy on PS4 so we are using this as a workaround, as well as to cast things from the local storage
Google Nest speaker
can't figure out my accent. It confuses "on" and "off" and thinks "close" is to query online for something close instead of closing the curtains, "screaming" instead of "streaming" and not to mention that once I tried to clean the bedroom with the RoboVac and it snarkily told me to do it myself :D
Lights under the bed
work with the morning alarm at the moment, but will attach the motion sensor so we can find our way to the bathroom at night
Universal Remote from Broadlink
to replace the remotes in the house and automate their functions at the same time, works with three devices at the moment

We also fell into the trap of pandemic shopping and bought a bunch of stuff unrelated to the automation. Some more necessary than others:

Showerhead
with a dynamo powered LED for checking when the water is warm enough (Vesna loves this one, she no longer dips a toe unless she sees the red light)
Desks
motorized standing one for me and a regular for Vesna (she prefers to do her exercise away from the desk). I'll automate mine eventually to rise every day instead of doing it manually
Chairs
gave mine to Vesna because it's the same model as the one from her job and she likes it, and I bought another one that I loved sitting on back in Croatia
Trolley for wine
well, wine mostly, for now. We had to shuffle our furniture a bit for this one to fit in
Water pump for the plants
we don't want to bother our friends to water our plants every time we're away so this should cover for us instead
Laminator
laminate everything! Well, some of the things in the apartment. So far underutilized
Mechanical keyboard
so I can get NKRO finally because the existing one was giving me a headache. This one glows as well
Book reader
eInk and all so Vesna can read more comfortably, also no dead trees
Smartphone for Vesna
so it's fast and takes cool photos
Bluetooth headphones for Vesna
mostly for audiobooks on her book reader, but she uses it for other things, too
Portable drone
for traveling and taking aerial photos
Electric scooters
right now we're buzzing around the park because we're too scared to go anywhere else
GoPro telescopic grip
the 360 camera was bought the year before, but the old grip broke ages ago so I had to take another one
Webcamera arm
for increased mobility during video calls
Caster wheels
hacking the IKEA coffee table so we can move it around
Magnetic photo frames
fridge is a shrine to our travels
Fingered shoes
to simulate barefoot walking

In 2021 we also:

  • changed the ISP and switched to fiber. A better deal than the previous coaxial one
  • more or less I was working on the automation scripts and visuals for the dashboard in the Home Assistant
  • I also started to host some services on the local Raspberry PI for the quick access
  • when visiting Croatia, I had to get a new ID card with biometric functionality so I had to go through the hoops of making it work with the chip reader on the PC
  • Vesna DMs D&D like a pro
  • our jobs didn't change
  • we paid off the apartment (and obviously started to finally implement the decor)
  • Trefle died so I had to unlock the API and am currently working with a drop-in replacement on Shamrock, but more on that later this year
  • we got vaccinated twice (and third time this year)
  • no courses and no conventions happened
  • still didn't draw and I am rectifying that this year, no excuses anymore. Krita 5 was released
  • no projects were finished, but were started so I expect to test and publish a big one this year. I also had to buy several items for it

All in all, not a bad year and I can only expect that this one turns out better. I am feeling pretty optimistic.