Internet of Things (IoT) Project-Part 2

(NO Caution) Agile development underway.

I’m a big proponent of Agile development and this project is a perfect example.

I built the initial version and a few tangential issues came up that were unexpected.

In SDLC, this type of thing creates havoc, schedule disruptions and a mad scramble to adapt the overall plan to the previously unknown finding..

Agile incorporates the discovery into the next cycle if desired. Agile is more Zen-like.


What I found:

A few things.

The serial port was a bit more unreliable than I thought. From time to time my program would lose track of it and throw an error stopping data logging. If this happened at night I would lose hours of data.

I did not have a good sense of the frequency of internet outaqes (mostly my ISP) were. This would cause a thrown error and a lost sensor readings.



With that learning in hand, I modified several things:

  1. Data logging strategy now would be a 2-step process. First log to a local SQLite database. This would shield me from Web connectivity issues (I also had DNS issues coming up). Then, add a second data replication process that would look for unwritten data in the local DB and post it to the Web database. I also built a mechanism to allow rapid catch up should there have been a multi-hour internet connectivity outage.
  2. To handle the serial port issue, I opened and closed the serial port more frequently. (hoping the close cleaned up garbage) We’ll see if this change improves the reliability on this one.

I did make one other architectural change to make room for other data collection Arduinos. I changed the data collection method from Arduinos reporting their reading on a timer, to the central computer asking for it from the Arduino. I also genericised the database design to allow data mixed from multiple different sensor projects. This strictly poled approach now puts control in the central computers’ hands and enables time slopts per sensor to be serviced where I do not incur the risk of serial communications being intermixed.


I have another sensor project planned… this one will record the decay of NiMH batteries over time. It’s necessary information for an invention I am working on. In short, it will record the battery voltage of fully charged NiMH batteries of different types under different loads over time.

So far after 2 days of running the system seems tight.