Show Posts
Pages: [1] 2 3 ... 14
1  Using Arduino / Sensors / Re: Sensors with Arduino Robot on: September 06, 2014, 04:28:05 pm
Have you read this page?

http://arduino.cc/en/Guide/Robot


Do you see the four prototype areas on your robot? You could mount your RFID module there and use jumper wires to interface with the I/O pins.
2  Using Arduino / Sensors / Re: Ultra sonic rangefinder on: July 15, 2014, 11:31:46 am
"sen 0078" looks like a part number from sparkfun. Is it a maxbotix ultrasonic sensor?
3  Topics / Robotics / Re: Android arduino sensor on: July 13, 2014, 04:14:24 pm
http://www.amarino-toolkit.net/index.php/tutorials.html

This will get you started.
4  Using Arduino / Sensors / PIR false trigger on: July 13, 2014, 03:48:53 pm
My concept is to use a Parallax PIR sensor to trigger an Arduino 328 Pro Mini 5V. It seems to work fine other than the false triggering which sometimes can be once a minute or so.

The code is written so that there is a minute of warm up time for the PIR sensor that occurs in the setup. The led then triggers whenever the PIR is high, but the squirt gun can only trigger after ten seconds has elapsed since the last time it triggered and the PIR is high. Could it be electronic noise that triggers the PIR?

In order to stop the false triggers, would it be worth trying any of these?
1. Pull down resistor on the PIR pin?
2. Low pass filter?
3. decoupling on the PIR pin?

I thought I would get an opinion before I tore it apart

5  Topics / Robotics / Re: Has anyone tried the "Ultrasonic Smart Car Kit" from HobbyKing? on: September 28, 2013, 07:25:24 am
LilAbner,
Please post some code and the steps you are making in your progress and we can steer you in the right direction. Right now it sounds to me as if you are wanting someone to give you all the answers to you so that you can give them to your son. How does he (or you) learn that way?
6  Using Arduino / Sensors / Re: Analog Read and PWM conflict on: September 28, 2013, 06:57:24 am
Is the power for your lights supplied through your Arduino or a separate source? In order for anyone to do any kind of meaningful speculating/troubleshooting, you need to supply your full code and a schematic.
7  Using Arduino / Sensors / Re: Multiple XL-Maxsonar reading on: September 27, 2013, 07:07:03 pm
Here are a couple links that can help you:


http://www.maxbotix.com/articles/031.htm

http://playground.arduino.cc/Main/MaxSonar
analogRead? It looks as though you have a mixture of analog and PW modes in your code. If you are trying to use your sensor in PW mode, then you need to use the PW pins on the Arduino, not the analog pins.


Also note the mode filter code example in the Arduino Playground link. It works much better than averaging.  
8  Using Arduino / Sensors / Re: robot with 3 ultrasonic sensors on: September 05, 2013, 08:16:26 pm
http://code.google.com/p/arduino-new-ping/
9  Using Arduino / Programming Questions / Re: Multiple things at once (millis) on: July 03, 2013, 07:25:29 pm
Disconnecting the wires to one of the motors didn't solve the problem, but it affected the behavior. Sometimes the circuit will behave as expected with the one motor turning on for 5 seconds while the led light turns on for five seconds. Other times the light will blink on and off at five second intervals with the motor turning just an eigth turn or so (or not at all). Sometimes they just both stay on constantly until I press the reset.

For the power supply to the motors, I use 6 AA NiMH batteries. (two packs of three wired in series, cheapos) Is it possible that the wires are too skinny? I don't know the gauge, but I'm sure you all are familiar with those. Probably about 28.

The rest of the circuit is described above.
10  Using Arduino / Project Guidance / Re: Using PWM to control 12v 1.5 amp dc motor on: July 02, 2013, 10:48:32 am
http://bildr.org/2012/03/rfp30n06le-arduino/

This link assumes that your motor only needs to turn in one direction. An N-Channel MOSFET is what you want.

 If it needs forward and reverse, you'll need a motor controller. This one is somewhat common, cheap, and easy to program:

http://www.pololu.com/catalog/product/713
11  Using Arduino / Motors, Mechanics, and Power / Re: Driving 4 small geared motors on: July 02, 2013, 07:17:39 am
If you use the TB6612FNG, wire the diodes (schottky or 1N4001) like in this picture for counter emf protection. It will protect your circuit from damage and help your sketch to behave the way you intended.
12  Using Arduino / Programming Questions / Re: Multiple things at once (millis) on: May 28, 2013, 11:45:04 am
I'm sure you're right about it being an electrical problem, but it baffles me. Both motors work fine without the "millis" in my code. For example if I just use delay. or just write the code to turn the motors on without stopping them.

