Do you have a DIY monitoring project that could use a boost? Here's how to create a 4 channel Wi-Fi sensor system with a 200ft increase in range over most projects you'll find online.

William Grill

January 11, 2017

7 Min Read
How to Build a 4-Channel Wireless Sensor System

Search around online IoT communities and resource sites such as thingspeak and you can find several examples of Wi-Fi-based, Arduino-sourced projects that include a popular wireless sensor application using a HDT11 humidity and temperature sensor. These projects have a number of applications in garden, home, and other automation and monitoring projects, including environmental applications, resource, and utility monitoring.

However, the simplest systems are constrained in that they require both a Wi-Fi environment and that they must be located within some fixed distance from the wireless router.

While this may be overcome with cell based systems, when creating local hotspots you still have limits location and perhaps cost return issues.

This project intends to build on the value found in those other projects by providing a wireless DHT-based sensor that extends the range up to 200 ft while allowing for up to four sensors to be monitored using a wired power source, battery, or a solar-based operation. This specific project is for a greenhouse remotely located a few hundred feet away. Its operation includes the sensors, fans, pumps and a misting system.

The hardware is based on a MicroChip 12F509 (transmitter) and 16F676 controller for the receiver. The application uses an inexpensive 433MHZ (up to 4) transmitters and a single receiver. The remote sensor used in my project was a AM2302, (DHT22 or DHT11) humidity/temperature sensor and was built without the up-convertor and terminal headers, shown in the figures and schematic. It uses a 9-volt battery and 78L05 regulator and can be assembled for about $5-6.

The receiver, which handles up to four sensors, provided with all the LEDs, shown in the schematic below, still comes in at $5. For all four remote wireless sensors and the receiver the total costs come in at about $25.

The transmitter features a 2-bit, settable, sensor id (S1,S2) and a power control signal to be used either as a transmit drive control (GP1), not shown and or for a transmit indicator. The transmitter reads the sensor, qualifies it, formats a 7-byte outgoing message, shown below, and repeats the transmit at a semi-random delay. Scheduling is coded to be pin allocated by qualifying a signal delay at GP1 upon power up. This allows sensor query and transmissions in 30-second or five-minute schedules.

Depending on the available power, the up-convertor, shown in the schematic, may not be needed. The transmitter I used will operate at 5 volts and allows operation up to 12 volts. I have also coded a second pin, GP5, which will translate the degrees celsius to fahrenheit before assembling the transmission bytes and calculating the correct checksum.

At the receiver, the controller monitors the 433MHz receiver’s output, qualifies the message for transmit collision events and the checksum. It then packs the data into a sorted data array based on the received, transmitted sensor’s ID, included in its transmission.

Pacific Design & Manufacturing, Anaheim, Rising Engineering Star, Linz Craig, Lindsay Craig, FundiBots, Golden Mousetrap Awards, GMTs,

Pacific Design & Manufacturing 2017

Registration is open!     Pacific Design & Manufacturing     connects you with over 20,000 engineers and executives, as well as hundreds of leading suppliers, across the advanced design and manufacturing spectrum who understand the value in working together on the industry’s cutting edge.   Register Today!

The controller also responds to hosted DHT request (pin13) for data and returns the data and correct checksum in the format defined by the original sensor. Two input bits, PA0 and PA1, are qualified to determine which of the four monitored sensor data, collected in the data array, and are processed to the output, for each request transaction.

PA4, set low, will include the status, as the first byte of a 6-byte response with the requested data. PA4, set high, will format the DHTin/out pin output information with the data and sequence found on the original selected remote sensor’s 5-byte output. With PA4 left open (high), existing DHT22/11 or AM2302 applications will be able access the four channels and should not see any change in their expected operation.

All the LEDs shown in the schematic are used to provide channel status, including a collision and a receiver ‘hit’ pulse. If any of the four upper bits of the received sensor status are set, they are indicated by flashing the associated channel’s LED.

As the receiver will be integrated with a Wi-Fi module and controller I didn’t mount the hardware on a more permanent board. The receiver parts only include LEDs, the controller, discrete hardware, and the RF receiver module.

The interface should provide a low level sync request of > 2ms. If the request line is not released after 40ms the receiver controller will remain idle and will reset the controller whenever the line is finally released. Shown below, with PA4 grounded, is the output including the status byte.

