Translate

Configuring Kannel WAP/SMS gateway (for HUAWEI E173)

Once you have installed Kannel, then you need to configure it for your device. I used a Huawei E173. And my OS is ubuntu 11.10

Go to /etc/Kannel/Kannel.conf and edit it like follows.

Here is my configuration file.



Here, to find the device in group smsc, I checked, /var/log/syslog. It shows when we plug a device in.

After configuration is done,

sudo bearerbox -v 0 kannel.conf
sudo smsbox -v 0 kannel.conf

If this not the first time and previous processes are still running, you need to kill them first. To do that,
first find the relevant processes by,

ps -ef|grep bearerbox
ps -ef|grep smsbox

Then kill them.

eg:
If the process ID is 914,
sudo kill -9 914

Now once you get bearer box and sms box running, try sending a message

http://localhost:13013/cgi-bin/sendsms?username=kannelUser&password=123&from=+94712345678&to=+94712121212&text=testing





For those who have trouble with measuring time with micro controller !

When doing our digital electronics project I wanted to measure time using the PIC(16F877A)
Here it is explained in simple words

instruction clock cycle = clock cycle/4

The timer input clock(instruction clock) is passed to the prescalar and that is divided by preferred value and fed into timer register.

Say an interrupt occurs when value of timer(counter) becomes 256. Assume clock frequency is 20Mz.

As the timer input clock is instruction clock, we can say an interrupt occurs at the completion of every 256 input clock cycles.

As value fed to timer = instruction clock/prescalar value(say 8), we can say an interrupt occurs at the completion of every 256*8 instruction clock cycles.

As instruction clock = clock/4, an interrupt occurs at the completion of every 256*8*4 clock cycles.

So, the number of interrupts per second = 20Mz / (256*8*4)

INTERRUPTS_PER_SECOND = clock_frequency/(4 * prescalar_value * counter's(timer's) turnover value)

Automated People Counting & fan Controlling System

For our 3rd semester digital electronics module we chose this project.

The purpose of the project was to implement a system which can count the number of occupants in a closed area and control the speed of the fan according to the temperature. The implementation was carried out by three subsystems such as one system for occupant counting, one for temperature measurement and other to control the speed of fans. It was found out that this can be done using  basically IR sensors (Transmitters and Receivers), a temperature sensor and a micro controller. But this implementation was carried out under certain assumptions. Under those assumptions this system works in a reasonably precise manner and serves the purpose and can be used in real world applications which adheres  those assumptions. But this system can be further developed so that it can be used in any situation.

The micro controller we used was 16F877A. The temperature sensor was LM35DZ.   

Here I am not going to explain how the circuits were built. My contribution to the project was mainly programming the micro controller. I preferred PIC C. 

Since we had to do several tasks we had to decide how are we going to use the microcontroller to achieve the expected results. 

Basic algorithm we had in mind was,


Occupants counting algorithm 
  Emitters (Emitter1 and Emitter 2) emit IR signals, which are received by Receiver1 and Receiver 2 respectively. 
  At the time when there is no interrupt the receiver will receive the IR signal.
  When an interrupt is taken place that will be notified by the receiver.
  If the Receiver 1 notices an interruption first and then the Receiver 2 it indicates an entrance to the closed area.
  If the Receiver 2 notices an interruption first and then the Receiver 1 it indicates an exit from the closed area.
  The time delay (T) between the detection of an interrupt by Receiver 1 and Receiver 2(or Receiver 2 and Receiver 1) will determine the time taken to travel between two sensors.
  There is a ceiling value (T1) and a floor value (T2) for this time delay.
  For the accuracy movement is taken as an exit or an entrance only if T1 < T < T2.
  The increment or decrement of the counter is done according to the movement.

It was decided to use the B0 interrupt pin of 16F877A for people counting task.
But the problem was we had two IR beams but one interupt pin. So the solution was, connecting an XOR gate to the inputs from IR sensor circuit and connecting the gate's output to PIN B0, PIN B1 and PIN B2.
By this method we could successfully detect when a person enters or leaves. 

To get the analog input from temperature sensor, PIN A0 was used.

To control the fan(AC), we used phase controlling. 

Below is the source code. Hope to explain the project further.