Show Posts
Pages: [1] 2 3 ... 10
1  Development / Other Hardware Development / Re: LEGO Arduino board on: January 31, 2012, 10:14:40 pm
I have developed a few Arduino compatible boards for building robots. Take a look at my blog here:

Now here are a few questions on what are you trying to achieve with this project:

1. Do you want at least the same functionality as the NXT controller? I mean 3 motor ports, 4 sensor ports, LCD, buttons, speaker, USB, Bluetooth?
2. Do you want a shield that can be plugged over an Arduino and let people use the Lego motors and sensors or do you want a special made board?
3. How much do you think will be the resale price of such a board/shield?

Depending on the answer, different variants can be made. Let's say you want to replicate a NXT brick with an Arduino compatible controller or shield. Only the Arduino Mega has enough pins and functions to perfectly emulate a NXT brick. The sensor ports on the NXT have one analog pin and 2 digital pins. Times 4, that's 4 analog pins plus 8 digital pins. One port has I2C on the 2 digital pins, so I guess there are only 6 digital pins used. I will have to look closely at the NXT brick schematic to know more. The motor ports have 2 wires that control the motor and 2 wires that read the quadrature encoder. For each motor there is an H-bridge that uses 1 PWM pin and 2 digital pins from the microcontroller, so that makes 9 pins (3 of them being PWM) plus 6 more pins for the encoders. The total is: 21 digital pins, 4 analog and 2 for I2C. Then there are the buttons, the LCD uses the SPI interface and the USB uses the hardware serial interface and another hardware serial interface for the Bluetooth module. So the Mega can surely cover all the pins needed and have spare. But perhaps will not be able to run everything smoothly. The NXT has an ATmega8 that takes care of the motors and encoders and talks to the ARM controller through the I2C interface. So yeah, if you get all the parts and put them together to make a similar controller you end up having a product that will cost about the same as the NXT controller sold separately ($150).

So it all depends what you want to have. To function properly, the NXT sensors and motors need several pins from the microcontroller. Depending how many sensors/motors you want to use with the Arduino, a design can be made based on the ATmega328 or on the ATmega2560.

Before the NXT came to market and before I ever heard about the Arduino I have made a couple of tiny controllers for the old RIS motors and sensors, using a Nemesis and a Perseus controllers (based on PICs) made by Kronos Robotics. I could connect 2 active sensors, 2 motors on both controllers, plus the Nemesis has 2 connectors for a servo and a Sharp IR sensor. The Nemesis also had a dual IR proximity sensor, the Perseus had only a IR receiver that allowed me to remote control it using a TV remote. The Nemesis was housed in a 2 layer 4x4 brick plus base plate, the Perseus was housed in a 2 layer 2x4 brick plus 2 base plates. The page I wrote at the time does not exist anymore, but here are some pictures with robots built with them:

So yeah, the old RIS parts are easy to use with Arduino. I can easily build a robot that uses 2 RIS motors and a bunch of RIS sensors, also some RC servos using the Robot Builder's Shield or the Robot Builder's R-duino that I designed.
2  Topics / Robotics / Re: Will atmega8 handle 6 servos and PWM ? on: May 22, 2011, 06:51:47 pm
If you want to use PWM from Timer1 (pins 9 and 10), the answer is no. Why? Because the Servo library needs Timer1 to function. So, to be able to use PWM and servos, you need to use either Timer0 (pins 5 and 6) or Timer2 (pins 3 and 11). Timer0 is also used by the millis() and delay() functions, so you can't change the frequency. Also, Timer2 is used by the Tone library, so if you plan on using Tone, better use Timer0 for PWM. This is the way my Robot Builder's Shield (see my blog or store from the signature bellow) is set up: Timer0 for motors PWM signal, Timer1 for servos and Timer2 available for Tone.
3  Topics / Robotics / Re: Balancing robot for dummies on: May 21, 2011, 06:54:23 am
PWM on pins 9 and 10 (Timer1) is 16 bit, I see no problem from the resolution there, just make sure the code writes an int not a byte. SparkFun also sells a Digital 6DOF IMU unit that has a 3 axis gyro with a built in 16 bit analog converter and a 3 axis accelerometer with a built in 13 bit analog converter and uses a fast I2C interface (400kHz). I got one, but I have no time to work on this until fall.

