Python based spy robot controlled over Ethernet using Raspberry pi

Aim of the project:

In this project we have developed a platform to remotely control surveillance robot controlled over Ethernet. It will enable us to monitor the activities in the remote and sensitive areas such as naxalite areas and etc.

In traditional security systems, monitoring devices are usually mounted on fixed locations. In such cases, we may use the proposed robotic system which will go into those areas and provide us with the photos of those locations. When someone enters such secured places, then PIR sensor senses it and immediately it will send an indication to the user. Meanwhile, the camera mounted on the robot will keep on capturing the photos from the surroundings to keep a record of the details of the incident happened and this is readily available to the user.

General Application of circuit:


In military it is mainly used in聽 boarder, in boarder it will monitor the聽 motion of enemies and it alerts the army and it also capture the photos of enemies and it will send the data with high security and聽 high speed聽 through Ethernet cable .Python based spy robot controlled over Ethernet using Raspberry pi


In banks it is mainly used in locker rooms for more security. If any motion is detected is in locker rooms it will聽 capture the photos聽 automatically .


Block diagram:

It聽is a聽family of聽computer networking聽technologies for聽local area networks聽(LANs) and metropolitan area networks聽(MANs). It was commercially introduced in 1980 and first standardized in 1983 as聽IEEE 802.3, and has since been refined to support higher聽bit rates聽and longer link distances. Over time, Ethernet has largely replaced competing wired LAN technologies such as聽token ring,聽FDDI, and聽ARCNET. The primary alternative for contemporary LANs is not a wired standard, but instead a wireless LAN standardized as聽IEEE 802.11聽and also known as聽Wi-Fi.

The聽Ethernet standards聽comprise several wiring and signaling variants of the聽OSI physical layer聽in use with Ethernet. The original聽10BASE5聽Ethernet used聽coaxial cable聽as a聽shared medium. Later the coaxial cables were replaced with聽twisted pair聽and聽fiber optic聽links in conjunction with聽hubs聽or聽switches. Over the course of its history, Ethernet data transfer rates have been increased from the original 3聽megabits per second聽(Mbit/s) to the latest 100聽gigabits per second聽(Gbit/s), with聽400 Gbit/s聽expected by early 2017

Systems communicating over Ethernet divide a stream of data into shorter pieces called聽frames. Each frame contains source and destination addresses and error-checking data so that damaged data can be detected and re-transmitted. As per the聽OSI model, Ethernet provides services up to and including the聽data link layer.

PIR sensor:-

An individual PIR sensor detects changes in the amount of infrared radiation impinging upon it, which varies depending on the temperature and surface characteristics of the objects in front of the sensor.]聽When an object, such as a聽human, passes in front of the background, such as a wall, the temperature at that point in the sensor's field of view will rise from聽room temperature聽to body temperature, and then back again. The sensor converts the resulting change in the incoming infrared radiation into a change in the output voltage, and this triggers the detection. Moving objects of similar temperature to the background but different surface characteristics may also have a different infrared emission pattern, and thus sometimes trigger the detector.

PIRs come in many configurations for a wide variety of applications. The most common models have numerous聽Fresnel lenses聽or mirror segments, an effective range of about ten meters (thirty feet), and a field of view less than 180 degrees. Models with wider fields of view, including 360 degrees, are available鈥攖ypically designed to mount on a ceiling. Some larger PIRs are made with single segment mirrors and can sense changes in infrared energy over one hundred feet away from the PIR. There are also PIRs designed with reversible orientation mirrors which allow either broad coverage (110掳 wide) or very narrow 鈥渃urtain鈥 coverage or with individually selectable segments to 鈥渟hape鈥 the coverage.

Raspberry pi:-

The聽Raspberry Pi聽is a series of聽credit card-sized聽single-board computers聽developed in the聽UK聽by the聽Raspberry Pi Foundation聽with the intention of promoting the teaching of basic聽computer聽 science聽in schools.

