|
MAKING THE CONNECTION
Itıs always interesting to see what people
are doing with PICs these days and the Internet PIC2000 contest provided
plenty of fine examples. Among the winners youıll find several practical
applications that demonstrate just how powerful a PIC can be in the
hands of a skilled designer.
Of course, the good design ideas and
practical applications werenıt limited to just the winners. Every
entry to a Circuit Cellar design contest is worthy of mention
because it takes more than just an idea to enter the contestıyou have
to mold and perfect your idea into an actual project. Each project
that arrives is the direct result of the designerıs time, effort,
and money.
And, just because a project doesnıt make
it on the winners list, doesnıt mean that all of the designerıs time,
effort, and money has been wasted. Read Steveıs editorial in the July
issue of the print magazine and youıll find out that the real motivation
behind Circuit Cellarıs involvement in design contests is to
find a new batch of Circuit Cellar authors. Whether you won
the grand prize, didnıt make the prize list, or ran into overwhelming
setbacks that prevented you from submitting the project on time, youıre
always welcome to write an article about what it took to design your
project. (Send your proposals to editor@circuitcellar.com.)
In the past, weıve had design contests
with a prize tier that contained 20 to 30 prizes. This year, the judges
had their work cut out for them as there were only seven prizes to
award. And to make things even more challenging, among the top entries
was a group of projects that all had one thing in commonıEdward Cheung.
Youıll find his name on the Grand Prize-winning project as well as
on the First Prizes in both the Internet Application and Internet
Connectivity categories. My hatıs off to anyone who spends the time
and effort to complete a project for a design contest, but anyone
who goes through it all five times (as Edward did) is certainly worth
mentioning!
Congratulations to all of the contest
winners and all of those who participated in the Internet PIC2000
contest. And, if you donıt think you have the time to enter one of
the upcoming Circuit Cellar design contests, just ask Edward
Cheung if he thinks his time and effort was amply rewarded!
GRAND
PRIZE WINNER
PIC WEB
CAM
by Edward
Cheung
Edward Cheung
Mitchellville, MD
echeung@hst.nasa.gov
There are several web servers on the
Internet offering "live" images [1]. They typically involve
video cameras feeding image capture boards that are contained in large
desktop machines with Ethernet boards. The PIC Web Cam project accomplishes
this with a PIC microcontroller and some off-the-shelf hardware. The
images are obtained from an Olympus D-220L digital camera via its
RS-232 interface. They are then served up by the integral web server
via a standard NE2000 Network Interface Card. The image seen on the
browser is refreshed automatically, leading to a live image.
 |
| Photo 1ıThe front of the sealed
case is clear, allowing the unit to be used in harsh environments.
The yellow board above the camera is custom and holds the PIC.
The Ethernet board is behind the camera. |
A significant difference from previous
PIC-based Web Servers [2] is the Ethernet interface, making this the
first direct Internet connected PIC known to the author. This project
is similar to the PicoWeb Server [3] except for several differences:
ı A PIC16F877 instead of an Atmel microcontroller
is used.
ı The maximum file size is not limited
to one Ethernet packet (1400 bytes). This complicates software considerably
as more of the TCP/IP stack needs to be implemented. This functionality
was needed to accommodate JPG images from the camera, which can
be several tens of kbytes in size.
ı The need for the 16 kbytes of external
RAM is eliminated as all code fits in the PICıs on-board resources.
ı One of the web pages on the server
can be updated in non-volatile storage via any web browser without
using additional software tools.
The completed project is a fully functional
Ethernet web server that also responds to ping (ICMP) requests.
|
|
| Photo 2ıControl panel for the
PIC Web Cam. |
After the PIC Web Cam is connected to
the local Ethernet network, the user can communicate with it by using
ping or by requesting the default home page with the URL: http://IP_ADDRESS,
where "IP_ADDRESS" is the PICıs preselected IP address.
The resultant display on the web browser is shown in Photo 2.
Clicking on "Small Image" will
result in the small image (160 x 120), which is refreshed automatically
every 10 s, and clicking on the "Large Image" yields the
large image (320 x 240) which is automatically reloaded every 30 s.
Lastly, clicking on "Custom" brings up the page that is
customizable by the user via the "Config Custom" link. A
form is then brought up where the existing HTML code of the custom
page is shown. The user can then edit and store the code in nonvolatile
memory.
Data from the camera to the PIC is sent
at 57,600 bps in 2-KB chunks. This is split into two parts since this
is larger than one TCP/IP packet. Multiple groups of 2-KB data are
transferred from the camera to the browser until the entire image
is complete. It takes about 3 s to transfer a small image, and about
6 s for a large image. The PIC web server has been tested with as
many as three simultaneous web clients.
 |
| Photo 3ıClicking on "Config
Custom" on the main control panel leads to this page, where
the user can modify/enter the desired HTML code for the custom
page. Note the name
of the image file is "IB." |
On the custom page, parameters such as
text, background color, image size, and refresh interval can be adjusted
to the users liking. Because the file is stored in the PICıs EEPROM,
a maximum of 256 bytes can be stored.
 |
| Photo 4ıAn example of the resultant
image served up by the PIC if the user clicks on the "Store"
button shown in Photo 3. In this case, the image served up by
the PIC is automatically refreshed every 20 s, leading to a
"live" image. |
This project illustrates what is capable
of a tiny PIC processor, doing the work of a much larger desktop computer
and serving up digital images from a still camera. It should be a
valuable addition to any system requiring an inexpensive yet effective
way of transmitting live images over the web.
REFERENCES
[1] Conventional web camera, http://www.ksc.nasa.gov/countdown/shuttle/camera60.html.
[2] Serial-line PIC web server, http://www-ccs.cs.umass.edu/~shri/iPic.html.
[3] Pico Web server, http://www.picoweb.net.
Internet
Connectivity Category Winners
Internet
Application Category Winners
Circuit Cellar provides up-to-date information for engineers. Visit
www.circuitcellar.com for
more information and additional articles.
For subscription information, call (860) 875-2199, subscribe@circuitcellar.com
or subscribe online.
ıCircuit Cellar, the Magazine for Computer Applications. Posted with
permission. |