On the other hand, the Maple brings out more computing power, but I'm not sure the bot really needs it, unless you're trying to do all in one balancing, driving, mapping, obstacle avoiding and other stuff. I would use one Arduino (or compatible) for balancing and another one (or more) for the rest of the stuff. Why? Because these micros don't have multitasking capabilities  and multiple things need to run at the same time, so having multiple micros running different code at the same time solves this problem without programming tricks that might or might not work. The I2C interface is perfect for communications between modules themselves and with the sensors, plus, more modules can read data from the same sensor.
4  Using Arduino / Motors, Mechanics, and Power / Re: Arduino Mega support 14+ servos? on: March 08, 2011, 09:27:43 pm
Best it to use a Arduino Mega if you need both xBee and SSC32. Also do not connect any of them on UART0, so you can program your board without any problems.

If you want to use both with Arduino Uno or Diecimila, I advise you to connect the SSC32 to UART (115200 baud) and xBee to some other pins and use NewSoftSerial (9600 baud or more, to be determined what works best). You will need to unplug the SSC32 (or use a switch) when you program your Arduino board or you will get an error.
5  Topics / Robotics / Re: Where to find a guide to build a simple robot? on: March 08, 2011, 09:20:28 pm
You should take a look at Let's Make Robots! Lots of robots with Arduino, even robots with 4 motors as you want to do. I am in the process to make a step by step tutorial on how to build the LMR Start Here robot with an Arduino compatible board (designed by me) instead of the Picaxe board. I also use Arduino to build robots, see my blog here or my pages on LMR.
6  Using Arduino / Motors, Mechanics, and Power / Re: Arduino Mega support 14+ servos? on: March 05, 2011, 02:18:56 pm
Try to plug the servos as close to the battery screw connector as possible. Even if the uBEC supplies enough current, the traces might not be able to let it pass to the servos that are further away.
7  Using Arduino / Audio / Re: Using phraselator with SpeakJet and Arduino Uno on: March 04, 2011, 05:18:13 pm
You can use a button to let the Arduino know it has to forward all communications from the hardware serial to the pins where the Speakjet is connected, then do a loop like this:

      byte pc2spkjet = digitalRead(hwRxPin);
      digitalWrite(spkjetTxPin, pc2spkjet);
      byte spkjet2pc = digitalRead(spkjetRxpin);
      digitalWrite(hwTxPin, spkjet2pc);

Of course, hwRxPin is 0, hwTxPin is 1, spkjetRxPin and spkjetTxPin are what ever you choose (2 and 3 in your example). And don't forget to set the pins to input (Rx) and output (Tx) using the PinMode command in setup().
This works at 9600 baud. For higher baud rates, you need to use the fast digitalRead and Write.
8  Using Arduino / Motors, Mechanics, and Power / Re: setting an angle on a continuous rotation servo on: March 02, 2011, 07:26:00 am
Good answer, but you did not answer the OP's origional question below:    

Can you do this with a continous rotation servo?  ...tell it to turn to 45 degrees and stop there for instance?

Actually, both methods allow that. Any unmodified servo is capable of going to 45 degrees and stay there if you continue supplying the pulses for that position. It will not stay there by itself.

With the first method I showed, the servo has a 360o magnetical sensor with a high resolution and it has a built in microcontroller. You can tell the servo to go to ANY position and stay there. Or to just rotate continuously. The way the magnetic encoder works allows the servo to stop at 45 degrees even after a random number of complete rotations.

The second method I showed, is a servo hack, and because of the way the potentiometer is built, you can tell the servo to stop at any degree between about 270 degrees (the range of the potentiometer resistance), for the rest until 360 degrees it is unresponsive. But, there are 360 degrees potentiometers out there (minus about 2-3 degrees), easy to replace the original one. Just look at the video and you will see the servo rotating continuously and then stopping at a certain degree and staying there until a new position was issued.

Of course, if you buy a continuous rotation servo and do not modify it, you can't tell it to go to 45 degrees and stop there!
9  Using Arduino / Motors, Mechanics, and Power / Re: setting an angle on a continuous rotation servo on: February 28, 2011, 07:48:03 am
Since no one gives an answer to the question of the topic, I have to step in and show you some methods to hack a servo to get both regular and continuous rotation:

1. Replace the electronics in your servo and get full positional control. The perfect solution, but costly:
Nowadays you can buy digital servos that already have built in these electronics.

2. Modify your servo for continuous rotation as usual, then open up your potentiometer, cut off the stop, then add a transistor triggered relay that replaces the potentiometer with 2 resistors; use a separate wire to trigger the relay to turn your servo into a continuous rotation servo or a regular servo:

