Iteaduino Plus is an open-source ARM development board, which is based on Allwinner A10 SoC, small size, hacker friendly, extendable and very low-cost.
Itead customized IteadOS, an operating system based on Ubuntu for it, offers operation function of the underlying hardware such as GPIO and SIM900, etc. At Iteaduino Plus platform, one who only knows a little about C and C++ and nothing about Linux system (to be frank, that is me) has no trouble in driving some common electronic modules and using ARM just as Arduino.
With existing resources, we made a small DEMO to show how to make a phone call to the target phone number when the ambient temperature is too high.
Step1:Parts list
- Iteaduino Plus
- ELECTRONICBRICK – TEMPERATURE SENSOR BRICK
- SIM900 GSM/GPRS MINIMUM SYSTEM MODULE
- RASPBERRY PI SIM900 GSM/GPRS MODULE ADAPTER KIT
- GROVE UNIVERSAL 4 PIN CONVERTER CABLE – 20CM
- ELECTRONIC BRICK – LIGHTING EMITTING DIODE
Step 2: Connection
Connect the parts to Iteaduino Plus with corresponding cables. As LED and temperature sensor adopt standard electronic brick Grove interfaces, and there is a customized Adapter Kit for SIM900 module, connection is quite simple instead of having a bunch of cables in mess.
First, connect RASPBERRY PI SIM900 GSM / GPRS MODULE ADAPTER KIT with SIM900 Module. Adapter Kit is customized for SIM900 module and Raspberry Pi to convert pin header interface on SIM900 module into Raspberry Pi compatible 26pin interface. Iteaduino Plus also provides a Raspberry Pi compatible 26pin interface, so that Raspberry Pi accessories can be used on it. As shown in Figure 2, insert Adapter Kit into SIM900 module according to the red marks and another end of Adapter Kit should be connected with Iteaduino Plus.
Figure 2:Adapter kit and SIM900
Figure 3:Connection to electronic brick
Then connect the temperature sensor and LED indicator to Iteaduino Plus via Grove interface as shown in figure 3. Please note that the temperature sensor should be connected to P17 and LED indicator to P18.
At this point, we have had the parts connected. It is quite simple, isn’t it?
Step 3: Coding
Itead has provided a lot of useful library functions, so that users can easily call these library functions to drive the underlying hardware. For example, SIM900, LED and temperature sensors, etc. used in this DEMO can all be driven by calling the library functions. Just think about it, we only need to call a few simple functions to drive the hardware without having to read <Linux Device Drivers 3rd Edition> and <Understanding the Linux Kernel, 3rdEdition> published by O'REILLY. How fantastic it is!
The code for the whole program is as follows:
#include
#include
#define tempsensor 17
#define ledgreen 18
//SoftwareSerial gsm0;
GSM gsm;
void ioSetup(void)
{
pinMode(tempsensor,INPUT);
pinMode(ledgreen,OUTPUT);
}
intCurrent_temperature;
int main(void){
printf("system startup\n");
gsm.TurnOn(9600); //module power on
gsm.InitParam(PARAM_SET_1);//configure the module
gsm.Echo(1);
ioSetup(); //Setup temperature sensor and LED work mode
while(1){
Current_temperature=digitalRead(tempsensor);
if(Current_temperature ==1) //Temperature is higher than expected
{
printf("ATTENTION:Temperature is too HIGH\n");
digitalWrite(ledgreen,HIGH);
gsm.Call("13600xxxxxx");
delay(30000);
break;
}
else //Temperature is Normal.
{
digitalWrite(ledgreen,LOW);
printf("SAFE, Current Temperature is OK\n");
delay(10000);
}
}
}
Compile and run
iteadcompilecpp test gsm_test.cpp
After compiling, it becomes an executable file test
./test
The video to show how it is running.
As we can see, Iteaduino Plus is also equipped with basic smart home features. It can detect ambient temperature constantly, and when the ambient temperature exceeds the set value, it can send a message to inform the owner that it is too hot in the house and it may cause a fire, so that the owner can take effective measures. The temperature sensor can be replaced with a variety of other sensors, such as proximity sensor, ambient light sensor, etc. to function as an anti-theft warning. Furthermore, Iteaduino Plus can also work as the master control in smart home to control various appliances in the house.