using a tft lcd to move a servo price

This project’s aim is to design a display interface for controlling a Servo motor. The Servo angle or position is changed either by dragging or pressing the button on the LCD display interface. The interface is built on a 4.3-inch touch display and programmed using an STM32 development board.
The serial screen is a type of screen that is controlled by the serial port. This screen saves a lot of time as it requires no programming and is perfect for those who use microcontrollers in designing the UI. By using this screen, you can get some common spaces through simple settings and there is no need to write the code for the UI implementation.
First of all, the interface of the serial port screen is designed. You can design a picture of the same using paint or any other similar tool. For each key effect, a particular image should be designed. For example, here I have designed separate display pictures for the separate key effect:
The original image is displayed when the screen is turned ON. In other words, it is the foreground display picture. Whereas the second picture with the corresponding position is displayed when the +ve or -ve position buttons are pressed.
This project is made by using hand to hand connections. The display, microcontroller board, and stepper motor are connected together by using jumper wires. To make this project more reliable, sturdy, and permanent, I suggest you use a custom made PCB board from PCBWay. They provide high-quality PCBs at a very low price.
After installing the software, open it, and create a new project. Since the resolution of the display screen is 480×272 px, select this resolution in the project details. I want to use the screen horizontally, so all other options are set to default.
Add the designed picture you want to use in the GUI. The picture name must start with a number, although there are no special requirements for the specified number. The size of the picture should be consistent with your screen resolution, otherwise, it will prompt an error.
Here I have added the two pictures, the default or foreground display picture is named as number 2. For this, I changed the screen settings inside the startup picture display. In this setting, the startup display picture corresponds to picture number 2.
On the right side of the interface, there is a hotkey area where you need to modify the storage address and the adjustment method. For the same operation or function of the -ve side, the storage address is made the same as the + address.
Under the variable configuration column, select the slider scale. In the right column, modify the slider file and slider icon properties that you want to display over the image.
Adjust the size of the slider scale control so that it fits your scale value. But keep in mind that the icon may exceed the lower scale. So, you can control the slider scale control by adjusting the size of the slider scale control. Or adjust the offset of X coordinate to align it, try to generate a project to debug it to see if the position is suitable.
There are other properties of the sliding scale control that need to be modified: the stored address corresponds to the +ve and -ve address and the minimum and maximum scale corresponding to the scale bar at the bottom.
In the touch configuration toolbar drop-down menu, select the drag adjustment to place over the picture. Now adjusts it to the appropriate size and modify its properties. The storage address is still consistent with the above but the maximum and minimum value range needs to be adjusted.
Add a data variable and the data should be stored at the same address as above. This is mainly to display the data and to better observe the changes in the data.
After completing this step, you can download or run the simulation test. If there are no problems with the design of the serial screen, move on to write the microcontroller program.
I used STM32cube IDE software to write the program for the board. But before that, the configuration setting should be selected for STM32, and I’ll give a brief description of the configuration here.
Open tim2 ch1 channel output PWM wave. The minimum adjustment is 1us for accuracy. The servo adjustment is 0° – 270° corresponding to the pulse of 0.5ms-2.5ms. After the configuration is complete, select the output frequency of 100K PWM wave.
Open the serial port 1. Here I used the DMA, mainly a matter of habit, there is this more advanced configuration on the use of it. Get used to the future of the project also helps ah! The images given below are the screenshot of the configuration information. And after the completion of the configuration, you can generate code.
After the configuration is completed, you have to add the code. All you have to do is add the array and the serial port receives the completion flag data.
c) In a regular project, the serial port processing function should be handled separately. But we don’t do it here because our function is relatively simple.
After the completion of the entire project, compile and download the code to the board. It should be noted that the screen communication connections are of 232 and TTL types. My board is not connected to 232, so it is directly connected to the IO port. Here on the screen, there are J17 solder joints that need to be welded open.
And the project is complete. The entire UI design is based on the picture. The MCU development was relatively simple as the serial port is used which greatly reduces the burden on the developers.

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.
![]()
This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

