Show Posts
Pages: 1 [2] 3 4 ... 377
16  Using Arduino / Sensors / Re: Can I use Ultrasonic Range Finder as a speed radar? on: September 02, 2014, 11:09:27 pm
While it probably wouldn't be very accurate, what you could try is to ping the object multiple times; in between each ping, there is always a "gap" of time needed to wait for the return signal. As the distance between you and the object you are measure the speed of gets smaller, that time gets smaller (and the calculated distance gets smaller). But with multiple measurements, the time differences should also be proportional to the speed at which the gap is closing (with some amount of error).
17  Using Arduino / Motors, Mechanics, and Power / Re: Looking for High Torque Servos. on: September 01, 2014, 01:09:36 am
Quite!  For the uninitiated torque is in units of length _times_ force.

While you may be technically right, it is easier for the layman to think about torque in "how much weight or mass will this shaft lift, given a lever extending from the center of the shaft" - which is why we see torque expressed as kg-cm and lb-ft (though for the latter, it is almost always said, and sometimes written, as "foot pounds" or "ounce inches" or similar). Sometimes a dash is used, sometimes a slash, rarely an "x" for some reason, though.

But I am sure you already knew this.

The thing is - most sites (not all) selling motors or other actuators don't list the information in the manner you prefer and indicate. Many of those sites aren't selling to scientists or even engineers, but rather mechanics, hobbyists, and other "laypeople" - that is, those generally without the formal training in such matters.

What I would personally like to see, is a web page or something similar that could relate and explain your method in a clear and concise manner, along with graphical examples - while comparing and contrasting that methodology to the more common "layperson" method of understanding torque. You yourself have explained several times how you view torque and how it works (and I commend you for that!). I haven't seen, though (maybe I missed it?) any explanation from you how that method compares (and translates to) the colloquial layperson method.

Furthermore, a site or page (or something) that could take all of that information, and show how to calculate the needed torque given a wheel on a robot platform - both for flat ground and for an angle (climbing a slope), and perhaps even for a joint on a robot arm (and maybe for something being slewed in a circle on a flat plane) - well, that would just be icing on the cake. Ideally it would show you how and why it all works, then have a section which you could plug numbers in and get a result back (via javascript or similar).
18  Using Arduino / Motors, Mechanics, and Power / Re: Looking for High Torque Servos. on: September 01, 2014, 12:56:57 am
On the other hand,  at the base of the arm,   the weight of the arm should be carried by some kind of bearing,   and the servo only has to turn it,   not hold it up.

He's probably talking about the tilt of the arm, not the slew...
19  Using Arduino / Project Guidance / Re: components needsed for 2 wheel trolley from eBay ? on: August 30, 2014, 06:38:44 pm
modifying the inexpensive rc toys is pretty much a no go.
Why is that? That's what I did to my RC truck and as far as the speed, you can control that easily with PWM.

I'm kinda curious on this, too - especially since some people have managed to control their RC cars by emulating the output from the receiver (the pulse code provided by the transmitter) - on RX2/TX2 and variant chipset cars:,86883.0.html

The only thing I can think of that would be objectionable is that on some cars, it can be difficult to find proper solder points, and that some use lower voltages and whatnot for the control of the on-board h-bridge drivers. As such, it can be easy to blow them rendering them useless. There's also the fact that you don't have proportional control of the steering in most cases, either (this could be rectified by substituting a real RC servo for the existing steering mechanism, though.

Worst case (sometimes the best option, sometimes the only option), you strip out all of the control electronics, and then use some other driver circuitry that is easier to control with your microcontroller of choice to control the actuator(s) and drive motor(s).

But if you want to add things to the RCs, then yea, its a pain in the butt. But if you just want to mod the rc to work with an Arduino, just for fun or to say that you did it, then it is very easy.

Most toy RC vehicles, once stripped of the outer shell, can be easily modified to add a "deck plate" onto which other things can be attached (sensors and such). This deck can be constructed of plastic, plywood, or other materials as needed (foamcore or coroplast can work well - even cardboard can work).

I personally prefer to make my robots by hand, from Legos or an Erector set, just so if there is something I want to change or add to it, I can. This also allows me to be creative with the designs too.

The only problem with Erector/Mecanno is typically the weight issue, being steel, but as long as that is kept in mind, the chassis and other systems can be engineered to work around it. Lego, on the other hand, tends to be very expensive for what you get, but it does lend itself to being a great prototyping platform - provided you are willing to take apart your creations.

Right now I am building a hollow wheel motorcycle with Legos. I am finished with the design, and now I just need to figure out the placement of the electronics. I do still need to work out how it will balance itself.

That's a pretty neat chassis - and one that puts lie to my earlier comments; in this case, you couldn't easily make that chassis out of anything else (unless you had access to a good machine shop - or a laser cutter and/or 3D printer) - and you would likely want to make the chassis a "permanent" one. I guess in this particular case, Lego wins!

As far as balancing is concerned, you might want to add the ability for the bike to "put a foot down" - maybe some kind of "training wheels" that can be let down as the bike slows, then raised up (like aircraft landing gear) as the bike speeds up and the gyroscopic action of the wheels take over to keep it balanced. You'll probably also want to add some kind of accelerometer or similar sensor so that your robot can determine how far it is leaning as it turns, among other potential issues related with keeping the bike upright...
20  Using Arduino / General Electronics / Re: Are momentarily shorted batteries still safe to use? on: August 30, 2014, 01:34:00 am
1. Is there a way to tell if these batteries are still good/safe to use?

Likely, as mentioned previously - they are fine. If you really wanted to know, you would want to discharge them to about 0.9 volts per cell (or 7.2 volts for the pack) - don't go any lower than this! - then recharge them at their proper rate (I encourage you to purchase a "smart" charger if you haven't already - they are more expensive than a dumb wall-wart charger, but worth it; some even come with discharging capabilities).

