Online thermometer using Arduino + Freetrionics Ethernet Shield

details

Feature image

Description

One of the projects in Practical Arduino is the “Online Thermometer”, which combines an Ethernet shield with a number of DS18B20 1-wire temperature sensors to allow you to read multiple temperatures and make the values accessible using a web browser. Here we are using the W5100 chipset on the ethernet shield so it would be 100% compatible with the official shield.

For maximum convenience the project can be built on the Freetronics Ethernet shield using its built-in prototyping area.

 

Hardware Requirements

Arduino Uno

Freetronics Ethernet Shield

DS18B20 Dallas 1-wire temperature sensor

4K7 resistors

PCB mount 3 pin male connectors

Line mount 3 pin female connectors

Twisted pair cable or alarm cable

online-thermometer-schematic_large

 

Instructions

The circuit couldn’t be much simpler. As explained in Practical Arduino, the DS18B20 temperature sensor uses a bidirectional serial communications protocol to allow a connection between the host (in this case the Arduino) and the device (the temperature sensor) using just a single data wire. That means we only need to run three wires to each sensor: ground, power, and data. For convenience we used 3-pin PCB-mount connectors, and used a pinout to match the pinout of the DS18B20 itself.

online-thermo-connector-pinout_large

In my prototype I used the Arduino’s analog input lines as the serial data lines. Many people don’t realise that the Arduino analog pins can be used as regular digital I/O lines simply by addressing them using a different pin number.
analog 0 = digital 14
analog 1 = digital 15
analog 2 = digital 16
analog 3 = digital 17
analog 4 = digital 18
analog 5 = digital 19
So to use, for example, analog input pin 2 as a digital pin, you can simply use a regular digital command such as:
digitalWrite( 16, HIGH );
to drive it high. The analog inputs can also be used for software serial or anything else that you can do with a regular digital pin.
Prepare Ethernet Shield
Start by fitting the six PCB-mount connectors to the prototyping area of the Ethernet shield, fixing each one in place by soldering at least one of the pins to its prototyping pad.
As you can see, overlapping the bottom pin of the bottom row of connectors onto the GND rail works out perfectly for the pinout shown above since the bottom pin of each connector is ground. Here we ran the connectors in two rows of three so that the left part of the prototyping area would be kept clear in case if needed to fit a PoE voltage regulator daughter-board in future, but you can run the connectors right across if you prefer. With this arrangement it’s also trivial to expand this to 9 sensors by putting a third row of three connectors across the top with the top pin overlapping the +5V rail: once again handily matching our connector pinout above.
Now turn the shield over and use a short piece of wire to loop around the +5V pins of all the connectors and link them to the +5V rail. Likewise use a piece of wire to link all the GND pins to the GND rail, and you’re done for the power connections. You can see in the pic below that we used orange for +5V and brown for GND:
Sensor Cabling
Wiring up the DS18B20 sensors on their cables with their 4K7 resistors and line-mount connectors is covered in detail in Practical Arduino and needs to be done in exactly the same way.
Sensor with arduino
Prepare the sketch
You can grab the sketch source code from:
Make sure you set the MAC address and IP address as appropriate for your network, paste this sketch into the Arduino IDE, compile it, and upload it to your Arduino. You should now be able to plug your Arduino + Ethernet shield into your network, access its IP address using the browser on your computer, and see the values read from the connected DS18B20 temperature sensors.
Tags: 201802, W5100, Ethernet, Freetronics, Thermometer, Temperature

Feature image

Description

One of the projects in Practical Arduino is the “Online Thermometer”, which combines an Ethernet shield with a number of DS18B20 1-wire temperature sensors to allow you to read multiple temperatures and make the values accessible using a web browser. Here we are using the W5100 chipset on the ethernet shield so it would be 100% compatible with the official shield.

For maximum convenience the project can be built on the Freetronics Ethernet shield using its built-in prototyping area.

 

Hardware Requirements

Arduino Uno

Freetronics Ethernet Shield

DS18B20 Dallas 1-wire temperature sensor

4K7 resistors

PCB mount 3 pin male connectors

Line mount 3 pin female connectors

Twisted pair cable or alarm cable

online-thermometer-schematic_large

 

Instructions

The circuit couldn’t be much simpler. As explained in Practical Arduino, the DS18B20 temperature sensor uses a bidirectional serial communications protocol to allow a connection between the host (in this case the Arduino) and the device (the temperature sensor) using just a single data wire. That means we only need to run three wires to each sensor: ground, power, and data. For convenience we used 3-pin PCB-mount connectors, and used a pinout to match the pinout of the DS18B20 itself.

online-thermo-connector-pinout_large

In my prototype I used the Arduino’s analog input lines as the serial data lines. Many people don’t realise that the Arduino analog pins can be used as regular digital I/O lines simply by addressing them using a different pin number.
analog 0 = digital 14
analog 1 = digital 15
analog 2 = digital 16
analog 3 = digital 17
analog 4 = digital 18
analog 5 = digital 19
So to use, for example, analog input pin 2 as a digital pin, you can simply use a regular digital command such as:
digitalWrite( 16, HIGH );
to drive it high. The analog inputs can also be used for software serial or anything else that you can do with a regular digital pin.
Prepare Ethernet Shield
Start by fitting the six PCB-mount connectors to the prototyping area of the Ethernet shield, fixing each one in place by soldering at least one of the pins to its prototyping pad.
As you can see, overlapping the bottom pin of the bottom row of connectors onto the GND rail works out perfectly for the pinout shown above since the bottom pin of each connector is ground. Here we ran the connectors in two rows of three so that the left part of the prototyping area would be kept clear in case if needed to fit a PoE voltage regulator daughter-board in future, but you can run the connectors right across if you prefer. With this arrangement it’s also trivial to expand this to 9 sensors by putting a third row of three connectors across the top with the top pin overlapping the +5V rail: once again handily matching our connector pinout above.
Now turn the shield over and use a short piece of wire to loop around the +5V pins of all the connectors and link them to the +5V rail. Likewise use a piece of wire to link all the GND pins to the GND rail, and you’re done for the power connections. You can see in the pic below that we used orange for +5V and brown for GND:
Sensor Cabling
Wiring up the DS18B20 sensors on their cables with their 4K7 resistors and line-mount connectors is covered in detail in Practical Arduino and needs to be done in exactly the same way.
Sensor with arduino
Prepare the sketch
You can grab the sketch source code from:
Make sure you set the MAC address and IP address as appropriate for your network, paste this sketch into the Arduino IDE, compile it, and upload it to your Arduino. You should now be able to plug your Arduino + Ethernet shield into your network, access its IP address using the browser on your computer, and see the values read from the connected DS18B20 temperature sensors.
Tags: 201802, W5100, Ethernet, Freetronics, Thermometer, Temperature

COMMENTS

Please Login to comment
  Subscribe  
Notify of