I hope these links will help other people that are looking to use a servo in both rotation modes.
10  Topics / Robotics / Re: Arduino Controller on: February 16, 2011, 11:25:24 pm
I am using Arduino to build robots. A simple robot that moves around using DC motors and has a few servos to pan sensors or pick up objects is easily doable with an Arduino Diecimila (or Uno). A wireless serial link is also easy to set up using xBee radio modules or Bluetooth, so the computer can decide where the robot should go, send the command, the robot executes it, sends back sensor data and what ever is needed. The only hard part to do is wireless video. As the Arduino does not have enough video processing capabilities, the computer has to do all that. You may try using a wireless network camera or a wireless surveillance camera with the receiver connected to a video capture card on the computer. Another approach can be to use a wireless router (on the robot) that can accept a wired IP camera and has either a serial interface to connect to the Arduino or use an Ethernet shield wired to the router. Or, you can have a Chumby on the robot, with a webcam, and an Arduino. I guess it all depends on what you have available or fits your likeness and budget better.
11  Using Arduino / Microcontrollers / Re: Nokia DKU-5 connectivity problem on: February 16, 2011, 07:22:29 am
12  Using Arduino / Project Guidance / Re: Multiple Servos & Arduino on: February 13, 2011, 04:55:35 pm
Arduino actually has 14 digital pins that can be used as outputs, plus 6 analog pins that can also be used as digital outputs. So, pin wise, you can connect 20 servos to an Arduino. But the Servo library can handle only 12 servos without problems, but you might want to try out the SoftwareServo library that may be able to handle more. I never tried using more than 12, but I'm working on a project where I'll use 12 servos plus another one to pan a sensor to find a clear path for the robot to go. I will generate pulses for the last servo by turning the pin High for the required microseconds then turn it Low and run the code during the rest of the 20 milliseconds period, then loop. I hope it'll work fine.

BTW, I made a board especially for this project: the uServotino robot controller.
13  Using Arduino / Motors, Mechanics, and Power / Re: Motorshield? on: January 27, 2011, 07:48:09 am
I have designed a shield for building robots, called The Robot Builder's Shield. It allows you to control 2 DC motors (up to 1A/motor), 6 servos and read 6 sensors. You also get a prototyping area where you can optionally use a mini breadboard.
14  Forum 2005-2010 (read only) / Forum / Poll in other people's thread? Why possible? on: October 06, 2010, 06:59:42 am
How come people can create polls in other people's thread? This should not be possible. A poll should be created only if you open up a new thread.

Here is an example:
15  Forum 2005-2010 (read only) / Troubleshooting / Re: Is it possible to make Arduino talk without shield on: January 21, 2011, 06:45:36 pm
Here is the list of phonemes, you can try to use them instead of text. You can also play with the intonation in the phonemes.

Quoting original text by Webbot (Clive Webster):
If you are programatically calling the speak method, or your text starts with a '*' character then
 the following text is made up of phonemes with optional pitch numbers.
If you are just 'playing' then it is very likely that you may get an error message - because you have
 used a phoneme that is not in the following list.
The valid phonemes are:-
AY as in 'pale'
AE as in 'black'
AA as in 'car'
AI as in 'fair'
EE as in 'meet'
EH as in 'get'
ER as in 'perk'
IY as in 'site'
IX as in 'sit'
IH as in 'sit!!'
OW as in 'coat'
O as in 'cot'
UX as in 'coot'
OY as in 'voice'
AW as in 'now'
AO as in 'door'
OH as in 'won'
UW as in 'you'
/U as in 'put'
UH as in 'wood'
AH as in 'up'
B as in 'bat'
D as in 'dab'
F as in 'fat'
G as in 'gap'
/H as in 'hat'
J as in 'jab'
K as in 'cat'
L as in 'lag'
M as in 'mat'
N as in 'nap'
P as in 'pat'
R as in 'rat'
S as in 'sat'
T as in 'tap'
V as in 'vat'
W as in 'wag'
Y as in 'yap'
Z as in 'zap'
CH as in 'chair'
DH as in 'this'
SH as in 'share'
TH as in 'thick'
ZH as in 'azure'
CT as in 'fact'
DR as in 'dragon'
DUX as in 'duke'
NX as in 'sing'
TR as in 'track'
When using phonemes you can optionally append a number from 1 to 8 to change the pitch of the phoneme.
So to say 'Welcome everyone' using phonemes we could use 'WEH4LKAHM EH3VREEWON'

Since I have no idea how this stuff works, I just converted it into a library, I can't improve it further. If anyone can do a better job, please do and post the code for others to use, as I did, with the permission of the original developer. Also, he said he did his best at it and can't be convinced to spend more time in this matter. He included his code to his WebbotLib library for building robots with AVR controllers.
Pages: [1] 2 3 ... 10