I can do the soldering if I have to. I also agree that the TFT should be mounted on the Mega. I can hardwire this shield and mount it remotely if I need to.
I have connected the motor shield to the Mega and confirmed correct operation of a piece of example code and then manually connected all the digital pins except 13. I also connected +5V and 0V for power and it sort of works but not correctly. just vibrates the stepper motor and moves a little bit where it should do a full revolution as part of the test code.

This website is using a security service to protect itself from online attacks. The action you just performed triggered the security solution. There are several actions that could trigger this block including submitting a certain word or phrase, a SQL command or malformed data.

Today I’ll show how you can control a servo with Visual basic. Before this project I’ve never used Visual basic so if anyone finds any mistake in my code please leave a comment here and help me improve it.
I’ve always used the Serial Monitor of the Arduino IDE to communicate with the Arduino, but today we will use a visual basic program that I’ve created. Basically in the VB program we have 4 buttons that will interact with the Arduino when we press them.
I’ll be showing program in Visual Basic that allows the user to rotate a servo attached to the Arduino. You need to make 3 connections from the servo to your arduino:
Thanks for reading, you can contact me by leaving a comment. If you like this post probably you might like my next ones, so please support me by subscribing my blog and my Facebook Page.

Let’s take a look into a simple interfacing project this time. This is actuator interfacing with Arduino Uno and the actuator being servo motor, specifically SG90 servo motor. SG90 is a lightweight (just 9g) and tiny servo motor which has quite good output toque. We can use Arduino IDE to code this servo and control its movements precisely. We can rotate 180 with this servo motor.
This project uses SG90 servo motor interfaced with Arduino Uno which is programed to turn the servo motor from 0 degrees to 180 degrees and back to 0 degrees.
For demo purposes, with zero load on the servo motor, we are powering the servo motor using Arduino 5V pin. But it is important to keep in mind that the motor should be powered separately. This servo motor has input voltage of 4.8V to 6V DC. It is recommended that the servo motor should be powered externally (using a dedicated power supply) and the voltage should be within the accepted range. The maximum current draw from Arduino is 0.8A only. So when we use an external power supply, it will make sure that the Arduino board won’t be damaged due to excess current draw.
There is a common problem when dealing with SG90 (or even MG90S) that is the overshooting or undershooting. This is a problem has a bit to do with Control Systems. In general, we can say, the systems that are overdamped miss the target value, that causes the “undershoot”. This means, the servo would not really reach 0 to 180 degrees or other specified value. Whereas those systems that are underdamped go over the target. This causes the situation to “overshoot”. This is when the servo motor exceeds the specified degree and sweeps more area than it is supposed to do.
There are a couple of fixes available online for this overshoot/undershoot problem. You could use a better servo motor like “Tower pro MG 995” servos. This is not a micro servo like SG90 but it is more precise and it can also deliver more power. There are other servo motors that are used for model aircraft building; they are known to be more precise. They give very good results but are quite expensive. If you really want to use SG90 servo motor only and get precise degree turn, then, consider the following points to get better results:
The circuit connections for this project are very simple as the servo motor has only 3 pins. The red wire of the servo goes to 5V pin of Arduino Uno. The Black wire of the servo goes to Arduino Uno’s ground pin (GND). And the yellow wire (called the control pin of servo) goes to Arduino pin 8. This completes the circuit connections of the servo motor with Arduino Uno.
First, we need to include a library called “Servo.h” to be able to control various servo motors. If you don’t already have this library in your Arduino IDE, then you can go to “tools” à “Manage Libraries…” and type “Servo” in the Library Manager and install the one from “Michael Margolis, Arduino”.
Next, we declare a variable called “servo”. In void setup function, we use the servo.attach function to tell the Arduino board that the control pin of the servo motor is attached to pin 8 of Arduino (the function attaches the servo variable to the pin). The servo.write function is used to tell the servo the degree to which it should turn. At the beginning the default state of servo is considered as zero degree we keep this as origin position that is zero degrees. So we write servo.write(0). Then a delay function is used to create a delay of 2ms.
Next, in void loop, we use the servo.write function again to tell the servo to turn to 180 degrees and the delay function will hold this position for 1ms. Then the servo is instructed again to go back to 0 degrees, as we had initialized before. The delay function will hold this position for 1ms. This is repeated until the power is disconnected or servo is disconnected.
This is a beginner friendly project. It focuses on controlling an actuator, SG90 Servo motor, using Arduino Uno and Arduino IDE. It provides a strong basic foundation in dealing with actuators and helps beginners jump into more fun with actuators.

