fbpx

Experiences from hay harvesting: equipment

Half-way through our first grass to barn hay harvest we are beginning to have a picture of what the process is all about, and what tools, techniques and machines that can be used or should be avoided. We started of with no knowledge or machinery but the internet and a tractor, but we figured that would be a good start since we at least were better off than the farmers working the lands manually just 70 years ago.

When?

The grass was growing and looked mature, but how could we know when the best time for the first harvest would be? We could keep an eye out for when neighbour farms started to cut, but since all other farms in the area are producing fermented hay for cows or horses, they would have an entirely different approach since they’re less dependant on drying times and the straw length for producing small bales.

We found that most of the information is found online at http://vallprognos.se/ where test samples from farms from all over the country are displayed, and a prognosis of the hay quality at the day of harvest is provided. As the goats likes heavier hay, with a higher cellulose content, than cows and horses, we decided that we could wait longer than the recommended harvesting date, and went for a week before midsummer when the weather forecast looked promising for drying hay on the field for a whole week.

How?

We realized that we needed three machines, a cutter, a tedder and a baler. We found an old sickle cutter left on the farm that looked like it could be used, and we actually managed to cut the small field (½ hectar) before we gave up on it. The construction was very weak, so when a twig or a thich chunk of hay would hit the sickel, the wooden connecting rod broke, and after manufacturing several new rods from an oak plank, we started looking for another solution.

34549324223_8e6127f7b5_z
Crappy sickle cutter

Since we soon would be baling the hay, we were looking for a baler, and one of our neighbours had one that he hadn’t used for 10 years or more. When I was picking it up I asked him if he knew anyone salling their harvester? He didn’t, put he told me there’s one laying on his junkyard up for grabs. It had certainly been there for 20 years, but after scaring away the surrounding wildlife, I managed to drag it home, greased it up, made a new connecting rod, and had it working in less than an hour. International harvester should have some credits for reliability.

35353150511_930cef63b1_z
Sickle cutter buried in thickets and nettles. Guarded by a wild hare.

When both fields where cut, we wanted to get the hay dry as soon as possible. The son of the previous owners gave us an old belt tedder that did the work perfectly. When ran on high gear (1040 RPM) from the power outlet, it spreads the hay in a thin layer all over the field wich dries surprisingly fast on a sunny day. After turning it once, we ran it on low gear (540 RPM) to let it produce strings for the baler to pick up.

After five days of drying on the field, the hay was ready to be baled and stacked up in the barn. Since the baler hadn’t been used for several years, it needed a litte care, and I needed to learn to thread it. Luckily, I found a manual for the Welger 450 baler on a forum https://www.maskinisten.net/ and another of the previous owners sons had some experience in threading the machine. We got it working pretty quick, even if it only binds on one side for the moment. But thats enough.

Since the baler runs really slow, we realised that the more work we put inte making straight thick strings with the tedder, the faster it gets done. The tedder can be run at least five times faster than the baler, so one extra turnin of the strings is really worth it.

After baling, we took out the old wagon and loaded up the bales. 3 loads from the small field, and 6 from the big field resulted in about 400 bales, averageing at 8 kilos. 3.5 tonnes of hay is now stacked up in the barn, meaning that we’ve covered half of our goats needs this winter. We’re expecting a little less from the second harvest, but if the fall is warm, we can take a third harvest in late october, that hopefully will be enough for the whole winter.

34644702724_52f164021a_z
Leaving the field with the last load. Halv an hour later, a heavy rain started, and the swedish midsummer celebration could continue in a traditionally cold and wet fashion.

What to do better?

A few weeks after the first harvest I came across this very helpful article from Iowa State University (the Americans have some real fine approaches towards small scale farming) . I wish I had found it a little earlier. Our chocie of cutter seems to be valid, even if it’s slow, we wouldn’t gain much in speeding up the cutting part of the process on our small lands. Maybe 2-3 hours/harvest. If we’re getting a knewer cutter, we would most likely get a new sickle cutter, but maybe on that moves in both directions, and is less likeky to collect wet hay and completely eliminates the need for jumping of and cleaning the sickle bar now and then.

The belt tedder is a simple and powerful construction, we’ll stick with that one.

If we’re getting a new baler some day, the mini round baler mentioned in the article would be an intreresting choice. The Welger 450 baler sure is heavy, and the density of the bales could be higher, but given that mini round balers not are very common in scandinavia, we’ll most likely stick to square balers from economical reasons.

The farms of capital: Perspectives

The economical perspective

We have never calculated on getting rich by moving to a farm. Maybe less poor, since buying a much smaller house in the Stockholm area would have cost us five times more. Still, to create actual economical value from a farm, you need some farming activities going that converts ecological and cultural capital into economical. We have chosen goats. Not only because we love goats, but they are also the perfect species for our stony, hilly and bushy farm. As the only domesticated ruminator that can break down cellulose, they are thriving from all shrubs and bushes that most farmers consider a problem. They are also low in expenses, since they’re not too out-bred to suffer from diseases that affects cows and pigs and calls for overuse of antibiotics.

35247884316_057a190430_z

