Show Posts
Pages: [1] 2 3 ... 377
1  Using Arduino / General Electronics / Re: Need Suggestions for Extending Approximately 40 Wires within 1 larger Wire on: September 20, 2014, 11:55:47 pm
When you say "Daft Punk" helmet, you might want to specify which one...

That said - I think I would approach it from a different angle - if we are talking about a bunch of LEDs in a matrix, then using a bunch of WS2812 (aka - AdaFruit's NeoPixels) or similar "smart" RGB LEDs might be the best way to go (if not the cheapest).

You can get them in SMD or thru-hole versions, by the way - all have four pins: Power, Ground, Serial Input and Serial Output.

Then just daisy-chain all of them together, and run the four wires out - at that point, using RJ45 cable and connectors makes perfect sense - you have more than enough conductors to provide the needed power and data to the pixels. Hook it up to your Arduino, dump in some code (WS2812 and similar LEDs have a ton of libraries available that people have written) - and you're set.

This would be the "proper" way to do this - that is, what you would see in a robust developed product meant for a bit of abuse. The problem with running all of the individual wires is that if one breaks (from flexing or such), you'll be in for a nightmare debugging or fixing. The added complexity of the system (wire and connectors, etc) - just makes for a less robust system that will be more prone to bugs and breakage over time.

While these so-called "smart" LEDs cost more up front, the overall system is simpler to implement, so there is less to go wrong, and if something does go wrong, it is fairly easy to diagnose and correct (at home or "in the field").
2  Using Arduino / Programming Questions / Re: Jumping back to "void loop();"? on: September 20, 2014, 11:44:33 pm
The below compiles: you can call loop() from loop() but your syntax is wrong.... you don't use the word void in the call. I'm not sure how the coding gurus will respond to such recursion though.

void setup() {

void loop() {

Every time you call a function, a return address is pushed onto a stack, which is popped back off by the return (if you call a function with arguments, those too are pushed onto the stack as well). Since you never pop that address off the stack in your example, I would think the above would clobber it in a short order on the Arduino (causing it to lock up or something), but I haven't tried it.

Return takes you back to calling function doesn't it? Not sure what's calling loop()- the invisible main()?

Yes - there is a main() function that is generated as part of the source before compilation that looks something like:

int main(void) {


  for (;;) {
3  Using Arduino / Project Guidance / Re: Writing your own g-code interpreter? on: September 20, 2014, 11:37:20 pm
I have become interested in this subject because I don't understand why the complicated calculations - the G-Code interpreter - isn't done on a PC which just sends motor instructions to the Arduino.

At that point you might as well use Mach or something similar. There's actually a good reason to have the Arduino (or some external controller) drive the machine, and that's to untether the machine from the PC.

For instance, you might want to share the printer among multiple PC platforms (Windows, Mac, Linux, etc) - which might not be easily doable depending on the platform and how you have things set up. There's also the issue that you might want to keep the accuracy of the print as high as possible - if you were running other software on the PC controlling the printer, you might miss steps or other issues might crop up (such as the PC crashing or something?) that would result in a ruined print. By decoupling the printer from the design machine, you can alleviate this concern.

Or you might have a situation where you want to queue up jobs to the printer - by decoupling it, you could put it in a central location, and the code could be loaded from the SD card and put into the queue on the printer; the person could then take the card and continue working.

Finally - there's the instance of having many, many machines (a printer cluster farm, for instance) where it wouldn't be practical or possible to have a PC per each machine.

Now - granted - nothing says you have to use an SD card to load the g-code into the printer. Ideally, the printers would sit on a network and you would just shoot the file over to the printer like you would any other job. Even so, the decoupling would be better to have in this case (rather than the PC streaming the g-code to the printer over the network). Such a networked printer could be made rather easily (as a proof of concept) by tying a Raspberry Pi to the Arduino controlling the printer (plus a bit of custom software to push the g-code sent over the network to the Arduino firmware via the USB serial port, instead of using an SD card).
4  Using Arduino / Sensors / Re: Detect 0.1mm object on: September 17, 2014, 02:26:07 pm
If the belt isn't very wide, you might be able to use a linear CCD sensor of some sort, with some sort of magnification optics.
5  Using Arduino / Motors, Mechanics, and Power / Re: servo not working in basic setup on: September 17, 2014, 02:16:33 pm
I'm suspecting a few things here (ideally, you'd want to try a second, known-good servo first, though):

1) Check that your signal wire has continuity - sometimes those cheap jumpers break.

2) Check that you have a solid connection (and continuity) between the signal wire and the connector (sometimes the connector can be broken).

3) Check that the signal wire of the servo has continuity.

4) Verify the position of the servo potentiometer.