Let’s take a look into a simple interfacing project this time. This is actuator interfacing with Arduino Uno and the actuator being servo motor, specifically SG90 servo motor. SG90 is a lightweight (just 9g) and tiny servo motor which has quite good output toque. We can use Arduino IDE to code this servo and control its movements precisely. We can rotate 180 with this servo motor.
This project uses SG90 servo motor interfaced with Arduino Uno which is programed to turn the servo motor from 0 degrees to 180 degrees and back to 0 degrees.
For demo purposes, with zero load on the servo motor, we are powering the servo motor using Arduino 5V pin. But it is important to keep in mind that the motor should be powered separately. This servo motor has input voltage of 4.8V to 6V DC. It is recommended that the servo motor should be powered externally (using a dedicated power supply) and the voltage should be within the accepted range. The maximum current draw from Arduino is 0.8A only. So when we use an external power supply, it will make sure that the Arduino board won’t be damaged due to excess current draw.
There is a common problem when dealing with SG90 (or even MG90S) that is the overshooting or undershooting. This is a problem has a bit to do with Control Systems. In general, we can say, the systems that are overdamped miss the target value, that causes the “undershoot”. This means, the servo would not really reach 0 to 180 degrees or other specified value. Whereas those systems that are underdamped go over the target. This causes the situation to “overshoot”. This is when the servo motor exceeds the specified degree and sweeps more area than it is supposed to do.
There are a couple of fixes available online for this overshoot/undershoot problem. You could use a better servo motor like “Tower pro MG 995” servos. This is not a micro servo like SG90 but it is more precise and it can also deliver more power. There are other servo motors that are used for model aircraft building; they are known to be more precise. They give very good results but are quite expensive. If you really want to use SG90 servo motor only and get precise degree turn, then, consider the following points to get better results:
The circuit connections for this project are very simple as the servo motor has only 3 pins. The red wire of the servo goes to 5V pin of Arduino Uno. The Black wire of the servo goes to Arduino Uno’s ground pin (GND). And the yellow wire (called the control pin of servo) goes to Arduino pin 8. This completes the circuit connections of the servo motor with Arduino Uno.
First, we need to include a library called “Servo.h” to be able to control various servo motors. If you don’t already have this library in your Arduino IDE, then you can go to “tools” à “Manage Libraries…” and type “Servo” in the Library Manager and install the one from “Michael Margolis, Arduino”.
Next, we declare a variable called “servo”. In void setup function, we use the servo.attach function to tell the Arduino board that the control pin of the servo motor is attached to pin 8 of Arduino (the function attaches the servo variable to the pin). The servo.write function is used to tell the servo the degree to which it should turn. At the beginning the default state of servo is considered as zero degree we keep this as origin position that is zero degrees. So we write servo.write(0). Then a delay function is used to create a delay of 2ms.
Next, in void loop, we use the servo.write function again to tell the servo to turn to 180 degrees and the delay function will hold this position for 1ms. Then the servo is instructed again to go back to 0 degrees, as we had initialized before. The delay function will hold this position for 1ms. This is repeated until the power is disconnected or servo is disconnected.
This is a beginner friendly project. It focuses on controlling an actuator, SG90 Servo motor, using Arduino Uno and Arduino IDE. It provides a strong basic foundation in dealing with actuators and helps beginners jump into more fun with actuators.

This repository contains the class workshops for the class. Each workshop has a folder as well as the final project. This repo contains mobile robots geometric models development, its digital model and construction in ROS and Gazebo, machine vision algorithms, trajectory control and a vision-based user following robot.

This repository contains the class workshops for the class. Each workshop has a folder as well as the final project. This repo contains mobile robots geometric models development, its digital model and construction in ROS and Gazebo, machine vision algorithms, trajectory control and a vision-based user following robot.