The investment itself is a zero sum. If we bought an adult goat and took it directly to the butcher, we would get meat for about 8 euros, and that’s what we are paying for minced cow meat in stores. But that is all economical risk there is. If we don’t want the goat, we eat it. As long as the animals are in production and bred, they keep producing buckling for meat and new milking goats each year, not to mention about 600-700 liters of milk. If we only would sell the milk for let’s say, 30 cents/liter, that would give us 200 euros/year, but here is a possibility to convert cultural capital to economical presenting itself. By using our knowledge and making cheese, the value increases significantly. Calculating on a cheese yield of 20%, 650 liter of milk can be turned into 130 kg of cheese. Depending on wich kind of  cheese, the price may vary, but counting low, we could probably sell it for 15 euro/kg. thats 2000 euros/year. Per goat.That’s not bad. And we got 21 of those. Then we have costs for feeding them, but 6 months of the year, they are browsing freely, not costing a cent, the cold 6 months are we feeding them hay and dried bushes from our own lands, but if we had to buy all hay for a winter season, that would sum up to about 30 euro/animal.

Working time is another factor that is hard to estimate. When we learned to make cheese, we estimated 6 hours/batch, wich would be 12 hours/week with two batches a week. This would be a reason to scale up, or collaborating with nearby farms. And now another cultural conversion opportunity appears. What if some process steps can be easily automated and monitored? What if I can expand my sensor network to control and record the process so I get reliable results without needing to put my nose over the kettle all the time? That’s potential.Talking potential. Quality dessert cheese are sold for much more than 15E/kg. 60-70E/kg directly to customer isn’t impossible. But that would need to involve a quite advanced storage facility… Mmm, tasty conversion.

Potential for conversions

Ecological to economical: Plants to milk and meat.

Cultural to economical: Milk to cheese

Cultural to economical: Programming skills to reduce labour time.

The cultural perspective

The capital form with the highest potential to be developed on a farm ought to be the cultural. Back before the industrial era, a variety of skills where required for maintaining several lines of production. During the industrial age, a specialized skillset was encouraged, but much due to the high conversion costs (labour taxes, insurances and administration), the option to hire specialized high skilled labour is not availible to the small scale agricultural entreprenour. Instead, as knowledge is becoming more and more accessible, developing the personal skillset has become the main value building activity on the modern farm. The old socialistic utopia where workers spend their lives specializing on their profession, supported by professionals in their other needs, seems quite outdated contemporary work life. For people of today, that idea even represents a dull and meaningless existence ledaing to exhaustion and psycholigical breakdown, taken the almost impossible choice of deciding specialty in early school years. Today, at least in the nordic countries, education is accessible when needed. In its institutionalized forms in universities and study circles, as well as less formalized forms online, just a search away. This is a time when people who embraces their full potential are starting to look for lines of occupation where all their areas of expertise are possible to convert into economical and social capital, or possible to let grow into more cultural capital. The small, flexible, affordable and sustainable farm has such endless opportunities in providing cultural growth and capital conversions, that we are likely to see an urban brain drain when mulitskilled individuals needs a place to realize their potential.

Potential for conversions

Cultural to economical: Skills in computer science boosts efficiency of the small farm through data analysis and automation.

Cultural to economical: A global presence catches experiences from successful actors world-wide, not just from the home market. The best suited methods for farming your lands may be developed in Japan, not Germany.

Cultural to social: By providing the community with a necessity like food, the relationships between the farmer and her customers are often reported as joyful.

Cultural to economical: By learning to perform a diversity of task, the costs for hired expertise can be lowered. Either by doing it yourself while enjoying the cultural growth itself, or by trading services outside the market. It may be the nightmare of a socialistic government to watch an untaxed gray market of people helping each other or doing stuff themselves, but since time and skills are harder to control than products and money, the advantages of keeping transactions within the cultural form of capital are obvious. Even if no real conversion is made from cultural to economical by eliminating the conversion costs, the saving is to be taken in the economical form.

Cultural to economical and social: The costs for workplace related illness is rising in Scandinavia, and many employers are struggling with high number of physical as well as mental illness among their employees. In the best cases, the costs are taken as high turnover, when people are able to change job easily on an overheated labour market, and the sick person gets a chance to feel better in a new workplace. In the worst cases, the costs are taken as sick salary and sick leave, and the sick person is trapped in an unsatisfying situation without a possibility to get any change. Even if the sick person has a safety net in Sweden, the trend that people are getting sicker and needs to be provided for, means higher costs for someone, and that reflects either on the taxpayers or the salary levels. Work on a small farm can be hard, but in the long term, the variation in physical exercise, as well as the intellectual challenges in making successful conversions creates a highly adjustable working environment. To be able to adjust your workplace to whatever unique conditions you may seek, is a rarely seen benefit on a regular workplace.

The social perspective

When we first moved to a farm, far out on the countryside, increasing isolation was one of our worries. With no social connections to the area were moving to, except for a handful of friends within a 250 km radius, and all colleagues spread out over the country on remote connections, we expected to be lonlier than in Stockholm. Another aspect we thouht about was isolation from society, since we would se a smaller part of the world, not take part in other peoples everyday struggles citylife and worklife, and quite much create our own parrallell universe.

It turned out to become the opposite. The guest rooms has been frequently occupied, by friends and family, as well as colleagues coming to work from the farm instead of the office. Friends with children always take the detour to our farm when they’re on the road, since missing visiting Claire and Nils’s goats never would be forgotten. Colleagues expresses a sentiment of vacation, even though we may work long days. Maybe due to the mandatory tasting sessions of homebrewed beer.

Moving to the countryside and taking an active role in caring for animals and the environment also means a lot for people, so finding new friends and aquaintancies that share our interests hasn’t been an issue. Actively participating in activites for development of cultural capital, sush as courses at the local makerspace Blekinge uppfinnareverkstad and visits at farms in the vincinity has been a great way to meet both technically and agriculturally skilled peoples, sharing our passions.

Participation in international networks such as World WIde Opportunities on Organic Farms  and several magazines coming to our farm to write about our story has also kept us in contact with the world outside, showing us that there’re people out there incredibly interrested in what we are doing.

Conversion

Social to cultural: Knowing skilled and passionate people that can advice us when things get ungoogleable is worth a lot. Doing interesting stuff on the farm attracts people with skills and passion, and even if they can’t solve a problem directly, they usually have someone in their extended network that knows about stuff.

Social to economical: Investing in social capital when you have a product to sell is an investment also from the economical perspective. By encouraging visits, from old friends as well as from becoming, we establish knowledge about our products. Especiallty, what no marketing activities can do, showing the complete trustable production chain where the origin and production methods of the food can be traced back to a happily smiling goat. More about the importance of trust and the teoretical foundation of our marketing strategy in this article by sociologist Mark Granovetter: The Strength of Weak Ties.

Social to cultural and economical: Beeing a host farm for the WWOF network gives us contact with volunteers helping us with practical tasks, as well as sharing knowledge about things that we never would come to think of ourselves.

The farms of capital. Part II

Previous part: The farms of capital. Part I

The forms of capital

The last two decades, as the first devices of the digital age has evolved from a bunch of futuristic prototypes and ideas to common necessities, we have been used to phenomenons such as tech startups and unicorns. Small creativity and knowledge-driven service enterprises going from nothing to billion dollar balance sheets on a few years. Compared to traditional industries, their valuation is very different. No machines, no properties, representing value. Only knowledge, and the ability to keep knowledge and attract new knowledge is worth anything. What they are doing is not that important either. With access to skilled people and great knowledge, the service appears where there is an instant need to fill, and discontinue when there is none. No capital invested in infrastructure or machinery that needs to be returned before the business can be considered a mistake. Just take your computers and expertise and work on something that is actually needed.

Access to the market is another significant key to success, meaning close contact with the customers.Traditionally, marketing was focused on branding and segmentation, meaning a strange one-way-communication strategy ,where you describe a lifestyle, feeling or social context to your customers, and then brainwash them to believe that they want it, and your product will provide them with that. In the age of information people see through all that. And when they in the process of finding out whats behind the mumbo jumbo realizes that your product is bad for the environment, bad for the farmer, and bad for the human body, your marketing investment is gone. There is no accident that the company that right now is maybe the most characterizing actor in the early information age, Google, never runs commercials. They just provide answers.

The act of farming will continue to take place as long as there are mouths that wants delicious food. That’s for sure. But to fully understand the mechanisms in motion behind the digital economy, and apply those on a successful agricultural enterprise, we need to expand the view on accounting, marketing and financing, all experiences inherited from the industrial age. Instead, we need to include the human as a social and intellectual being, depending on and appreciating  her ecological environment as well as the society she is a valued part of, rather than just a profitable consumer or zealous worker.

The french sociologist Pierre Bourdieu introduced quite such a model in the 80’s in his well cited essay The Forms of Capital. It derives from deep sociological and economical roots, including Karl Marx, Max Weber and Gary Becker, and proposes that there are essentially three different kinds of capital: economical, cultural and social, and that many important choices are made in order to develop and transform these capitals.

Economical capital, well we’re all familiar with that. Money in the bank. It can take different shapes, currency, stocks, properties, debts, but it’s all an accumulation of the social construct that we all agree on as money. It follows a few agreed upon rules. A surplus of capital generates interest, for example, just a negative balance will cost you. It can be inherited, accumulated from value-creating activities as labour or trade, spent in a day, or taken by a robber, inflation or the tax authority. Even though it seems to be a placement of high risk, economical capital is the only fully tangible form of capital, and as such, defining the value of other capitals out of how easily they are converted into economical capital. Economical capital is the easiest form to convert into other forms. It’s said that money can’t buy you love, but one of the main reason for a society to establish the construct of money is that they should be universally interchangeable. Not necessarily the best way to obtain everything, but certainly one way.

Not much growth in sight from the ecological and economical perspective, but from the cultural?
Not much growth in sight from the economical perspective, but from the cultural and ecological?

Cultural capital are the abilities that let you function in the society. Languages, skills and acceptable behaviour are some examples. Good health, creativity, a job title or an academical qualification are others. In most cases, cultural capital is either innate or achievable through education or experiences. We often speak about cultural capital in terms of how they can be converted into economical capital. We acquire skills in order to get a job, from wich we get salary. We use our creativity to perform music and sell tickets and records. Many people developing their cultural capital derives feelings of joy and meaningfulness from these activities, and I think that more and more people would rank learning higher than earning, if not earning were the means to be able to acquire knowledge and skills. Being rich on cultural capital often automatically converts into social capital, as the highly skilled, creative and educated often are seen as venerable and respected members of the society. Being in good health also becomes crucial to the accumulation of cultural capital, since sickness easily destroys the possibilities to monetize, as well as acquire new skills.

Social capital are the benefits you get from your social environment. Being members of your family, acquired friends, politicians, fans, customers, followers, they all influences you, and get influenced by you. By developing social relations and building trust and friendship, a social safety net is constructed, that activates in times of trouble and can greatly reduce the time and effort needed to get back on track. Group memberships is another social ticket to transactions based on borrowed and shared trust, that never would been possible to build on your own.

What about ecological capital? No, Bourdieu didn’t mention that, but during the 30 years since he wrote The Forms of Capital, the issue of ecological sustainability has risen from a hippie thing, to everybodies concern. We might as well add this to the model. The human civilization as we know it is depending on a working ecological system on the planet. Disturb it, and famine, draughts, war and plagues comes running, rendering all other forms of capital practically useless. Every person is born with a quota of natural resources that can be consumed without depleting the earth, or without forcing  coming generations to lower their standards or face catastrophes. When world population increases, that quota decreases, but when inventions in the area of ecological sustainability are made, more are being produced from less. When more of the resources are put into recycling systems, the quota is extended. When you develop ecological capital, is when you develop the other forms of capital, without letting the earth’s resources take the cost. Neither today, nor in the future. Hopefully, increasing population also comes with increasing cultural capital, as knowledge and consciousness seems to present the best opportunities of conversion into ecological capital.

The farms of capital

So how do we best use a farm to accomplish growth in these four capital forms? There are no final answers to that question, rather an eternally ongoing investigation, so let’s down with the results found so far, before they dissolve in the inflation device of cultural capital called memory.

The farms of capital. Part I

The post-industrial crossroads

During the last century, the farm as a societal phenomenon, as well as economical factor, has transformed. A typical farm 100 years ago, would today be considered small scale or homestead. The activities on a farm 100 years ago could span over almost the entire agricultural field, including animal husbandry for several species, vegetable, crop and fodder cultivation, forestry, fishing and fruit foraging, as well as processing the staples into refined and conserved food. These value creating processes was distributed horizontally over several production chains, as well as vertically from raw material and staple production, to refined food and manufactured goods. An economically flexible model, since the cost of switching line of production when one was doing bad, mostly was service based as taken in the learning of a new skill, or hiring another specialist.  The modern industrialized farms are most often highly specialized on a few activities, chosen from an economical perspective. If there are grasslands, cow or sheep meat would be a good choice. If there are sedimentary soils, growing crops would be suitable. However, managing farms from an industrial perspective has proven risky, as not only the weather presents unforseeable risks, but also the global market, dependencies on logistics, dependencies on fertilizer and fuel prices and interests on the capital invested in the machine park. The solution to many of these problems has been to scale up and specialize even more, all inspired from other industrial areas. But as the same logistic network that is needed to transport your cattle to a distant meat packaging plant, also can transport meat from a place where it is cheaper to produce, the competition eventually becomes harder. A phenomenon that has greatly reduced the amount of small farms.

That’s all logical. This curve is to be found in all areas affected by industrialization, let be during different periods.The agricultural sector just tends to be a little slower than i.e. manufacturing and raw material sectors, that accomplished the same a few decades earlier.

However, the industrial age is long in the past now. The digital era, the age of information and knowledge, has introduced itself in area after area, leading to transformation of traditional methods, or extinction. Will the huge, specialized and economically vulnerable farms destroy each other ecologically and economically in the competition, and how will our food be produced then?

Pesticides being distributed on a field. Expensive and specialized machinery eradicating the biological environment, as well as the means of its own economical existence. Source: Modern Farmer/Wikimedia commons

Next part: The farms of capital. Part II

How much wood would the woodchuck chuck, if the woodchuck could chuck wood

One of the many new activities that farm life has brought us is taking in wood from our small but lovely forest. We have yet to optimize this process (having discussed alternatives such as using a horse to drag logs from the forest to the far, as well as buying a quad and bringing  in chopped wood after having chopped it in the forest).

For now, we are happy to view this labor as exercise with a purpose – keeping the house warm! There is a primal pleasure in sawing down a tree, sawing it into logs that are the right length for our furnace, chopping the logs into firewood, and then stacking the firewood in neat boxes that are sheltered from the rain. The actual chucking of that same firewood into the furnace takes place at least 6 months from when the tree was cut down – usually longer, the drier the wood is the better!

We primarily take down trees that have broken after a storm, as well as trees that are growing on the very edge of the lake and are sick from too much water. We have a variety of species – a lot of spruce but also more sturdy kinds of trees such as aspen and beech. An added bonus of taking down spruces is that the goats love eating the needles and peeling the bark off the branches, especially now in wintertime when fresh greens are scarce.

IMG_20151212_140122IMG_20170106_151506

IMG_20161128_174657

GoTo Goat – A GPS goat tracker

As goats are naturally born masters of escaping, we soon realized that the electric fence only should be considered as the first line of defense. Usually, the most clever ones finds their way out, and then calls for the others to follow, and generally, their just heading out to a nearby pasture, where the grass is allegedly greener, or home to the barn. On a few occasions though, they have been spooked by wild boars, and ran off into the forest. When I was tracking them out on a small dirt road, and a neighbor called from his forestry tractor, about 3 km out, and asked if maybe my goats where out hiking, I realized that we have a need for a tracking device. The idea of the GoTo Goat device was born, a GPS-module, transmitting coordinates over the cell network.