Sensors can be added in real time without resetting the receiver controller. All data in the receiver’s array are initialized to zero and the status bytes of each channel are pre-loaded with only the channel’s 2-bit address value. The application maintains and sends only the last value of each received and qualified channel.

There are some constraints. The timing, both at the sensor transmit and receiver ends, is based on internal oscillators. Perfection costs money and this application didn’t demand crystal based sources or any extraordinary timing attention. For the sensor side there is also a trade needed between accuracy and power. For a possible solar-based power requirement some compromise was required. While there are no issues with the link transmission, the sensor update scheduling is based on the controller's watch dog timer, (WDT). The WDT is more loosely specified than the processor's internal clock, consequently there will be variation with the sensor update scheduling from sensor to sensor. A few to several seconds, more or less, particularly over the temperature variations the sensor may be exposed to should be expected.

Overall, the application allows for a flexible scheme permitting both this temperature/humidity sensor suite and other custom sensors, such soil and water characteristic, to be forwarded over the link. The use of four channels was selected based on practical considerations and controller memory size. Several available controllers would certainly be able to accommodate eight or more channels and their required memory array requirements.

As all transmissions are asynchronous, the controller code’s transmission protocol is bit synced, at the receiver and evaluates the received data for collisions as well as includes evaluation of the received checksum provided from the transmit sensor controller.

I used a small antenna (17cm), pre-formed and purchased on-line, to fluff up my sensor range. Depending on the specifics of the transmitter/receiver used, transmitter voltage, and the loads presented by the transmitter to receiver path, sensor data, for my link was available from up to 150 to 200 feet. Other OOP link-based products or any transmit telemetry set that will replicate, what is essentially a pulse width modulation input string, would increase the available sensor range to portions of, or multiples of a mile.    

Those with any questions are welcome to contact me via email. 

Parts list:

Receiver

 

 

 

 

 

 

 

Description

 

Part reference

 

Qty

 

Digikiey #

Nnotes

controller

 

PIC16F676

 

1

 

Digikey Stk #: PIC16F676-I/P-ND

other packages available

433MHz 

 

OOP, 5V

 

1

 

 

XD-RF-5V

antenna

 

24 ga copper wire

 

 17cm

 

 

 

LED

 

red

 

6

 

 

or equivilent

resistor RPAK

 

6-470ohm/w bussed

 

1

 

 

or discrete resistors

resistors

 

4.7K

 

1

 

Digikey Stk #:

OK4725E-R52-ND

 

cap

 

10uF

 

1

 

 

 

regulator

 

78L05

 

1

 

Digikey Stk #:

MC78L05ABPGOS-ND

optional */not shown

proto/perf board

 

.1" centers/clad 1 side 

 

-

 

Digikey Stk #:

438-1019-ND

as needed

socket 

 

14pin DIP

 

1

 

Digikey Stk #:

609-4713-ND

optional

Xmitter

 

 

 

 

 

 

 

controller

 

PIC12F509

 

1

 

Digikey Stk #:

PIC12F509-I/P-ND

other packages available

433MHz

 

OOP, 5V

 

1

 

 

XD-FST

antenna

 

24 ga copper wire

 

 17cm

 

 

 

regualtor

 

78L05

 

1

 

Digikey Stk #:

MC78L05ABPGOS-ND

*

sensor

 

DHT22

 

1

 

 

DHT11 or other equvilent

resistor RPAK

 

4-4.7Kohm/w bussed

 

1

 

Digikey Stk #:

CSC4.7KE-ND

or discrete resistors

resistor

 

1.5Kohm 1/4W

 

 

 

Digikey Stk #:

OK1525E-R52-ND

 

diodes

 

1N4148

 

3

 

Digikey Stk #:

1N4148W-FDITR-ND

leaded shown,  *

cap

 

10uF

 

2

 

 

*

proto/perf board

 

.1" centers/clad 1 side 

 

-

 

Digikey Stk #:

438-1019-ND

as needed

up-convertor

 

3.3 to 15V 

 

-

 

 

XL-6009 optional */not shown

socket

 

8 pin DIP

 

 

 

Digikey Stk #:

609-4717-ND

optional

* depending on power source, configuration and or and transmitt voltage requiremnets 

 

 

 

 

 

 

 

[All images courtesy William Grill]

Sign up for the Design News Daily newsletter.

You May Also Like