
- #Raspberry pi light logger install#
- #Raspberry pi light logger update#
- #Raspberry pi light logger code#
Light meter project: Disconnect the breadboard You should see the temperature steadily increase and then decrease back to room temperature when you let go of the thermistor. The easiest way to change the temperature of the thermistor is to pinch it between your fingers so that your body warmth heats it up. If you would rather have the temperature displayed in degrees Fahrenheit, then run the program 05_thermometer_f.py instead. For example, if Beta is 3800 and R25 is 1 kΩ, you would use: p.read_temp_c(3800, 1000).Īfter a few seconds, a window will appear, like the one in Figure 2, displaying the temperature. You will find both of these values in the thermistor’s datasheet. The first parameter is the value of Beta for the thermistor, and the second the value to R25 (resistance at 25☌). If you are using your own thermistor, you will need to add two new parameters to the method call. If you look near the top of the file, you will see the line:
#Raspberry pi light logger code#
The code is configured for the thermistor supplied with the MonkMakes Project Box 1 kit.
#Raspberry pi light logger update#
Temp_text.after(1000, update_temp) # Used to update the temperature reading Temperature = "%.2f" % temperature # Round the temperature to 2 d.p.Īpp = App(title = "Thermometer", width="400", height="300") # From the code for the Box 1 kit for the Raspberry Pi by Load and run the 05_thermometer.py program using Mu. It doesn’t matter what colour jumper wires you use, but if you stick to the colours used in the diagram, it’s easier to check that your wiring is correct.

A GPIO template will make this easier – if you don’t have one, you’ll need to carefully count the pin positions. In this project, none of the components needs to be a particular way around.Īgain, using Figure 1 as a reference, connect the GPIO pins on Raspberry Pi to the breadboard. The five holes in each row on the breadboard are connected together under the plastic, so it’s very important to get the correct row for your component leg. Bend the resistor legs so that they fit into the holes.

Using Figure 1 as a reference, push the jumper wires into the breadboard at the positions shown. This will copy the programs used in this tutorial into the mu_code directory, along with some others. To do this, open a Terminal window and run the commands:


Running Mu ensures that the mu_code directory is created, into which we will now copy the program code. If it’s not there, update your system to the latest version of Raspbian.
#Raspberry pi light logger install#
The thermometer project: Install the codeīefore fetching the code from the internet, you should run Mu, which you will find in the Programming section of your main menu. NPN phototransistor (visible light wavelength)īoth projects in this tutorial make use of the PiAnalog Python library that lets you connect analogue sensors to Raspberry Pi without special hardware.Īlthough these projects sense temperature and light, you could easily adapt them to use other types or resistive sensor, including stress sensors, variable resistors, and even some types of gas sensor. Temperature & Light sensor projects: You'll need
