Building a cellular tracker: Part 5 – Which mobile Service Provider to chose for a Worldwide Coverage at low price

As said in the first post of this series – the idea is to create a cellular tracker. Not just because mobile internet makes more sense in the wild – i also believe that IoT Devices will be operated on mobile networks even if they are at home or in an office.

Anyway – one thing that had to be sorted out is the mobile service provider, at the end i needed a SIM-Card for my device. Of course i could just have used my local mobile provider (in my case Deutsche Telekom) – and indeed my first tries were conducted with a secondary SIM-card from my iPad. But of course this approach does not scale in many ways: It is too expensive – even if you buy a prepaid data-only card you will end up with more or less 10EUR monthly fee. No Roaming included of course. Another point – if you think about many devices you would want to have a sort of management dashboard or so to see your SIM-cards, activate and control them etc. – with no surprise consumer-oriented SIM-cards are not coming with a service like this.

We need a dedicated machine to machine SIM-card provider that comes with a management console, affordable prices, ideally international roaming (because you might quickly want to sell your product outside your company or use your tracker while traveling) and in my case at least a 2G coverage (Fona does only need 2G, it couldn’t even handle higher networks).

Surprisingly my provider Deutsche Telekom indeed are offering M2M cards as well – they even have a dedicated Website for it and are offering interesting starter kits, a developer community etc. – So i ordered a testkit right away. Unfortunately i did not receive anything until today, no email, no call, no kit. But i ordered months ago. Well…

Fortunately i had a chat with Alexandra Deschamps-Sonsino, the Designer of the famous Goodnight-Lamp. I asked her how she solved this and she named a company called

To cut it short: They are great! Contact was established with an email and a response time within a day and i got a first test-card within another 2-3 days. And it worked with no further ado – although it was already on roaming as these guys are sitting in the UK and the SIMs are registered as roaming in a german network*. They do have a management console/portal that shows you all the SIMs you are running including details like traffic consumption etc. They have affordable prices based on volume only. It’s really the solution you are looking for if you want to do something in that field. Ah – and not to forget: their SIM-Cards are coming with international roaming in all European countries + Canada and the US (the website currently says 96 countries all together)! That’s really awesome!


*ok, i had to modify the fona-sketch because it would not work with a roaming-response initially – but this is just one line of code

Posted in Allgemein | 1 Comment

Building a cellular tracker: Part 9 – Solar Power

One of the more exciting tasks while building up a cellular tracker is the Solar-Power part. Below i will describe my first results – this article will be updated later on when i am running some more tests and gathered more experience and data in general.

The reason why i am considering a Solar-Panel as part of my setup is quite obvious – i want the guy to run forever without human intervention ideally, at least for a very long time.


I thought it would be easier to do this. Buy a solar panel, connect it to a charger and you are done. Especially as my Fona-Board has a charging circuit onboard it looked very straight to me. Thus my first approach was to solder a Mini-USB-Connector to the Solar-Panel and connect it to Fonas USB-Port – which is explicitely designed for charging the attached battery only. The fact that the charging LED immediately lit up made me even more confident that i found the right way to do this. While waiting for an effect on the charge state that was transferred to the Web every 30minutes i read a little bit more on the Adafruit Website which has some excellent articles on batteries, charging and also solar-charging. And as nothing changed on the battery status even after hours of sunshine i stumbled upon this article by Lady Ada: Continue reading

Posted in Arduino, electronics | Tagged , , | 2 Comments

Building a cellular tracker: Part3a – Circumventing unreliable Watchdog with external 555 timer

In my current endeavor to build a cellular tracker that can run autonomously for months i stumpled upon a strange problem during outdoor tests which could only be resolved the hard way…

Initially i intended to use the built in ATmel-Watchdog feature in two ways – for the sleeping function and for resetting the system in case of failure. According to the official documentation this is a supported use of these functions.

And it worked – the system goes to sleep for an hour, wakes up, does some measurements and uploads them to the internet. If something strange happens which takes longer than 8seconds (the longest possible watchdog timeout) the system will reset itself and startover. Quite nice – especially as the communication with Fona sometimes has issues and can have unexpected delays etc. this is very useful.

Unfortunately my outdoor tests showed a strange behavior, sometimes after days of normal operation. Suddenly the board got stuck and hangs with power on at the System-LED (which sits on PIN13), obviously in a loop or so. This is strange because the watchdog should prevent something like this specifically and normally it should not be possible to let the guy hang himself. Perhaps it’s also an issue with my code, asked a few people but nobody could help (it does not seem to be a memory issue).