Once they are recharged, you can then put them on a load (sand resistors or similar - sized for the current draw needed) and measure the pack voltage; if it dips fairly quickly down or below 7.2 volts - then one or more cells in the pack is no good (you could do the discharge/recharge/load test again to each cell to see if any are working properly).

If, however, the voltage lowers at a steady pace consistent with the load sizing (it would need to be timed), then it is ok to use.

2. Why aren't NiMH batteries a particular fire hazard; or, are they reasonably tolerant of these sorts of screw ups?

Every battery is a potential fire hazard when shorted (max current draw!) or when a heavy load is placed on them; some batteries can withstand fully max current draw and max recharge current - the pack will get warm, and the life may be shorter, but it will continue to work.

Other batteries (well, the individual cells, actually) have a max current draw you shouldn't exceed (and a max current for charging that shouldn't be exceeded either) - if you do, the battery could be damaged or catch fire; the best way to figure this information out is to contact the manufacturer of the battery and/or cells. If you purchased cheap chinese no-name cells, though, you are likely out of luck in finding this information (and you might want to assume that the lettered mAh on the side of the cells is not correct either, but inflated by some percentage).
21  Topics / Robotics / Re: VACUUM ROBOT on: August 28, 2014, 11:34:21 pm
because any flaw in wheel spin or not doing what it thinks it's doing

Guess what: In any such system you are always going to have error - error in the output, error from the sensors - error everywhere.

If you want to have any hope of making the robot navigate properly within a certain level of probability of being in the proper location where it thinks it is (but only within a certain level of error - mind you!) - then you need to be thinking in this manner.

The problem, though, is that it is very difficult (but possible) to build a robot that navigates in such a manner. The main concept is known as SLAM (Simultaneous Localization and Mapping - google it), and there are as many possible solutions and algorithms as you could care to investigate (some are sized for small processing systems, others for much larger systems). Despite what you may read or see as you research, SLAM can be implemented as an outbound, on-board sensor system (think on-board the robot chassis LIDAR, ultrasonic sensors, cameras, etc) or an inbound, off-board beacon or sensor system (think cameras looking in on where the robot is, or IR beacons, or ultrasonic beacons, etc). Most SLAM discussion, though, focuses on sensors located on the chassis of the robot - so keep that in mind.

The process is difficult to understand, and more difficult to implement - but it is at the heart of the most advanced robot navigational systems being researched and implemented. That said, you don't see such things on robot vacuums, because they are so difficult to implement well, and that costs money, lowering profits (well - not completely true - I suspect that the Neato XV series use some form of simple SLAM or something real close). Instead, you get the typical random walk and edge following behavior such as the Roomba uses. Much simpler to implement, and the parts are inexpensive (which translates into larger profits).
22  Using Arduino / Motors, Mechanics, and Power / Re: Arduino + h bridge l298n + dc motors, robot move a litle and then gets crazy on: August 28, 2014, 11:23:19 pm
Also realize that the L298 drops a couple of volts from the supply - so your 4.8 - 6 volt supply (not sure what kind of batteries you are using) could be as low as 2.8 - 4 volts by the time it gets to the motors...
23  Topics / Robotics / Re: OV7670 sketch??? Please help me! on: August 26, 2014, 11:55:38 pm
Are you ignorant about Google?

