Page 1 of 5 12345 LastLast
Results 1 to 10 of 43

Thread: Welcome the Louverduino!

  1. #1
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Welcome the Louverduino!

    It took 2 days of drawing and laying out in Fritzing and a couple hours to breadboard it but it works! Hopefully I'll get this puppy etched sometime soon and test her out!

    I know the routing isn't pretty, and I HAD to use 1 jumper wire (it was unavoidable), but it should work!

    If anyone thinks they can simplify it (while using a one-layer board) PM me and I'll shoot you the .fz file

    Comments and suggestions welcome


  2. #2
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Welcome the Louverduino!

    Sweet! Looks like you could probably shift down to an even cheaper AVR chip if you wanted to...not sure the cost difference would really justify it unless you're making a lot of them though.

    For the PCB design, if you did something along these lines you could get rid of that jumper line. Ground is ground, it doesn't really matter how it gets there as long as it doesn't blow out.
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  3. #3
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Welcome the Louverduino!

    +rep and fixed Thanks!


  4. #4
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Welcome the Louverduino!

    How big is your code? You could run this on a $4 Atmega 8 if its not too big.

  5. #5
    Code Monkey NightrainSrt4's Avatar
    Join Date
    Jun 2007
    Location
    Your cookie jar
    Posts
    2,679

    Default Re: Welcome the Louverduino!

    It looks pretty good to me, at least coming from a graph theory point of view. You could probably write an algorithm using incidence lists to draw/approximate possible graphs, or pcb layouts in your case. But aside from testing for planarity, which yours essentially is, the only other thing I could think of is to use a take on the shortest path problem to design a layout that used the minimal amount of pcb trace while still creating a planar graph.

    Sorry, going all CS/Math on you. Been stuck designing algorithms for this type of stuff all year, and the last few weeks we've had a focus on graphs.

    Looks good to me as it is. With a small design like this it tends to be more about the visuals and getting everything onto the pcb size that you want than to minimize trace material,etc. Looks good.

  6. #6
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Welcome the Louverduino!

    Quote Originally Posted by Oneslowz28 View Post
    How big is your code? You could run this on a $4 Atmega 8 if its not too big.
    here's the code, and I'm running it on a $4 Atmega 328 lol the smaller chip might be useful for space/trace routing reasons, and I've got a serial IC programmer, but the only programming I know is Arduino, so I'd have no idea how to transfer the coding
    Code:
    // Controlling a servo position using a temperature sensor
    // by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
    // edited 5-12-2010 by Will Lyon to include base setting for servo if voltage not detected on pin 7
    // edited again 7-4-2010 by crenn to simplify the code a little
    // edited yet again 7-5-2010 by crenn to add features
    // edited again 7-21-2010 by Will Lyon - recalibrated servo positions
    // edited again 10-15-2010 by crenn - slow down servo when computer is off
    // edited again 10-15-2010 by Will Lyon, with new VarSpeedServo library to slow servo movement
    // VarSpeedServo library from Korman on Arduino.cc forums
    
    #include <VarSpeedServo.h>
    
    VarSpeedServo myservo;                      // create variable speed servo object to control a servo
    
    //Constants
    const unsigned char CONTROL = 5;            // digital pin used to detect if the system is on or off
    const unsigned char TEMP_SENSOR = 0;        // analog pin used to connect the temp sensor
    const unsigned char MAX_SAMPLES = 10;       // number of temp sensor samples to average
    const unsigned char OFF_POSITION = 180;     // position of servo when no voltage is detected on pin 5
    const unsigned char LOW_POSITION = 160;     // servo position for lowest temp
    const unsigned char HIGH_POSITION = 135;    // servo position for highest temp
    
    //Main global varibles
    char trigger = 0;                           // varible used to store the control pin value
    unsigned int val = OFF_POSITION;            // variable to read the value from the analog pin
    
    unsigned int updateAvgtemp(){
      static int history[MAX_SAMPLES]={0};
      static unsigned char lastHist=0;
      static unsigned char numHist=0;
      unsigned int temp=0;
      unsigned char counter=0;
      unsigned char arcount=0;
      history[lastHist] = analogRead(TEMP_SENSOR);
      if(numHist<MAX_SAMPLES)
        ++numHist;
      arcount=lastHist;
      ++lastHist;
      if(lastHist>=MAX_SAMPLES)
        lastHist=0;
      temp=0;
      counter=0;
      do{
        temp+=history[arcount];
        arcount--;
        if(arcount>MAX_SAMPLES)
          arcount=(MAX_SAMPLES-1);
        counter++;
      }while(counter < numHist);
      return (temp/numHist);
    }
    
    void setup()
    {
      pinMode (CONTROL, INPUT);                                // sets the control pin to input
      myservo.attach(9, HIGH_POSITION, LOW_POSITION);          // attaches the servo on pin 9 to the servo object
      digitalWrite(CONTROL, LOW);                              // ensure internal pullup resistor is disabled.
    }
    void loop()
    {
      trigger = digitalRead(CONTROL);                          // read input of pin CONTROL  and store it
      if (trigger == HIGH){                                       // reads if pin CONTROL, if true, do this:
        val = updateAvgtemp();                                 // read the value of the temp sensor (value with range of 1024)
        val = map(val, 350, 700, LOW_POSITION, HIGH_POSITION); // scale it to use it with the servo (value between 160 and 120)
        myservo.slowmove(val, 0);                              // sets the servo position according to the scaled value
      }
      else {
        while(val<OFF_POSITION){
          val++;
          myservo.slowmove(val, 0);
          delay(100);
        }
        myservo.slowmove(OFF_POSITION, 1);         // sets servo position to 180 if above statment is false, at slowest speed
      }
      delay(125);                                  // wait 25ms for the servo to move to it's new position and also 100ms until it gets the new value
    }

    Quote Originally Posted by NightrainSrt4 View Post
    It looks pretty good to me, at least coming from a graph theory point of view. You could probably write an algorithm using incidence lists to draw/approximate possible graphs, or pcb layouts in your case. But aside from testing for planarity, which yours essentially is, the only other thing I could think of is to use a take on the shortest path problem to design a layout that used the minimal amount of pcb trace while still creating a planar graph.

    Sorry, going all CS/Math on you. Been stuck designing algorithms for this type of stuff all year, and the last few weeks we've had a focus on graphs.

    Looks good to me as it is. With a small design like this it tends to be more about the visuals and getting everything onto the pcb size that you want than to minimize trace material,etc. Looks good.
    Yea I basically tried to fit it all in in as little space as possible. The reason for the empty space @ top left is that the two 10F caps are going to lay flat in that space, so it works out nicely. That's also why the diode and resistor are in the center, so the caps come down to either side

  7. #7
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Welcome the Louverduino!

    well after a lot of messing around with the breadboard I found I could remove a lot of components that turned out to be completely unnecessary altogether. Here is Rev. 3:



    It turns out I didn't need the 5v Regulator, 5v relay, 15ohm resistor or the diode at all. These were put in to change 12v to 5v then charge the caps. However upon further testing the caps charge from the 5v line without these components installed.

    Now the only issue I'm having is after the power supply is shut off, the servo moves to it's closed position slowly as it's supposed to. However, after 3 or 4 mins as the caps drain down, it starts to jitter then shoots almost 180º! This wouldn't be good at all, all I envision is parts breaking anyone have any ideas?

  8. #8
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Welcome the Louverduino!

    Sounds like that might be backflow from the caps. Put the diode back in, see if that fixes it. IMO, any time you're using caps you should have a diode, just to make sure they don't backflow into the circuit.
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  9. #9
    Resident 100HP water-cannon operator SXRguyinMA's Avatar
    Join Date
    Jun 2008
    Location
    MA
    Posts
    5,865

    Default Re: Welcome the Louverduino!

    where in the circuit should I put it?

  10. #10
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Welcome the Louverduino!

    Between the 5V source and the cap, allowing flow from the source to the caps.
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •