Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: jeisel on March 08, 2011, 08:34:29 AM

Title: help pls..
Post by: jeisel on March 08, 2011, 08:34:29 AM
i only used alkaline batteries equal to 6v..the servos are rotating at the same direction so the robot keeps spinning..
the LED is not working..is it all about the battery why it doesn't work properly??
pls discuss about the differences of using a battery pack,a battery holder and a 9v bat,,and 6v alkaline battery..

TNX!!much appreciated for ur comments..
Title: Re: help pls..
Post by: newInRobotics on March 08, 2011, 11:52:04 AM
You talk about servos then about LED, then You say that something does not work properly.
Be consistent in explanation of the problem, otherwise, You will not get help You seek.

So, please describe Your problem again in a more consistent manner, because I did not understand a thing  ???
Title: Re: help pls..
Post by: dmclifton on March 08, 2011, 01:29:10 PM
I am assuming this is in reference to the $50 robot.

I'd agree that the issue needs to be described in more detail, and perhaps some pictures of your circuit would be helpful, as well as code you are using to test - for instance - the LED.
Title: Re: help pls..
Post by: Soeren on March 09, 2011, 12:03:38 AM
Hi,

Most problems come down to bad soldering and/or incorrect wiring - use a magnifying glass and lots of light to inspect your work.
Title: Re: help pls..
Post by: jeisel on March 09, 2011, 10:11:18 AM
yes sir,it's about the $50 robot..is the purpose of the LED just to show that the microcontroller receives voltage?
if that so,is the battery the problem why my microcontroller doesn't receives certain volts or current.. I'm using a 4 AA alkaline batteries.. 1.5V each in particular..
tnx^^
Title: Re: help pls..
Post by: Redcap on March 09, 2011, 11:16:58 PM
As Soeren said, first thing to check is that all your wiring is correct (and your joints).

For the LED, check that it's soldered in the right way (anode to positive, cathode to ground/negative), and not backwards.
Edit: As dmclifton pointed out below, the LED is connected to an output pin.


Now, if I understood your first post correctly,
both your servos (one on each side) are rotating ClockWise (or both Counter ClockWise), so the robot is spinning instead of going straight.

This might be a problem with how your photoresistors/photocells are soldered.
Double check the joints and the wiring as it sounds like only one of the photoresistors are giving feedback/input.
Title: Re: help pls..
Post by: dmclifton on March 10, 2011, 09:30:18 AM
yes sir,it's about the $50 robot..is the purpose of the LED just to show that the microcontroller receives voltage?
if that so,is the battery the problem why my microcontroller doesn't receives certain volts or current.. I'm using a 4 AA alkaline batteries.. 1.5V each in particular..
tnx^^

Incidentally, no the LED is not just a power light in the $50 robot schematic. Rather, it is wired to one of the output pins, when you have to set low in order to cause the LED to come on.

Use a multimeter to check voltage between ground and power pins from the battery to see if it is ok, and then you can use that same multimeter to check all the rest of the wiring to make sure power is flowing where you want it to.

Forget about reading the inputs and powering servos at first - use the LED_On() and LED_Off() functions to flip around the LED and see if you can get that working. It is at the end of the regulated power bus, and connected to an output pin on the controller, so is a good test of a large portion of the circuit.
Title: Re: help pls..
Post by: dmclifton on March 10, 2011, 09:32:11 AM
Maybe helpful maybe not, there's a ton of posts from other folks with their problems - here's mine:

http://www.societyofrobots.com/robotforum/index.php?topic=13301.msg98725#msg98725 (http://www.societyofrobots.com/robotforum/index.php?topic=13301.msg98725#msg98725)

If you replace the code in your main .c file with this it does not use any of the other code and isolates it down to just the absolute minimum required to make the LED blink.

Code: [Select]
#include <avr/io.h>
#include <util/delay.h>

#include "global.h"
#include "a2d.h"

void delay_ms( unsigned long int ms ) {

_delay_ms( ms );

}

void delay_cycles( unsigned long int cycles ) {

while( cycles > 0 )
cycles--;

}

void PORTD_HIGH( int position ) {

PORTD |= (1 << position);

}

void PORTD_LOW( int position ) {

PORTD &= ~(1 << position);

}

void LED_ON( void ) {

PORTD_LOW(4);

}

void LED_OFF( void ) {

PORTD_HIGH(4);

}

void configure_ports( void ) {

  DDRD = 0xFF; // Set Port D pins as all outputs
DDRC = 0x00; // Set all C ports for input
PORTC = 0x00; // Make sure pull-up resistors are turned off

}

int main( void ) {

    // Setup input and output ports as such
  configure_ports();

while(1) {

LED_ON();
delay_cycles(1000);
                LED_OFF();
                delay_cycles(1000);

}

return 1;

}