Anyway – i got tired of trying to find the source of the problem and btw during my research i found a few others reporting watchdog hanging etc.

So i tried to find an alternative solution – this is where i asked the stackexchange community for help and got exciting support.

The basic idea is to use a 555-timer chip and configure it in a way that it triggers the reset pin of the arduino after the given time. My first contact with that famous chip to be honest and am grateful that newer variants exist that use less power, because the original NEC 555 from 1970 (which is still sold) will consume about 10mA _permanently_. The younger CMOS-versions are pin-compatible and consume 10-times less energy + the can work under less voltage.

As you can see in the video below my first tests work quite well. Currently i am testing a setup where i really replace the software watchdog with the external one completely, which means permanently resetting the board. Which is not too beautiful. I will try another setup where the 555 is only triggered as a fallback-watchdog that is powered while the Board in on and will reset if this takes longer than expected(**see Update at the end). Clearly more elegant, but also comes with some dependencies as well which could undermine stability again because the Arduino has to power a PIN and shut it down properly in this case. As i don’t really know yet what exactly is happening in these cases of failure this more elegant version might have a disadvantage compared to the brute-force approach…

** have this version up and running as well now. It works like this: it’s a normal 555 astable circuit, which would stay high for a few minutes and go low for a second after that. This Output-Pin is connected to the Reset-Pin of the Arduino with a 1K resistor. A Mosfet connects the positive leg (–> please check update below) of the Capacitor in the 555 circuit with Ground and is being triggered by an Arduino Pin. So i am turning this Pin low when the sketch starts and high again at the end. This way the 555 is charging it’s capacitor during the sketch and will hit reset if the sketch takes too long. If not the Arduino discharges the Capacitor during sleep to prevent unintended resets.

—- UPDATE —–

With the help from a friend i figured that the above circuit also works without the Mosfet – you just have to use the right resistors. I do connect to Reset with 1K and to the Arduino control PIN with a 56K resistor. The control-PIN is configured as INPUT when the board wakes up – that way it is practically not existing for the 555-circuit which therefore starts to load. At the end of the code before going to sleep the control-Pin is set to OUTPUT. As this is LOW on default the capacitor starts to unload through this Pin instead of the 555 which has a higher resistor (100k). This way the 555 is not triggered during sleep but it will be triggered during execution if it takes too long.

BTW: this additional circuit consumes about 43micro-Amps on top of the sleeping Arduino (be careful to use a CMOS-version of the 555, the original NEC will consume much more energy and requires higher operating voltage!) which is not great (the Arduino consumes 10x less in sleepmode). But the benefit of a failover procedure can be worth it if autonomous operation is key.


Posted in Arduino, electronics | Tagged | 2 Comments

Basic Electronic tinkering set

The idea was to assemble the cheapest and most straightforward tinkering set for beginners. It’s designed to be used in a huge Workshop at a conference. All parts together (including packaging) cost less than 1 EUR.




Posted in Allgemein | Leave a comment

This is why i love the Internet so much…

One of the reasons for this blog is that i wanted to share my learnings with the world, because i learned so much by shared stuff of others, it’s just amazing. Yesterday i asked a really tricky question on the electronics forum of stackexchange – only a few hours later i received the perfect answer, exactly what i was looking for. In a nice and readable form. This is not just awesome for practical reasons – because it let’s me find solutions so much quicker, cheaper…

I also like it, because i like the attitude behind it, it’s a friendly, warm and open habit to answer questions for free and invest time to make the answer even good, provide code-examples and help if further problems occur. I mean, these people could get money for this, they could decide to hide information and rather invest their time into their own stuff. But they are not doing it. And it’s clearly something that is not just happening in the Internet by accident – if you read the history of the Net and the World-Wide-Web specifically you will see that it was intended that way from the very beginning. And yes, i know that this also started to become a kind of reputation-currency, because developers are being hired based on their Karma-Status on Stackexchange (i did hire that way by myself). A currency based on friendliness and helpful behavior (+competence of course) – still great.

But of course this is always at stake – many of the recent developments do not carry this beautiful idea in their DNA or even try to drive it further. Sometimes you can get the feeling that it is rather a behavior from the past when Usegroups and Forums were reasons to “get online”. I would hope to see more of this beauteousness in future Internet applications, platforms and companies. And perhaps it could also help improving our society beyond the digital borders, make us more open, friendly and supportive if a refugee is in front of our house or the question is at stake, whether we invest in a society, that takes care for the needs of others instead of optimizing wealth of a few. Sorry, am just overwhelmed and dreaming a bit.

