Show Posts
Pages: [1]
1  Forum 2005-2010 (read only) / Troubleshooting / Re: power for a 12v washer motor project on: January 26, 2009, 08:01:05 am
I'm using Duemilanove.
2  Forum 2005-2010 (read only) / Troubleshooting / power for a 12v washer motor project on: January 26, 2009, 03:08:59 am
My project uses a PIR to activate a 12v car washer motor. The circuit below and sketch all works fine but only if I plug in both the USB to the computer and the DC jack to a 12v wall-wart.

The project now needs to be independant so ideally needs a single rechargeable battery to supply all power. Can I do this with a single battery and if so do I need to make changes to my circuit?



And yes, I'm a newbie.
3  Forum 2005-2010 (read only) / Interfacing / Re: Wii Nunchuck and pan/tilt servo control on: April 25, 2010, 04:51:19 am
I no longer have the original code but my version of it ended up here:
http://www.instructables.com/id/Arduino-Wii-controlled-Lego-Star-Wars-rocket-tur/
4  Forum 2005-2010 (read only) / Interfacing / Re: Wii Nunchuck and pan/tilt servo control on: March 13, 2009, 05:55:28 am
I'm using this sketch to make a wii controlled water shooter. My nunchuck was giving me opposite movement for yaw (x) so fixed it with this small change to the code

  yawServo.SetRotation(-xAnalogPos);

I need just one level of smoothing (equivalent to level 3 in this sketch) and always on, as I need the c and z buttons for other functions. Any suggestions how to do this?
5  Forum 2005-2010 (read only) / Interfacing / battery question on: February 05, 2009, 09:29:36 am
My project needs to power a washer pump, PIR and arduino from a rechargeable NiMH battery.

According to the spec sheet for the pump it is 12v with a 17.8W output at maximum efficiency. The pump is motion activated by a PIR sensor so only needs intermittent use, not constant, so to keep the size and cost of the battery down I'm aiming at 2 hours use. So (17.8 x 2)/12 = 2.96AH, right?

But presumably I need to add power for the Arduino board. The Duemilanove specs say it has a 5v operating voltage and 40ma per I/O pin. I'm using 2 pins, one to the PIR and one to the pump. Do I simply add those figures to the battery voltage and maH or is it more complicated than that?
6  Forum 2005-2010 (read only) / Exhibition / Re: Wi controlled Lego gun turret on: January 23, 2010, 06:18:57 pm
Flyboy: nominally the accelerometers, yes, but pressing the c button activates the joystick so you can use either.

Cr0sh: instructables seems to do that sometimes. Here are the includes
 #include <Wire.h>  
 #include <string.h>  
 #include <stdio.h>  
 #include <Servo.h> // controls the trigger servo only

Sciguy: I have cheap Futaba servos in the Lynxmotion pan/tilt assembly but yes, I think the constant data stream from the inputs is adding to the problem and could be solved with a software fix. I'm a relative newbie so still working on that.

7  Forum 2005-2010 (read only) / Exhibition / Wi controlled Lego gun turret on: January 23, 2010, 12:04:43 pm
Full instructions and code is posted here: http://www.instructables.com/id/Arduino-Wii-controlled-Lego-Star-Wars-rocket-tur/


8  Forum 2005-2010 (read only) / Exhibition / Motion activated water cannon on: February 20, 2009, 06:36:44 am
Y'know, for kids. We call it "Squirt".

http://www.instructables.com/id/Squirt/



This is my first arduino project and I'm amazed it got it to this stage so fast with virtually zero knowledge of electronics or coding just over a month ago. I think that's more down to the arduino than me!

A PIR sensor activates a windscreen washer pump whose nozzle is mounted on a servo. The PIR is in a tube so that it only detects motion in front of it - or when a target is in range. When activated the servo moves to a random position within 30 degrees right or left of center and shoots. It waits a random length of time between half and 3 seconds and moves and shoots again , then repeats and waits to detect further movement. Actual motion tracking is a bit beyond my current abilities so this is a reasonable facsimile that is fun for kids. The sometimes fickle readings of the PIR just add to the randonmess and hence the fun.


Here's the circuit and the code. Any suggested improvements to either are welcomed (sorry the circuit diagram's a bit small!).


Code:
#include <ServoTimer1.h>

/*
*  "Squirt". Jonathan Robson Feb 2009.
*  
*  A PIR activates a servo & pump. Servo moves its arm to a random position between 60 and
*  120 degrees, fires a pump for half second and returns to center (90 degrees). Cycle repeats
*  3 times at random intervals between half and 3 seconds then waits to detect further movement.
*  Circuit based on http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads
*  PIR code adapted from http://www.liquidware.org/view.php?id=63
*  Random code adapted from www.arduino.cc/en/Tutorial/Blink & www.arduino.cc/en/Reference/Random
*  Servo code adapted from http://www.ladyada.net/make/mshield/use.html
*/


int transistorPin = 8;         // transistor base connected to pin 8
ServoTimer1 servo1;            // defines the servo

long randOff = 0;              // Initialise a variable for the OFF time between shots
long randNumber;               // Initialise a variable for servo position angle and delay between shots

void setup()
{
  servo1.attach(10);            //servo on pin 10
  pinMode(8, OUTPUT);           // set the transistor pin 8 as output to pump
  pinMode(5, INPUT);            // set the PIR pin 5 as input
  digitalWrite(8, LOW);         // defines LOW as movement
  randomSeed (analogRead (0));   // randomize

}

    int pinin = 0;                  
    long countint = 0;
  
void loop()
{
    pinin = digitalRead(5);                     // reads the PIR sensor
    while (pinin == 0)
{
    pinin = digitalRead(5);
}
   servo1.write(90);                              //sets servo to center
   randOff = random (500, 3000);                  // generate OFF time between 1/2 and 3 seconds
   delay(randOff);                               // waits for a random time while OFF
   servo1.write(randNumber = random(60, 120));    // servo to random position within 30 degrees of center  
   delay(400);                                     //gives servo time to get there
   digitalWrite(transistorPin, HIGH);             // turns pump on
   delay(500);                                     //fires pump for 1/2 second
   digitalWrite(transistorPin, LOW);               // turns pump off
   servo1.write(90);                               // moves servo back to center
  
   randOff = random (500, 3000);      // generate new OFF time between 1/2 and 3 seconds and repeat
   delay(randOff);                            
   servo1.write(randNumber = random(60, 120));    
   delay(400);                                    
   digitalWrite(transistorPin, HIGH);        
   delay(500);                                  
   digitalWrite(transistorPin, LOW);            
   servo1.write(90);                            
  
   randOff = random (500, 3000);          // generate OFF time between 1/2 and 3 seconds and repeat
   delay(randOff);                                
   servo1.write(randNumber = random(60, 120));      
   delay(400);                                    
   digitalWrite(transistorPin, HIGH);                
   delay(500);                                      
   digitalWrite(transistorPin, LOW);              
   servo1.write(90);                              
  
   delay(3000);                               // gives the PIR time to "settle" before reading again
  
}

9  Forum 2005-2010 (read only) / Bar Sport / Any Arduino users in Shanghai? on: January 17, 2009, 05:33:28 am
Newbie looking for locals to bounce ideas off of and a bit of help with Chinese translations of components for when I go to Beijing Lu.  jrobson1 at mac dot com
Pages: [1]