I discussed problems with the hardware in my last blog entry. The general hardware problem discussed in my last blog (january_31st_2010) entry was that we could not get our IR receivers to detect the IR emitters (no tripwire). We built the circuit several times and measured all the outputs which were all accurate… so we decided to wait until today to make further progress.
We found the problem this morning and fixed our hardware! In our attempt to increase the current going through our IR LED's we implemented a Driver chip which cycles between 5V (vcc), PWM and Ground to create a stronger signal. When we measured the voltage this morning with the oscilloscope we noticed that there was a lot of noise on the line. When we measured the frequency of this noise we realized that it was exactly 56.1kHz. Which means somehow our PWM was getting tied into our Vcc. This creates the problem because when the IR receiver receives the frequency through the Vcc it considers the wire as untripped. Even if we remove the IR LEDs or cut the signal the IR receiver would get the signal from the Vcc and consider the wire to be not tripped. We corrected this problem by redoing the wiring.
The hardware we have finalized puts out approximately 55mA-60mA to each IR LED. With stronger IR LED signal we are able to create the tripwire over a longer distance. The 60mA of current provides us with a distance of approximately two feet. The IR LED we are using has a max current rating of 200mA (IR LED datasheet) We have bumped the current to 170mA which should provide us with a distance of approximately two meters, which is enough to cover the length of the door.
The IR LEDs are harder to see in this design, they are located directly across from the black receivers. We cut the extended wires because it was difficult to keep the IR LED steady which made it a pain to keep them focused on the IR Receiver.
The schematic for the hardware can be found in the following PDF: IR Tripwire Schematic. The first page is the schematic of our current hardware which puts out approximately 55mA-60mA of current through each IR LED. The second page is the schematic of our expanded hardware which will put out approximately 170mA-180mA to each IR LED.
The code for the project was created and finalized yesterday. The code was done with broken hardware (discussed earlier in this blog). However we avoided IR receivers/IR emitters altogether by simulating wire the wire trips by connecting the input port to High (Vcc + resistor). The idea for connecting input ports to high was all earmuffs! The code was a success and keeps an accurate count of total people “inside”. The full commented code can be found on Earmuff's latest blog entry counting_code. A video of the complete small scale model can be viewed: Count Video
I have emailed the dining services department tonight to schedule a demo of our project. If they give us an approval we can expand our hardware and implement the project for the benefit of the University and for the benefit of the Students.