There’s a war going on outside

And it’s an armed war – between poachers and rangers. A war between a $70 Billion dollar industry driven by the Asian demand for animal parts and a small group of bootstrapped wildlife enthusiasts. One can only imagine what Africa would look like if humans would never have initiated this senseless hunt for ivory and horn – the same material our nails are made of. Would there still be 26 Million elephants strolling around on the continent, as they did in earlier centuries, where now only 350.000 persist? Would there still be 500.000 rhinos, instead of the 20000 that are left today? It’s a sad story, but fortunately it also challenges people to think of ways to turn the downhill slope around…

In this blogpost, we’ll take you through the story of our eager to help one of the world’s most pressing issues. The eager became an idea, the idea became a plan and the plan became a crucial step towards creating a safe environment for Africa’s unique and endangered wildlife.

Coca cola shotguns
Fast forward to Kafue National Park. We just landed in one of the largest national parks of Africa – once a rhino paradise, now home to exactly 0 of them – and we meet wildlife ranger Paul who wants to show us something new. In his hands lies a gun of a type we have never seen before (and believe us, we played a fair share of CoD). It is bright green, the barrel seems a little rounded and the trigger looks as if it once was part of a Coca Cola can.

Turns out it’s a self-made shotgun. This is how far poachers go today. In the lack of Zambian kwachas for a decent AK47, they have figured out how to forge their own weapons to go out to the bush and shoot at sight. Taking another look at the tented campsite of the heavily-armed wildlife ranger unit, we realise that such situations don’t just exist in our imaginations of guerilla wars decades ago… They are happening right now.

When nerds get psyched
Back to 2016. At Q42, we are working on an autonomous drone to help Greenpeace get coverage of the palm oil fires in Indonesia. Could we use this for other purposes as well? In our search for other use cases, we stumble upon information about the urgency of wildlife poaching in Africa; the statistics mentioned before. What if we could use our Greenpeace drone to act as the digital ears and eyes of wildlife rangers? Since we happen to know a few people in the world of wildlife conservation, we’re able to schedule a few meetings and eventually find out that anti-poaching organisations would actually be helped with a well-working drone with meaningful sensors. A sensor idea was on our mind already. The codename is Hack The Poacher.

Sad for us, the idea is killed only two weeks after: drones are rarely allowed in any African wildlife area, and crash to the ground more often than they spot anything interesting. That doesn’t stop us from going forward though. If drones are so unpractical, why not just hang the sensors in trees?

Without getting into details about the sensor (we could write a five-part long-read about the tech by itself), believe us when we say that building a waterproof, heatproof, animal-proof, solar-powered, 6W-consuming, 9-part-device that is able to detect poachers for years to come is not your typical proof-of-concept project. But at Q42 (our parent company) we figure that if we can shoot balloons into the stratosphere, create a cat-recognizing water turret, and build a self-driving boat, we can pull this engineering job off as well.

Power to the sensors
The magic of building such a prototype lies in collaboration. Not only with wildlife conservation parties, but also with hardware guys. As we quickly discovered in conversation with our partners at Green Safaris, our sensor should be close to invisible so as to prevent the whole thing from being stolen. It still required quite large solar panels though; the device would probably consume 3-8W and there is no other way to generate power in the park. Since invisible solar panels haven’t been invented yet, we’d need the smallest and most robust solar panels out there. By chance we found out about Voltaic Systems, a US-based company that turned out to have successfully installed solar panels in all kinds of remote areas, from the Amazon to Africa. Apart from advising us on the sizes of panels and batteries (based on the estimated wattage we could catch in Zambia), Jeff from Voltaic Systems also helped us relax some of our power issues.

What power issues? Here’s the summarized version of the story. Since our device would consume about 3-8W when turned on, it would require about 120Wh if it is turned on all day. However, we could allow it to be turned on only 50% of the day (e.g. in time cycles of 5 minutes on – 5 minutes off), so we would require 60Wh to be generated by solar panels per day. A rule of thumb is to generate at least 2x the required amount, which comes down to 120Wh. A second rule of thumb is to expect 4 hours of sunshine per day. In conclusion, a 90/4 = 22.5W solar panel would be needed to power our device. To give you an idea of the solar panels that provide such power, they’re pretty big (and visible).

Hmm, having the device stay active for a shorter time than 50% (and thereby potentially catching fewer poachers) vs. increasing the solar panel size (and thereby being ‘less invisible’ for thiefs). A difficult trade-off. We decided to go for two set-ups: one small setup using 2x 6W solar panels, and one larger setup using 1x 17W solar panel. During the test in Zambia, we will still be able to alter the on/off schedule.

