Journal of Computer and Communications, 2014, 2, 90-98
Published Online March 2014 in SciRes.
How to cite this paper: Özcan, Ö. and Gündüz, M. (2014) Investigation and Implementation of a PIC-Based Sensor Node for
Wireless Sensor Networks. Journal of Computer and Communications, 2, 90-98.
Investigation and Implementation of a
PIC-Based Sensor Node for Wireless Sensor
Ömer Özcan1, Mesut Gündüz2
1Vocational School of Computer Technology, Selçuk University, Konya, Turkey
2Computer Engineering, Selçuk University, Konya, Turkey
Received Novemb er 20 13
The basic component of wireless sensor networks is sensor node, and it is one of the most investi-
gated complex issues in wireless sensor networks. Within this investigation concept, one of the
major topics focused on wireless sensor networks is designing sensor node equipment. In this
study, a new wireless sensor node design was proposed. In this design, a low-power PIC and a low-
power transceiver-receiver device were used. In order to connect various sensors to the node, an
expansion slot was designed. The software that runs on the microcontroller was written in the
PIC-C language, and it could be adapted for different routing algorithms and sensor types. So this
paper presents an alternative low cost and low powered sensor node design and implementation
for usage of the researchers and practitioners.
Sensor; Wireless Sensor Networks; Microcontrollers; RF Module
1. Introduction
In recent years, development of Micro-electro-mechanical systems (MEMS), wireless communication technolo-
gies and digital electronic developments and improvements of these technologies bring out the production and
funding of low-cost, low-power demanding multifunctional sensor nodes. A small mobile phone or a coin sized
these sensor nodes can communicate with each other or a base station. Ability of sensing, data processing, wire-
less communications, data storage and interoperability specifications have revealed the idea of wireless sensor
networks [1]. Figure 1 shows a sample wireless sensor network structure and additional equipments of the
structure. The most distinctive feature of the traditional wireless sensor networks is the ability of working toge-
ther. The data obtained by sensors can be shared between themselves and can be transferred to each other. The
feature of transmitting the data over each other allow low-power sensor nodes to transfer data in an environment
where many sensors exist [2].
In previous researches, Lo and Yang designed a sensor node for wireless sensor networks. In their design,
Ö. Özcan, M. Gündüz
they used Texas Instruments MSP430 microcontroller. MSP 430 has 12 bit ADC, 2 Kb RAM, 60 Kb flash
memory. This microcontroller needs 15 µW energy in sleep mode. They used Chipcon CC2420 wireless tran-
sceiver for communication. This sensor node has a 512 Kb external memory [8]. Lee and Huang designed a
sensor node for wireless sensor networks namely ITRI ZBnode. In their design, they used ARM 720 T micro-
controller. ARM 720 T has 10 bit ADC. In this design, an external 16 M RAM and an external 16 M flash
memory used. They used Chipcon CC2420 wireless transceiver for communication. ZBnode can be powered
with an AC adapter or a Li-ion battery with a DC input range from 3.5 to 5.5 V [9]. Körber et al. designed a PIC
18F452 based sensor node. PIC 18F452 has 32 Kb flash memory and 1.5 Kb RAM. In this sensor node, they
used TINYOS Operating System. They used TCM 120 wireless transceiver for communication [10].
In this study an alternative low cost, low powered sensor node was designed [11]. The rest of the paper orga-
nized as follows. Section 2 presents the hardware components of the designed sensor node. Section 3 describes
the software components of the designed sensor node. Section 4 concludes the paper.
2. PIC-Based Sensor Node Platform
The proposed system was composed of a PIC microcontroller, wireless transceiver modules, LED indicators and
a power regulator. Sensor or sensors could connect to the platform via the expansion slot. For examining the
system, a sht11 humidity sensor and a temperature sensor were connected to the system and then the system
evaluation procedure was carried out. Besides, both software and hardware structures of the system supports
other types of sensors. Figure 2 shows an image of the designed system.
Figure 1. Wireless sensor network.
Figure 2. PIC-based sensor node.
Ö. Özcan, M. Gündüz
2.1. Hardware
The sensor node uses a PIC chip which is Microchip 18F4620. This microcontroller has a 16-bit processor, sup-
ports 40 MHz external oscillator, has 36 input-output, 64 K Flash, 4 K RAM, 1 K EEPROM, 13-bit analog to
digital converter (ADC), 3 timers, pulse-width modulation (PWM), 1 EUSART (Enhanced Universal Synchro-
nous Asynchronous Receiver Transmitter) features [3]. In order to reduce the power consumption, no external
memory unit was used. Udea UFM-M11 was used as wireless transceiver unit. UFM-M11 works in 434 Mhz
band and can run on 10 different channels, and it can also operate at the speed of 9.6 Kbps [4]. It operates 2.7 -
3.3 V DC range. UFM-M11 was connected to the serial port of the microcontroller. Figure 3 shows the modular
view of the designed sensor node.
The detailed circuit drawing of the equipment, and the links in the designed system was shown in Figure 4.
J15 port in circuit diagram indicates expansion slot for the external sensor or sensors.
2.2. Power Management
The power unit which provides power to the sensor node unit was shown in Figure 5. 18F4620 microcontroller
can operate within the range of 2.0 - 5.5 V. UFM-M11 wireless transceiver unit can also operate within the
range 2.7 - 3.3 V. So the system works on 3 V because both UFM-M11 and microcontroller support this voltage.
In Table 1, the power consumption of the design was compared with the sensor nodes on the market. The
consumption data was measured while the system is running and reflects the maximum amount of consumption.
When operating at the maximum power, the power consumption would be high and the battery life would be
shorter. However, with the help of low-power routing algorithms and media access (MAC) protocols, consump-
tion would decrease and the battery life would be longer.
2.3. Medium Access Control (MAC)
During communication, media access protocol (MAC) determines the interaction with devices. MAC protocol
for wireless sensor networks has a special significance. The power consumption can be reduced due to the MAC
protocol so the sensor nodes with limited storage facilities, can use their memories better.
2.3.1. Timeout MAC (T-MAC)
This protocol is another derivative of the S-MAC protocol. In this protocol there is no regular sleep-wake cycle.
Sleeping operation takes place when the sensor node is unable to obtain data in a certain time. Waking can start
with start of sending data or when the sleeping time expires. Sensor nodes have a certain time limit for sleeping.
The sample demonstration could be given as in Figure 6.
2.3.2. Traffic Adaptive Medium Access Protocol (TRAMA)
In this protocol, sensors become synchronized by waiting each other. When the media is empty, the sensors have
access to the environment [7].
2.3.3. T-MAC and TRAMA Hybrid MAC
In this study, a hybrid MAC protocol was developed utilizing the T-MAC and TRAMA protocols. The proposed
Figure 3. Sensor node’s modular view.
Ö. Özcan, M. Gündüz
Figure 4. Hardware circuit design and links.
Ö. Özcan, M. Gündüz
Figure 5. Regulator.
Table 1. Comparative data on power consumption.
EnOcean TCM [5] Crossbow Mica2 [5] Telos [5] Our Platform
Microcontroller PIC 18F452 ATMEL 128 L TI MSP430 PIC 18F4620
Active Mod (mA) 13.40 8.90 1.70 10
Sleep (µA) 8.00 27.70 3.30 3.5
Tx (mA) 9.90 15.50 19.40 40
Rx (mA) 15.80 10.70 21.10 13
Input (V) 4.75 2.70 1.80 3
Data Rate (kbps) 120.00 38.40 250.00 9.6
Tx Output Power (dBm) 10.00 5.00 0.00 10.00
Tx Input /Tx Output 4.70 13.23 34.92 5.00
Rx sensitivity (dBm) 95.00 98.00 94.00 107.00
Figure 6. T-MAC protocol [6].
hybrid protocol was obtained by making changes on the T-MAC protocol. When the sensor node wakes up, it
does not start to send data, instead, it just waits until discharging of the medium. So the sensor node can adapt
itself to the traffic and it could also be possible to sleep sometimes then wake another times.
2.4. Routing Algorithm
Routing algorithm is one of the complex problems in wireless sensor networks. Routing algorithm determines
Ö. Özcan, M. Gündüz
the way the data will go through. Many proposals have been made to solve this problem. In this study flooding
algorithm was used. According to this algorithm, the data obtained with the sensing node is send to other sensors
through the border nodes as if the water flows. Illustrative demonstration of this process could be seen in Figure
3. Software
3.1. Microcontroller Software
All operations of the sensor nodes are managed by the software. To fulfill this task, the operating system had
been developed using the PIC-C language. The sensor node operating system was responsible to determine the
routing algorithm and the MAC protocol, sending data retrieval, data processing, reading data from analog and
digital sensors and memory management etc. Routing algorithm and MAC part of the Microcontroller software
has been discussed above. For wireless communication microcontroller software uses the packet structure as
shown in Table 2.
The microcontroller’s memory has capacity to store 1000 packets. The reason to store that much packet was
that if the network gets busy, the data should wait in the microcontroller’s memory. Figure 8 illustrates the hie-
rarchy in the data preparation and standby and Table 3 shows the memory information of running software on
the microcontroller.
Figure 7. Flooding algorithm.
Table 2. The data packet structure.
Sensor ID Data ID Data
1 byte 1 byte 1 byte
Ö. Özcan, M. Gündüz
Figure 8. Transferring the data to the sensors queue.
Table 3. The area covered by the program memory of
the microcontroller.
Used Total %
Program memory C35h(3125) 10000h byte 4.8%
Data memory C16h(3094) F80h byte 78.0%
EEPROM 0h 400h byte 0.0%
3.2. Monitoring Software
The data obtained from the wireless sensor network were stored in certain centers. Through these centers, the
obtained data could be observed and processed. Observation software had been developed for the sensor nodes.
With the developed software, the data could be observed and stored. Figure 9 shows the interface of this soft-
The communication between the computer the observation software and wireless sensor node was carried out
through USB. FT232 USB-UART interface integrated circuit was used for USB communication. Sensor nodes
connected to the network which appear in monitoring software could be shown in Figure 10.
The data collected from the network was stored for processing and displaying later. Figure 11 demonstrates
the recorded data.
In Table 4 the comparison data provided with the designed sensor node and the other sensor nodes are shown.
4. Conclusion
There are several studies utilized to solve the problems of wireless sensor networks. Several sensor nodes were
designed and implemented. Different needs have led to the design of different sensor nodes. To solve some of
these problems, there is a need for designing smaller sized sensor node. In some cases, the maximum battery life
becomes the first aim. In some applications, more memory space is needed. In some cases, more cost-effective
hardware and software are needed.
Ö. Özcan, M. Gündüz
Figure 9. Sensor monitoring software.
Figure 10. Image sensors are connected to the network application.
Figure 11. Recorded data.
Ö. Özcan, M. Gündüz
Table 4. Feature comparison of sensor nodes.
Our Platform Mica2 [5] Mica2Dot [5] Tmote Sky [5] Imote [5]
Microcontroller PIC 18F4620 Atmega128l Atmega128l MSP430F ARM7
Archictecture 16-Bit 8-Bit 8-Bit 16-Bit 32-Bit
Speed 40 MHz 7.3728 MHz 4 MHz 8 MHz 12 MHz
Program memory 64 KB 128 KB 128 KB 48 KB 512 KB
Data memory 1 KB 4 KB 4 KB 10 KB 11 KB
Storage memory 4 SRAM 512 KB 512 KB 1024 KB -
IO 36 51 18 16 30
Built-In sensors 2 2 2 5 -
Interface 3 LED 3 LED 1 LED 3 LED 1 Buton 1 LED
This article was produced from The Graduate School of Natural and Applied Science of Selçuk University mas-
ter thesis named A Pic Based Sensor Node Design for Wireless Sensor Networks. The authors wish to thank
The Scientific Projects Coordinatorship of Selcuk Universityfor their institutional supports.
[1] Intanagonwiwat, C., Govindan, R., Estrin, D., Hei demann, J. and Silva, F. (2003) Directed Diffusion for Wireless
Sensor Networking. IEEE Transactions on Networking, 11, 2-16.
[2] Akyildiz, I.F., Su, W., Sankarasubramaniam, Y. and Çayirci, E. (2002) A Survey on Sensor Networks. IEEE Commu-
nications Magazine, 40, 103-114.
[3] Microchip Technology Inc (2004) PIC18F2525/2620/4525/4620 Data Sheet.
[4] UDEA Wireless Technologies (2008) UFM-M11 Modem Modülürün Kılavuzu.
[5] Beutel, J. (2006) Metrics for Sensor Network Platforms. Proceedings of ACM Workshop on Real-World Wireless Sen-
sor Networks (REALWSN’06), New York, June 2006, 26-30.
[6] Çakıroğlu, M. (2010) Kablosuz Algılayıcı Ağlar.
[7] Karl, H. and Willig, A. (2005) Protocols and Architectures for Wireless Sensor Networks. John Wiley & Sons Ltd,
[8] Lo, B. and Huang, Y. (2005) Architecture Body for Sensor Net Works. Conference or Workshop Paper Perspective in
Pervasive Computing, London, 23-28.
[9] Lee, J. and Huang, Y. C. (2006) ITRI ZBnode: A ZigBee/IEEE 802.15.4 Platform for Wireless Sensor Networks. IE EE
Conference on Systems, Man, and Cybernetics, Taipei, October 2006, 15-20.
[10] Körber, H. J., Wattar, H., Scholl, G. and Heller, W. () Embedding a Microchip PIC18F452 Based Commercial Platform
into TinyOS. Real-World Wireless Sensor Networks (REALWSN’05), Stocholm, 101-102.
[11] Ozcan, Ö. (2011) A Pic Based Sensor Node Design for Wireless Sensor Networks. Master Dissertation, The Graduate
School of Natural and Applied Science of Selcuk University. (in Turkish)