— Update —-

Of course i had to give it a try as i came home – here is my first touchdown with a 555

Posted in Maker-Movement, Society | 3 Comments

Building a cellular tracker: Part4 – Which cloud-service to chose for storing the data

As described earlier, i want to create a cellular tracker – below i am going to describe where to store the data…

Tracking sensor-data only makes sense if the data is being stored in a central place for further action. Usually you would want to analyze and visualize the data, drive further actions from the data and probably even perform some machine learning tasks to get deeper insights.

Of course this can be done locally with your own server and file-system which most probably would be something hadoop-based in these days with a stack of spark-services on top. If you really want to build something significant and do very specific stuff i would recommend exactly that – but: it will be a huge effort to build a backend-service like this and operate it on a daily basis.

Continue reading

Posted in Allgemein | Tagged | 3 Comments

Building a cellular tracker: Part3 – Running on Batteries for Months

As described earlier, i want to create a cellular tracker – below i am going to describe what i learned about power-consumption and why i believe that the tracker could run on batteries for months…

My goal is to have a system that can run on batteries for a long time – ideally it would be able to run forever with a combination of rechargeables + a solar-panel.

But this is harder to achieve than i thought. A standard Arduino Uno consumes around 55mA while looping – and as the board is looping all the time this is the baseline – it’s actually consuming the same amount if it is in delay() all the time and practically doing nothing. Of course there are ways to put the CPU in sleep-mode, if you leverage the full potential of this with an Uno it will go down to 35mA. This would mean that an Arduino would run for less than 30 hours with a 1000mAH battery. The biggest available Lipo Batteries at Adafruit carry 6.700mAH which would mean 7 days of autonomous operation. This does not include any power requirement of Fona btw – as this can be expected to draw a lot more while sending the whole system would run less than a week with the biggest battery available…

The power needed by Fona is hard to influence – the only relevant factor here is number of measurment/upload cycles.

Therefore the Controller hast to go on diet. Which is exactly what can be done with an Arduino, and i was really excited how easy it is to build a “bareduino” which is a ATmel chip on a Breadboard with only a few additional components. The components that can be left out if you carefully design the circuit and power-needs of your sensors (and of Fona) are voltage shifters and a few other things that are known to consume a lot. Suddenly the same Arduino consumes not more than 10mA while running and goes down to less than 10μA while in sleep-mode! This is really amazing, a hundred times less in sleep mode means a lot for the goal of this project. An Arduino that consumes 0.1mA would run 416 days on battery in sleep mode. Of course this is a theoretical calculation because the battery would lose power over time etc. – but it is still very promising.

My experience regarding fona says it consumes around 100mA on average when active and doing GPRS communication. This is not the most accurate value because measuring is difficult as Fona has some peaks in using electricity and won’t run properly when under measurement – at least with my voltmeter. But i think it can be taken as an estimate – i will update this article when i finished more test-runs (one of the first runs indicates 8 days of operation with 10-minutes send intervals on a 2.000mAH battery, but i will repeat that more systematically).

This means – if i would do one measurement/upload per hour and Fona would need 1.5 minutes for this and i would use the biggest 6.7mAH battery the system would run for 100 days. There are a couple of options to reduce the consumption even more, e.g. powering the sensor with a digital PIN instead of permanent voltage so that it can go to sleep as well, shutting off the AD-Pins while sleeping, getting rid of any status-LEDs etc. – but in general i am quite confident that a system that runs on batteries for many months can be built.

I will cover the actual code i was using in a later chapter, but as the power-saving functions of an Arduino are quite tricky i will link the code-repository here already. In the code you will find a function called sleepabit(). This function does take seconds as an argument and puts the Board into the maximum sleep-function available for the given amount of time. To do this you have to activate a watchdog-function that wakes up the board from sleeping. Unfortunately the longest available time is 8seconds (!), so the function has to wake up after 8 seconds and go to sleep again etc. – the other detail that has to be considered (especially if the watchdog should be used as a real watchdog to reset the board in case of a problem) is that the Arduino/Atmel Watchdog will by default reset the board if called more than once – this is not the behavior we want while sleeping. That’s why the watchdog is always disabled and enabled again in this sleep function.

BTW – the best documentation to learn about the sleep modes i found was the official documentation from Atmel on their website – quite a (positive) surprise…

Posted in Arduino, gsm | Tagged , | 3 Comments