wp-1474494088463.jpg
The goats where very happy to see me, and followed me home through the forest.

 

 

Features:

Real-time GPS location

Upload coordinates to a cloud service, or your own server over GPRS

Solar powered

Android locator app

Component list

Microcontroller: Arduino nano 6 euro

GPRS module: SIM800L 5 euro

GPS module: Ublox NEO-6M 7 euro

Power supply: Linocell 3X Solar Powerbank 8000 mAh 50 euro

Step-down regulator: AMS1117 adjustable (5V-3.7V) 1 euro

Sim card (Telia) free

Total cost: 19 euro for the components and 50 for the powerbank, but i bought the powerbank locally in Sweden, and there are much cheaper ones around on ebay. With a little more labour put into sourcing, the cost could probably drop to about 30 euro.

The SIM800L

s-l225

This is a very nice little module. Essentially a complete cell phone, except for user interface, speaker and mic. It’s controlled from the arduino by sending AT commands through serial communication. The SIM800L is supposed to be powered by a 3.7V Li cell, as in a cellphone, and that’s why the buck converter is needed in this setup to bring the current down from 5V.

The only functionality used here is the GPRS device for sending over HTTP, but using SMS or DMTF for controlling the unit are possibilities as well as calling the goat for an occasional chat.

 

 

The NEO-6M

u6

 

 

A neat GPS-module supported by the arduino TinyGPS library. Pretty fast on getting a fix, and supplying coordinates once a second.

 

 

 

The Nano

$_1

I choose an Arduino nano for prototyping, since it has it’s own FTDI, a reasonable size and a friendly number of pins. If the size, power consumption and prize needs to be further tweaked, I can’t see any reason not to use a mini pro though. The SIM800L is rated for max 3.7V to 4.1V so the internal voltage regulators will be useless.

 The SIM

Any sim card that supports GPRS will work, but it’s recommended to use one that not expires too soon after charging. As very little traffic volumes are transmitted, it would be a shame if the card needed to be refueled every 3 months or so. Instead, if you can find one that works for several years, and only using the throttled speed when paid data is depleted, that would be completely sufficient.

 

Connections

SIM800L pin NEO-&M pin AMS1117 pin Arduino pin Powerbank
Net – antenna Usb Port2
Vcc Vout
Rst D5
TX D8
RX D7
Gnd Gnd Gnd Gnd Port1 –
Vcc 5V
Rx D4
Tx D3
Vin Port1 +
31583617682_a1031ba862_o
SIM800 and nano in the center, NEO-6M to the right. Here, the SIM800 is powered by a 3.7V battery

Cloud API

I choose thingspeak.com as cloud service to store the coordinates. Mostly because I already use it for other sensors, so I’m already familiar with the API. Virtually any online API would be suitable, as long as you can send in values through a HTTP GET parameter.

Thingspeak will let you send in 3 000 000 updates / year with their free account, so that will limit you to 5.7 updates / minute. I’ll go for max 1/min, probably less. Since you are putting the API key in the arduino code, you don’t want to use a service that is likely to go off the market, or become ”premium only”, like Xively did. To be sure that the service stays alive, you could host your own thingspeak platform on a raspberry pi or similar.

Code

The NEO-6M is very simple to interface from the Arduino. I used the kitchensink example from the TinyGPS library, and trimmed it down to the bare necessities.

The SIM800L is more complicated to interface, since you need 2-way communication to ensure that the commands have been successfully performed. I found some example code at Cassiopeia that was very helpful. Even if I do not use DMTF functionality as in the example, their approach for communicating with the SIM800L is very convenient.

As both the NEO-6M, the SIM800L and the arduino IDE Serial monitor are using serial communication for interfacing the arduino, there will be issues regarding which ports to use. I kept the hardware serial (Serial) for debugging purposes, and let only the computer interface with it. For the modules, I assigned two SoftwareSerial ports, sim800 on pin 7 and 8 and ss on pin 3 and 4. To keep the communication channels separated, the arduino is instructed on which one to listen, depending on where input is expected.


#include <SoftwareSerial.h>
#include <TinyGPS++.h>
#include <avr/sleep.h>
#include <avr/wdt.h>
//Thingspeak channel
#define CHANNEL 199082 //Not used
//Thingspeak API write key
#define APIKEY "XXXXXXXXX"//Put your own write key here
//SIM800 TX is connected to Arduino D8
#define SIM800_TX_PIN 8
#define RATE 10000 //GPS sampling rate
//SIM800 RX is connected to Arduino D7
#define SIM800_RX_PIN 7
static const int RXPin = 3, TXPin = 4;
static const uint32_t GPSBaud = 9600;
const int sim_rst = 5;
int errors = 0;
//Create software serial object to communicate with SIM800
SoftwareSerial sim800(SIM800_TX_PIN,SIM800_RX_PIN);
SoftwareSerial ss(RXPin, TXPin);
TinyGPSPlus gps;
unsigned long last = 0UL;
// watchdog interrupt
ISR(WDT_vect)
{
wdt_disable(); // disable watchdog
}
void myWatchdogEnable(const byte interval)
{
MCUSR = 0; // reset various flags
WDTCSR |= 0b00011000; // see docs, set WDCE, WDE
WDTCSR = 0b01000000 | interval; // set WDIE, and appropriate delay

wdt_reset();
set_sleep_mode (SLEEP_MODE_PWR_DOWN);
sleep_mode(); // now goes to Sleep and waits for the interrupt
}
void setup() {
//Begin serial comunication with Arduino and Arduino IDE (Serial Monitor)
Serial.begin(9600);
while(!Serial);

//Beging serial communication with Arduino and SIM800
sim800.begin(9600);
delay(1000);
ss.begin(GPSBaud);
delay(1000);
Serial.println("Setup Complete!");
last = millis()-RATE;
}