Wouldn't you think 6 fully charged AA NiMH batteries would be fine for those motors? http://www.pololu.com/catalog/product/77 But yes, I will try disconnecting a wire to one of the motors and see if that works. I will also try commenting out part of the code so that only one motor turns on and off with the LED blinking.

Also I will try all this with an arduino board instead of the stand alone 328 to see if that works.
13  Using Arduino / Programming Questions / Re: Multiple things at once (millis) on: May 28, 2013, 05:56:35 am
http://arduino.cc/en/Main/Standalone
I'm using this circuit up to and including the ftdi https://www.sparkfun.com/products/9716 I just use male header pins to plug the ftdi board into. That gives me temporary power to the circuit and allows me to use the serial monitor to debug when I'm not using the 9v described below. I disconnected the AREF pin as suggested in an unrelated thread, but that didn't help my problem.

I'm also using 6 AA rechargeable NiMH batteries for the motors (input to the motor driver) and a 9v battery to a 7805 regulator decoupled with .1uF and 22uF on the input and 100uF and 10uF on the output for the microcontroller.
14  Using Arduino / Programming Questions / Re: Multiple things at once (millis) on: May 27, 2013, 07:26:14 pm
Code:
const byte PWMA = 10;
const byte AIN2 = 2;
const byte AIN1 = 3;
const byte STBY = 4;
const byte BIN1 = 7;
const byte BIN2 = A4;
const byte PWMB = 9;
const byte RedLED = A5;
// Time periods of blinks in milliseconds (1000 to a second).
unsigned long Motorsinterval = 5000;
unsigned long RedLEDinterval = 5000;
unsigned long timeinterval = 2000;
// Variable holding the timer value so far. One for each "Timer"
unsigned long Motorstimer;
unsigned long RedLEDtimer;
unsigned long timer;


void setup()
{
  pinMode(AIN1, OUTPUT);
  pinMode(AIN2, OUTPUT);
  pinMode(PWMA, OUTPUT);
  pinMode (STBY, OUTPUT);
  pinMode(BIN1, OUTPUT);
  pinMode(BIN2, OUTPUT);
  pinMode(PWMB, OUTPUT);
  pinMode(RedLED, OUTPUT);
  Serial.begin(9600);
  digitalWrite(AIN1, LOW);  //FORWARD  ****
  digitalWrite(AIN2, HIGH);    //REVERSE IF HIGH
  analogWrite(PWMA,255);
  digitalWrite(BIN1, LOW);  //FORWARD
  digitalWrite(BIN2,HIGH);  //REVERSE IF HIGH
  analogWrite(PWMB,255);
  Motorstimer = millis ();
  RedLEDtimer = millis ();
}


void toggleMotors ()
{
  if (digitalRead (STBY) == LOW)
  {
    digitalWrite (STBY, HIGH);
  
  }
  else  
  {
    digitalWrite (STBY, LOW);

  }

  // remember when we toggled it
  Motorstimer = millis ();  
}  // end of toggleMotors

void toggleRedLED ()
{
  if (digitalRead (RedLED) == LOW)
  {
    digitalWrite (RedLED, HIGH);
  }
  else
  {
    digitalWrite (RedLED, LOW);
  }
  // remember when we toggled it
  RedLEDtimer = millis ();  
}  // end of toggleRedRedLED


void loop()
{
  
  if ( (millis() - timer) >= timeinterval)
  {
    Serial.print("Time:   ");
    timer = millis ();
    Serial.println(timer);
  }

  if ( (millis () - Motorstimer) >= Motorsinterval)
  {
    toggleMotors ();
  }

  if ( (millis () - RedLEDtimer) >= RedLEDinterval)
  {
    toggleRedLED ();
  }


}


I cleaned up the code a little as suggested and added Serial.print for debugging. Also I changed the PWM pins from 5 and 6 to 9 and 10. I am also attaching a screenshot of the serial monitor.

The motors still only twitch a little, but the LED behaves as expected by turning on for 5 seconds then off for 5 seconds. After a few cycles the motors will turn on indefinitely. AS evidenced by the screenshot, the program appears to be resetting itself.

As I mentioned earlier,  The program behaves as expected if I only use delay instead of millis (motors only). Could it be that my crystal oscillator is damaged? Unfortunately I don't have a spare to test that. Also, this circuit is comprised of a standalone ATmega 328.

15  Using Arduino / Project Guidance / Re: PIR sensor with timer, first time and need help on: May 07, 2013, 07:43:07 am
I need to put serial print to determine when motion starts and ends? So it is most probably then sensor and not the coding right? I'm gonna give it a shot and we'll see how it goes..thanks guy

Yes, with the serial print, you can see when motion starts and stops. Or you can do the same thing with an additional LED so you can look at it instead of the computer screen. Your preference. Let us know how it goes.
Pages: [1] 2 3 ... 14