티스토리 뷰

조도 및 온도 센서, 데이터 로거

Light and Temperature Logger 

 

 


 BILL EARL

Introduction

OK now that we have introduced both the RTC and the SD card and verified that they're working, we can move onto logging!

We'll use a pretty good & detailed demonstration to show off the capabilities of this most awesome data logging shield: We'll log both temperature and relative light levels to determine:

  1. How much does the temperature in a fridge vary as the compressor turns on and off?
  2. Does keeping the door open cause a big temperature drop? How long does it take for it to cool down?
  3. Does the light inside really turn off when the door is closed?

Build It!

 BILL EARL

Items you'll need:

You can get most everything in that list in a discounted pack in the Adafruit shop!

The sensors

We'll use two basic sensors to log data, a CdS photocell to track light (this will tell us when the door has been opened) and a semiconductor temperature sensor to log the ambient fridge temperature.

We have two great tutorials for these sensors on our site, if you haven't used them before or need some refreshment, please read them now!

We will wire the sensors as shown in the diagram below.

Note that we connect ARef, the power pin of the temp sensor, and the light sensor to 3.3V not to 5.0V - we do this because the 5V line is very noisy and the 3.3V regulator is better filtered. In the actual board we used the 3.3V line from the datalogger's regulator, see the images below - in theory its the same as the one off of the Arduino but we trust ours more.

Wiring it up

The prototyping area on the board is a simple array of holes with soldering pads. The steps below show how we built this circuit and illustrate some some basic circuit prototyping techniques. For clarity, we will use the same color wire as shown in the circuit diagram above:

  •  

Position the sensors

The sensors could go anywhere on the prototyping area, but we chose this arrangement to simplify connections between the components later on.

  •  

Prepare some jumpers

Measure a piece of wire (red) long enough to reach from the 3v breakout hole to 1/2" past the temperature sensor. Strip about 3/4" from one end, and about 1/4" from the other.

Measure another one (yellow) long enough to reach from the AREF pin to the hole between the two sensors. Strip 1/2" from one end and 1/4" from the other.

  •  

Install the Jumpers

Place the jumpers as shown, with the long stripped ends nearest the sensors.

Since there are no signal traces between the holes in the prototyping area, we will use the long stripped ends to join the legs of the components on the board.

  •  

Make the connections

  • Solder the first jumper (red) to the 3v hole.
  • Bend the stripped end of the wire so it rests next to the legs of the light sensor, the temperature sensor and the end of the AREF jumper.
  • Fold the sensor legs and AREF jumper legs over the 3v jumper and solder to make the connection.
  •  
  •  
  •  
  •  

Add more jumpers for the Sensors

  • From Analog Pin 0 to the hole near the light sensor and resistor. (white)
  • From GND to the hole next to the other end of the resistor (black)
  • From the Analog pin 1 to the hole next to the center pin of the temperature sensor (green)

And also for the LEDs

  • From L1 to Digital Pin 2 (yellow)
  • From L2 to Digital Pin 3 (yellow)
  •  
  •  
  •  

Solder and trim all connections

Using the same technique of folding the component legs over the jumper - make all connections as shown in the wiring diagram.

Make sure that all connections are soldered. Also solder wires and component legs to the board where they pass through the holes.

  •  
  •  
  •  
  •  

Prepare the Battery Pack

  • Place the black plastic ferrule from the connector over the battery pack wires.
  • Solder the red wire from the battery pack to the center pin
  • Solder the the black wire to the outer barrel.
  • Crimp to hold the wires securely
  • Screw the black plastic ferrule on to cover the solder joints.

Now your Light Temp Logger is wired and ready for testing!

Use It!

 BILL EARL

Sensor test

We'll now test the sensors, using this sketch which is a bit of a mashup of the two examples in our tutorials

Copy Code

here

  1. /* Sensor test sketch
  2. for more information see http://www.ladyada.net/make/logshield/lighttemp.html
  3. */
  4.  
  5. #define aref_voltage 3.3 // we tie 3.3V to ARef and measure it with a multimeter!
  6.  
  7. int photocellPin = 0; // the cell and 10K pulldown are connected to a0
  8. int photocellReading; // the analog reading from the analog resistor divider
  9.  
  10. //TMP36 Pin Variables
  11. int tempPin = 1; //the analog pin the TMP36's Vout (sense) pin is connected to
  12. //the resolution is 10 mV / degree centigrade with a
  13. //500 mV offset to allow for negative temperatures
  14. int tempReading; // the analog reading from the sensor
  15.  
  16. void setup(void) {
  17. // We'll send debugging information via the Serial monitor
  18. Serial.begin(9600);
  19.  
  20. // If you want to set the aref to something other than 5v
  21. analogReference(EXTERNAL);
  22. }
  23.  
  24.  
  25. void loop(void) {
  26. photocellReading = analogRead(photocellPin);
  27.  
  28. Serial.print("Light reading = ");
반응형

'HWDesk > ElectronicParts' 카테고리의 다른 글

Op-Amp를 이용한 삼각파 만들기  (0) 2020.02.20
Noncontact Voltage Detector 조사  (0) 2020.02.17
[DataLogger] TRC test  (0) 2020.02.15
Overview of Data-Logger Shield for Arduino (by Adafruit)  (0) 2020.02.15
TMP006 Hookup Guide  (0) 2020.02.13
반응형
250x250
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/01   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함