If you go to Google (, and you type in "OV7670" - you should get a ton of hits (for me 348,000 hits appeared).

Now - for me, the third link down was this link to the Arduino forum from 2012:,125767.0.html

If you review the links google gives you (especially the links to various datasheets - along with code for a variety of platforms other than the Arduino - which you can reference to validate whatever code you come up with -for- the Arduino) - and the links in that Arduino forum thread, you should be able to find more than a few potentially working (??? - unknown, I have not tried any of the code personally) examples - at least more than enough to get started.

But - before all of that - perhaps you need to take some time in learning how to perform Google searches, proper search terms to maximize relevant results, etc - before you start down this road with the OV7670 camera - simply because if you were unable to get this far, and were unable to use Google for some reason, you will likely hit another stumbling block which could be answered fairly quickly - sooner, rather than later.

Good luck - the world is counting on you!
24  Using Arduino / Project Guidance / Re: Need Help on creating a code for my Tank Project. on: August 25, 2014, 12:06:00 am
The thread that liudr posted is the right thread - page 2 has a link to a different forum post about a descriptive implementation I created:

Right below it (next comment after mine above) is a code implementation of the idea - the guy says it worked great.

I don't know if the code on page 3 of the thread liudr posted works, but I will give him the benefit of the doubt that it does...
25  Topics / Robotics / Re: Robot Surveillance Car on: August 23, 2014, 04:13:57 pm
If you have a wireless router available, you might use an arduino with an ethernet shield to make a basic routerbot setup like below.

If you have a wireless router available, and it is a model that will support OpenWRT or DD-WRT (or other open-source firmware) - you might be able to use it directly without an ethernet shield.

Some routers that can use such open firmware usually have a serial port (generally running at 3.3v TTL) on-board that can be directly connected to the Arduino RX/TX pins (plus ground); from there, it's not too difficult to begin controlling the Arduino (especially if the Arduino is running Firmata or similar software).

Some routers will have USB ports - which are usually used for hooking up USB drives (external hard drives and thumb drives) - to act as a simplified NAS device on the home network for sharing files. As such, they are effectively host controllers, and the open-source firmware can be set up to use those ports as virtual serial ports - just plug the Arduino in, and again - communicate with them via serial USB.

Sometimes you can hook up a USB hub to the port to gain more USB ports (plus extra current capability if needed); doing this would allow you to connect up a cheap web camera and other devices (like a GPS unit, or maybe a USB servo controller - just a couple of options that might be useful for the OP's needs - though most of that could be run thru the Arduino anyhow). Or you could simply use a wifi or hard-wired ethernet IP camera if you have one lying around.

On ebay is sold a cheap "travel router" called the TP Link TL-WR703N - goes for about $20.00 USD and is supported by Open WRT:

It's got quite a lot going for it - you can hack it to add extra USB ports, add a flash thumb drive (for more storage space for firmware OS extensions), add an external antenna, etc. Depending on your wants, needs, abilities and finances, one of those coupled to an Arduino would make a really nice system that would potentially be much cheaper (and more expandable) than an ethernet or wifi shield.

If you can't afford that, you can typically find old Linksys WRT54G routers (only certain models and versions are supported by the various open-source firmware distros available - so be sure to check that before you buy) at a thrift store. I've seen them sold at such places for under $10.00 USD usually. They aren't good for home network use, but for interfacing purposes (with open firmware) they are really useful.

Earlier today I purchased a Netgear WNR2000v3 - while it doesn't have USB support, it does have plenty of memory for a lot of options, is supported by OpenWRT and DD-WRT, it has a serial port easily accessible, and while I didn't see anybody who had done it - in theory it should be possible to add an external antenna (most of the time you just need to solder on a pigtail to SMA adaptor and you're done). It was half-price Saturday, so I got it for $7.50 USD.
26  Community / Bar Sport / Re: Why Q for transistors? on: August 22, 2014, 10:43:14 pm
This thread has some interesting info:
27  Topics / Robotics / Re: Robot Surveillance Car on: August 22, 2014, 10:33:04 pm
One option you can do (though it takes more than an Arduino) - is to control the Arduino with a Raspberry Pi (or similar small form-factor computer) on board the vehicle.

The purpose of using such a device is:

1) More powerful machine for hosting a web page and server system
2) Easy to connect to the Arduino
3) Easy to connect many kinds of USB web cameras

So - you basically use the Arduino to control the motors and the pan/tilt servos - set up the Arduino with Firmata - virtually no other coding is needed for the Arduino.

Then on the Pi, install Node.js and write a simple web-form application to grab info from the video stream and plug it on a page, as well as take user input and output the needed actions to the serial port to Firmata (via one of many extensions available for Node.js - a popular and powerful one is called "Johnny Five").

Then all you need to do is have that Node.js script run, then point a browser at it (like the browser on your phone) - and you'll be able to see the streamed video and control the robot platform via the web form.

