4.5.7. GrovePi Modules

4.5.7.1. Intro

  • Electronics: An introduction to the basic principals of electronics.
  • Volatage: An introduction to the physics of electricity.
  • Unix: An introduction to the Unix os.
  • grove examples: A list of Dexter Industries example code for GrovePi modules.
  • GrovePi module classes: A repository for the GrovePi module classes.

4.5.7.2. LED

An LED is the simplest possible module for a raspberry pi, as it is responsive only to the provided power. For an LED to emit light, it must be exposed to a voltage greater than a certain threshold value. Above this voltage, the conductivity of the diode increases exponentially and its brightness increases likewise. If the current through the LED becomes too high, the LED will burn out. The following link leads to a tutorial from Dexter Industries for the LED module.

Connect the LED To a digital port. The following code describes an LED class. Since it is connected to a digital output, the voltage has only two states, on and off. The default port for the LED class is D3. The code for the LED class can be found here:

LED

LED

4.5.7.3. Buzzer

Connect the buzzer to a digital port. The default port for the Buzzer class is D3. You will notice that the Buzzer class and the LED class are interchangeable. This is because they work on the same digital principal. Their two values are on and off. The code for the Buzzer class can be found here:

Buzzer

Buzzer

4.5.7.4. Relay

The relay acts as a switch in a circuit. When the value on the relay is 1, it allows current to flow through it. When the value is 0, the relay breaks the circuit and the current stops. Connect the relay to a digital port. The default digital port is D4. The Relay class can be found here:

Relay

Relay

4.5.7.5. Light Sensor

The light sensor measures ligh intensity and returns a value between 0 and 1023. Connect the light sensor to an analog port. The default port is A0. The analog port allows the light sensor to return a range of values. The LightSensor class can be found here:

Light Sensor

Light Sensor

4.5.7.6. Rotary Angle Sensor

The rotary angle sensor measures the angle to which it is turned. Connect the sensor to an analog port. Port A0 is the default. The RotarySensor class can be found here:

Rotary Angle Sensor

Rotary Angle Sensor

4.5.7.7. Barometer

Connect the barometer to an I2C port. In addition to pressure, the GrovePi barometer measures temperature in Fahrenheit and Celcius. The Barometer class can be found here.

Barometer

Barometer

4.5.7.8. Distance Sensor

Connect the distance sensor to a digital port. The grovepi module has a built-in function to read the distance from the distance sensor, but it is improperly calibrated, so this DistanceSensor class has a calibration based on experimental data. The DistanceSensor class can be found here:

Distance Sensor

Distance Sensor

4.5.7.9. Temperature Sensor

The temperature sensor measures both temperature and humidity. Connect the temperature sensor to a digital port. D7 is the default port. The TemperatureSensor class can be found here:

Temperature Sensor

Temperature Sensor

4.5.7.10. Heartbeat Sensor

Connect the heartbeat sensor to an I2C port. The heartbeat sensor returns the heart rate of the wearer. The HeartbeatSensor class can be found here:

image

image

4.5.7.11. Joystick

Connect the joystick to an analog port. A0 is the default port. The joystick has an x, y, and click status based on the current state of the module. The Joystick class can be found here:

image

image

4.5.7.12. LCD Screen

The LCD screen can be used to display text and colors. In order to use it, plug it into one of the I2C ports. The LCD class can be found here:

LCD Screen

LCD Screen

4.5.7.13. Moisture Sensor

Connect the moisture sensor to an analog port. The default port is A0. The MoistureSensor class can be found here:

Moisture Sensor

Moisture Sensor

An example of the implimentation of the moisture sensor from Dexter Industries can be found here. The program is meant to measure the environmental conditions that affect plant growth.

4.5.7.14. Water Sensor

The water sensor measures the amount of water in the environment of the sensor. Connect the sensor to a digital point. D2 is the default port. The WaterSensor class can be found here:

Water Sensor

Water Sensor