Items 1 & 2 can be done using a multimeter; you might also write code to send regular PWM down pin 9, and hook the signal wire up to a resistor and LED to verify things - although checking the signal with an oscilloscope would be the best way (you'll see continuity, be able to verify the frequency, and the voltage level).

Items 3 & 4 will be difficult to do, because you will need to open the servo to access the signal wire solder point (for item 3) - and to take apart the servo far enough to center the potentiometer.

Basically, to center the potentiometer (once you have it all the way apart, and have verified the signal wires) - you will see a motor, and the final output gear will be connected to the potentiometer (the output shaft is generally the shaft of the potentiometer or coupled tightly to it). Send the "middle" signal (1500 uS) and watch the motor - if it rotates (however fast or slow), rotate the potentiometer until it stops - that's "middle position". Remove the power, reassemble the servo, then try your test program again.

If it still doesn't work, then your servo is bad most likely.
6  Community / Bar Sport / Re: Who hasn't accidentally touched a mains voltage once or twice? on: September 16, 2014, 02:15:29 pm
My shocking experiences:

1) Once, when I was young, we had dogs and watered them using a kiddie pool. It was my job to clean the pool out on occasion. Bailing it was tortuous, so I came up with a solution: I used an old but working swamp cooler pump connected to a hose to pump it out. One day, it fell over into the water. Stupidly, I reached in to put it back upright, forgetting it was an exposed motor. Buzz...

2) As a kid I was once riding my go-cart in our back yard, and the accelerator got stuck. I panicked, turned wrong, and ran into a tree. I hastily reached back to flip the cut-off clip (next to the spark plug) on the engine to kill it. Missed the clip, grabbed the spark plug (no rubber boot on it either). Buzz...

3) First time going to Burning Man in 2003. Got there early-am on Sunday dark, set up camp, went to bed. Got up the next morning, and one of my camp-mates said a nearby camp was having problems starting their orange-polka-dotted-fur covered VW golf art-car. I went to help. Was trying to find out if they had spark with no tools by popping a spark plug boot off and having them crank the engine. I was hot, sweaty, and leaning my arms on the radiator support. (big buzzed - hurt). I did get a nice ham-sandwich out of it for lunch, and we did get the engine started (burned wires to the fuel pump). I was the "hero" for the rest of the burn, and got free rides around the playa at night when I saw them tooling around...
7  Using Arduino / Motors, Mechanics, and Power / Re: Motors and Controllers on: September 16, 2014, 02:07:35 pm
Do yourself a big favour and use a proper stepper motor driver board such as an Easydriver or a Pololu A4988. An L298 is a very poor choice for driving stepper motors.

Well - today it is. But if you have a lot of them (I have a few tubes worth myself) - they are cheaper overall. And provided you stay within the parameters of the design, they work fairly well (with proper heatsinking, of course).

Finally - they work best (for steppers, at least), when paired with the L297.
8  Using Arduino / General Electronics / Re: Soldering problem on: September 16, 2014, 02:01:58 pm
I've got a standard 1602 LCD display which works fine but I cannot solder the pin headers on.

As others have noted, it does seem like you aren't getting the pin hot enough for the solder to wet the surface of the pin and "stick" properly. There could also be a problem (again, as others have noted) if the pin headers are tinned for non-leaded solder; trying to use leaded solder on such pins can be very difficult (or impossible, unless your iron gets hot enough for the non-leaded solder to melt, which has a higher melting temperature than leaded solder).

Something that might help would be knowing the specs of the header pins (if you know them); unfortunately, if you got this LCD as an unassembled "kit", it might be impossible to know or find out. Do the pins look tinned? If they are a dull silver color, they might be (better would be to look at them under a low-power microscope - tinned pins will look rougher than plated pins). If they are gold colored, then they aren't likely to be tinned.

