









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










By Meghan Bannon William Healey Ziyi Zhang ECE 445, SENIOR DESIGN PROJECT FALL 2005 TA: Ishaan Gupta 05 December 2005 Project No. 16
The point of this project was to create a module for appliances that would interface with the internet. Each appliance or module would have its own IP address which would allow users to turn the appliance off and on. The project was broken into a few modules which helped for implementation. The two main modules that had to be designed were the Ethernet interface and relay/optocoupler circuit. This circuit was used to protect the microprocessor from damage and also to isolate the 120 volts AC from the appliance. Status of the appliance was added to the webpage. This status showed whether a light bulb had been turned on when the appliance was set to turn on. Our project turned out to be cost effective. Everything worked as planned and there are many opportunities to be explored with this project. ii
We designed a module for appliances for the internet. The module allowed a user to interface with an appliance through the internet. The project was designed for a generic appliance so the only user option was to turn the appliance off or on. The design incorporated an Ethernet board which hosted the website used. The output of this board was a TCP/IP packet. A microprocessor took this packed, parsed it, and output its data. The data went into a circuit which turned the appliance off or on. 1.1 Purpose The main purpose of this project was to enable someone to turn on or off an appliance through the internet. Each appliance module would support one appliance with one IP address. A website, hosted on the module, would allow the user to turn the appliance off or on. This product has many uses in the real world. One main function that we focused on when designing our project was for someone on vacation. Simple timers which turn off and on appliances at the same time each day can seem suspicious to house invaders. This allows the user to turn the appliances off and on whenever they see fit. Originally we wanted to display status on the module using LEDs in case the appliance did not turn on so the user would know the module was in fact working. If the user was not in the same location as the appliance there would be no way to know if the appliance actually came on. To overcome this, we also decided to add status to the website in the case of a lighted appliance. In this way, if a bulb burns out, the website will report that no light is being produced even though the appliance is “on”. 1.2 Specifications Our design was broken down into five modules. A diagram of the modules and how they connect can be found in A.1. The Ethernet board needed to be able to output one of two things. The first possibility was to output a TCP/IP packet. This is the option we originally selected. The data was to be sent out of the board using I2C protocol. The second possibility for the board’s output was to simply output the data sent in the TCP/IP packet. This data was output to easily accessible to the rest of the design. This data was required to be within normal TTL logic voltage range. Our circuit had a few requirements for input and output voltages. To see a diagram of our circuit see B.1. The Ethernet interface board output TTL logic voltages to an optocoupler in our circuit. We therefore needed an optocoupler which would input and output roughly 5 volts for high and 0 volts for low. The other end of our circuit is where our appliance was connected. The circuit was designed to use a relay to do the actual switching off and on of the appliance. This relay needed to support loads up to 110volts AC and at least 10 watts since our test appliance was a 7.5 watt light bulb. 1.3 Subprojects For various reasons our design was broken down into five modules. These modules are planned as follows:
1.3.1 Computer A computer was used to call a GET/index.html HTTP/1.1 command. 1.3.2 Microprocessor The original microprocessor code was to parse a TCP/IP packet and output the data to a pin. Though needed only for testing, it was also designed to create a packet and send it out to the Ethernet Interface board. 1.3.3 Ethernet Interface An Ethernet interface board was needed because the microprocessor speed was too slow to for the Ethernet. The original Ethernet board, CS8900 made by EDTP Electronics, was to capture packets and buffer them for the PIC. The board used, SBC45EC by Modtronix, also parsed the packet and output the data to pins. 1.3.4 Optocoupler/Relay Circuit The purpose of the circuit was to take TTL logic from the Ethernet interface/ microprocessor and turn on the appliance. An optocoupler was used to pass on the data from the Ethernet interface to the rest of the circuit. This protected the Ethernet board in case something went wrong with the circuit or appliance. We used a relay on the other end of the circuit to turn the appliance off and on. 1.3.5 Appliance Theoretically any appliance could plug into our module depending on the relay used in the circuit. We chose to limit the appliance to anything under 10 watts. For example, we used a 7.5 watt night light bulb.
SBC45EC to test our relay circuit. It allowed us to make sure that the output voltage and current levels provided by the microprocessor were sufficient to trigger the opto-coupler, and subsequently, the rest of the relay circuit. Secondly, if we misconnected something while building our relay circuit, we would possibly burn out a relatively cheap microprocessor instead of the expensive Ethernet adapter. Finally, our microprocessor test program allowed us to quickly and easily trigger the relay circuit by simply waving our hand in front of an LED.
The design was broken into a few different components. We did not implement the Ethernet interface, appliance, and computer modules; however, they were used in our design. The implemented modules are as follows: 3.1 Relay Circuit Module The first relay we attempted to use was an unknown model from the ECE parts shop. It was one of the only relays the parts shop had, and most of the markings were worn off. We attached the relay to a voltage source and linearly increased the voltage in an attempt to determine the switching voltage of the relay. We got up to about 30 volts DC and were unable to trigger the relay. The second relay we attempted to use was a Potter & Brumfield KHAU-17A11 relay from the ECE parts store. We were able to trigger the relay with 28 volts DC. The problem with this relay was transforming the low TTL level output from the opto-isolator into the necessary 28 volt must operate voltage. It was also desirable to have our circuit project run from a single 5 volt source. For this reason, we decided not to use the KHAU-17A11 relay. For our final design, we settled on OMR series Dry Reed Relay E82292. This relay was desirable because it has a low must operate voltage, of 3.5 volts. This allows us to switch the relay using TTL voltage levels. The relay supports 110 volts AC, but only 500mA and a maximum load of 10 watts. The relay’s low load rating severely limits the type of appliances that it can drive. However, it was more than sufficient for our demo, using a 7.5 watt light bulb. For real-world applications, this relay should be replaced with a mechanical or solid-state relay capable of driving much greater current loads. For isolation, we originally used a MOC5008 opto-coupler. After building and testing our preliminary relay circuit, it became apparent that the .4 volt maximum output from the MOC5008 was insufficient to drive our relay circuit. We chose to improvise, and create our own opto-isolator using a standard LED, and phototransistor and covering it with electrical tape to eliminate triggering from outside light sources. Our custom opto-isolator device can be replaced with any opto-isolator that both inputs and outputs TTL logic levels. The input to the circuit is one of the pins from the microprocessor. The opto-isolator is driven by standard TTL logic. The output of the opto-isolator is connected to a 2N2222A/ZTX transistor. The transistor amplifies the output of the opto-isolator so that it is sufficient to drive the E82292 Dry Reed Relay. The circuit allows for complete electrical isolation of the 110 volt appliance. It also amplifies the output of the opto-isolator enough to provide sufficient voltage and current to reliably trigger the relay. See B.1. 3.2 Original Microprocessor Module Our original design for the microprocessor involved the microprocessor parsing packets sent by the Ethernet device. The communication between the microprocessor and the Ethernet device was accomplished through the SPI serial protocol (very similar to I2C). The microprocessor would receive raw packets from the Ethernet device by calling a SPI_recv function. The microprocessor would then check the IP-layer header to verify checksum, packet length, and data integrity. After verifying the packet, the microprocessor would determine if the packet is interesting, specifically, if the packet is
After designing the project, we had to test the equipment and circuits to ensure that every component works as desired to ensure a functional product. 4.1 Testing 4.1.1 Optocoupler The first optocoupler we obtained was from the ECE lab shop. From the data sheets, the input current to drive the LED on is 1 mA and the current to turn off the LED is 0.75 mA for a supply voltage of 5 V. We tested the optocoupler chip by using a 0.8 mA current from the function generator into pin 1 and out from pin 2. Next, we applied a 5 V in pin 5 and pin 6 into ground. To find if the optocoupler worked, we measured across pins 4 and 6 with a voltmeter. Pin 4 is the switch pin that would indicate whether the chip works. The voltmeter showed 0 V so we increased and decreased the current from 0.5 mA to 1. mA. By doing the current sweep, we still had no voltage across the photodiode. Therefore, the optocoupler does not work since we tested the currents in the specified range and a few milliamps above and below the suggested thresholds. The second optocoupler is the one we constructed simply from an LED and a photo detector. The LED takes in 1 mA to turn on, we used a 5 V input with a 740 Ohm resistor making a 6.757 mA current. The input current is much greater than the 1 mA needed to drive the LED. We verified the functionality of the LED because we can see light from the LED. The photo detector detects light that the LED emits and turns the switch on. 4.1.2 Relay We tested the first relay trying to turn the switch on with a 5 V input. Since we found the relay in the back of the ECE shop, it has no descriptions or specifications. From the size of the relay and the fact that no voltage between 1 and 25 volts could turn on the relay, we had to abandon the relay. The second relay we bought from Radio Shack, which was driven by 5 volts and can allow a 0.5 A, 120 V, and 10 W to be connected on the appliance side. We applied a 5 V across the switch, and measured the resistance of the output by using a voltmeter. When the input is 0 V, the resistance is infinite and when the input is 5 V, the resistance is 0 so that the switch is closed. From the test, we concluded that this is the relay we needed in our circuit which provided a 5 V input and needed to operate a 120 V AC from the wall. From the table of relay E82292, we found the minimum voltage to turn on the relay is 3.50 V; the maximum voltage to turn off the relay is 0.50 V. The voltage that we input into the relay for it to turn on is 4.88 V therefore satisfies the 3.50 V threshold. To turn off, the non-operating voltage for our circuit is 0 V, which is lower than the release voltage of 0.5 V. The resistance in the relay is 250 Ohms so the nominal current is 24 mA. Our circuit operated at 4.88 V and supplied 19.5 mA, just slightly under the nominal current. 4.1.3 Appliance / Light Bulb We bought a light bulb that is 7 W that works with the functional relay. The light bulb required 120 V AC to turn on and worked as specified. 4.1.4 Relay Circuit
We created the circuit with PSpice, a circuit simulation program. Refer to figure B.1 for the schematic. We had the input as a 5 V DC to model the output of the Ethernet board with TTL voltage output. To test the circuit for off, we changed the voltage from 5 V to 0 V. For output, we simply had a 120 V AC to simulate the voltage of a wall outlet. From the PSpice plots, we can see when the input is 0 V, the output is 0 V; when the input is 5V DC, the output is 120 V AC, which is the exact results we were looking for. 4.1.5 Ethernet Board Once we built and tested the relay circuit, we moved onto the Ethernet aspect of the project which focused mainly on the Ethernet board. We used two of the seven pins on the board, specifically pins 1 and 4. Pin 1 sent a TTL voltage to the relay circuit and pin 4 received the photo detector voltage from the circuit. To test the board, we initially did not connect the board with the relay circuit or the appliance. To test the software on the board, we connected the board to a computer with Ethernet and connected to the board with the IP: 10.1.0.1 and uploaded our control website. We uploaded the website via FTP from the computer using the standard HTTP 1.1 Get request. The website contains a welcome screen that leads to the control page. We tested the board by switching a button from 0 to 1 and from 1 to 0 and measured at the output, which is pin 1. From the voltmeter, we found pin 1 to output 5 V when the website is switched from 0 to a 1 and the output to be 0 V when switched from 1 to 0. From this, we concluded that the board operated effectively. 4.1.6 Microprocessor Test Module Our test microprocessor module consisted of only a PIC 16F676 microprocessor and an LED. This provided us with a quick and efficient way of testing our relay circuit. The overall goal of the program was to have an easy way of switching on and off a TTL logic level. This was accomplished by using a simple LED as a light/motion detector. The light detection was accomplished by measuring fluctuations in the capacitance of the LED. To do this, we first applied a forward bias across the LED for a short period of time. This allowed us to charge the LED’s p-n junction. We then measured the time it took to discharge the p-n junction. We accomplished this by switched the tri-state buffer of the microprocessor pin from output to input, and initializing one of the microprocessor’s timers. We programmed the PIC to continually monitor the input value and wait for it to go low. The time required for the pin to drop to TTL low is inversely related to the amount of light incident upon the LED. The more light that hits the LED’s p-n junction, the faster the junction will discharge. This method allows for a very sensitive light measurement from a device that normally exhibits only a slight response to light. During startup, the first 2-10 seconds, the microprocessor takes continuous light measurements using the technique described above. The measurements are used to establish an upper and lower bound on the lighting level fluctuations inside the room. After the bounds stabilize, the microprocessor makes continuous light level readings. Once one of the readings is outside the established bounds, the alarm is triggered. The alarm consists of flashing the LED, and applying a TTL logic high on one of the unused output pins. After about 10-15 seconds, the alarm terminates, and the cycle repeats. For testing our relay circuit, we attached the unused output pin to the input of the relay circuit. The test microprocessor module proved quite useful as a tool allowing us to quickly and easily simulate the TTL output of the Ethernet board’s microprocessor by simply waving our hand in front of an LED. 4.2 Conclusions
5.1 Labor The cost for labor was calculated out by the following formula: [(Individual hours) + (team hours3)] desired hourly salary = labor cost Our team spent most of our time working as a team. Because there are three members on our team, the “team hours” field was multiplied by three. From our lab notebooks we estimate this value to be around 38.5 hours. “Individual hours” is the total number of hours any of our partners worked separately from the rest of the group. This value we estimate to be about 13 hours. As previously stated, our team worked as a group majority of the time so our individual hours total is very low. To view the tables of our labor refer to equation E1. Our total labor cost was approximately $10275. 5.2 Parts This category is split into to two subcategories, parts used for testing and parts used in the module. This was done because testing parts will only be an expense once, whereas parts used in the project will be an expense for every module produced. The results and calculations for these two subcategories can be seen in tables in Appendix E. 5.2.1 Parts used in testing Our testing used a lot of functional tests using the module and parts in the module; however we also had to do some tests that required extra parts. For example, appliances would not come with this product if purchased in a store. The user would be expected to have their own appliance; however we did not have a simple appliance, such as a light bulb and stand, to use for testing. Our total cost for this section was approximately $14. 5.2.2 Parts used in module In this section our biggest expense was the Ethernet interface board. The rest of the module was very inexpensive. If this product were to be produced, a large number of these boards would be bought, in which case the price may drop, however we did not account for this. Our total cost for this section was approximately $88. 5.3 Conclusion The cost of our prototype was $10377. Each additional unit would cost $88. Products similar to ours sell in stores for around $100 so this is what we chose to sell ours for. This means we would have to sell approximately 861 units to break even. We felt this was a reasonable number of units needed to be sold.
Our project was completed as well as we hoped. The module turned off and on an appliance as well as send light status back to the website to be viewed. This product would still need a lot of work before being introduced to the market. The relay used to switch on the appliance would need to be replaced with one that could handle higher wattage appliances. However, this would drive the price higher because we used a cheaper, reed relay. Our home-made optocoupler would need to be replaced by a real optocoupler that met the necessary specifications. The reason for this is because our optocoupler had to be aligned perfectly in order to work. The circuit and Ethernet board would also have to be packaged into a useable form. If the product were to be sold in a store than the circuit and board could not be visible on the outside for obvious reasons. This product could also benefit to a few added features which were not in our original design due to time restraints. One feature that would have been helpful would have been adding more than one appliance to each module. This could allow one whole room to be monitored using one unit and one IP address. Another way we could have reduced the cost or added other features would have been choosing a different board. Because of time restrictions we bought the first board we found that suited our needs. There are plenty of other boards available that may have been bought at a lower price. Because we would have to buy these boards in mass quantity we could possibly get them at a lower price, also reducing the overall cost.