The original Raspberry Pi is based on the聽Broadcom聽BCM2835聽system on a chip聽(SoC), which includes an聽ARM1176JZF-S700聽MHz聽processor,聽Video Core聽IV GPU,聽and was originally shipped with 256聽megabytes of聽RAM, later upgraded (models B and B+) to 512聽MB.聽The system has聽Secure Digital聽(SD) (models A and B) or Micro-SD (models A+ and B+) sockets for boot media and persistent storage. In 2014, the Raspberry Pi Foundation launched the聽Compute Module, which packages a BCM2835 with 512聽MB RAM and MMC聽flash chip into a module for use as a part of embedded systems.

Pi camera:-

The Raspberry Pi Camera Module is a custom designed add-on for Raspberry Pi. It attaches to Raspberry Pi by way of one of the two small sockets on the board upper surface. This interface uses the dedicated CSI interface, which was designed especially for interfacing to cameras. The CSI bus is capable of extremely high data rates, and it exclusively carries pixel data.

The board itself is tiny, at around 25mm x 20mm x 9mm. It also weighs just over 3g, making it perfect for mobile or other applications where size and weight are important. It connects to Raspberry Pi by way of a short ribbon cable. The camera is connected to the BCM2835 processor on the Pi via the CSI bus, a higher bandwidth link which carries pixel data from the camera back to the processor. This bus travels along the ribbon cable that attaches the camera board to the Pi.the sensor itself has a native resolution of 5 megapixel, and has a fixed focus lens onboard. In terms of still images, the camera is capable of 2592 x 1944 pixel static images, and also supports 1080p30, 720p60 and 640x480p60/90 video.

8051 microcontroller:-

The Intel 8051 microcontroller is one of the most popular general purpose microcontrollers in use today. The success of the Intel 8051 spawned a number of clones which are collectively referred to as the MCS-51 family of microcontrollers, which includes chips from vendors such as Atmel, Philips, Infineon, and Texas Instruments.

About聽 8051

