Hangar Heater Cellphone Switch
This project lets you send SMS text messages to a controller which allow you to turn an AC outlet on or off. The basics of the project are described at the Adafruit site: Adafruit FONA 800 Shield.
In my implementation, I used an AC plug and socket from a dead rotary timer. This made it a once piece controller that just plugs into the wall and saved adding the 120V plug and socket cords.
A 3D printed box was designed in SketchUp to fit this AC plug/socket component, the 5V-120V relay board, and the Arduino Uno. The box was printed using ABS filament on a PowerSpec 3D Pro Printer. I'd post the box design but the placement of the plug/socket is not likely to fit anyone elses component.
Here's a picture of it in use.
For my wireless carrier, I used T-Mobile which works out to $3 a month and includes 30 messages. The SIM card was free from a local T-Mobile store. You need to make sure the carrier uses GSM (T-Mobile, etc.) not CDMA (Verizon).
FONA 800 Interfaces:
- Vio to 5V
- GND to Ground
- Key to GND (always on)
- RX to Data Pin D2
- TX to Data Pin D3 (D9 on Leonardo/Micro, D10 on Mega)
- RST to Data Pin D4
- Heater Relay to Data Pin D11
- Timer LED indicator to Data Pin D12
- Thermistor on Analog Pin A0
A couple of commands may need to be issued using the FONAterminal.ino program. Send the commands "AT+CLTS=1" followed by "AT&W" to FONA to tell FONA to get is clock sync from the cell network. Power off then on again to get time sync. Query the new message indicator with "AT+CNMI" and you should get 2,1,0,0,0. This mode is set to notify the Uno that a SMS is waiting.
I included a temperature sensor in my design, however, this is not needed and those lines can be commented out. I had a 5k ohm no-heritage thermistor that I read with a simple one line curve fit.
The miniswitch should be connected between the battery and FONA shield. Turn it off when you are not using it since it will drain the battery which isn't a good thing. The larger LiIon battery is definitely needed. I started using a 350mAh LiIon but when the FONA transmitted, it would pull down the voltage and scramble the data.
The two LEDs indicate the operating state of the controller. One is on when the relay is on. The other is on when the Timer function is on. The timer LED also pulses to show you that the control loop is functioning.
- Arduino UNO
- Adafruit Parts
- FONA 800 Shield - GSM Shield
- 1200 mAh, 3.7V LiIon battery
- uFL GSM/Cellular antenna
- Stacking headers, 0.1" spacing
- 5V Relay Module
- T-Mobile SIM card
- AC plug cord
- AC socket
- 9V power with barrel connector to power the Uno and FONA
- 2 LEDs
- SPST Miniswitch
All coding was done with the Arduino IDE. You will need the Adafruit_FONA library. Location and downloading are described on the Adafruit FONA 800 Test page. The basis for my code came from the FONA examples in the library subdirectory. Here's the current Arduino code for the Hangar Heater.
The commands are very simple. Just text "ON" to turn the relay on or "OFF" to turn it off. Texting "S" will provide a status of the controller giving you the time, battery voltage and percentage charge, cell signal level, temperature, whether the timer is on, and whether the heater is on. The timer function is turned on with a command in this format: "ONhhmmcc" where hhmm is the hour and minutes past the hour to turn on and cc is the number of hours to turn on. The timer is shut off with an "OFF" command. The controller will always send a confirmation response to any valid command. An example status response would be: "Status: At 18:20 B:4137mV 92% S:-97dbm 35F Lo:20 @04:20 Hi:38 @13:01 Timer=Off Heater=On"