This tutorial is a part of series of tutorials on pwm(pulse width modulation) signal generation with stm32f103 microcontroller. Previously we looked upon how to generate pwm signal with stm32 microcontroller using keil uvision 5 ide and stm32cubemx code configurator. We moved forward on generating variable pwm signal using internal timers of stm32f103 microcontroller. We studied about generating pwm, now its time to put it in to practical and control a peripheral with the pwm signal. I decided to control a simple toy servo motor with stm32f103 microcontroller. I used two servo motors in the project for testing the code. First i used tower pro SG-90 servo motor. This motor does well but it did not move its arm at right position there is always some degrees of tolerance in actual results. You can buy one at fairly $3 price. Another motor which i just tested is HS-785HB it properly turns but requires more power(current). For this tutorial i recomend to use tower pro sg90 servo motor due to lower power consumption and simplicity.
Servo motors are small motors unlike size they possess greater torque and can move heavy loads. Their small size possessing high torque made them popular among toy makers. Many toys that are around us contains servo motors in them along with dc motors. Normally servo motors in ideal state consumes little power but during load moving power shoots off and servos start consuming greater amount of current.
Servo motors works on pwm(pulse width modulated) signals. They have an arm/armature which rotates when sufficient voltage, current and pwm signal is applied to motor. When arm rotates it moves every thing that comes in its ways.
Not every servo motor can move heavy loads. It depends on their specifications and details. Normally toy servo motors can move loads from 1 kg up to 12 kg. Their are two types of servo motors DC and AC. Ac servo motors can move even mush heavier loads they are used in industrial applications. DC servo motors are best for small projects. In this project i am also using a DC servo motor with stm32 microcontroller.
As you learned servo motors work on pwm signal. Most of the dc servo motors require 50 Hz frequency for operation with variable duty cycle. Below is the standard requirement wave forms. Our motor also require the same pattern.
At period 20 milli seconds and duty cycle 2 milli seconds servo motor arm moves to 180 degree. At duty cycle 1.5 milli seconds arm moves to 90 degree and at duty cycle 1 milli seconds arm rotates to 0 degree.
I am going to interface servo with stm32f103c8t6 microcontroller. I purchased a pre assembled and cheap board which mounts the microcontroller on it. For rotating the arm of servo motor three pins of microcontroller are used as input. For outputting pwm signal one pin is used. Port-A pins 0,1 and 2 are used as inputs and Port-B pin#6 is used to output the pwm signal.
Stm32f103 microcontroller works on 3.3 volts where as servo motor tower pro sg90 works on 5 volts. So both modules motor and microcontroller must be powered with different power sources. We can not drive servo directly with stm32 output pwm signal because its in 3.3v wave form and motor requires 5v. I inserted a circuit in between the two modules to converted 3.3v to 5v. First transistor is converting the input signal to output 5v but the signal is inverted. Another transistor inverts the inverted signal and brings it back to original logic. So now 3.3v at input cross-ponds to 5v at output to servo motor.
In the above circuit make sure to common the grounds of both motor and microcontroller power supply. You can also use ULN2003 IC here instead of the two transistors. ULN2003 contains the same circuit in it with fly wheeling diodes.
I am going to output pwm signal on PB6. For this you have to do some settings in stm32cubemx ide. Like selecting the channel and configuring some other things. Before moving any forward i would like you to take a simple tutorial on pwm pin selection and duty cycle calculation formula.
The above tutorial is very important to understand the code flow and settings below. Internal stm32 microcontroller oscillator is used in the project. Though the board has an external 8 MHz oscillator but i preferred to use internal. Final clock to timer 4 is 1 MHz.
Then i calculated the values for counter register and other values required to input in the timer-4 configuration. You can see the formula and other values calculations in the above tutorial.
My counter period is 1000. It means at 1000 the pwm duty cycle will be 100% with period 20 milli seconds or 50 Hz frequency. At 500 pwm duty cycle will be 50% which translates to 10 milli seconds. At 5% it will be 1 milli second and at 10% it will be 2 milli seconds and at 7.5% it will be 1.5 milli seconds.
This counter value is used in code to move the servo motor arm. Below is the code.When button-3 is pressed motor moves to 180 degrees. When button-2 is pressed button rotates to 90 degree and when button-1 is pressed it comes back to 0 degrees.
Download the project code. Code is written in keil uvision 5 ide. Stm32cubemx is used for microcontroller configuration. Code folder contains all keil and stm32cubemx files. Code is open source you can modify and use it according to your needs. Please provide us your feed back on the project.

