Legible_journey art project
The project's main program controls interactive sound based on bicycle movement. It has two modes:
- Three sounds (s5, s6, s7) that respond to speed ranges:
- 0-7 km/h: "bliss" sound plays
- 7-16 km/h: "story" sound plays
- Above 16 km/h: "deconstruction" sound plays
- Sounds fade smoothly between transitions
- If wheel stops for 30 seconds:
- All sounds stop
- Sequence resets
- Will start fresh when movement resumes
- Sequential playback of sounds over time frames:
- 0-30s: Gradual introduction of s1, s2, s3
- 30s-2m30s: Speed-controlled s4
- 2m30s-4m30s: Variable s5
- Resets after completion
- Speed thresholds adjustable in legible.py:
- SLOW_MAX = 7 km/h
- MEDIUM_MAX = 16 km/h
- Sound transition rate: FADE_RATE = 0.5
- Measurement period: PERIOD = 3.5 seconds
The project's main program. According to the speed of a bike's wheel, the program will adjust independently the volumes of 3 custom audio tracks. Its behaviour can be configured inside config.py
. The program now includes master volume control via a rotary encoder and visual feedback through an RGB LED.
This program reads sensor signals to measure:
- The rotation speed of the main wheel using a Hall sensor
- The movement of the pedal using another Hall sensor
- Tracks milestones based on active riding time
It is a dependency of legible.py
.
- The main wheel sensor measures rotation speed for audio track mixing
- The pedal sensor detects when the bike is being actively pedaled
- When both wheels are moving, the system:
- Tracks active riding time
- Counts milestones (every 1 minute by default)
- Triggers milestone marks every 3 milestones
- Visual feedback is provided through an RGB LED:
- Green brightness increases with milestones
- Blue blinks when audio track volumes change significantly
Manages additional hardware components:
- Shows milestone progress through green brightness levels
- Blinks blue when audio changes occur
- Uses GPIO pins 5 (red), 6 (green), and 13 (blue)
- Controls master volume using a rotary encoder
- Includes save functionality to persist volume settings
- Uses GPIO pins:
- 23 (CLK)
- 24 (DT)
- 25 (SW)
- 16 (Save button)
The configuration file for all components. Key sections include:
- Main wheel sensor (GPIO17)
- Pedal sensor (GPIO27)
- Timing and threshold settings
- RGB LED pin assignments and behavior
- Encoder pin assignments
- Volume control parameters
- Time between milestones
- Number of milestones per mark
- Debug options
- Volume curves for each track
- Mixing and transition parameters
- Raspberry Pi 4B
- 2× Hall effect sensors (for wheel and pedal)
- 2× Magnets (for wheel and pedal)
- 1× RGB LED (common cathode)
- 1× Rotary encoder with push button
- 1× Push button (for saving volume)
- 3× 220Ω resistors (for LED)
- Main Wheel Sensor → GPIO17 (pin 11)
- Pedal Sensor → GPIO27 (pin 13)
- Red → GPIO5 (pin 29) through 220Ω resistor
- Green → GPIO6 (pin 31) through 220Ω resistor
- Blue → GPIO13 (pin 33) through 220Ω resistor
- Common Ground → Any GND pin
- CLK → GPIO23 (pin 16)
- DT → GPIO24 (pin 18)
- SW → GPIO25 (pin 22)
- VCC → 3.3V
- GND → Any GND pin
- Signal → GPIO16 (pin 36)
- GND → Any GND pin
Note: The wiring diagram needs to be updated to include the new components (RGB LED, rotary encoder, and save button)
- Connect all hardware components
- Configure settings in
config.py
if needed - Run
legible.py
- Use the rotary encoder to adjust master volume
- Monitor speed and sound transitions in debug mode
The legible.py program starts on boot. To run manually:
-
Stop existing processes:
ps aux | grep python kill -9 [process_ID]
-
Enable debug output in config.py:
DEBUG_MODE = True DEBUG_SOUND = True # For sound transitions DEBUG_MAIN_WHEEL = True # For speed readings
-
Audio configuration
to see the list of audio devices
aplay -l
edit the audio configuration file
sudo nano /etc/asound.conf