author
2Instructables100,753Views54CommentsSouth DakotaJoined May 5th, 2014
I am currently a student in South Dakota. All my life I have been interested in tinkering with electronic amd mechanical gizmos, however after working at an electronics shop and being a member of instructables, I impulse bought an arduino. Now my days entail day dreaming up new creations and then building them!

Achievements

10K+ Views Earned a bronze medal
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot1 week ago
    Motion Following Robot

    It does. You'll have to look at the specs of your sensors and do some testing on your own to determine the best placement of the sensors. If you look through the comments here, you'll see why I picked the angle I did for the sensors I was using. It was a simple approximation though and I did not perform any thorough engineering analysis so be sure to take that with a grain of salt.

    View Instructable »
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot1 week ago
    Motion Following Robot

    It should still track smoothly. However, due to the nature of the system, even without serial communication, the follower doesn't move very smoothly. In order to move smoothly, a lot more work would have to go into the design. For one, more sensors would need to be used to increase the resolution of detection. Two, an output smoothing controller should be designed. Three, a better motor should be used. Those are some of the design tweaks I can come up with off the top of my head if you want to keep the system from jerking as it tries to follow you.

    View Instructable »
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot2 weeks ago
    Motion Following Robot

    Try increasing the Baud rate to 115200 (9600 is the default on Arduino). Even with a baud of 9600 though, you shouldn't be delayed by 4 seconds, you should be delayed for a couple milliseconds at most.

    View Instructable »
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot2 months ago
    Motion Following Robot

    Thank you for the suggestion, I have been learning GIT and plan on uploading it there.

    Sounds like an excellent idea! In case you aren't very familiar with embedded systems and electronics, I would recommend that you get a motor driver board that can run off of 3V3. If I recall correctly, the Raspberry Pi uses 3V3 logic and does not have as much protection as an Arduino does when it comes to driving devices from the GPIO pins.

    You are asking a very low effort question. I am more than happy to help people with parts of their projects, but I am not going to build it for you. I would recommend that you look into how differential drive robots work. Then figure out how to power the motors as a function of how close the object is to each sensor.

    I believe that you both are probably correct. When I originally created this Instructable, I was quite new to everything and hadn't thought about the physics and engineering behind ultrasonic range sensors. If I were to redo this project, I would certainly study the physics behind ultrasonic sensing. Thanks for the tip!

    View Instructable »
  • Improve Ultrasonic Range Sensor Accuracy

    Happy to hear you liked it! If you folks need some extra help for an advanced build, feel free to PM me.

    View Instructable »
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot10 months ago
    Motion Following Robot

    We need to see a picture of how you connected it. Could you tell us what the problem is? Is it not compiling, not uploading, not moving, moving erratically?

    Ok, but what is wrong? What doesn't work? Your Arduino could be dead, you might not be uploading correctly, the motor may not be hooked up correctly, or a large number of other factors could be causing an issue. I need to know what your problems are and I need to see pictures of what you have hooked up in order to help you.

    View Instructable »
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot1 year ago
    Motion Following Robot

    Were you hoping to have a camera mounted on the motion tracker or did you want to replace the ultrasonic sensors with a camera?I would recommend replacing the sensors with a camera if you can send a live feed of the camera to a computer. You would then use computer vision in order to detect and track motion. A comment I left above regarding following a laser pointer might be helpful to you.

    Thank you!You would need a sensor that can pick up the laser dot. In a very low light situation, you might be able to use photoresistors. But realistically, unless you were using a flashlight, a laser even in low light probably wouldn't work with a few discrete light sensors. I would recommend using OpenCV. OpenCV is a computer vision package that is built for both C++ and Python (as far as I know). You will need a computer to do the processing since an Arduino does not have sufficient power to process images. You will also need a camera. The camera doesn't need to be super fancy, in fact it could probably work with a cheap $20 webcam. The most important aspect of the camera would be its ability to differentiate the laser signal from the noise of the image. You would want to use OpenCV ...

    see more »

    Thank you!You would need a sensor that can pick up the laser dot. In a very low light situation, you might be able to use photoresistors. But realistically, unless you were using a flashlight, a laser even in low light probably wouldn't work with a few discrete light sensors. I would recommend using OpenCV. OpenCV is a computer vision package that is built for both C++ and Python (as far as I know). You will need a computer to do the processing since an Arduino does not have sufficient power to process images. You will also need a camera. The camera doesn't need to be super fancy, in fact it could probably work with a cheap $20 webcam. The most important aspect of the camera would be its ability to differentiate the laser signal from the noise of the image. You would want to use OpenCV (or your own image processing algorithm of course, since this should be among the simpler tasks) to determine where in the image the laser dot was. Using that information, you could then drive the motor to, for example, always keep the laser dot in the middle of the image. For better results, you could pulse the laser at a specific frequency and use a filter to make sure that it is your laser and not a different laser or other sources of light that your algorithm picks up. Finally, I would recommend looking into control theory (if you have the time, desire, and ability) in order to better control the motor. A very basic, yet incredibly effective control system is a PID controller. I hope this helps!

    View Instructable »
  • MagicByCalvin commented on DIYT's instructable USB Mini Drill1 year ago
    USB Mini Drill

    That's a capacitor you see on the motor. There is no back emf protection in that circuit. You'll want t put a flyback diode on that circuit or risk frying the USB power rail. You also might want to throw in a current limiting resistor. I'm not sure what the stall current is of those little motors, but that could also risk pulling too much current from the board. While most computers automatically cut off the USB current draw at 1A, you still want to be safe.

    View Instructable »
  • Improve Ultrasonic Range Sensor Accuracy

    So I took a look at your code and tweaked it a little bit so that it didn't have a compile error. I am in a rush unfortunately so I didn't have the time to look at the logic of it. Hopefully it will work as expected! Here you go:#define trigPin 13#define echoPin 12#define tempAir 24#define max_distance 91int Buzzer = 9;int temperaturePin = A0;long unsigned soundSpeed;boolean debug = true;float temperature = 30;long cm;float getVoltage( int pin );long microsecondsToCentimeters(long microseconds, long temp);void setup() {if (debug){Serial.begin (9600);}soundSpeed = 331300+606*tempAir;pinMode(trigPin, OUTPUT);pinMode(echoPin, INPUT);pinMode(Buzzer, OUTPUT);}void loop() {temperature = (getVoltage(temperaturePin) - 0.5) * 100;if (debug){Serial.println(temperature);}long duration, distance;di...

    see more »

    So I took a look at your code and tweaked it a little bit so that it didn't have a compile error. I am in a rush unfortunately so I didn't have the time to look at the logic of it. Hopefully it will work as expected! Here you go:#define trigPin 13#define echoPin 12#define tempAir 24#define max_distance 91int Buzzer = 9;int temperaturePin = A0;long unsigned soundSpeed;boolean debug = true;float temperature = 30;long cm;float getVoltage( int pin );long microsecondsToCentimeters(long microseconds, long temp);void setup() {if (debug){Serial.begin (9600);}soundSpeed = 331300+606*tempAir;pinMode(trigPin, OUTPUT);pinMode(echoPin, INPUT);pinMode(Buzzer, OUTPUT);}void loop() {temperature = (getVoltage(temperaturePin) - 0.5) * 100;if (debug){Serial.println(temperature);}long duration, distance;digitalWrite(trigPin, LOW);delayMicroseconds(2);digitalWrite(trigPin, HIGH);delayMicroseconds(5);digitalWrite(trigPin, LOW);duration = pulseIn(echoPin, HIGH);distance = (duration/2) / 29.1;cm = microsecondsToCentimeters(duration, temperature);if (debug){Serial.println(cm);Serial.println(" cm");}if (distance >= 91 || distance <= 61){Serial.println("Out of range");digitalWrite(Buzzer, LOW);}else {Serial.print(distance);Serial.println(" cm");tone(Buzzer, 100);delay(300);noTone(Buzzer);}if (distance >= 61 || distance <= 30){Serial.println("Out of range");digitalWrite(Buzzer, LOW);}else {Serial.print(distance);Serial.println(" cm");tone(Buzzer, 200);delay(300);noTone(Buzzer);}if (distance >= 30 || distance <= 0){Serial.println("Out of range");digitalWrite(Buzzer, LOW);}else {Serial.print(distance);Serial.println(" cm");tone(Buzzer, 300);delay(300);noTone(Buzzer);}delay(500);}float getVoltage(int pin) {return (analogRead(pin) * .004882814);}long microsecondsToCentimeters(long microseconds, long temp) {return (microseconds * (331.3 + 0.606 * temp)) / 2;}

    I am happy to hear you are interested in my project! At first glance, I think that the code is missing the function prototype. This code was written in an older IDE which most likely did not require function prototypes. If this is the issue, you can solve the problem by writing the following line above void startup():float getVoltage(int pin);Let me know if that solves your problem!

    View Instructable »
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot1 year ago
    Motion Following Robot

    While I am not familiar with pneumatics, I do think you could create a simple feedback system with DC motors. All you would need it to use a gear on the motor shaft to turn a potentiometer. The potentiometer would then create a voltage divider and the voltage can be measured. That voltage can then be mapped to angular position (and velocity and acceleration too if you add one or two differentiators to the control system). Depending on the system you are building, you will want to look into some control theory if you haven't already. For heavier and more powerful systems, if you have an unstable system, you could destroy your project or even bring harm to yourself or others.

    That is a great question. I did not apply any special analysis, I chose the angle based on the cone of sound produced by the sensors. I figured that angling the sensors so that the cones just touched would produce the best result. Upon reflecting on my design, I should have probably done some analysis and testing to produce the ideal angle. I am not familiar with the physics of stereo imagery but my thoughts are that I would not want to apply that for this design. I wanted the design to be able to pick up objects within the widest range in front of the sensors. My thoughts are that angling the sensors inwards would produce better detection of an object in front of them but would not detect objects as well that are further off center. I would love to hear your thoughts on it though!

    View Instructable »