loading
2Instructables77,470Views38 CommentsSouth Dakota
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
Show 0 More »
  • MagicByCalvin commented on MagicByCalvin's instructable Motion Following Robot1 month 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 Drill3 months 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 Robot8 months 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 »