Panteltje's humidity_pic_udp

a POE ethernet connected humidity and temperature sensor.

This design is for <= 24V POE, do not use 48V with this LM2596 chip.

This project is released under the GPL license

Circuit diagram:



The PCBs in the box:
humidity_and_temperature_pic_udp_in_box_IMG_6211.JPG


The pieces:
humidity_and_temperature_pic_udp_the_pieces_IMG_6221.JPG


The displayed menu via the serial link at 115200 Bd, 1 start bit, 8 data bits, one stop bit, no parity, if you type 'h':


Panteltje (c) humidity_udp_dht22-0.2


          Commands
AnnnENTER          set source IP address A.xxx.xxx.xxx saved in EEPROM
BnnnENTER          set source IP address xxx.B.xxx.xxx saved in EEPROM
CnnnENTER          set source IP address xxx.xxx.C.xxx saved in EEPROM
DnnnENTER          set source IP address xxx.xxx.xxx.D saved in EEPROM
EnnnENTER          set destination IP address E.xxx.xxx.xxx saved in EEPROM
FnnnENTER          set destination IP address xxx.F.xxx.xxx saved in EEPROM
GnnnENTER          set destination IP address xxx.xxx.G.xxx saved in EEPROM
HnnnENTER          set destination IP address xxx.xxx.xxx.H saved in EEPROM
LnnnnnENTER      set source port, saved in EEPROM
PnnnnnENTER      set destination port, saved in EEPROM
S                              show data on serial out, saved in EEPROM
s                              do not show data on serial out, default, saved in EEPROM
v                              print status, IP address, ports, and MACs
h                              help (this)


status report on serial out:

source IP address 192.168.178.81
source port 1081
source MAC 01:02:03:04:05:0A
destination IP address 192.168.178.73
destination port 1081
destination MAC B8:27:EB:0A:2C:43
data to serial out Y


Data via serial out:

RH 64.4 % T 16.2 CS 28 CCS 28


Data received at destination IP (192.168.178.73 here) one entry about every 5 seconds:

netcat -u -l -p 1081
65.7 16.1
65.9 16.2
65.8 16.1
65.9 16.2
65.9 16.1


Some remarks about the asm code.

This code is assembled with gpasm on Linux, it may not work in Microchip Mplab without changes.
In fact I never use simulators, test and debug via serial link, use scope.
MAC address is fixed and needs to be set in the #define in the asm source file and needs to be unique for your LAN.
The sensor software is in a loop that does ARP request, sensor reading, and data transmission about every 5 seconds.
When network changes happen then it will adapt itself that way.

This archive contains the asm, the Makefile, include files, as well as the AM2302 ( is DHT22) sensor datasheet, for assembly gpasm (part of Linux gputis) is required,
however a hex file is included that could be programmed directly into the Microchip PIC 18F14K22,
untar it with
tar -zxvf humidity_pic_udp-0.2.tgz
humidity_pic_udp-0.2.tgz


The ethernet module is ebay item 170929813328, for POE you need to replace the connector by type HLJ-6115ANL ebay item 271891560407


return to main page