Notifications
Clear all

R2-D2 needs help connecting Arduino and Xbee

6 Posts
3 Users
2 Likes
536 Views
(@roypaith)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

Hello everyone and thank you for checking out my post.  I'm a complete newbie when it comes to coding Arduino and am looking for some help.  I am a member of the R2-D2 Builders Group and have a full sized droid that is remote controlled.  Currently operating him with a Taranis X9D Plus transmitter, connected to two X8R receivers so I can take advantage of 16 channels.  Two channels are connected to a Sabertooth 2x32 that control his drive (forward, back, left, right), one channel is connected to a Syren 10 that controls dome turning left/right, two channels control his utility arms open/close, one channel controls turning LED lights on/off, and one channel controls his fire extinguisher (can of compressed air turned upside down).

For his sounds, I'm using a Sparkfun MP3 Trigger that is controlled by an Arduino Mega.   The Mega is currently connected to 5 channels on the receiver.  Those are controlled by 4 switches and one potentiometer on the transmitter.  The switches are operating the sounds and the knob is controlling volume level.  For some reason, I'm getting some sort of interference when I connect the wire for the sound control to the receiver.  Not sure if it's an issue with a ground wire, something in the coding, or what the problem is.  So I'm considering changing the setup.  

I have a couple of Xbee Pro S3B's, Sparkfun Xbee Explorer Regulated, and several different types of Arduino's (Mega, Uno, Nano, I've got a few of each), momentary switches, wires, etc.  You get the idea, just like most of you, I've got a lot of "extra" parts laying around!  So my thought is, build a box (I also have a 3D printer, go figure!) that will house 12-16 momentary switches, connected to an Arduino/Xbee that would become a transmitter.  Add a second Arduino/Xbee combination inside the droid, connected to the Sparkfun MP3 Trigger that would become the receiver.  This would completely isolate the sound system from the Taranis so there should be no interference issues.

I'm good with the actual "building" portion, but need some help with the coding.  Building my droid, I followed what most of the R2 group did and just had to copy their steps so I didn't do anything with the coding of the current setup.  Any help would be greatly appreciated and I can give more details as necessary either here in this thread, through PM's, or email.


   
Quote
Will
 Will
(@will)
Member
Joined: 3 years ago
Posts: 2527
 

@roypaith

Welcome to the forum.

If you mostly copied your droid from the other club members, then it would seem reasonable to assume that they also have had some interference issues. Have you found anyone there who also had your problem and managed to fix ?

Anything seems possible when you don't know what you're talking about.


   
ReplyQuote
(@roypaith)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

@will Most of the people are not using the rc remote.  I had to make some edits to the Arduino code to get it to work and my guy that did it for me does not understand what is going on either.


   
ReplyQuote
(@davee)
Member
Joined: 3 years ago
Posts: 1680
 

Hi and welcome @roypaith,

   Tracking down interference issues can be really tricky when it is on the bench in front of you with lots of test gear ... attempting it over a forum like this requires superhero powers ... sadly, I haven't got any. Nor have I encountered the Trigger board you refer to, so this is only a 'first go' general suggestion to try to track down the cause.

My first suggestion would be to look at your power supply arrangements. Ensure the Trigger board, and any involved audio amplifier, if it is driving a loudspeaker, have completely separate power supply system, with the only earth connection between this 'audio' subsystem and the rest being a single wire associated with the digital inputs to the Trigger board.

... In more detail, I am saying ...

Earthing and power supply arrangements for sensitive analogue circuits, such as audio amplifier chain, should always be kept as separate as possible from digital circuits. When 'digital meets analogue', which in your case is at your Trigger board, special care is needed.

For a simple analogy, imagine (i.e. figuratively ensure) the entire digital part of your system is on one electrical island, and your Trigger board plus audio amplifier is on an adjacent island. Then (simplistically**) the two islands should be joined with just the Trigger digital control lines, plus one earth line. Each island should power all of the equipment on its own territory.

(NB, with mains powered stuff, remember two mains cables could mean a second earth connection route if the power outlets are not isolated from mains earth ... most 'wart' and 'brick on a wire' power supplies are isolated, but equipment with a metal case may not be.)

**Note, I emphasise this is the 'simplest' arrangement, which for these low speed digital connections is probably enough - if the link was higher speed, then there could be more return lines, but that is a different story..

-------------

For test purposes, maybe connect simple (unpowered) headphones to the Trigger board audio output and supply the Trigger board by battery .. perhaps 3 AA cells in series, to see if this reduces/eliminates the stray noises.

Good luck with your investigation ... please report back your findings, as someone may be able to help you further.


   
ReplyQuote
(@roypaith)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

@davee Thank you Dave, appreciate the help.  That all makes perfect sense to me.  I never thought about trying just a set of earbuds into the MP3 trigger.  I am using an amplifier so the setup is, rc receiver connected to the arduino, arduino connected to the MP3 trigger, then the audio jack has a cable running from it into the amp, then from the amp to the speakers.  Everything inside the droid is being powered off of a single onboard battery.  It is an 18 volt battery, and then I'm using step down voltage regulators to get the 12volt and 5volt power needed to the correct components.

I'll give it a shot with the earbuds and separate power to the MP3 trigger and let you know what happens.  Appreciate the help.


   
DaveE reacted
ReplyQuote
(@roypaith)
Member
Joined: 3 years ago
Posts: 4
Topic starter  

Follow up:  I was checking into the wiring this afternoon and found that I had a couple of ground wires not hooked up right, and when I got them all cleaned up, he started working perfectly.  I appreciate the help from everybody, but am still curious about my thoughts on using the Arduino Nano's and Xbee's.  Anybody have any insight?


   
DaveE reacted
ReplyQuote