I was for a long time searching for a real and useful project for my Arduino. I get this idea when my parents lost 2 days of work because of a power failure which disabled all fridge of their shop.
After a quick look on internet I calculate that I could do a similar system for almost the same price than a commercial product.
The main feature of this new project was to enable sms alert on power failure, to several predefined contacts.
My project specifications were:
- reuse a maximum of available components
- use an arduino as controller (UNO or MICRO)
- be really easy to use ie: only one main power source for the system AND the phone (and the same with the secondary power source)
- be modulable (version 2 may have a PC configuration tool)
So there were mainly 2 challenges for me: send sms thanks to an old 3310 Nokia, and design the hardware.
Communicate with the Nokia 3310
The FBus protocol:
As you can find on google, there are many links speaking about nokia and microcontroleurs but I was not able to understand this protocol only reading blogs I found.
Moreover, I couldn’t find a lib for the FBus protocol, which was Object Oriented, platform independent and working with a really small amount of ram (Arduino Uno has 2ko of SRAM).
First of all, I wrote a really small arduino sketch to send fbus command to a nokia directly from the computer through the arduino UNO (which act as a simple Serial repeater): arduinoSerialTransceiver. With this, your nokia is available through the serial port of your computer, and commands can be tested directly form it (in any language).
Then I used a test program running on a Linux computer to send FBUS command, based on the n61sms.c library. Sources can be found Nokia3310_sendSmsSerial
The hardware schematic can be found on the embedtronics.com website:
and the nokia pinout on the mytutorialcafe website :
With all of this, you are now able to send an sms from your arduino. But you may want to change the Nokia initial battery to your own power supply (a 9V battery for example) so here is the power supply schema to use to start the phone: .
I used a 5300µf capacitor to provide enough power to start from a 9V battery.
To regule your current (from a sector plug for example, you can use the following circuit:
Here is the complete circuit I used to design my power supply alarm, based on an Arduino UNO.
To start or stop the phone, it is just needed to simulate a on/off button push which connect it to the ground.
I used a relay based power control which, with a capacitor, permit to switch to a backup power supply without resetting the board. This secondary power source is a 9V battery.
If your nokia reboots at start-up, or when receiving calls or sms, it would probably be because your power supply does not provide enough current to the phone. I made tests with a rechargeable battery of 250mA but the final project has an 9v alarm dedicated battery of 1000mA.
The final alarm is based on a Micro arduino and is totally working:
Here are pictures of process and the source code is on github
Please find below all links I used to design my C++ FBus library:
|Arduino generic logger||ArduLogger||To be able to log analog values as curves and text logs, with logLevel support|
|Fbus protocol||embedtronics.com||The link seems now to be down but it was one of the most interesting as it was describing the FBus protocol to interact with the 3310|
|C Fbus arduino library||fbus.pde||It helped me to understand some other codes (not tested)|
|Fbus commands documentation||fbus html||A kind of Fbus doxygen doc|
|Fbus protocol description and nokia PinOut||Nokia and microcontrollers||Some examples of FBus commands|
|Fbus documentation from Gnokii||gnokii doc||Maybe the Fbus doc reference|
|Nokia and arduino||insidegadgets.com||Some links + arduino and nokia hardware connection + arduino code samples|
|Fbus C library||n61sms.c||My first sms was sent thanks to this library, from a computer (library not compatible with arduino => too much memory consumption)|
Please find below all links I used to design my alarm hardware:
|Nokia power supply||shaddack.twibright.com||This document explains hw to power a nokia without its battery|
|Nokia to arduino connection||embedtronics.com||This document explains how to correctly connect a Nokia with an arduino|