So - back to getting enough heat: What I've found while soldering (these past 20+ years) is that if you tin the tip of your iron, then apply a tiny blob of solder to the iron, you can use that blob to heat things up faster. Press the blob (and tip of the iron too!) against the lead and the pad; when the temp of both is up properly, the blob will flow and stick to the pad and lead - at that point immediately add more solder (keep the solder near the tip while you wait - for small leads and such, with a hot iron, it should only take a couple of seconds to heat up max before you need to add the solder). When you have enough solder, move on to the next pin (whatever "next pin" means in your soldering situation). If you do this right, when you pull the iron away you'll still have a bit-o-blob attached, and you can somewhat rapidly jump from point to point soldering quickly.

If you stop - you might find the solder "oxidise" and burn out all the rosin (it stops smoking); at that point, clean your tip (a pure brass or copper "sponge" works best - in the "old days" we used a damp sponge, but this is frowned on now because it cools the iron down - meaning it needs to get back up to temp first before continuing using it - and it degrades the tip); never use sandpaper if you can avoid it; sometimes you might need to - in that case, immediately tin the tip and keep it tinned. While it is true that soldering irons do have a "special coating" (nickle over copper or something like that), and stripping it will cause the tip to degrade quicker, it isn't like it's going to fall apart immediately. Tips are cheap, too (unless it's an integrated cartridge heater and tip - those are pricey). And never use a soldering iron for anything but soldering, like "cutting" plastic or such - if you do, dedicate that soldering iron to that purpose, and don't use it for anything else).

Finally - regarding temperature controlled irons: I like them - they heat up quickly, maintain a constant set temperature - but they aren't absolutely needed for proper soldering. I learned on an el-cheapo 30 watt worse-than-radio-shack iron; I still have that iron. The tip looks like hell from it's constant use and abuse. It's probably been sanded and/or filed once or twice. I keep the tip tinned, though, and it still works great. The key is proper tinning, keeping that small blob on the end, and quick/deft handling of the soldering iron to do that "point-to-point" solder jumping. Because it runs hotter than smaller irons, it maintains that heat well, but on small parts this can be a problem - you might apply too much heat to the joint. Just move quicker - that's your temperature control.

I really think I need to make a video of myself using it to solder on a PCB, just to show that it isn't the tool (though they are, again, nice to have and use) - but the person using it, and their application and practice of the skills.

9  Using Arduino / Motors, Mechanics, and Power / Re: Help with Large Scale Servo Project on: September 15, 2014, 12:12:52 am
There's also the question of supplying the Arduino with 6 volts; unless the Mega you are using has a low-dropout regulator so it can convert 6 volts to 5 volts.

Normally, you must supply a minimum of 7 volts to the Arduino via the barrel jack because the regulator won't work properly (or it will be unstable) at anything less. I'd run the Arduino directly from the batteries, and only the servos from your 6 volt regulator.

Furthermore, you might want to incorporate a fuse on the positive line of the battery prior to the output to the Arduino and 6 volt regulator, for safety purposes.
10  Topics / Robotics / Re: arduino 360° servo wheels on: September 13, 2014, 12:30:38 am
Large plastic jar lids can be used for wheels by hot gluing them to the servo horns.

Why glue them?

Position the servo horn (the round one is best) in the center of the lid, mark the holes (2 to 4), drill or punch them out, then use a few small screws (or small nuts/bolts) to hold them in place. Much more secure and easier maintenance (plus you can re-use the servo and horn later).
11  Using Arduino / Motors, Mechanics, and Power / Re: Best 12v dual motor drive for the job on: September 13, 2014, 12:27:48 am
I'm very familiar with PCB traces not being well suited above about 5-10 amps.

PCB traces can easily handle more than that, provided they are sized properly.

If they didn't, then magic must be what's keeping the things working in the various Vantec, Roboteq, and wheelchair motor controllers I have played with. Those can easily control well over 50-100 amps.
12  Community / Bar Sport / Re: Lead free solder on: September 10, 2014, 11:02:45 pm
What's really interesting about RoHS is what things were exempted from the regulation:

Military electronic assemblies were exempted because it was known that lead-free solder points are more fragile (less ductile than lead-based solder), and the tin-whisker issue. In other words, because lead-free solder assembly was inherently inferior and had a shorter longevity, it was deemed unfit for military usage. But just fine for consumers, because who really needs to keep their old electronics working for more than a few years, right?

The other industry and product that was exempted was automobile batteries, which actually contain the majority of lead that is smelted today. Nobody in their right mind trashes a car battery, because you can get money to recycle it for the lead (which goes back into more car batteries).

