Embedded Ethernet Project

From Kathmann Labs

Jump to: navigation, search

Contents

Embedded Ethernet Sensors

Add this page to your De.lico.us bookmarks

Blow up the image for item descriptions
Blow up the image for item descriptions
The goal of this project is to create a device that can send the values of digital or analog IO over the network to a system to process that data. This can be used for applications like data logging, environmental monitoring, alarm systems, home automation, etc.
The first project in this category will be a simple device capable of monitoring temperature and humidity over the web and using SNMP. Thresholds will be setup for temperature and humidity allowing SNMP traps (for enterprise monitoring applications) or SMTP messages (for SMB customers) in the event those thresholds are exceeded. The proof of concept work for this project was done on a Rabbit Semiconductor BL2600 Wolf SBC. This allowed for really quick prototyping and easy coding, and once comfortable with the project, I switched development to the new PIC18F97J60 PIC from Microchip. The PIC18F97J60 has more than enough IO on the actual chip, along with ethernet built directly into the chip, allowing for quick and easy development. In addition, Microchip has provided a Free TCP/IP Stack that will run on top of that microcontroller. The device will have two options for power. It can be powered through PoE 802.3af or by plugging it into the wall.
The concept behind the temperature / humidity sensor will be that all configuration will be done through a web interface. Items like IP settings, SNMP settings, SMTP settings, and threshold settings will all be setup through a web server running on the PIC18F97J60. The web interface will also show the current temperature and humidity, but should not be used primarily to monitor those variables. SNMP will configured to allow for remote monitoring by systems like Nagios, Cacti, MRTG, HP Openview, etc. For those people or businesses not running an SNMP monitoring system, SMTP will be available to send emails as alerts.
Click here to see the work in progress. There are still some bugs. I haven't finished setting all of the pages up, nor have I set up any of the remote configuration from the webpages. You can also query directly against the device from the internet using SNMPv1 using the DNS name 'kathmann.dyndns.org'. The Humidity should respond on OID 1.3.6.1.4.1.26904.3.2 and the Temperature should respond on OID 1.3.6.1.4.1.26904.3.1
An actual demo of the system as it's working now
- password = "password"
Picture Gallery


Expertise Level

3 out of 5
Electronics Knowledge
C or ASM programming Knowledge
Register level progamming
Networking Knowledge

To-Do List

  • Complete Web Interface & add username and password
  • Tweak SNMP Trap settings
  • Fix broken SMTP
  • Write plugins for Nagios, etc
  • Look into the PoE interfaces, the one I'm looking at now is TI TPS2375
  • Changed the humidity sensor to a lower cost, higher range capacitive sensor. Figured out how to process the signal
  • Prototype the board
  • Print & Assemble the boards
  • Beta test (we will need beta testers once we get to this point. Send me an email if interested)

Hardware

Protoypting

Rabbit Semiconductor BL2600 Wolf SBC
TDK CHS-MSS Humidity Sensor
National Semiconductor LM34 Precision Temperature Sensor

Production

Microchip TC1047 Analog Temperature Sensor
Microchip PICDEM.net 2 Development Board
Humirel HS1101 Capacitive Humidity Sensor
Pulse Engineering PoE RJ45 Jack
TI TPS2375 802.3af PoE Powered Device Controller
Assorted caps, resistors, voltage regulators, ...

Software

Prototyping

Rabbit Semiconductor Dynamic C 9.25
Rabbit Semiconductor SNMP Module

Production

Microchip MPLAB IDE
Microchip C18 C Compiler
Microchip MPLAB ICD2 Programmer / Debugger
Microchip Free TCP/IP Stack

Tools

Solarwinds Engineer Edition Toolset. Already had the license, and it has features like an SNMP Trap receiver
Open Source Project - MIB Navigator
Nagios
Wireshark Network Protocol Analyzer
Tektronix THS720
K&H Products ETS-7000
SciLab - The open source platform for numerical computation (used to model algorithms)

Web Links

Microchip Website
Rabbit Semiconductor Website
SNMPv1 RFC1157
Huge list of SNMP related tools. Most commercial, but have free demos

Current Status


Worked with Microchip support to realize why the ethernet port connected to the PIC18F97J60 wasn't working. As it appears I removed the ETH97J60.c file out of the project by accident. Thanks to Microchip support in helping me to get that back up. Up until this point, I thought the temperature sensor connected to the PICDEM.net 2 was an SPI digital temperature sensor, but just found out it's an analog temperature sensor connected to the AN3 port on the board. This is incidentally the same port I had configured to accept the humidity readings. I am still using the pot on the board rather than the actual humidity sensor. That will be the easy part once the programming is done.
I also got a copy of the TCP/IP 3.80 alpha stack which fixed some of the SNMP bugs that existed in the 3.75 stack. I've tweaked it some and now have it working to correctly report the temperature and humidity, along with the SNMP info (contact / location / name) through the appropriate OIDs. However in the process of fixing the SNMP, I broke the SMTP client I wrote and will have to spend some time debugging that. First I'm going to clean up some of this code to remove the C30 and HiTech C code from the project, along with all of the useless code for items I'm not going to use.
--Nick 15:36, 11 January 2007 (CST)
Worked on the SNMP a bit more last night and got some of the ADC conversions finally working. I also did some testing with the Solarwinds SNMP Real-Time Graph application to see what kinda sampling performance I can get out of the device. The device kept up with the SNMP polls relatively easy, but I'm only able to go down to a 1 second polling interval in the Real-Time Graph application. The humidity AD Channel is still attached to a pot, so I adjusted that just by turning it (thus the really wild graph). I got the fluctuations in the temperature by placing a cold soda can on the temp sensor. See below screenshots:
Screenshots removed so the page doesn't become too long
--Nick 10:14, 17 January 2007 (CST)
Cleaned up the code significantly to get rid of C30 and Hi-Tech C code. Also adjusted the LEDs to work for the final design concept. One LED will come on as soon as the device is initialized, the other LED will come on after the system obtains an IP address (kind of like a network status LED). Enabled the built in FTP server and set one of the push button switches to enable the FTP server. This will allow for firmware upgrades through FTP without having the FTP server always listening (security risk) and eating up system resources. This might change in the future to be enabled through the web interface, so that people wouldn't have to go press a button on all of the sensors for firmware upgrades.
Connected the humidity sensor finally, and got it configured and sampling. The real humidity is being reported on 43.6.1.4.1.26904.3.2, the real temperature (in F) is being reported on 43.6.1.4.1.26904.3.1, and the pot is being reported on 43.6.1.4.1.26904.3.0.
Image:snmpgraph3.gif
--Nick 16:41, 22 January 2007 (CST)
In a moment of sheer stupidity, I deleted the VM that hosted my CVS. With it went all of the code associated with this project, so I get to start over from scratch. Guess this is what "extreme coders" feel like!
--Nick 22:28, 27 February 2007 (CST)
Microchip was generous enough to give me a PICCkit 1 Flash Starter Kit and a Humidity Sensor PICTail Demo Board, so I guess that means I have to get back to work on this project. More to come.
--Nick 12:37, 28 March 2007 (CDT)
Microchip released the new version of the TCP/IP stack (v4.02 if I remember right, maybe 4.03). This version has SMTP client and server support, as well as Telnet, DHCP client and server, etc. I have already found a couple of bugs, especially in trying to run the webpages within the flash memory, but overall it's a really nicely designed stack. I'm hoping to have everything ported over to it shortly and ready to start testing.
--Nick 16:54, 24 April 2007 (CDT)
Personal tools
extras