void loop() {
errors = 0;
// Dispatch incoming characters from GPS
ss.listen();
while (ss.available() > 0)
gps.encode(ss.read());
if (millis() - last > RATE)
{
if (gps.location.isValid())
{
static const double OFFICE_LAT = 56.000, OFFICE_LON = 14.000; //Hard coded reference coordinates if needed in the future
double distanceToOffice =
TinyGPSPlus::distanceBetween(
gps.location.lat(),
gps.location.lng(),
OFFICE_LAT,
OFFICE_LON);
Serial.println(distanceToOffice);
double courseToOffice =
TinyGPSPlus::courseTo(
gps.location.lat(),
gps.location.lng(),
OFFICE_LAT,
OFFICE_LON);
char tmpCourse[10];
char tmpDistance[10];
char tmpLat[10];
char tmpLng[10];
char tmpSpeed[10];
char params[200];
int batteryLevel;
//Convert GPS data to strings
dtostrf(gps.location.lat(),1,6, tmpLat);
dtostrf(gps.location.lng(),1,6, tmpLng);
dtostrf(distanceToOffice/1000, 1,6, tmpDistance);
dtostrf(courseToOffice,1,6, tmpCourse);
dtostrf(gps.speed.kmph(), 1,6, tmpSpeed);
sim800.listen();//Turn to sim800l channel
disconnectGPRS();//Sometimes, the sim800l gets stuck with GPRS activated, and trying to activate it again will naturally fail.
while(!wakeUpSim800());
if(simOK()){
batteryLevel= getBatteryLevel();
Serial.print("Battery level: ");
Serial.println(batteryLevel);
sprintf(params, "apikey=%s&field1=%s&field2=%s&field3=%s&field6=%d", APIKEY, tmpLat, tmpLng, tmpSpeed, batteryLevel);
Serial.println(params);
//Next three stages are sequential. Error handling means that if the sequence is not completed with less than 5 unsuccessful tries on all stages, there is something wrong, and the sequence is aborted.
while(!initGPRS()&&errors++<5);

while(!initHTTP()&&errors++<5);

while(!putDataToThingspeak(params)&&errors++<5);
errors = 0;
while(!disconnectGPRS()&&errors++<5);
while(!powerDownSim800());
delay(200);
Serial.println("Entering watchdog sleep");
delay(100);
myWatchdogEnable (0b100001); // 8 seconds
myWatchdogEnable (0b100001); // 8 seconds
myWatchdogEnable (0b100001); // 8 seconds
myWatchdogEnable (0b100001); // 8 seconds
myWatchdogEnable (0b100001); // 8 seconds
myWatchdogEnable (0b100001); // 8 seconds
myWatchdogEnable (0b100001); // 8 seconds
myWatchdogEnable (0b100001); // 8 seconds

Serial.println("Resuming operations");
}
ss.listen(); //Turn back to GPS channel
}

if (gps.charsProcessed() < 10)
Serial.println(F("WARNING: No GPS data. Check wiring."));

last = millis();

}
}
boolean wakeUpSim800(){
Serial.println(F("Checking for sim800 module..."));

digitalWrite(sim_rst, LOW); // hardware reset after sleep RST
delay(300);
digitalWrite(sim_rst, HIGH);

// time to startup 3 sec
for (int i = 0; i < 6; i++) {
digitalWrite(13, HIGH); // green LED blink after RESET
delay(250);
digitalWrite(13, LOW);
delay(250);
}

sim800.println("AT"); // check if sim800 module responds
delay(100);
if (sim800.find("OK")) {
Serial.println(F("sim800 module awake"));
return true;
}
else{
Serial.println(F("sim800 module not found"));
return false;
}

}
boolean simOK() { // SIM CHECK OK
Serial.println(F("Checking for SIM card.. "));

sim800.println("AT"); // check if sim800 module responds
delay(100);
if (sim800.find("OK")) {
Serial.println(F("sim800 module found"));

delay(100); // wait for sim800 to settle a bit
sim800.println("AT+CFUN=1"); // operation
if (sim800.find("OK"))
Serial.println(F("Function level 1"));
else
return false;
delay(2000);
sim800.println("AT+CSMINS?"); // check if SIM card inserted
delay(100);
if (sim800.find("CSMINS: 0,0")) {
Serial.println(F("no SIM card found, stop here"));
return false;
}
Serial.println(F("SIM card found")); // continue if SIM card found

Serial.println(F("Allow some time for SIM to register on the network.."));
Serial.println();
delay(1000);
return true;
}
else{
Serial.println(F("sim800 module not found, stop here"));
return false;
}
}