The amount of lead that was in solder pre-RoHS was a mere pittance compared to car batteries, but it was made out to be a big deal by people who for some reason overlooked that fact, and the politicians ran with it. All it really did was make our consumer electronics worse, made a variety of other companies richer while placing a large burden on the manufacturers for retooling their assembly system (who of course passed on this increase in costs to us consumers), and ultimately likely did nothing to help the environment, because the majority of lead isn't contained within solder.

...and consumer electronics still get thrown in the garbage! Now you might say "Well, at least the solder doesn't contain lead any longer...", right? Well, ignoring the fact that as a compound the lead is in solid-metallic form (and thus isn't likely to migrate into the water table any more than natural lead would) - those boards have a ton of other chemicals and potential pollutants in them that do break down and contaminate soil and water. In fact, one could speculate that the introduction of "lead-free" construction may have made the situation worse, as now people might think that they are free to throw away those old electronics and not worry about potential lead pollution, while ignoring the real pollution issues of the other parts of the devices.

I have also read reports that lead-free solder can be more hazardous to people who work in plants that utilize it, mainly due to the more noxious fluxes that are needed when soldering with lead-free solder (vs the relatively benign fluxes used with lead-base solders - most are nothing more than pine rosin dissolved in alcohol - and while the fumes are unpleasant and shouldn't be breathed in, they aren't as bad as those fluxes used for lead-free solders).
13  Using Arduino / Motors, Mechanics, and Power / Re: Motors Disengaged? on: September 08, 2014, 02:35:06 pm
I believe (and I could be totally wrong) - looking at the PDF schematics from this thread:,202973.0.html

Specifically the "Motor Board" - there is a jumper labeled "SJ2" - which is likely "open". In the open state, IC7D (inverted AND basically) has 5 volts on that leg (13) and when VUSB (?) puts 5 volts on the other leg, that pulls the gate of T2 to ground - and from there I am not sure what exactly happens (and/or whether SJ1 is involved?) - but it basically has something to do with the DRV8833 motor driver - it goes into the NSLEEP pin, which according to the datasheet:

...needs a HIGH signal to activate the driver - so I think if you bridged the jumper SJ2, and I think maybe jumpering SJ1 as well (?) - it should bypass as wanted.

In short - it's a hardware issue - I don't know if SJ1 and SJ2 are actual pin jumpers - or if they are (more likely) pads on the board you have to solder bridge. They will likely be on the topside of the motor board (bottom board), which means you'll have to disassemble the robot pretty heavily to get to them properly.

Care should be taken when modifying the board - research the PDFs I have provided carefully before making the modifications (and maybe also someone else here can give me an assist as far as my explanation is concerned? Thanks!)...

Also - realize that if you do this and get it working, you now have no protection against errant programming, and could send the robot careening off the table (or wherever) - so when testing, put the robot up on a stand so that the wheels aren't touching the ground!

Good luck.
14  Using Arduino / Sensors / Re: 3D mapping in Arduino on: September 07, 2014, 09:04:37 pm
Yep - assuming that is what is wanted (which seems reasonable).

The problem would be doing it with an Arduino - there are some "tiny SLAM" implementations out there, but I tend to wonder if you'd be able to do anything more with the Arduino after implementing one (SLAM needs a lot of memory - in the case of the Arduino, SRAM).

And that would be for a "simple" (quoted because SLAM is anything but simple) 2D SLAM implementation - 3D SLAM might not be possible with an Arduino (heck, there aren't many implementations of a 3D SLAM algorithm period - I doubt anyone has done a tiny one yet - but I haven't looked).

As wildbill noted, alrro, search the forums for threads where I have mentioned it. You might first start here, though:

Note, BTW, that SLAM is not an easy concept to wrap one's head around, unless one is well versed in both linear algebra and statistics/probability mathematics - I learned that the hard way after taking the Udacity CS373 class online (something I recommend, btw - it will get your feet wet, at least).
15  Using Arduino / Motors, Mechanics, and Power / Re: L298N motor driver part for fritzing on: September 07, 2014, 08:57:40 pm
It might be best in this instance to learn how create your own part for importing. It's a somewhat involved process, but not overly complex, provided you know how to use a vector art program (like inkscape or similar). I believe you also need to create an xml file or something of that nature as well.

Once you've created it, post it up on github or somewhere, then tell us about it so that others can benefit from it.
Pages: [1] 2 3 ... 377