In the meantime, we had been drawing all kinds of electrical circuits: we needed to ensure that the sensor would (1) shutdown once the (Li-Ion) battery voltage decreases to values below +/-3.6V and reboot once it rises to +/- 4.0V, (2) shutdown and reboot on predefined (yet customizable) time cycles, and (3) charge the batteries through its solar panels while consuming power from the batteries simultaneously. Just before we had warmed up our solder kits and ordered a batch of Arduinos when Jeff from Voltaic Systems recommended us to speak to Luka from IRNAS (Github), a Slovenian organisation making great open source hardware. One of their boards, called PiRA, is capable of fixing a giant range of power issues that you’d run into with a solar/battery-powered Raspberry Pi setup (and more). A few Skype calls later and all our electrical circuit drawings were ready for the bin. In fact, the boards that were about to be shipped our way fixed more than the aforementioned power challenges: it also had a little LoRa chip on it, so we could easily make the sensor transmit alarm signals of poacher detections to a receiving point (LoRa gateway) back at the ranger unit in the national park. Depending on the altitude of the sensors and of the gateway, the obstacles in between them, the landscape and some technical factors, the range distance of transmitting alarms would be between 5 and 30 km.

Awesome. We finally have a hardware setup – quite a relief for a bunch of software dudes. That’s not to say that there was no software to be forged. We won’t bother you with the details, but let’s say it was a classical example of “We’ll get this done in an evening, maybe two.”

We got it done though, with credits going to Leonard and our fellows at IRNAS.

So, we were going to track down poachers now. This is where Project Hack The Poacher began.

Into the wild
The moment we have been looking for arrives when the Boeing wheels hit the Lusaka Airport landing strip. It must be exactly what Will Smith and Martin Lawrence in Bad Boys feel like, walking out the airport with bags filled to the top with more curious electronics than the airport staff has ever seen before (you bet that customs took a while!). A few Zambian smiles and 4 hours later and we’re in Kafue National Park, where we are welcomed by our friend Vincent Kouwenhoven in his ecological Ila Safari Lodge. The surroundings are astonishing, more raw than I remember from Serengeti, Tarangire and Kruger… On the downside, there’s less wildlife as well: the vastness of the park combined with the lack of park conservation over previous decades have caused poachers to safely shoot whatever they saw. Whereas you find large game around every corner in Kruger National Park (S. Africa), you may have to drive an hour to spot something here, as ranger Paul tells us that night.

It’s hard to believe for an engineer, but even more important than technical excellence in a project like this is working together with passionate wildlife conservation organisations. No one knows better how poaching works than the guys who are in the field every day. These are guys from WWF, Wildlife Crime Protection, Panthera, and Green Safaris. On the day we land in Zambia, we meet a number of them and sponge up tons of surprising facts – some known to us, some completely new. Here’s a collection of them:

– There is a surge in lion poaching because of a surge in Asian demand for lion bones

– Once arrested and sentenced for years of jailtime, poachers are often back at large within weeks

– Apart from big game poachers (e.g. elephants, rhinos), there’s a large group of small game poachers (e.g. antelopes) who often use traps for hunting bushmeat to feed their families. Unfortunately, animals such as lions, hyenas and wild dogs become trapped as well…

– While you’d expect that all of the area within a national park’s borders gets protected by recurring patrols, only a 5-25% of many national parks (including Kafue National Park) is actively protected by armed rangers

– Certain poachers actually go on ‘hunting streaks’, traversing the park to hunt multiple elephants/lions/whatever and transmitting their location to their friends back home to collect the loot

– Tourism proves to be an effective way of conserving wildlife, since it brings infrastructure, lodges, ranger units and simply ‘activity’ to endangered national parks

– It’s shocking to hear every time, but corruption up to the highest (political) levels enable poached animal parts to be shipped from national parks all over to Asian customers. Imagine the organisations involved when a piece of ivory has to cross national park borders, multiple country borders, harbour security and customs (twice), amongst all other checks in between. Not just here in Zambia, but also in South Africa, Namibia, Zimbabwe, Malawi, Congo, Uganda, Tanzania, Kenya, Rwanda, Mozambique, and a number of other countries

Inspired by hard-working wildlife enthusiasts yet saddened by the ‘David v.s Goliath’ feeling described before, we creep into our tents – now surrounded by hippos who take the dark nights to not get sunburned while consuming grass – resting our minds before starting to get to work in the morning.

Day 1: Taking off
When we get up in the morning we can hardly choose between taking breakfast and getting our sensors to work. The former option won, since we decide that it’s quite irresponsible to have Tim around without 7 espressos before 09:30am. Then we unload all the hardware, which looks a bit like this:

And the hardware adventure begins. The plan for today is to turn our 2 prototype sensors on in a testing environment (i.e. at the lodge), install the gateway and make the sensors send signals to the gateway. We hope that everything from our LoRa antennas to our 3G dongles don’t magically stop working here in the wild… A typical case of ‘It worked on my machine’ we want to avoid by all means.