void simReply() { // SIM REPLY
delay(500);
while (sim800.available()) {
char c = sim800.read();
if (c != '\n') Serial.write(c); // replace new line with space
else Serial.print(" ");
delay(5);
}
Serial.println();
}

boolean initGPRS(){
boolean noError = true;
sim800.println("AT+CIPSHUT"); //Ensure GPRS PDP is down before init
simReply();
//delay(1000);
sim800.println("AT+CGATT=1");//Attach to GPRS service
simReply();

sim800.println("AT+SAPBR=3,1,CONTYPE,GPRS");//Set(3) bearer connected(1) to Contype GPRS
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+CGATT=1");//Attach to GPRS service
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+SAPBR=3,1,APN,online.telia.se");//Set(3) bearer connected(1) to APN
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+SAPBR=1,1");//Open connected bearer
if (sim800.find("ERROR"))
noError = false;
Serial.print("initGPRS finished with no errors = ");
Serial.println(noError);
return noError;

}

boolean initHTTP(){
boolean noError = true;
sim800.println("AT+HTTPTERM");
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+HTTPINIT");
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+HTTPPARA=CID,1");
if (sim800.find("ERROR"))
noError = false;
Serial.print("initHTTP finished with no errors = ");
Serial.println(noError);
return noError;
}
boolean putDataToThingspeak(char params[200]){
boolean noError = true;
char req[250];
sprintf(req, "AT+HTTPPARA=URL,api.thingspeak.com/update?%s", params);
Serial.println(req);
sim800.println(req);
if (sim800.find("ERROR"))
noError = false;
delay(1000);
sim800.println("AT+HTTPACTION = 0");
if (sim800.find("ERROR"))
noError = false;
Serial.print("putDataToThingspeak finished with no errors = ");
Serial.println(noError);
return noError;
}

boolean disconnectGPRS(){
boolean noError = true;
sim800.println("AT+CIPSHUT");
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+SAPBR=0,1");
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+CGATT=0");
if (sim800.find("ERROR"))
noError = false;
sim800.println("AT+CFUN=0");
if (sim800.find("ERROR"))
noError = false;
Serial.print("disconnectGPRS finished with no errors = ");
Serial.println(noError);
return noError;

}
int getBatteryLevel(){
sim800.listen();
sim800.println("AT+CBC"); // battery level
delay(500);
String s = sim800.readStringUntil(',');//Grab the value between the commas
String level = sim800.readStringUntil(',');

return(level.toInt());
}

boolean powerDownSim800(){
boolean noError = true;
sim800.println("AT+CPOWD=1");
if (sim800.find("ERROR"))
noError = false;

Serial.print("SIM800l power down = ");
Serial.println(noError);
return noError;

}

 

Here are the latitude results from thingspeak, for more, go to the GoTo goat section on the IoT page.

Android app

The Android app is still just an embryo, but it will find a goat… You can find it on Play: https://play.google.com/apps/testing/com.framtidabruk.gotogoats

You need to enter your own thingspeak.com Api key and channel ID in the settings before it becomes useful.

3766840962902790605-account_id=1

On locally produced food

The concept of locally produced food is by nature a very dynamic concept. The self-sustained household would of course provide the most locally produced supplies there are, but  since the market would be so limited (i.e. me and my wife), the fixed and overhead costs would be out of proportion to big to us to bear. The concept locally produced will only be economically sustainable if the market defined as local is large enough to create a demand for an efficiently scaled production.

I Sweden, the largest organization for ecological certification (KRAV) describes a geographical radius of 250 km as a reasonable measure used by other actors. But that only means that the final product is manufactured within that radius, not that the crop in the cereals was grown there, or the cattle in the meatballs where raised there. If we control the whole process from goat feed to cheese, and are doing that on the same very local farm, wouldn’t that be more locally produced than meatballs made from Argentinian and Irish beef and sold as Swedish locally produced meatballs, as long as the cheese is sold on a market closer than Argentina or Ireland?

So if the concept of ”locally produced” is stretchy, we can be just as stretchy when finding a market for our locally produced products. Since the concept is neither environmental nor geographical, ”locally produced” should be regarded as a crude economical concept.

Turning the concept towards an economical viewpoint, we get the question: How big market can we reach with our locally produced food still being locally produced? We have a minimum of a 250 km radius from our farm, that by all means is considered local.

250km
The map radius tool is found at https://www.freemaptools.com/radius-around-point.htm

 

 

 

 

Well OK, we got Malmö, Copenhagen and Gothenburg, that’s good, but half of our geographical market is water, and we are missing densely populated parts of Poland and Germany. All our family and friends in Stockholm wouldn’t get our locally produced cheeses, neither would ferry connected towns of Klaipeda and Gdynia/Gdansk/Sopot, where food from just across the Baltic sea could be seen as both local and exotic.

So what’s the actual population in this circle?  Eurostat, the statistical office of the EU, provides detailed population data. I should probably create an API-request to get the most accurate result, but a quick mapping of their pre-defined regions (I had no idea that Europe was divided in NUTS, only that a few of them lives here) on NUTS-2 level will be good enough.

The 250 km circle gives a market of approximately 11 million people.

Hovedstaden 1,768,125
Östra Mellansverige 1,621,566
Sjælland 820,480
Småland med öarna 826,243
Södra Sverige 4,211,985
Västsverige 1,942,677
Total Result 11,191,076