Now you may wonder "why do I need the Arduino at all - after all, the Pi has GPIO pins?" - which is a very valid question. The best thing I can say is that since the Pi is single threaded, you gain by splitting the processing power up - the Pi can command the Arduino, then continue processing as needed (without waiting or consuming other resources. The other advantage you get with this arrangement is not having to worry about level-shifting of the GPIO pins (the Pi uses 3.3 volt TTL  logic - whereas the Uno and most other Arduinos - but not all - use 5 volt TTL logic). You also protect the Pi from damage on the GPIO as well.

Also - I realize that all of the above is very brief, and may well be over your head. If it is, take it one step at a time. First just get Firmata installed on your Arduino, and learn how to use it (via a serial terminal) to control the actions of the robot (pan/tilt and movement). Then work on learning how to set up and use the Raspberry Pi (including how to hook up and use a web camera).

Then learn how to code using Node.js (tons of great tutorials out there). Once you have that, you should be able to connect to Firmata using Node.js and one of the extensions.
28  Using Arduino / Project Guidance / Re: Robotic arm, need help with servo movement on: August 22, 2014, 10:20:08 pm
I want the servos to move smoothly so the arm doesn't wobble when the high torque servos jerk from on position to the next. I'm looking for smooth natural movement.

That's a nice looking robot arm, btw.

Something you'll probably want to do is a "ramp-up...ramp-down" on the speed of the servos. So - each time thru the loop as you increase the servo speed, increase the "distance" between the amounts you set, until you reach a fixed upper bound.

The below is rough pseudo-code - but it should illustrate the idea I am meaning:

from = 10; // start position of servo
to = 120; // end position of servo

min = 1; // minimum acceleration
max = 10; // maximum acceleration

rdpos = 0; // ramp down position

pos = from; // start the servo at this position
ai = 1; // acceleration incrementor starting value
ac = 1; // acceleration constant


      if pos >= to then exit loop; // reached the end of movement

      pos = pos + ai; // accelerate the positioning of the servo

      ai = ai + ac; // increment the acceleration incrementor by the acceleration constant (see note below)

      if ai > max then
           ai = max; // bounds check for max acceleration
           rdpos = to - (pos - from); // position at which to start ramping down

      if ai < min then ai = min; // bounds check for min acceleration

      if pos >= rdpos then
           ai = -ai; // invert acceleration to slow down servo until done
           ac = -ac;

Ok - the above code is -completely- untested, and it also only allows for positive directional movement of the servo (that is, from a position smaller relative to the end position) - it will likely need to be debugged and then generalized to allow for movement in the opposite direction.

Note: You might want to only increment the incrementor every "n" times (where n is some integer) thru the loop, in order to make the ramp up and down less abrupt. Alternatively, one could imagine where most of these values are floats of some sort, and only when the servo.write() is performed do you cast the value to an integer.

However you perform the ramp-up/ramp-down for the acceleration curve - the point is to do something like this; ideally, doing so will make the movements smoother and more fluid, and allow the mass being moved to come up naturally to speed, instead of forcing it to move at full speed (which results in the jerkiness you have experienced).
29  Topics / Robotics / Re: Recommendations Needed: Hardware Suppliers on: August 17, 2014, 02:21:34 pm
Depending on where you are at on the west coast, be sure to check out surplus suppliers and "industrial junk yards" as well.

Especially if you are in or near the San Jose area of California! The Los Angeles area also has more than a few. Just be sure to wear old clothes and expect to get a bit grubby (for certain places, it is advisable to bring gloves and boots - especially if it has an outdoor yard).

Realize that retail outlets as have been offered - while great places to get exactly what you need - will in the end cost more than a bit of cash. For instance, Servo City has a great robotics construction system - but it doesn't come cheap once you go beyond simple constructions.

In general, if you need to keep within a budget - using raw materials (plastics and metals) - as well as surplus parts, then machining and fitting everything together yourself with whatever tools you have on hand will ultimately be a lower cost method (although the time/money factoring can come into play here as well - as you'll be doing a lot more work to get things working properly than had you used pre-machined and standardized components).
30  Using Arduino / Motors, Mechanics, and Power / Re: dc motors without arduino motor shield on: August 17, 2014, 02:12:32 pm
...and there's your lone 9V transistor battery.

Not only that, but those tiny hobby motors are directly connected to the wheels with no discernible gearing whatsoever!


If you want this to work (and it can!) - the first thing you need to do is position some kind of gearing mechanism between the motor and the wheels. Even it is just some pulleys and rubber-bands, that will be better than nothing.

Indeed, a simple rubber band around the outside of the wheel and using the shaft of the motor (maybe with a pencil eraser as a small pulley) should be enough of a gear reduction to get you the torque you need. Shift the motors forward of the wheels, put the wheels on an axle (so they can rotate freely and independently of each other, of course).

Secondly - drop the use of that small transistor battery as everyone else here has noted, and use a proper battery pack to power the motors. Your 9V can still power the Arduino (not ideal, but it will work) - if you have things hooked up in that manner.
Pages: 1 [2] 3 4 ... 377