Category: iPhone

It only took 4 years, but I finally found enough time to build a new mobile app and update an existing one. Things have been busy to the point where my weeknights are taken up with other things, and any software development has to be done during the day. Sometime last year I had another idea for a mobile app utility and decided to build it properly to learn about Android store processes and online advertising. Here’s what I built and how the process worked.

Log – flexible data tracking

Like the name says, this is the app idea I came up with last year to solve a problem I couldn’t find an existing app for. It’s a data journal that provides the ability to create custom streams of data and track those over time. The streams can contain multiple inputs like numbers, text or dates, and get added to the list. For example, track driving trip distance or count the number of times you go to the gym. It’s all manual and offline.

Learn a lot more about it at thelogapp.com.



Equation Library

This was an app I wrote back in 2014 and it received a surprising number of downloads. I ended up not having enough time to commit to its maintenance and let it sit for too long. Recently I reviewed the tech needed for it to work and decided it was new enough that I could do that. So I spent a few evenings rebuilding it with the latest SDK and made some improvements.

The application itself works by including a number of math categories that have equations I’ve collected from my textbooks and online sources. Each equation can solve for the primary variable and most provide the ability to solve for additional variables. My hope is that as people use it and start to request categories I can slowly build a much larger database. Fortunately the new system is much easier to update and maintain than it was previously.

The hard part comes after

If you’re proficient at mobile development, building the apps themselves isn’t that difficult. I wanted to use the process of updating the apps to learn about online marketing and advertising, so it turns out that the hard part is just getting noticed. I think the market has shifted significantly since I started building small utilities in 2011 and I’m surprised at how much people don’t want to spend on apps now. So far targeting ads with Facebook and Google has not resulted in many sales, but I’m still learning so hopefully that starts going up as I do more.

Give the apps a try!

Tagged with: , , , ,

Finished product
My apartment uses baseboard heaters and anyone who’s paid for hydro can tell you, they’re pretty inefficient. I wanted to collect some information about the inside conditions of my apartment so that I could better understand when and how to turn the heaters on. Normally a simple thermostat would do, or even a Nest, but my equipment is so basic, there is no read out available.

So I built my own. Here’s what I did.

In high level terms, I have an Arduino UNO using a WiFi shield and custom PCB connected to a DHT22 temperature and humidity sensor and photocell. This information is sent to data.sparkfun.com and is displayed in snapshot, table and graph form on my iPhone.

Setting up the Arduino

The components with the Arduino are all fairly well known, but I had not made anything with them together. Here are the parts and links to where to get them

I put them together on a breadboard and build the code. I can provide code if interested, but essentially I assembled individual modules in order to upload the data every 5 minutes. As far as the program goes, it’s laid out like this

  1. Include all libraries — this uses DHT, Timer, Wifi, SPI WifiClient, WifiServer and medianFilter
  2. Define base variables — Wifi shield configuration, website, pins, etc
  3. Create objects — Timer, client, server, filters
  4. run setup() — set pin modes, connect to Wifi and set the timers
  5. loop() only updates the timer
  6. Every 30 seconds all sensors are read and added to a filter
  7. Every 5 minutes the filtered data is sent to data.sparkfun.com

Creating a circuit

schematicA breadboard is fun for prototyping, but it wouldn’t look so good on a shelf, so I took the opportunity to test out a new PCB manufacturing website by building my own circuit. The pinouts of all components is fairly easily available online, or better yet, in EAGLE itself. The board doesn’t have many pieces, just some 0.1″ header holes, but the tricky bit is making sure that there are no pin conflicts with the Wifi shield.

Moving to a PCB

environmental_board
EAGLE provides a nice way to import a schematic to a board, and since I started with an Adafruit shield piece, there was a nice outline ready for me. At that point it was a matter of making sure that all traces have clean paths and there are 5V and GND planes.

1-IMG_7920
4-IMG_7930
3-IMG_7924
I tried a PCB service previously called OSHPark.com but was unhappy with the cost and lead time required. A friend pointed me towards dirtypcbs.com and that turned out to be a great choice. The name is basically entirely what you get: printed circuit boards at affordable prices, with a very reasonable 1 week lead time. I was also impressed with the shipping from China, as it was no more than an additional week with DHL. That’s 2 weeks for 10 custom boards.

Displaying it all on a phone

The data is sent to data.sparkfun.com, which provides a nice free way to store key-value data (eg. temperature=25,humidity=38, etc) and a way to retrieve it. During the day I work for a mobile software company, so building something to retrieve the data was fairly straightforward. I ended up with a way to view different properties in the latest data, table and graph form.
IMG_1565
This is the home page where the latest data point is displayed front and centre, along with the time it was retrieved. The time is relative, so a timer runs every second to indicate how old it is, but clicking the label shows the actual timestamp. Below that is some related information that might be useful: the 24 hour high value, 24 hour low value, and the current outside temperature according to forecast.io.
IMG_1569
Additionally the menu button at the top left presents a slide out “hamburger menu” that can switch between the different properties collected.
IMG_1570
The middle tab shows the last hour of data in table format and as you scroll downward, will load the next block from Core Data. In order to keep the actual internet request simple, the app retrieves the timestamp of the most recent datapoint and only requests points from Sparkfun that are after that. All points are stored in Core Data and loaded on demand.
IMG_1567
Finally the right most tab shows a graph of whatever property is displayed at the time, with options for last 4 hours, last day or last 4 days. At first I had last hour but I realized the data I was collecting wasn’t really changing in that time frame so it was largely useless.

For the most part the graphs are consistent, with my heater keeping the temperature at about 19-20C through the day. The light graph is very interesting because it clearly shows when the light goes off and how sunlight filters through the curtains in the morning.

Next plans

There’s one thing I’d change about the PCB design, and that would be to replace the fixed photo cell resistor with a potentiometer to adjust the threshold. Right now I’m using a 16k ohm (I think, something about 10k) and that produces a nice range between full bright and darkness, but it would be good to adjust as required.

With the data collected, I’d like to now make use of it somehow. You might notice how the board has 4 pins showing “relay” on it, which is so that I can connect an AC relay and control my lights or humidifier. Ultimately I’d like to work in some geocoding to my app so that I never come home to a dark apartment and have my light be smarter so that it doesn’t turn off while I’m still at my desk.

Tagged with: , , ,

Towards the end of school in April, I got in contact with a classmate who was connected to iPhone development, and in September I started working full time for them. It’s been really cool to see how apps actually progress from ideas to real products, because so many people use them, but only a small percentage actually understand the mechanics of how the apps get onto their phones.

I mostly did some feature additions to existing apps to get to know Objective-C and the iOS environment, but during a recent road trip, I created an app that has just entered the App store. A small utility, it serves a need that I could have used many times on the trip.

It’s called Here’s My Location and it gives you the ability to alert friends and family to your exact GPS location through email and SMS. There are similar applications out in the store already, but I think this one has the right combination of simplicity and utility that many people like.

To use the app, open it and wait for the GPS accuracy indicator to go green. This little badge changes based on the accuracy of the phone’s current location: red for inaccurate, yellow for moderate, and green for accurate to approximately 5-10m (the iPhone’s limit). You can send a message using the top two blue buttons, or copy the formatted Google Maps link to the pasteboard to use in another application.

It’s really a simple start, but I hope that through user feedback I can add other requested features in the future.

Tagged with: , , , , , ,