Herkulex DRS-0101 is state of the art modular smart servos incorporating motor, gear reducer, control circutry and communications capability in one single package.
Equipped with a lot of adapting pieces including Horn, Horn Bolt(BHT 2.6X8), Wheel Horn Bushing, Wheel Horn Washer, Wheel Horn Bolt(PHM 3X8), Cable Guard, I-type Joint, L-type Joint, L-type Joint(Single Nut), Bracket Bolt(PHT 2X5), Joint Bolt(PHM 2X5), Wire Harness(200mm) and with it"s amazing structure, DRS-0101 is extremely easy to assemble. Two connectors attached to each servo allows serial connection as well as parallel connection if required.
It carries different Control Algorithms like PID, Feedforward, Trapezoidal Velocity Profile so on and so forth, which makes the movement smoothly and precisely. By Using UART Serial communications ,we can lightly change the speed, position, LED, operational compliance, stop and operational status of up to 254 servos simultaneoulsy at once. Meanwhile we can get the feedback such as internal temperature, position, and overload sensors.
Servos are capable of diagnosing seven different types of errors which are then indicated by the LED. And we can directly control the RGB of the LED for diagnostics and decorative purposes. It"s especially suitable to mechanical arms, robots, joints and etc.
Various Control Algorithm: PID, Feedforward, Trapezoidal Velocity Profile, Velocity Override, Torque Saturator & Offset, Overload Protection, Neutral Calibration, Dead Zone
Tips: There is only one Hardware Serial port on UNO, so that Software Serial has to be used. However, the default baud rate of HerkuleX is up to 115200, which may be unstable when using the Software Serial. Thus it"s recommended to change the baud rate of HerkuleX to 57600 first.

Veyron Servo Driver (24-Channel) is a multiple servo controller, especially designed for humanoid robots, spider robots, robotic arms, and many other likewise applications. The controller integrates wireless data transmission interface, which is fully compatible with DFRobot Bluetooth module, APC220 wireless data transmission module and Xbee module. The controlling modes include real-time, timer, constant speed. Veyron Servo Driver (24-Channel) is the most powerful Mirco USB servo driver with high reliability on the market. It uses a high-performance, low-power STM32F103 microcontroller as its core control unit, which has a powerful, fast execution speed, high accuracy, strong I / O drive power. It supports Futaba, Hitec, Fraser and most common servos. The servo control range could be 0 ~ 180 ° (for 360 ° continuous rotation, retrofitting is needed); It has two servo control modes: single servo control, group servo control. In group control mode, the same group can be coordinated automatically with start and stop at the same time. It will be very useful in multi-DOF biomimetic robots, which requires smooth actions.
NOTE: If you met any problem of installing the driver, you may need disable the Windows feature of Digital signature requirment, you need to disable that to install the driver. Actually, there is another way to install the driver for STM32, read at the end of the wiki > More > Share. |
Press the "reset" button again, and then press to hold "BOOTO" button during blue lights flashing rapidly, until the light starts blinking slowly. The blue light will keep flashing. Now you can install the driver.
Windows will prompt you for a driver, manually locate the directory, select mapleDrv -->dfu_x64/dfu_x32(Please select your OS bit: 64-bits or 32-bits) in the folder. Next install a virtual serial port driver:
Reset Veyron Servo Driver 24-Channel with RET button, wait for the blue light stops flashing. At this point Windows will prompt to install the driver, too. Please manually locate the directory, select mapleDrv -->serial in the folder. Until now, the driver has been installed.
In this section, we will use Arduino IDE as a Serial port communication tool to control the servo. And, you also could use other Serial port software, like putty, CoolTerm etc.
Connect Micro USB cable to the Veyron Servo Driver 24-Channel, then the power indicator LED will be on. Connect an external 5V power to the VS and GND. Then switch the DIP 3 at SERIAL, USB has been defaulted to 57600 baudrate (cannot be changed), should be consistent with software.
The Servo on Channel 5 will move to 1600us position and servo on channel 10 will move to the 750us position. They will arrive simultaneously after 2500ms. This command can coordinate multiple servo speed, even if the initial position of two servos are very far, you can make they start to rotate and stop at one specified position. This command is very suitable for humanoid bipedal robot
This command allows the 8-bit binary write-once and simultaneously update all channels in the bank, the update will be completed within 20ms after receive carriage return symbols
This command enables bank output 123 in decimalism, 123(decimal) = 01111011 (binary), bank 1 for channels 8-15, then channel 8 and 13 in bank 1 will be 0, the other channel will be 1.
If servo is rotating, it will return "+", if servo has moved to a specific location, it will return "." The return value of this command will delay 50us to 5ms.
The return value is one byte (binary), which means the servo current pulse width, resolution: 10us, for example, the pulse width is 1500us, then it will return to 150 (binary). This command can query multiple servo pulse width, each servo has a byte, the return value will delay 50us to 5ms, typical value is 100us.
Why I cannot control servo by external serial port, I mean when I use BT module or by arduino Uno serial port? I can do it through pc"s serial monitor.
Hello, it"s for the baud rate setting. Have you noticed the baudrate setting switch on the corner of the board. Is it in the right place, e.g. if your code is 115200, then the 3 switchs should be in the position as:A1, B1, SERIAL. Besides, the switch are not good to use, you might need a little strenth to poke it from one side to the other side to make sure it is connected firmly. We will update the switch in the next version.
Arduino STM32, this method can help you install all the drivers you need, besides, it could allow you to program it using Arduino IDE if you"d like to. Read the warning