An hour later, everything is running. High-fives start clapping.

The rest of the afternoon is themed by meetings with great conservation organizations who we aim to serve with our sensors in Kafue National Park. Each of these meetings is interesting in its own way, always making us realise how much technology can bring in these areas. However, when there’s not even internet, phone coverage or electricity around, how well does tech really work?

By the end of the day we still have time to do a little range/distance test to measure how far a sensor can be apart from the gateway while still getting messages (=poacher alarms) across. This is when we meet one of our dearest local colleagues. His name is Sam, and he can climb trees quicker than you run up your stairs. He won’t be bored today since both the sensors and the gateway need to be installed on high altitudes (>10m) to get a proper range. Before we asked him if he could hang the gateway in a high point around the lodge, he’s already 15 meters up in a tree that scares us just looking at it. Africa…

With the gateway being installed 15m high up, we jump in a 4×4 with Sam and driver Jack. To test the range continuously, we make our sensors send test messages (eventually poacher alarms) every 30 seconds. However, African Mother Nature doesn’t feel like it as much as we do. A massive storm begins to hit, making treetops quite an uneasy destination – even for climbing god Sam. After the rain Tim figures that he could mimic a tree by holding the sensor high up in the air and see if messages come across to the gateway. It looked pretty funny, but it kinda worked at a (disappointing) range of about 5km.

Some stuff that happens in the meantime:

– 2 PiRa boards break down (a teared up micro-usb connector and an RTC issue). Luckily, we have estimated a hardware breakdown percentage of 50% and thus brought spare parts of about everything

– A leopard sprints over the road right when the unfortunate Tim and Leonard are watching their phones

– We find out there’s an inactive radio tower of 30m high where we can install the gateway tomorrow morning to increase range

– There’s something wrong with the auto-shutdown of our sensor at low voltages

– A lion has been eaten by a crocodile in the river 500m away from the lodge

Day 2: Getting high
The next morning, the hippos and the Nespresso machine respectively wake and fire us up. We quickly fix the hardware issues we encountered, and drive off to the bush. Today we want to reinstall the gateway to a higher altitude and deploy the sensors in actual trees to see if we can track human activity in its most realistic setting. Sam has already gotten the gateway out of the tree at the lodge and half an hour later he is in the 30m high tower at a nearby ranger post. (We succeed in making him wear a safety harness.)

A LoRa gateway at an altitude of 30m should dramatically increase the range of our sensors, especially since we found out yesterday that the area is not at all flat: hills go 20m up and 20m down consistently, deterring signal after each one of them. We estimate a potential range of some 20km now and optimistically look for trees to hang in the sensors. We bring a 10m pole (the lodge’s swimming pool swiper) this time and attach it to our sensor, so we can assess our range while driving. It looks pretty awesome:

As we drive about 10km away from the gateway, we decide to deploy a sensor in a nearby tree. The second sensor can be installed farther away to . The question rises: what kind of tree is best? Obviously, it should be pretty high (for good range), accessible to climb into, exposed to sunshine, and full of leaves (to hide it from thieves). As we stumble through the bush, we unexpectedly find a perfect candidate: it’s 15m high marula tree. Marulas fruits are the type of food that elephants wouldn’t mind being woken up for (and the ones that caused the drunk elephant myth). And indeed, there’s elephant traces all around. Having aggressive elephants as your guards is a pretty good advantage, so we decide to quickly hang a sensor in the tree while we look out for incoming elephants. 30 (nervous) minutes and 120 tie wraps later and we’re running back to the car. Connecting to the gateway over The Things Network, we see all messages from the sensor coming in. It’s all working!

Lions & LoRa
Installing the second sensor proves to be a little bit more challenging. We drive off to the other side of the gateway where there is no cellphone coverage, meaning that we can’t assess realtime whether messages from the sensor to the gateway arrive or not. While driving off, planning to simply stand still at 5, 15 and 20km range for a few minutes for messages to be transmitted (and check the status of their arrival later) a group of lions blocks the road. They are clearly not intimidated by the Japanese truck we’re in. Our driver reminds us that being in the truck provides no guaranteed safety: the popular story claiming that animals perceive a car full of human beings as one large animal is a myth.

Although we’re in a hurry – the sun is going down rapidly – we take our time to check out these giants before rolling on. Luckily for our time schedule the lions are bored from us earlier than the other way around. After a very hilly 30min return trip we’re disappointed to see that none of the messages have arrived. In fact, our connection to the gateway is restored at the exact same place that our phones connect to the network. An essential takeaway: hills have a giant effect on connectivity range of LoRa.