The Intel 8051 is an 8-bit microcontroller which means that most available operations are limited to 8 bits. There are 3 basic 鈥渟izes鈥 of the 8051: Short, Standard, and Extended. The Short and Standard chips are often available in DIP (dual in-line package) form, but the Extended 8051 models often have a different form factor, and are not 鈥渄rop-in compatible鈥. All these things are called 8051 because they can all be programmed using 8051 assembly language, and they all share certain features (although the different models all have their own special features Some of the features that have made the 8051 popular are:

路聽聽聽聽聽聽聽聽 4 KB on chip program memory.
路聽聽聽聽聽聽聽聽 128 bytes on chip data memory(RAM)

[ 32 bank reg + 16 bit addressable reg + 80 general purpose reg ]

路 聽 聽4 reg banks.

路 聽 128 user defined software flags.

路 聽 8-bit data bus

路 聽 16-bit address bus

路 聽 16 bit timers (usually 2, but may have more, or less).

路 聽 聽3 internal and 2 external interrupts.

路 聽 聽Bit as well as byte addressable RAM area of 16 bytes.

路 聽 聽Four 8-bit ports, (short models have two 8-bit ports).

路 聽 16-bit program counter and data pointer.

路 聽 1 Microsecond instruction cycle with 12 MHz Crystal.

8051 models may also have a number of special, model-specific features, such as UART, ADC,.

Pin diagram of the 8051 DIP

Basic Pins

PIN 9: PIN 9 is the reset pin which is used to reset the microcontroller鈥檚 internal registers and ports upon starting up. (Pin should be held high for 2 machine cycles.)

PINS 18 & 19: The 8051 has a built-in oscillator amplifier hence we need to only connect a crystal at these pins to provide clock pulses to the circuit.

PIN 40 and 20: Pins 40 and 20 are VCC and ground respectively. The 8051 chip needs +5V 500mA to function properly, although there are lower powered versions like the Atmel 2051 which is a scaled down version of the 8051 which runs on +3V.

PINS 29, 30 & 31: As described in the features of the 8051, this chip contains a built-in flash memory. In order to program this we need to supply a voltage of +12V at pin 31. If external memory is connected then PIN 31, also called EA/VPP, should be connected to ground to indicate the presence of external memory. PIN 30 is called ALE (address latch enable), which is used when multiple memory chips are connected to the controller and only one of them needs to be selected. We will deal with this in depth in the later chapters. PIN 29 is called PSEN. This is 鈥減rogram store enable鈥. In order to use the external memory it is required to provide the low voltage (0) on both PSEN and EA pins.


There are 4 8-bit ports: P0, P1, P2 and P3.

PORT P1 (Pins 1 to 8): The port P1 is a general purpose input/output port which can be used for a variety of interfacing tasks. The other ports P0, P2 and P3 have dual roles or additional functions associated with them based upon the context of their usage.The port 1 output buffers can sink/source four TTL inputs. When 1s are written to portn1 pins are pulled high by the internal pull-ups and can be used as inputs.

PORT P3 (Pins 10 to 17): PORT P3 acts as a normal IO port, but Port P3 has additional functions such as, serial transmit and receive pins, 2 external interrupt pins, 2 external counter inputs, read and write pins for memory access.

PORT P2 (pins 21 to 28): PORT P2 can also be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P2 will act as an address bus in conjunction with PORT P0 to access external memory. PORT P2 acts as A8-A15, as can be seen from fig 1.1

PORT P0 (pins 32 to 39)聽PORT P0 can be used as a general purpose 8 bit port when no external memory is present, but if external memory access is required then PORT P0 acts as a multiplexed address and data bus that can be used to access external memory in conjunction with PORT P2. P0 acts as AD0-AD7, as can be seen from fig 1.1

PORT P10: asynchronous communication input or Serial synchronous communication output

Features of raspberry pi:

The model B+ is the final revision of the original Raspberry pi. It replaced the model B in July 2014 and was superseded by the Raspberry Pi聽 2聽 Model B in February 2015. Compared to the Model B it has:

路聽聽聽More GPIO. The GPIO header has grown to 40 pins, while retaining the same pin out for the first 26 pins as the Model A and B.

路聽聽聽More USB. We now have 4 USB 2.0 ports, compared to 2 on the Model B, and better hot plug and over current behavior.

路聽聽聽Micro SD. The old friction 鈥揻it SD card socket has been replaced with much nicer push 鈥損ush micro SD version.

路聽聽聽Lower power consumption. By replacing linear regulator with switching ones we鈥榲e reduced power consumption by between 0.5W and 1W.

路聽聽聽Better audio. The audio circuit incorporates a dedicated low 鈥搉oise power supply.

路聽聽聽Neater form factor .we鈥榲e aligned the USB connectors with the board edge ,moved composite video onto聽 3.5mm jack, and added four squarely-placed mounting holes.

The Model B+ is perfectly suited for use in schools : it offers more flexibility for learners than the learner Model A or A+,which are more useful for embedded projects and projects which require very low power, and has more USB ports than the Model B.Python based spy robot controlled over Ethernet using Raspberry pi schematic


A聽DC motor聽is any of a class of electrical machines that converts direct current electrical power into mechanical power. The most common types rely on the forces produced by magnetic fields. Nearly all types of DC motors have some internal mechanism, either electromechanical or electronic, to periodically change the direction of current flow in part of the motor. Most types produce rotary motion; a linear motor directly produces force and motion in a straight line.

DC motors were the first type widely used, since they could be powered from existing direct-current lighting power distribution systems. A DC motor's speed can be controlled over a wide range, using either a variable supply voltage or by changing the strength of current in its field windings. Small DC motors are used in tools, toys, and appliances.

Working of the circuit:-

Raspberry pi consist internally python IDE tool. We use this tool we write the code for control the pi camera,pir sensor and motors. in this pir sensor activate i.e. if any motion is detected the pi camera automatically capture the images and displayed on screen. for control the robot a GUI is designed .click the required button in GUI for the motion of the robot. the raspberry pi give the instructions to the AT89S52 microcontroller and the controller will control the related moving task and display the lcd display to the status of robot.


For more detail: Python based spy robot controlled over Ethernet using Raspberry pi

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top