Today I am going to share with you some ideas how you can turn an old mobile phone into a desk manager to display or to control many things in the house. The fun started when I was creating my new desk and my girlfriend gifted me an old mobile phone. I thought for a longer time to make a bigger Arduino clock for my table but this old mobile phone turned my thoughts for more than 180 deggrees :) What is good about an old mobile? It has a BIG screen and nobody wants it!
Thanks to MIT APP Inventor we can create any app on a mobile phone we want and thanks to Arduino we can play with diffrent data and the communication in (or outside) the house.
My first idea started with these features:
- a big clock on my desk
 - to turn on/off the led stripe on the table and to set its colour
 - to display the temperature and humidity inside the house
 - to update the time in my Arduino clock in the bedroom
 
As I had developed this basic app for the mobile phone, new ideas came:
- to display current bitcoin price
 - to display current weather and temperature outside
 - to count 20 minutes by clicking a button
 - to display current soil condition that my plants have to know if to water them
 
First let's look generally how we can create the entire home network to display various information or to control a lot of events. I like this variant because it is very cheap and adaptable:
The mobile phone receives or sends data through bluetooth module HC-05 (BT module) that is connected to Arduino. This Arduino communicates wirelessly with other Arduinos through nRF24l01 module.
I mention here the word "Arduino" only, but I work mainly with Arduino Nano, Arduino Pro Mini 5V or 3.3V or even ATTiny85. Every "module" has its pluses and minuses so it depends what you want to do.
Let's start one by one:
The big clock on my desktopThis was the easest part. The mobile phone has exact time that is updated through wifi. In MIT APP Inventor we can take this information about the time directly from the mobile phone and display it on the screen.
As we already have the information about the time, we can send it to Arduino through bluetooth. The app has a clock counter and I set it to send the current time every 1 hour to Arduino.
This Arduino sends the information further to my Arduino clock in the bedroom through nRF24l01. My bedroom Arduino clock is the part of the system that evaluates CO2 in the air and automatically opens or closes the window. So I already had this nRF24l01 implemented. Now I developed it to receive the time and to update it in the DS1307 rtc module.
DS1307 rtc module is not accurate and the time can deviate more than 5 minutes per month. This way I update the exact time every hour so it always shows the right time.
Displaying the temperature and humidity inside the houseArduino with the BT module is under my desk and it is also connected to DHT11 module to measure the temperature and humidity. The current data are sent every 20 seconds to the mobile phone through the BT module. The app checks every second if there are any available BT data. If yes it reads them and shows them on the display.
Honestly, this part was my nightmare because the bluetooth communication fell down every day. After 1 month I finally read somewhere that DHT11 module can give NaN values and if such value is send through bluetooth it can block it. After I treated this in the code with isnan() function, everything runs without any stop for months at last.
Turning on/off the led stripe on the table and seting its colourThe Arduino under my desk controls the R, G and B value of the led stripe. 3 PWM Arduino pins are connected to 3 mosfets. In my app I set buttons with diffrent colours. These buttons are displayed if I give my hand closer to the mobile phone. I use here the approximity sensor of the mobile phone that reacts by displaying or hiding buttons. If I click on a button it sends R, G and B value to Arduino. These values are first recalculated with the value (coefficient) of the scroll bar that sets the brightness of the led stripe.
The mobile phone is connected to wifi so we can take diffrent information from the internet. The following link gets the json with the information about the current bitcoin price:
https://www.bitmex.com/api/v1/instrument?symbol=XBTUSD&count=100&reverse=false
I set the mobile app to get the information every 1 minute and display it on the screen. You can find many videos how to extract a value from a json in MITT APP Inventor.
Displaying current weather and temperature outsideDisplaying current weather and temperature outside is very similar to displaying current bitcoin price. First we must register to API weather on the following link:
https://home.openweathermap.org/users/sign_in
Then we must subsrcibe to the Base billing plan. It allows you to make 1.000 demands every day for free. You get your API key that you use to get a json for your location (API key, latitude and longitude are the part of the link):
In my app I get the json every 5 minutes (it is around 280 demands per day so it is for free) and I display the current weather as a picture and the temperature outside. The good news is that the json contains the picture name of the current weather so you can assign it any picture from the internet if you upload it in your app.
If I click on the picture, it shows on the separate screen a prediction for next 3 hours (json contains prediction for next 48 hours):
I set a button that counts 20 minutes if I touch it. I use this time for 2 things: 1) it helps me to focus to any task without a distraction if I work on something and 2) it helps me with cooking when I need 20 minutes to bake potatoes or to make a delicious chicken. After 20 minutes the app plays the sound I uploaded there.
As you see above such small home network can allow you to have many information from sensors around the house, for example the solid condition to water the plants or water level in the garden well. Even you can turn on/off many devices at home directly from your desk manager or have under the control the current state of the devices e.g. if the garage door is open, if the light in the basement is off and so on.
You can also use the time feature of the mobile phone and turn on/off any device at (or for) a certain time automatically (e.g. turn off the wifi and have peaceful deams).
Code of my appBelow you can find my Arduino code and importable file for MIT APP Inventor 2 with my app that you can directly install on the mobile. Some changes are required:
- set the right API key for the weather information (mine was changed in the app)
 - set the right address of your HC-05 module
 
Any questions write in comments. Any other ideas are welcome :)











Comments