The driver knows of a place with fewer hills in between and we decide to quickly go there and find a tree to attach the second sensor to now it’s still light. After spotting a beautiful tree that Sam is eager to climb into, we move through the paths that elephants and lions have created in the high grass. Convenient yet alarming – this place is a ‘animal highway’ according to the driver. Standing in front of the tree and figuring out the best climbing route, we notice the discomfort of Sam and our driver and decide to come back tomorrow. Sunset is hunting time for many predators and we don’t feel like falling prey to the creatures we aim to protect. And so we return to the Ila Lodge, a bit disappointed, but we are welcomed with a campfire and a lovely starry night.

Day 3: There’s an elephant under the tree
Then the sun rises for the third time on this trip. Leonard moves back to Lusaka for a tech assessment elsewhere while Tim and me remain for a final testing day. Before anything, we race to the tree we were standing at yesterday and hang in the second sensor there. Checking the gateway over The Things Network, we surprisingly don’t see any messages coming in at the gateway while Sam is wrapping the sensor around a few high branches. I happen to see that Luka, our friend at IRNAS (the hardware experts), is online. He advises a few configurations to the firmware of his PiRa board, which we quickly follow (over a local WiFi hotspot, we can connect to the sensor remotely). Magically, we directly see messages coming in at the gateway directly. Off we go!

Next up is a check-up on the first sensor. It doesn’t seem to work reliably and we might be able to solve it with the same configurations we just did at the second sensor (i.e. adjusting the LoRa spread factor). Since we also have to move the gateway back to the lodge before we leave Zambia (as was arranged with authorities) and present our findings to partner organisations, we’re in a big rush. When we jump out of the car and stride towards the marula tree, we see what we didn’t want to expect: a giant male elephant eating marula fruits under ‘our’ tree…

Elephants are responsible for about 500 deaths in Africa each year (not as much as the 3000 casualties by hippos) and they are particularly violent in Kafue. After decades of being hunted, the mammals here have learned that human beings are enemies that should be either attacked or run away from. Once they charge you (or your car) at 50km/h, there is little that can stop the 6000 kg creature running you over. The question for us is: how close can we get? We can connect to the sensor over WiFi with our laptops, but we never really tested that range. Lead by our guide Bob, we come closer to the tree, step by step, hoping for a ‘Connected’-notification.

We can almost hear the elephant chewing when he suddenly seems to notice us from a 60m distance. We’re in luck. Within seconds he runs away the opposite direction. Bob performs a little search around, since he may return with the same speed as he fled away (and with his friends), but finds no trace. Tim and me move towards the tree and try to connect to the sensor asap. Remember that the deployed sensors are scheduled to turn on/off regularly? This one is scheduled at 2mins on/8mins off… Staying here for too long might involve a messy elephant brawl, so we’ve got to do everything we want to do in just 2 minutes. The instant it turns on, we quickly reconfigure a few variables and download the log files. At the exact moment we execute the final command, the sensor turns off again. You should have seen Bob’s face. Another 8 minutes of waiting under a delicious marula tree – probably the only 8 minutes of the trip that went too slow instead of too fast. Counting the 480 seconds away while continuously on the lookout for uninvited wildlife, we finally establish connection and finalise the reconfiguration. Our hearts drop back from our necks into their regular place and we’re ready to sprint back to the car.

Our happiness to be back in a safe car is amplified when we notice that the sensor is getting messages over to the gateway again. It worked! A few hours before the end of the pilot test, we have managed to get everything operationally working.

Last thing we do before our final presentation to Panthera and Green Safaris is moving the gateway back from the 30m high tower to a different place. It’s also the last time Sam does his climbing trick for the project, which makes us a little sad.

The future
Wow. The next day we meet Leonard again in Lusaka, and three insane days of testing a completely new type of sensor with such inspiring wildlife conservation partners are over. We cannot stress the importance of these organisations enough, since it’s for them that the downward line in the elephant population graph hasn’t hit 0 yet. In fact, the work they’ve been doing is becoming so effective that there is hope for bringing back the African rhino to Kafue National Park some day.

Nonetheless, it’s still David vs. Goliath and we have no excuse for slowing down on our efforts to keep the African wilderness a safe home to all of its natural species. We believe that in this fight, David’s catapult is quite a techy one. One that is built by a number of collaborators from engineers like us to conservation organisations like Panthera, pioneering anti-poaching foundations like Smart Park/ShadowView, education initiatives in both Africa and Asia and tree climbers like Sam. We think we can win the fight. Do you?

So… curious what we’re doing next? We’re discussing a V2.0 sensor design with Rotterdam-based hardware specialists TWTG already, and future plans with WWF and Panthera are being discussed as we speak. Stay tuned on the Hack The Planet website!