You have no items in your shopping cart.

Subtotal: 0.00


This Project implements obstacle avoidance on the air when dish antenna is receiving signal from space station. The purpose of this project is to continuously receive satellite signals by sensing the interfering object and change the direction of reception. The project was implemented with the help of Spartan3an FPGA Starter Kit, Spartan3an interfacing card with stepper motor interface and Ultrasonic Sensor.

demonstration Video


Tool required


  • Xilinx ISE 11.1i


  • VHDL


Block Diagram for Ultrasonic based dish antenna Obstacle detection using Spartan3an FPGA Starter Kit

Block Diagram

Interfacing stepper motor with Spartan3an Starter Kit

The motor is used to covert mechanical energy into electrical energy. Stepper motor is not like as any other motor which means is not rotating continuously. It is rotating step by step according to given electrical pulse. The Spartan3an FPGA Starter Kit cannot drive stepper motor directly. Because of the I/O capability of FPGA is 3.3v. So for the driver circuit are required able to drive the stepper motor. A full rotation divides into a number of equal steps. So this motor called as also stepper motor.

Stepper motor driver

The voltage capability of FPGA GPIO is only 3.3v standard logic level. So the FPGA output cannot drive the stepper motor with 3.3v. Hence the driver circuit is needed to energize the stepper motor. Here the driver circuit helps to increase the output voltage of FPGA for stepper motor that voltage often called as bus voltage. The driver controller circuit provides step and direction output as an electrical signal to the step motor. The rated voltage of driver circuit must be five to ten times of stepper motor rating voltage. Because of the driver output is related to the speed versus torque of stepper motor. Therefore if output increases, the speed of the stepper motor will increase and if the output decreases, the speed of the stepper motor will decrease. On the other hand the driver circuit current should be limited to the step motor current rating.

Stepper motor driver

Ultrasonic Sensor Interface

Non Blind Zone Ultrasonic Module SDM-IO is a stable and measure the distance accurately ultrasonic module which provides 0cm - 1500mm non-contact measurement function, the ranging accuracy can reach to 3mm. Its performance can compare with SRF05/SRF02 ultrasonic distance measuring module, also it has non-blind (From 0-1cm the measurement results are not accurate when we test, but more than 1cm are accurate) design and fast response

Stepper Motor Interface with Spartan3an Starter Kit

Stepper Motor Interface

Ultrasonic based dish antenna Obstacle detection Output Image

Ultrasonic based dish antenna Obstacle detection using Spartan3an


              Ultrasonic based dish antenna Obstacle detection using Spartan3an


Ultrasonic based dish antenna Obstacle detection using Spartan3an


Ultrasonic based dish antenna Obstacle detection using Spartan3an


Ultrasonic based dish antenna Obstacle detection using Spartan3an

Source Code

VHDL Code for Ultrasonic based obstrucle avoidance

library IEEE;

entity sonar is
    Port ( clk        : in  STD_LOGIC;
	        buzzer : out STD_LOGIC;
           sonar_trig : out STD_LOGIC;
           sonar_echo : in  STD_LOGIC;
           count1 : out  STD_LOGIC_vector(3 downto 0));
end sonar;

architecture Behavioral of sonar is
    signal count            : unsigned(16 downto 0) := (others => '0');
    signal centimeters      : unsigned(15 downto 0) := (others => '0');
    signal centimeters_ones : unsigned(3 downto 0)  := (others => '0');
    signal centimeters_tens : unsigned(3 downto 0)  := (others => '0');
    signal output_ones      : unsigned(3 downto 0)  := (others => '0');
    signal output_tens      : unsigned(3 downto 0)  := (others => '0');
    signal echo_last        : std_logic := '0';
    signal echo_synced      : std_logic := '0';
    signal echo_unsynced    : std_logic := '0';
    signal waiting          : std_logic := '0'; 
	 type state1 is (a0,a1);   
	 signal ps1 : state1 := a0;
	 signal s_count:std_logic_vector(3 downto 0);


        if rising_edge(clk) then
            if waiting = '0' then
                if count = 500 then -- Assumes 100MHz
                   -- After 10us then go into waiting mode
                   sonar_trig <= '0';
                   waiting    <= '1';
                   count       <= (others => '0');
                   sonar_trig <= '1';
                   count <= count+1;
                end if;
            elsif echo_last = '0' and echo_synced = '1' then
                -- Seen rising edge - start count
                count       <= (others => '0');
                centimeters <= (others => '0');
                centimeters_ones <= (others => '0');
                centimeters_tens <= (others => '0');
            elsif echo_last = '1' and echo_synced = '0' then
                -- Seen falling edge, so capture count
--                led <= std_logic_vector(centimeters);
                output_ones <= centimeters_ones; 
                output_tens <= centimeters_tens; 
            elsif count = 2900*2 -1 then
                -- advance the counter
					 if centimeters_tens = 0 and centimeters_ones < 9 then
						 buzzer <= '1';
						 buzzer <= '0';
					 end if;
                if centimeters_ones = 9 then
                    centimeters_ones <= (others => '0');
                    centimeters_tens <= centimeters_tens + 1;
                    centimeters_ones <= centimeters_ones + 1;
                end if;
                centimeters <= centimeters + 1;
                count <= (others => '0');
                if centimeters = 3448 then
                    -- time out - send another pulse
                    waiting <= '0';
                end if;
                count <= count + 1;                
            end if;

            echo_last     <= echo_synced;
            echo_synced   <= echo_unsynced;
            echo_unsynced <= sonar_echo;
        end if;
    end process;
variable j,k,l,m:integer:=0;
if rising_edge(clk) then

	end if;

	end if;

	end if;

		if k 

User Constraint File for Obstacle avoidance VHDL Code

NET "clk" LOC = P57;
NET "count1" LOC = P41; 
NET "count1" LOC = P42; 
NET "count1" LOC = P43;
NET "count1" LOC = P44; 
NET "UltraSonic_trig" LOC = P92;
NET "UltraSonic_echo" LOC = P91; 


The Ultrasonic Based dish antenna obstacle detection using Spartan3an FPGA Starter Kit is successfully completed using Spartan3an Starter Kit, Spartan3an Add-on card, Stepper Motor, Ultra Sonic Sensor.