Thanks for setting up a nice project. I was able to follow and my project works. The only issues i found that the scanning is not very fast. I tired to reduce the angle and at the end looked into increasing the serial baud rate which didn’t resulted in fast scanning. Serial monitor always showed very same reading speed. So, the radar lines on frame move very slowly and distance get updated slow when compared to you video.
hi, i want to construct it for my school project. but i just have a week for that. can it be made that easily? in addition to that i have zero knowledge of arduino devices. should i just follow the steps? or is there any more explanation on your site? being honest i m really confused
Hi there, well if you follow all the steps from the video and the article the project should work. There isn’t anything hidden, though you would need a bit of knowledge in case you connect something wrong, because you will wonder that is going on. Check my other beginner tutorials if you are complete beginner.
I realize I’m just another voice in the choir, here, but I feel I have to say it anyway: This was a delightfully whimsical project. I did “just because”, and it was very fun. Thanks! I learned a handful of things that may turn out ot be useful, later on.
Thanks! Of course, everything is possible with Arduino, but that would requite appropriate code changes. You would have to code the GUI to suit the TFT screen.
Really cool project! And, it was easy enough for me to pull off with only minimal mess ups. I only first bought an Arduino (Uno R3+) 3 days ago. I went through all of the tutorials in the starter kit I bought, and then purchased some other stuff to add on to it (shields, sensors, etc.).
I really appreciate the tutorial on setting up and working with Processing, as well. I didn’t know about that before, but now can add that into my learning. Thanks!
Yes sorry I found that. But also in the latest ‘complete source code’ bit, there is no #include and I am getting confused and I have already written half of the the code titled in red letters. Help!
I just wanted to ask that, is it possible to adapt the code for measuring the speed of an approaching object. I reduced the angle of scanning to 60 degrees and I want to see the speed on the screen if an object is getting closer to the sensor. Any tips to get me started?
Thanks. That sounds like a good project idea and you might be able to make it with this or similar sensor and setup. You comparing the distanced the object has approached in a particular period of time.
Dejan, The project is excellent. The code all works and the instructions and tutorials are excellent. My only trouble was finding out how to clear the font error in Processing but a quick google search taught me how to create the font. It’s a great project!
Well the servo motor can only rotate 180 degrees. You would need different motor, so different code for both Arduino and processing. But sure, it’s possible to make it.
hi i just want to ask how can i match the distance of the detected object in the sonar since i already change the distance that the sensor to 1m, the distance that the sonar give doesnt match with the distance that the sensor detect
It’s possible but you would have to make a suitable application for your mobile. I already have a tutorial on how to make your own custom Android application using the MIT App Inventor, so you can check it out and find some more details there.
I get the program to work some of the time, but not every time. The sensor will often hesitate on the swing back (165 to 15 degrees) at about 80 to 90 degrees and then will often hesitate on the swing forward (15 to 165 degrees) at about 70-80 degrees. Any idea why it hesitates on the swing back and forward? What is weird, is that sometimes it doesn’t hesitate at all, but most of the time it does. Any help would be appreciated.
Thanks a ton man!. The project definitely works. The coding is free of error. There is just one slight modification though. The font which you use in the processing IDE needs to be moved into the sketch folder first and you seem to have skipped mentioning that part.
It seems like your Arduino doesn’t have enough power to run the servo motor smooth (although this shouldn’t happen) or your servo motor might be faulty.
The ultrasonic sensor u used for this project is HC- SR04. I read data sheet of it. range of sensor is upto 400 cm. then why only upto 40 cm can be got by this code. if we consider its measuring efficiency is lesser than ideal one then also it could measure atleast upto 100cm. What changes in code required if i want output of 400cm or 100cm.
I need the most high possible precision for my project but this code (processing code) is not very precise. Arduino and the sonar are working good, sending the right distance to the serial port. Processing IDE is recieving the right distance but the results showed by the radar are not! The value showed near “Distance” is correct but the red line is wrong by 3, sometimes 4 cm. Also, the segment from point 0 and 10 cm is much bigger then segments between 10-20, 20-30 and 30-40. I also modified the processing code to show red lines only at a certain distance (eg. 10cm) to see exactly how much is the red line long when processing read 10cm from the serial port and the red line is at about 7/8cm (so it starts before the 10cm segment). Same as for 20cm or any other distance.
That’s true, this project is not that accurate, considering both the cheap electronics components used in this project, as well as the coding in the Processing IDE. The point was to make it as simple as possible so that everyone can easily understand it and make it on their own, and sure there is always room for any project to be improved.
Can i make the radar screen with LCD touch screen 2.8 or 3.2 inch? And if the answer is yes, can you give the code with LCD screen (processing code). thanks very much bro!
That’s a different approach to this project. You would need to program the Arduino to display the radar on the LCD, you won’t need Processing code. I don’t have such a code though.
hey, i really like this project you have, but I am having, is that for starters the screen for some reason does not fit, but my main problem is that the red lines are not showing up for me when i run the program. everything else is working fine, the green lines are moving and all, but when i place somthing in front of the sensor, no red lines appear. do you know how to fix this? thanks for the help
Are you using the right Processing IDE code, the updated to work on each screen resolution, the one on the bottom of the post. If you are using that one you just have to set your screen resolution and all other drawings will be adjusted according to the set resolution.
I’m having a small problem. The green and red lines are not moving at all and the angle is only showing 0° all the time. Please give me some instructions of solving this problem!
Check your connections twice, you probably have connected something wrong. Test the sensor whether is working with the simple tutorial code for the ultrasonic sensor.
The lines plotted are only red, its always In Range, and the distance is not calculating on the plot, it’s at zero. I made another project to test the pinger, and it works. What should i try next?
Hi sir, thank you for your great tutorial ! but I have a problem. It says in the Processing IDE that “Could not load font OCRAExtended-30.vlw. Make sure that the font has been copied to the data folder of your sketch.”. Can you help me out sir , please ?
Great project. Even I have followed and done it. Everything is working fine but the problem I am facing is that my servo motor is getting hot and after 1 or 2 rotation it stops rotating and then it doesn’t rotate till it doesn’t cool down. May be next day it start to work and again after 2 roation it heats up and stops.
I want to just ask you that whatever distance which is measured, I want it to be uploaded to my Cloud, So can I do that? Can you help me out? Please.!
Sure you could store your measurements, but I don’t have any tutorial about storing them on Cloud. If storing them to a MicroSD card could do the job for you, you can check my particular tutorial for that.
I am experiencing really noisy HC-SR04 data. I was wondering if you have experienced that and if so how did you solve it. Or do you have any advice on what might be the problem.
But I wanted to know how can we make it rotate 360 degrees because the servo can rotate up to 190 degrees. Can we have a wireless radar configuration for making it rotate 360 degrees or a sensor equivalent to 360 radiation pattern?
Hi Dejan I would like to know how did you set up the screen and how to connect it in order to have the green radar lines going on if you could explain me this thank you I already scrolled the other comments…
The resolution issue is solved. I think I had used a previous version of your code, I see that all graphics are sized for width and height of the size() function.
Thanks for making this project available, it’s very impressive. We brought it to a group of about 60 students and they made it. All were very impressed with the results.
I’ve done it on my computer and it works very well. On the student laptops, coming with many different setups, screen resolutions and operating systems, we had issues on some. The main one was with resolution. Even using your last code for all screen resolution, and changing the “size (1920, 1080); ” line with their respective screen resolution did not change the size of the radar graph. We can only see the top left corner of the radar, with the base and angles-distances out of the screen. This mainly happened with the lower screen resolutions, around 1360, 768. I think other feedbacks mentioned this as well, I’m trying to troubleshoot on my computer but if you can help it would be great.
Others were getting error messages when compiling the Arduino code, I’m thinking it could be linked to their antivirus softwares as they were getting prompts from it. Anyway we’ll work through this one.
I have a problem with Processing. Last time I used this app everything functioned. Now the radar’s drawing is broke. I can’t attach a picture to show you what is happening. Radar appear regular when I open Processing but it doesn’t scan the near environment. It just draw a bold red line from the center to the begining degree of scanning.
I tried to change pins in the testing program for the sensor with the pins 10 and 11 and the sensor is working. do you know another software like processing?
I have a question regarding the display. after clicking the run button in processing, my display only shows partial screen of the scanning radar. Changing the display resolution does not fix the problem. I also change to different font. Please help.
and since i’m not familier with IDE Processing i still trying to change the resolution wich comes for (1920, 1080) screen i guess ,in way to make it compatible with my own 1280*1024.
I tried to use this code but it seems that the bottom half is in Javascript instead of c++ or any other compatible code, so it won’t work with my Arduino. How could I fix this?
we have used your code word to word and even worked out the font and screen resolution errors. But in the end we are facing a problem. when we disconnect the sensor, the green line shows but as soon as we connect the sensor the green lines disappear and only the red lines are visible. The sensor doesn’t detect anything as the distance is always 0 but the red lines move from 15-165 degrees. we thought there was something wrong with the sensor so we changed it but that didn’t help. so please help.
Can the given processing code work on Processing 3.0.2…….for some unknown reason i am not getting any output after i run the code because or is there any additional steps i need to take before/after uploading the arduino code and then immediately running the processing code
I have copied the 2 programs for arduino and processing as given…..but after connecting the arduino uno to my laptop and running the code in processing the console window is not appearing…….the program is uploaded in the arduino and the connections are fine….i am getting the output on the serial monitor…….i am a beginner so i am not sure where i am going wrong..
sir my processing shows a message could not load font OCRAExtended-30.vlw. make sure that the font has been copied to the data folder of your sketch. what does that mean? im new in this field pls help me
Read the other comments of this tutorial and you will see that the most of the people have managed to get it working. So the program is working, the problem has to be with you, you are probably doing something wrong.
hi sir good day thank for the amazing project I like it . but im not experience , I want to ask u about 1 thing i upload the arduino code its good done uploading but at the prociccing i get the error :
sir my processing shows a message could not load font OCRAExtended-30.vlw. make sure that the font has been copied to the data folder of your sketch. what does that mean?
Hi Dejan, first I have to say that I saw your other projects and I am glad to see that we also have succesful arduino developers in our neighborhood.
Ms.Josey
Ms.Josey