About

Showing posts with label Arduino. Show all posts
Showing posts with label Arduino. Show all posts

1/26/13

Using a TV remote to control an Arduino

I had bought a couple of pairs of these IR emitters/receivers and wondered if the wavelength of the light would be the same as for standard IR remote controllers for TV sets.

So instead of trying to hook up the emitters, I went straight for the TV remote. I had two available; one universal remote and one Panasonic DVD/TV remote.

The red one is the LTR301 (reciever) and the yellow one is the emitter. (LTR302).

Using IRremote.h, I was able to collect the raw IR codes from the remote control. This required me to remove the file Tone.cpp from the Arduino IDE's /cores folder. The reason for this was that IRremote.h library was implementing the same interrupt handlers. I am not using the tone generation functions in this library, so I just moved it outside the root folder and then IRremote.h would compile eventually :)

Having no use for the actual functions of the remote, I don't bother to translate them. I just made a lookup-table of what to do for each code, and drew out a sketch on paper what button produces what code. An obvious use of some buttons, like the 'center joystick-like pad', usually consisting of four identical left-right and up-down buttons for channel and volume, respectively, was ideal for forward-backward and turning control.

I hooked the IR sensor up with a 10k resistor, this gave me a detection range of about 50cm, straight angeled on the side of the sensor. Not very practical for a remote controlled device, but some modificationm of this could extend the range.

On the other hand, I do have the both the IO shield and the Mega ADK and a spare Android phone, so this could be controlled over BlueTooth or Wifi too. This could be a low level fail-safe input channel, in case the robot has to be shut down at a moments notice, regardless of the potential fickles of BT and WiFi reliability on an Arduino system.

1/11/13

Rover 5 Robot soon ready

So there's been a while since last post.

Huge improvements has been done. The robot is essentially operational. This is what what I have done so far: This robot seems fairly similar to Mr. Explorer, actually.


  1. Rover 5 (4 motor/encoders, the ROV5.3 model) 
  2. DFrobot Robot Base Plate mounted on 50mm standoffs. 9V
  3. Dagu 4 channel motor controller mounted upside-down on 250mm standoffs, right under the pan servo.
  4. Metal framework mostly made of Hoist/Metal Element metal pieces.
  5. Arduino Mega ADK mounted with baseplate and mini breadboard, vertically 9v.
  6. Arduino Ubo R3 mounted with HME parts, including mini breadboard, vertically. 9v.
  7. DFrobot Pan/Tilt Kit  but with extra long U bracket
  8. Maxbotix LV+EZ1 Ultra Sonar (Running on high power 4.5v battery, measured to 4.9 volts)
  9. Dagu/AREXX IR Compound eye. 5v
  10. 8 and 9 mounted on tilt servo with HME parts.
  11. IR detector, using an old PanasonicTV remote to communicate with the detector
  12. Piezo buzzer, photoresitor, 2x LM35 temp sensor, humidity sensor, dewpoint sensor, 2x IR sensors
  13. 4-keys on breadboard for core functions
  14. Sparkfun LCD 09531 128x64 LCD (Running on separate 9V)
  15. Custom 2-tier OS, codenamed 'Defiance', with multitasking and will communicate with you trough LCD and a buzzer. User input is the 4 keys and a TV remote.
  16. Diffused tricolor LED for system status indication.
  17. Mega and Uno communicates vie RX-TX and RX1-TX1. (Still working on that.)
  18. TODO: Hook up my S2 running CM9 and utilize BlueTooth, WiFi and of course its excellent array of sensors, the 1080p camera and the sheer power of a quad core ARM to do the heavy CPU stuff!
Now all code is tested, all components are running separately and the work ahead now is just to tie it together with some neat AI, as well as tidy up the code, gather some more credits (yes i blatantly stole some code here and there).

My primary concern now is to figure out a mechanism that will kill the 4 motor power source in case the 5V controller supply should die. (this situation is not good)

My other problem is that the one of the robot chassis tracks will derail once in a while. I am working on a remedy including weight distribution and tape. I will at the end of this produce a how-to on this whole endeavour.

Here's some pictures of the process and a link to a video that shows the motors working.

The first version of cabling between the motor controller and  a breadboard.
Although it would probably work, I decided to use regular F7F cables instead.

Mounting the LCD. This was not actually a good location, so  it was removed.

First incarnation of the robot.



A later version; with LCD on the back

The other side.

I ended up butting the base plate sideways to recuce overall height

The Uno drives, the motors, the sonar and the IR. It signals the Mega if anything interesting is happening.

The whole thing can be loosened with 4 screws so I can access the motor controller and the battery pack.
 Video:

  http://www.youtube.com/watch?v=RhAFjcacjHo&list=UUb4_Uft1J4XmXQXZqHPF8AA&index=1




12/28/12

Rover 5 test

Finally, I got to test out the controller and motors. I had some problems with the motors stalling at first; it would seem that this revision of the controller is not entirely compatible with the motors. Direction was reversed and also opposite on the same side; leaving me with an if-else block of code to make the desired movement.

Heres a short video:

http://www.youtube.com/watch?v=RhAFjcacjHo


12/1/12

Last post for a week or so, moving to new location!

So we are moving into a new apartment on Tuesday, so robot building and blogging will be suspended to sometime next week, when all has settled down. Here's some more pictures of the Rover 5 project and some pictures and links.

Update: 01-11-12: Some corrections

Resistor calculator (at http://www.1728.org/)
Michaels electronics lessons



I think I am going to attach this breadboard to this
Hoist/Metal Elements frame I came up with.

Setting up a frame for attaching various stuff.

Latest shipment from Robonor.no:
2000x resistor package
200x capacitor package
10x diodes (not pictured)
Protoboard
Standoffs
Screws
20x F/F cables


So far, the main parts of the robot is:

  • 4-motor Rover 5 with encoders
  • Dagu 4 channel 2.5A controller (credits to Dev Donkey for good pictures of wiring and setup)
  • Arduino Mega ADK with TX to an Arduino Uno R3 (slave)
  • Samsung Galaxy S2 with CM9 (planning to get some pan/tilt kits to mount this as a HD camera as well using it for it's CPU power & WiFi/BT)
  • Dagu AREXX IR compound eye
  • Maxbotix LV EZ1 ultra sound sonar (good tutorial here) on a separate 5v circuit for minimum interference. I made a thread on the Sparkfun forum, lots of input there. Thanks guys!
  • Linear temperature sensor + 2 simple temp sensors
  • 16x2 LCD
  • 128x64 LCD on separate 9v course (draws quite a bit of power, trying to avoid dip)
  • Humidity sensor
  • Dew point sensor
  • 2x QRD1114 phototransistors (for rear proximity) (tutorial, same page as EZ1)
  • 2x IR RX/TX transmitters
  • 2x Dual channel 2A motor controllers
  • Pan/tilt arm
  • 2x mini breadboards, one of them mainly for buttons to control OS
  • DFRobot Protoboard

Most of it has been up and running at some point, I am working on the OS to control everything. Lots of code to organize.

I'm trying to build some form of exoskeleton around
fragile parts, like the LCD. It's not that easy, considering
the pan/tilt arm has quite a bit of turning range and
will easily crash into something if the controlling code
has bugs!

Here you can see the Dagu controller mounted beneath the servo too,
as well as IR compound eyes mounted in front.

Top view. Adding more rails and brackets to further extend
mountability.

11/17/12

DFRobot Robot basis plates, Rover 5 mounting hacks

Adding stuff to your robot with 'nonstandard' parts.

'Builder Center - Metal Elements'

Updated 11-21-2012: Minor edits.

I've found that the Hoist sets (mentioned in earlier post) and  these ones are really useful for Arduino/DFrobot/Rover 5 units.

Some of the screws from these kits doesn't fit the basis plate, but all you have to do is to mount an angled bracket from the Hoist/BCME kits with standard DFrobot screws, and then build on the metal parts with the included Hoist/BCME screws. Just be sure that you have a bunch of standard DFRobot screw sets.

Just to give you an idea, an angled bracket (4-40) costs about a dollar at my retailer. This set includes 691 parts (not sure if it that includes the immense amount of screws and nuts as well) and costs about 35 bucks.  

But here are a huge load of beams, plates, brackets of different shapes and configurations. I was able to mount sensors, motors etc. with this kit. Go buy it, you wont regret! They have many different sets, this one with 691 parts are the biggest one they had.

I am not sure Meccano parts fit, they look like they do, but they also cost 4-6 times as much.

Click on images to enlarge!

- Professor Falken

That is a LOT of parts!

Trying out some parts on the back of the Rover

Dagu IR compound eye mounted using these kits.


11/15/12

Robots and Hoist kits ('Intelligent building toys series')

Robots and Hoist kits

 ('Intelligent Building Toys Series')

Updated 11-21-2012: Fixed some typos, some small edits.


This is their smallest kit (atleast in my store) and it costs around 10 bucks.
I bought this first, but I'm going to get their biggest set tomorrow. It has 650 piceces or so. The little one on the picture has 45 peces.

Losts of metal plates and brackets + some tools.
Some of the stuff does not 100% fit DFrobot stuff, but most do.
You will easily find a workaround if you encounter a problem.

Inckuded kit of screws, big and small. The big ones did not fit the
robot basis plate. Havent tried the Hoist screws with DFrobot
screws of standoffts yet, BUT Dfrobot screws and standoff fit with
all the metal parts!

Current revision of my Rover 5, nothing working still....
This revision is based on scavenged PC hardware still.
I will post new pictures as soon as the new mounting options are utilized.

11/14/12

Rover 5 with Dagu 4 motor controller

Controller does not fit rover holes and does not pass trough the
chassis standoffs on the Rover.

Good selection of standoffs, 4x of each type, plus screws and nuts.

Without card mounted

Card mounted under the servo

Encoder wires hooked up. Hope thats the right order!

Dagu Cur/Dir/PWM/GND pins trough an ABIT IDE cable rated 150V and 105 degrees.
Should hold!

11/9/12

Rover 5, mounting old PC parts as chassis

Some more Rover 5 updates! I dismounted some old PC gear and found some stuff I could incorporate.



2 servos mounted and working. (standard DFRobot Pan/Tilt Kit



Rewired the project for easier cable management and handling!

Added som more pushbuttons, which gives better flexibility
using menus

Currently using 4 buttons to operate the OS

Dismounted DVD drives and PC chassis parts are pretty useful now

Here mounted on the Rover 5

Back view

11/3/12

Rover 5 with pan-tilt kit,breadboard and 2 servos mounted

Some more pictures of mounting a pan tilt kit on a Rover 5.

The robot chassis base plate is on a 50 mm standoff to utilize the mounting holes for a servo instead of getting a second multi-purpose bracket. Saw this on a YouTube vid. Follow the "0.1 assembly guide" that comes with the kit (and is the only one produced) as far as you can get without fastening things much, then take a look here if you need. I had to google pretty hard to find some pictures and a short video snippet, but it's out there. The kit also does not come with enough screws to mount it this way. You are supposed to get an extra MP-bracket, they come with the screws too.

HERE is the images I can find. The ones you can see on this page are my own.

These are not mentioned in the assembly instructions
and many people seek help for this kit, but it's supposedly
agreed on that this is how you do it.

Then, on the multi+bracket, put them in like this.
This will fit quite nicely. Not so much with the U-bracket.
Make sure you don't fasten the center screw until the
servo is centered. Then you can take it off, and re-position it.
Here you can also see the positions for mounting
the Arduino base plate (here with Mega ADK and breadboard)
Make sure then, that you can twist it as much as you want in each direction
Try it out. When assembling, keep using two screws to
test out that you can rotate (slowly!) the servos
The standard servos goes up to about 150 degrees
from the data sheet, but mine almost does 170 or so it seems.

Then fasten center screw

I found that there are two holes drilled in the base plate and they
actually fit quite nicely on the Rover like this.
I found some slightly thinner stand-offs from a
computer with long screw length and short stand-off length
that went nicely trough the holes after trying first with
thinner screws. (the pointy ones, I just randomly picked it from
an old computer as well)
Before the camera was out of power, I didn't get to
take a picture of how i stabilized it completely. I'll post that later. There was
a hole quite far to the left that I put in an M3 standoff with a screw
in and put on the nut. It then just sled into the outer ridge under the
breadboard. I'm pretty sure it's not supposed to be done this way
but it worked well for me.
Two 9V batteries, supposed to be taped in here
on opposite side of the breadboard to counter weight.
The 6xAA battery pack also helps putting
center of weight down a bit. 

10/31/12

More Rover 5 building

Got some new parts today from Robonor: (ty for quick shipping!)

* 9V to barrel adapters
* Breadboard buttons
* 10 and 50mm standoffs
* Breadboard cables
* Breadboard

Now I can mount both my Uno and Mega with separate breadboards on the Rover 5, and power them both from 9V, as well as having the built-in separate battery pack for the Rover. With two breadboards, I can now add more buttons and sensors too :)

The previous version of my Rover OS used a potmeter for menu selection, so this will make it a lot easier.

Now I just need to wait for some supplies from Robosavvy in the UK....

1 x IR compound eye 
1 x Dagu - 4 Channel DC Motor Controller with Encoder Support 
2 x SparkFun - Optical Detector / Phototransistor - QRD1114

....which should be here in around 2 weeks or so :) Then the Rover will actually be able to run!

Mean while, I have a ton of literally screwing around to do to get the optimal design and layout.

10/29/12

More Rover 5 progress

As you can see, short stand-offs are too small to mount the servo in the hole.

This is as far down as possible with battery mounted

So while there are still nothing moving here, I'm working on a little OS to control the rover. It will be a breadboard button system:


Here the two buttons are essentially a
2-button keyboard for my Rover 5 OS
Menu selection using a potmeter!

OS screenshot
Clicking button 1 will activate temperature readouts to the LCD
Clicking button 2 works as a 'back' button

Pre-broken pushbutton from the Sparkfun Inventors Kit.
I still managed to get it working with some creative wiring :/


Here's the setup so far. It's basically half the SIK projects on the
same breadboard, all rolled into one 7K 'OS'
As you can see, that is all on an Uno, using all digital PWR but #7. So I just moved the project over to my new Android Mega ADK board, and it worked just the same. Both the Uno and the Mega will run the Rover eventually.