Let’s reach out a little, and double the radius. 500 km is the new proposed local market.

500km

Now we’re talking! Stockholm, Oslo, Hamburg and Berlin. Those are some densely populated regions. Along with northern Poland, Denmark, Lithuania and Latvia, we have quite a few local mouths to reach. 43.4 million people to be precise (or maybe not that precise, since Latvia and Lietuva only are 1 NUT each, I counted the whole countries. But I forgot the Norwegian NUT Sörlandet, so that will make up for some of it).

Hovedstaden 1,768,125
Latvija 3,972,192
Lietuva 5,842,524
Lüneburg 1,677,715
Mecklenburg-Vorpommern 3,198,276
Midtjylland 1,282,750
Nordjylland 582,632
Oslo og Akershus 1,232,854
Östra Mellansverige 1,621,566
Pomorskie 2,271,559
Schleswig-Holstein 5,661,728
Sjælland 820,480
Småland med öarna 826,243
Södra Sverige 4,211,985
Stockholm 2,198,044
Syddanmark 1,205,728
Västsverige 1,942,677
Warminsko-Mazurskie 1,418,541
Zachodniopomorskie 1,688,486
Total Result 43,424,105

To view the market as a function of geography and population would of course be to simplify a lot. Culture, communications, currency and concentration of cheese-lovers (the 5 C:s of cheese marketing) are important factors too. But one thing that these figures points out, is that the potential market for physical products, never could have been the same if we had decided to stay in the Stockholm region. In fact, The funny thing is that in Stockholm, we lived in a crowded place, in a sparsely populated region. In Blekinge, it may go several days without seeing other people, even as we have 40 millions of them  around the corner.

Keeping up appearances

We bought the farm in Febuary 2015 but did not move here until a little over a year later. We did however spend our summer holidays getting to know the place quite intimately – scraping, spraying, and painting!

This is what the house looked like when we bought it:
IMG_20150405_130225After brushing the old paint of we rented a skylift named ”Dino” and used a paint spraying machine to do most of the red areas, except for the front of the house which we painted with brushes by hand.
IMG_20150717_173600IMG_20150720_203034IMG_20150725_175154IMG_20150718_150545IMG_20150725_101602IMG_20150725_212455IMG_20150717_171619 IMG_20150717_171410IMG_20150726_214745

 

 

 

 

 

 

 

 

 

It took us nine full days, working three shifts a day: before noon, afternoon and after dinner. Luckily the weather was quite good for painting, not too hot and it only rained one afternoon. We had a little help from Claires old friend Yasmina – she came to visit and was probably not expecting to be thrown up on the roof to paint as soon as she got here! The result after all the hard work was thrilling:

IMG_20150723_195358

 

 

 

 

 

 

 

Since then we have also painted the door green and have put up some lights on the facade to illuminate the garden during the darker season (now in wintertime it gets pitch-black at around 3 pm..)

Happy as clams in our freshly painted house, and happy to have another 10-15 years ahead of us before we need to do it all over again. The barns have yet to be touched up, that will probably be one of our projects next summer!

Arduino for beginners

As you might have noticed we love technology and finding innovative ways to use it around the farm. Nils has a lot of knowledge in programming as well as micro-computers such as Arduino and Raspberry Pi. Claire is an enthusiastic beginner, having participated in courses in Visual Basic, HTML/CSS and Python in the past. Her latest endeavour is to learn more about Arduino which according to the official website: ”…is an open-source electronics platform based on easy-to-use hardware and software. Arduino boards are able to read inputs – light on a sensor, a finger on a button, or a Twitter message – and turn it into an output – activating a motor, turning on an LED, publishing something online. You can tell your board what to do by sending a set of instructions to the microcontroller on the board. To do so you use the Arduino programming language (based on Wiring), and the Arduino Software (IDE), based on Processing.”

Happily, we found that there is a place called Blekinge uppfinnareverkstad dedicated to innovations and co-working in a near-by town called Svängsta, and they offer courses in Arduino for beginners -among other things. It is a really cool place, founded in the 80’s in an old factory and is run on a volunteer  basis. Worth a visit (or even membership – 500 SEK for a year) if you are interested in anything from welding to 3D printing.
IMG_20161103_190618The idea is to use Arduinos for some of the many things we want to monitor and automate at the farm – in the milking process, at the dairy – or even to make a goat locator for when the critters decide to break out of their pasture! We will keep you posted…

 

Working 9 to 5

Since we both have ”office jobs” it was a priority for us to get a good working space sorted. One of the smaller rooms downstairs seemed like a good option, and since it had a funky smell (hence giving the room the not-so-flattering name ”kissrummet”/”the pee-room”)  as well as the floor being way crooked, it felt even more like the best place to start off the interior remodeling. We took out the greenish/brown plastic floor and uncovered some pretty old floorboards and isolating materials which we replaced and built up a little to make the floor more even. Finally we were able to put down a nice new oak floor! After that it was only the small matter of replacing the wallpapers, painting the ceiling, frames, window and radiator and putting up new lamps… We did not get around to finishing the room until October but we were mighty happy to be able to move in our desk!

This is what the room looked like before:


Work in progress… Raoul ”helping” as usual!
29591753956_504fcd29ba_k

And this is what it looks like now:
wp-1480278826869.jpg