EarMuffs's Blog

final thaughts

Welp, we are done the winter session 2010. It was cool. We built a hall sensor, which got approved from the dining hall. So now we can take pictures and also install our stuff. Yeah buddy. So through out the semester we got quite a bit finished. I liked the class because we had to build our own thing, and use all kinds of equipment like the Digital multimeter, an o-scope, microcontroller, leds, driver chips. It was fun working in a lab too. We had our own access card. Like James Bond type stuff. (secret agent man). I feel like a learned a lot too. For example, personal identity safety, and easy pcb board design. I knew how to code a little bit in c language, but after the semester I feel more confident about my abilities. The instructor Steve was pretty cool. He shared a lot of insight on how to make our projects better, and ourselves while doing a presentation. So now I feel more like a people person when I talk during a presentation. Overall this class was pretty good. What is cool though is that I started a project and over time hopefully we can advance it so that way we have sorta like a contribution to the U.D.

Wow got to go now.

· 2010/02/06 14:12 · earmuffs

Coolest thing ever

Today was awsome, we were able to meet with the Sr. Residential Dining Director to discuss our project. We talked about how the project has like trip wires and it counts the people going into the dining hall. He was very impressed. He was italian just like me so, when chainfire and I walked into his office, I started up a little side conversation. Come to find out he was a pretty good guy. He said that we could use him as the contact guy and that he would call the dining hall managers to let them know that we would be doing some testing. He said that it would be useful for the dining hall because they could use an electronic hook-up to know how much food to serve and when to get it ready for the people who are dining in. We have made a lot of progress. To sum things up a little he gave us a yes, and said that he would support our project. Now all we have to do is implement it in the dining hall and see what happens.

Yeah yeah.

· 2010/02/04 10:25 · earmuffs

Final Assembly

We were able ot finish our hardware and also the counting portion to it. The coding fo the website stuff is also finiished. The code for the website can be found here→Code.

This is a pic of our final circuit.

This is the final circuit diagram.

We have the PWM going to the driver and then to the parallel combinatian of resistors(for good current) then that goes to the IR Led, which then shines to the IR sensor. The counting code was implemented into the hardware and now we have the final product.

A video of it working can be seen Here.

Chainfire also has some incite on the hardware: Additional Info

· 2010/02/04 10:00 · earmuffs

Better counting logic

The orginal counting logic diargram was not that great. For 1 it was only going one way. It would only show state count in the in direction. So the new diagram has both directions in and out. Also it is not on a drawn up piece of paper. It is now legit.

also check out more logic code. code progression

· 2010/02/03 17:10 · earmuffs

Counting Code

The first thing we had to do was define our variables. We put them in as global. The code has pretty good coments which would make it easier to follow. We then wanted to achieve a time period in between the states so that way if a person never successfully enters into the place than another person will not trip the counter as having two people going in. So the person now has about five seconds to get into the place, but if a person does not than the timer will reset the states and the timer.

The ideal logic diagram.
Better counting code logic

 int count_out=0; // this is our count of people going out
 int total;       // keeps track of the total people walking in and out
 int count_in=0;  // this is our count of people going in
 int k=0;         // keeping track of states going in
 int j=0;         // keeping track of states going out
 int total_in=0;  // this is the total amount of people in the place
 int Jcount=0;    // keep track of out time count
 int Kcount=0;    // keep track of in time count
 int limit=65535; // max limit for timer
 int jcnt=0;      // keep track of time for interval between out trips
 int kcnt=0;      // keep track of time for interval between in trips
 int cntLimit=5;  // keep track of amount of time its allowed to go through the

This is our actual counting code. This code was put into the for loop that normally is inserted into the program during the start up of a new FreeScale code warrior project file.

for(;;){   
 
     if(kcnt==cntLimit){ // if time takes to long going in the place, will reset states and counting time
      k=0; // state count of the entrance goes to 0
      Kcount=0; //in time count reset
      kcnt=0;   //between the trips time reset
     }
     if(jcnt==cntLimit) {// if time takes to long going out the place, will reset states and counting time
      j=0;  // state count of the exit goes to 0
      Jcount=0; //out time count reset
      jcnt=0;   //between the trips time reset
     }
 
     if(k==0&&PTAD_PTAD3==1){ // did person go into the first trip
          k=1;  // in state 1 was entered
     } else if(k==1&&PTAD_PTAD5==1){ // did person go into the second trip
          k=2; // in state 2 was entered
     } else if(k==2&&PTAD_PTAD7==1){ // did the person go in all the way
          k=0; //person in reset trip in
          count_in+=1;   // add to the number of people who are in the place
     } 
     if(j==0&&PTAD_PTAD7==1){ // is the person starting to go out
          j=1; // out state 1 was exited
     } else if(j==1&&PTAD_PTAD5==1){ // the person is almost out
          j=2; // out state 2 was exited
     } else if(j==2&&PTAD_PTAD3==1){ // the person had left
          j=0; //person out reset
          count_out+=1;  // add to the number of people who had left
     } 
 
    total = count_in - count_out; // now how many people are in the place
 
    if((total)<0){ // we do not want negative numbers or do we (people sneeking in our stuff should stop that though)
    total_in=0; // reset to 0 if there is a negative number
    } else{total_in=total;} // what is our actual total of people in the place
 
    if(Jcount==limit){ // does the out time count match limit
      jcnt++;   // keep timing
      Jcount=0; // reset out time count
    } else if(j!=0) { // at an out state 
      Jcount++; // keep timing
    }
 
    if(Kcount==limit){ // does the in time count match limit
      kcnt++;   // keep timing
      Kcount=0; // reset in time count
    }else if(k!=0){ // at an in state
      Kcount++; // keep timing
    } 
 
    __RESET_WATCHDOG(); 
  }
· 2010/02/02 14:39 · earmuffs
 
Back to top
users/earmuffs/blog.txt · Last modified: 2010/01/07 00:14 by afterburn
 
 
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0