Putting robotics at your service™

Free shipping on orders over $200

Arduino Mega based DIY Remote (XBee)

Print view Share :
Previous topicNext topic

Page 1 of 11 [ 160 posts ]

1, 2, 3, 4, 5 ... 11
User avatar
Guru ( offline )
Posts: 4920
Posted: 2011-06-07 10:43 
As I have recently mentioned in some of the other threads, I have been collecting some new components to build myself a second DIY remote control. Some of the components that I have collected and their requirements include:

2 4 function Joysticks (http://www.servocity.com/html/4_function_joystick.html): 3 Analog + 1 digital each: 6A 2D

2 Sliders (http://www.mouser.com/Search/Refine.asp ... 2-9201F-5K + knobs: http://www.mouser.com/ProductDetail/Eag ... P9ug%3d%3d): 2A

1 16 button keypad (I had a different one, but will probably change to: http://www.elexp.com/cmp_1604.htm): 8D

Other switches: 4+ (can be handled by 1 D if added on to keypad logic)

XBee: 1 USART (2 D maybe 3)

1 Display (Trying an OLED like DialFonZo - http://www.sparkfun.com/products/8537): 1 U

Sound: 1D

PC connection: 1U

So I need at least: 6 Analog pins, 12 digital pins, 3 Usarts. Which does not fit on a Basic Atom Pro 28, so I decided to go with an Arduino Mega. I am using ones by SeeedStudio: http://www.seeedstudio.com/depot/seeedu ... 73bf3cbf85
This gives me: 4 USARTS, 16 Analog pins, and 70 digital pins, so leaves me lots of room to experiment and add additional things like Nunchucks (Wii)... I thought about doing this with an Arc32, but I did not have any spare ones sitting around.

I have started to experiment with a rats nest of wiring and have some of the pieces in place, so far I have done the following:

Step 1: I plugged in a 4x4 keypad I had sitting around (different one made by actcomponents.com), that I ordered years ago from Digikey. I put tape over some of the keys to have the same labels as the ones that were used in the DIY. Code is working on Arduino. Easy to hook up, just used 8 digital IO pins. Did not need pull-ups as I simply enabled the ones on the Atmega1280. This now works.

Step 2: I connected up a 128x128 OLED display. Connected to USART, running at 125000 baud rate. I started off with some of DialFonZo BAP code and have it running on the Arduino. Started creating functions to do many of the simple things like display text, numbers... Got some of it working. Will add more as I need it. Will also try to abstract this out into a c++ class, such that I can have different implantations for a simple 2 line or 4 line LCD display.

Step 3: rigged up one of the 4 function joysticks. Have it connected to 3 of the analog inputs, plus 1 digital. Have analog code in place that does the averaging of the last 8 samples (like our BAP code). That part appears to be working. I have some of the centering code in place that scales the output from 0-255 and tries to make the initial centers to be 128. Still need to add the code to read the actual Mins/Maxs for each one. Note: these joysticks appear to give me good values from near 0-1023.

The following picture shows the OLED display with outputs showing the outputs for 1 joystick (Should look familiar to DialFonZo):


Step 4: I connected up an XBee using a parallax USB adapter (http://www.parallax.com/Store/Accessori ... fault.aspx). I have had better luck with these on Atmega based systems than the ones from sparkfun as it does voltage conversion both directions...

Step 4a: I converted my XBee conversion program from Basic for the BAP to an Arduino sketch. Currently only working on Mega, but will add support for non-mega as well.

That is what is completed so far. My next steps will include:

1) build some form of case for these components as they currently are not very portable :lol: This will also include something to clean up the wiring. Maybe a shield, maybe ...

2) Hook up the rest of the current components (2nd joystick, sliders, speaker...)

3) Figure out what I want to display on the OLED. Will probably have a graphical battery indicator (rectangle shows how much left, maybe change color...), show the 3 joystick values for each stick plus slider (value and/or graphic). Maybe some Status areas: Text? Values? Button States? ...

4) Finish porting my DIY Remote code to this new platform. Will take me awhile as I have several other projects going on as well.

That is all for now.

Thoughts?

Kurt


User avatar
Veteran ( offline )
Posts: 112
Posted: 2011-06-09 04:44 
sounds like a dream :) i like it and planning to create same/similar but with BT module

if you be so kind and share firmware and some schematics

_________________
Specialists are predictable. Be afraid of amateurs


User avatar
Rookie ( offline )
Posts: 39
Posted: 2011-06-09 04:52 
Maybe a LCD Display with touchscreen. You would be able to create virtual buttons that change in form, size, labeling and function due to different programs.
Same thing for the sliders and switches. I would also decrease wearable parts und clean up the front panel to make space.

Do you have a CNC mill?

_________________
Regards
Stefan


User avatar
Guru ( offline )
Posts: 4920
Posted: 2011-06-09 09:38 
I will for sure share everything. I don't have any schematics for what I am doing yet. May produce one later as I have things hooked up. These parts are pretty easy to wire in on the mega. The 16 button keypad is simply running a 8 (4 rows and 4 cols) wires from the keypad to the arduino. Software wise you enable the hardware pull-ups. The joysticks I simply wired up 3 wires per axis (+5, GND, and the center one which I connect to an analog pin... Will cleanup soon and post.

Code wise I am still experimenting, I could post bits and pieces that I have so far, like code to read buttons and the like or the sketch that I used to do the XBEE configure, but will wait until I have some more limping along. That is unless some one wants to see some specific stuff now.

I think touch screens would be interesting as well, but decided to first try a simple progression from our first DIY. Maybe something like: http://www.sparkfun.com/products/10089

As for CNC mill? No :( I have drills, jig saw, Dremel, table saw, miter saw...)

I have not played around much with BT yet, but could be fun. I like working with XBees as it makes it easy for me to set it up such that I can control multiple things...

Kurt


User avatar
Rookie ( offline )
Posts: 39
Posted: 2011-06-09 11:59 
Hm, if you need something to be milled just ask. Maybe i can make it for you.
I mill most parts of GFK FR4 if its possible

_________________
Regards
Stefan


User avatar
Veteran ( offline )
Posts: 112
Posted: 2011-06-09 14:13 
i like Xbees too but here in Poland it's quite expensive and rare enough to make decision for BT module.
at the other hand BTM-222 modules promising 100m range so mostly enough. here it costs around 20$ when Xbee around 60$

as a schematic i meant the connections from peripherals to mega board, could be very useful since arduino uses own pin map

eagerly waiting for topic updates :)

_________________
Specialists are predictable. Be afraid of amateurs


User avatar
Rookie ( offline )
Posts: 39
Posted: 2011-06-09 16:44 
Ha, i use BTM-222 too. Unfortunately i havent got them working with BB.

_________________
Regards
Stefan


User avatar
Veteran ( offline )
Posts: 112
Posted: 2011-06-09 17:09 
that would be offtopic but need to ask.

how did you connected BTM to BB? mine works fine with SSC and there is a 74HCT14D (or similar) in between BTM and Tx/Rx pins of SSC. connection ommits MAX232 chip.

_________________
Specialists are predictable. Be afraid of amateurs


User avatar
Rookie ( offline )
Posts: 39
Posted: 2011-06-09 18:20 
viewtopic.php?f=30&t=7429

_________________
Regards
Stefan


User avatar
Guru ( offline )
Posts: 4920
Posted: 2011-06-27 23:19 
Quick update, to say that I have not drooped this project, I have been busy with other projects like testing Arduinos and other non robot tasks, like building a deck and planting trees.

However today I did have a little time to play with this and I am playing around with some of the XBEE code. I now have code that I can run from the debug port connected to the PC that allows me to select a destination. It has all of the code in place to issue the ND command and find all of the XBee that are available and create and maintain a list of them and allow me choose which one to communicate with. Later will have a configuration panel for the display to do this, but waiting until I have more of the hardware connected up.

I still need to make some type of front panel to hold all of the stuff, maybe should take some of you up on the offer. But in the mean time I can continue to play.

Well that is all of the typing I can do for now.
Kurt


User avatar
Guru ( offline )
Posts: 4920
Posted: 2011-07-04 13:49 
While waiting for Botboarduino to arrive, I have been playing some with remote control code. Currently only have one joystick and the buttons hooked up, but it is enough to test a lot of the code. I am still doing configuration with serial port. The display currently looks like:
Attachment:
arduino-remote-2.jpg
arduino-remote-2.jpg [ 8.27 KiB | Viewed 3846 times ]


The code is working well enough now that I can hit 0 on my T-Hex and it starts, can hit other buttons and tell it to walk or the like. Also getting messages to display as you can see walking on the display.

I also hacked up hardware serial for build 22 to allow for output buffering. Have not tested much, but so far it looks like it works on Mega, soon will test on others like UNO and botboardduino.

Still more work to go, but I uploaded current code which includes the serial code in case anyone wants to have a preliminary look.

Kurt


Attachment:
DIY_Remote-110704a.zip [25.29 KiB]
Downloaded 154 times
User avatar
Guru ( offline )
Posts: 2010
Posted: 2011-07-04 14:07 
Hi there.. Really Really interesting ..!!!

Just take a look at the thread..!

I attach a little code for the Arduino with a library that i have edit.

I think i will rejump in the game.. :)


Attachment:
File comment: I think it's the more up to date..
DIY_Remote_Rev5(03-06-2011).zip [5.76 KiB]
Downloaded 141 times

_________________
Eric Nantel - DiaLFonZo
UAV/Drones Specialist

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com
User avatar
Guru ( offline )
Posts: 2010
Posted: 2011-07-05 10:35 
I don't know if i have post that last video yet... if i did.. real sorry.. LOL


_________________
Eric Nantel - DiaLFonZo
UAV/Drones Specialist

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


User avatar
Guru ( offline )
Posts: 4920
Posted: 2011-07-05 10:54 
Looks great! My goal is to implement the same functionality as the earlier DIY XBees which has BAP28... At least for a common communication protocol. As part of this I will be changing the client sides as well to allow for additional data in the packets. Have clients that know their minimum data and ignore additional. Or could add more handshaking where clients say which fields they want...

I like your configuration stuff, may lift some of it. May also extend my protocol some and add the ability for robot to report battery levels maybe as percentage or like an show level as some form of graph, which changes color when below some percentage...

Lots of things to try when I have chance and ...

Kurt


User avatar
Guru ( offline )
Posts: 2010
Posted: 2011-07-05 11:00 
I was more at the "Interface" side when i suddenly have no time.. LOL

Would like to have multiple pages to change function etc..

On that video it show mainly the I/O page wich show the value of potentiometer and digital switch.

_________________
Eric Nantel - DiaLFonZo
UAV/Drones Specialist

RobotShop inc.
Putting Robotics at your service!™
www.robotshop.com

Lynxmotion
Imagine it. Build it. Control it.™
http://www.Lynxmotion.com


1, 2, 3, 4, 5 ... 11

All times are UTC - 5 hours [ DST ]. It is currently 2014-11-26 20:03
Feedback Form
Feedback Form