Hi hello Electronics Lovers, today I bring something new and interesting for you guys. In this tutorial, I will show you how to make an Electronic Bat by Using Arduino ide and development software tool for coding known as Processing. This is a “do it yourself project” I have explained everything in a clear and easy way.

“The theme of this project is to detect objects in space or ground for surveillance purposes. Whenever an object is detected by ultrasonic sensors, it will make an alert sound and will display distance and angle of the targeted object right on your Computer screen.”

Novelty in this project:

Hopefully, everyone who is reading this article right now must be aware of how SONAR and Radar works, if you are new and don’t know anything about radar then must read basics of radar here.

Building the device:

As you people can see that I have connected Trigger pins of the two attached Ultrasonic Sensors to the Pin No 10 of the Arduino Uno Board. Echo Pins of the Distance sensors have been connected to the pin No 11 of the Arduino Board.

I have connected Control wire (yellow) of the Servomotor to the Pin No 12 of the Arduino Board.

External Power for Arduino:

As we can see that this project is truly based on serial communication between Arduino IDE and Processing Code software. For serial communication, we will connect our Arduino Board to the PC through USB cable. Yes everyone knows that we can give power to our Arduino Board directly from the PC through the USB cable without using an external power supply. T his is perfect but in this case, you are using servo motor and of course, it will require more current to operate accurately.

First, you need to Turn on your Arduino board by using your pc but if you found that the movement of the servo motor is slow or laggy or irregular then use an external power supply to the jack of the Arduino or Vin pin (Do not unplug USB cable). I am going to clear one thing, many students and hobbyists are still confused and think that their Arduino board will blow away if they use the External power supply at the same time when Arduino board is connected to the pc through USB cable. This statement is totally wrong, you can give power to the Arduino board by using both sources at the same time and Arduino board is intelligent device it will choose the best input power having more current as compared to the other one.

Source code: