Muayad AlhilalDaniel Garver
Published © GPL3+

Mountain Bike Suspension Pressure System

On-board data acquisition for mountain bike air suspension pressures.

IntermediateShowcase (no instructions)10 hours510
Mountain Bike Suspension Pressure System

Things used in this project

Hardware components

Jumper wires (generic)
Jumper wires (generic)
optional shrink wrap was included in the build
×1
Photon
Particle Photon
The project can be completed with just one
×2
Ebay 500 psi pressure transducer
These are the pressure transducers used for the project but others can be used
×1
Suspension Pump head (Schrader valve adapter)
We used Bontrager suspension pumps from trek but any pump can be cannibalized for use
×1
Fittings used to adapt to pressure sensor
Dependent on suspension pump and sensors used this is subject to change. Most parts to adapt these fittings can be found at a local hardware store
×1
2200mh batteries
Any rechargeable battery will work these were selected due to their battery life
×2
OLED Display
×1
Breadboard (generic)
Breadboard (generic)
×1
Water bottle
24 oz or larger dependent on bike carrying capacity
×1

Software apps and online services

Blynk
Blynk

Story

Read more

Schematics

Wiring Diagram

project wiring diagram

Code

Photon 2 OLED controll

Arduino
This is the code for controlling the particle that displays the read out display and writes to the Blynk app
// This #include statement was automatically added by the Particle IDE.
//#include <Adafruit_SSD1306.h>

// This #include statement was automatically added by the Particle IDE.
#include <SparkFunMicroOLED.h>
#include "math.h"
#include <blynk.h>
#define BLYNK_PRINT Serial

char auth[] = "229a6a4dac0e4237ae0058ea8db243da";
BlynkTimer timer;
double pres_front = 0;
double pres_rear =0;
/*
Micro-OLED-Shield-Example.ino
SparkFun Micro OLED Library Hello World Example
Jim Lindblom @ SparkFun Electronics
Original Creation Date: June 22, 2015

This sketch prints a friendly, recognizable logo on the OLED Shield, then
  goes on to demo the Micro OLED library's functionality drawing pixels,
  lines, shapes, and text.

  Hardware Connections:
  This sketch was written specifically for the Photon Micro OLED Shield, which does all the wiring for you. If you have a Micro OLED breakout, use the following hardware setup:

    MicroOLED ------------- Photon
      GND ------------------- GND
      VDD ------------------- 3.3V (VCC)
    D1/MOSI ----------------- A5 (don't change)
    D0/SCK ------------------ A3 (don't change)
      D2
      D/C ------------------- D6 (can be any digital pin)
      RST ------------------- D7 (can be any digital pin)
      CS  ------------------- A2 (can be any digital pin)

  Development environment specifics:
    IDE: Particle Build
    Hardware Platform: Particle Photon
                       SparkFun Photon Micro OLED Shield

  This code is beerware; if you see me (or any other SparkFun
  employee) at the local, and you've found our code helpful,
  please buy us a round!

  Distributed as-is; no warranty is given.
*/

//////////////////////////////////
// MicroOLED Object Declaration //
//////////////////////////////////
// Declare a MicroOLED object. If no parameters are supplied, default pins are
// used, which will work for the Photon Micro OLED Shield (RST=D7, DC=D6, CS=A2)

MicroOLED oled;

void myTimerEvent()
{
    
}
  
void setup()
{
    Particle.subscribe("FrontPSI", FrontPSI, "2e0047000e51353338363333");
    Particle.subscribe("RearPSI", RearPSI, "2e0047000e51353338363333");
    oled.begin();    // Initialize the OLED
    oled.clear(ALL); // Clear the display's internal memory
    Serial.begin(9600);
    Blynk.begin(auth);

    timer.setInterval(250L, myTimerEvent);

}


void FrontPSI(const char *event, const char *data)
{
  pres_front = atof(data) ;
  Particle.variable("FPressure", pres_front);
  oled.clear(PAGE);  
  oled.setFontType(1);  
  
  oled.setCursor(0,0); 
  oled.print("F:");
  oled.print(pres_front,2);
}

void RearPSI(const char *event, const char *data)
{
  pres_rear = atof(data) ;
  Particle.variable("RPressure", pres_rear);
  oled.setCursor(0,32);
  oled.print("R:");
  oled.print(pres_rear,0);
  
  oled.display();
}
void loop()
{


  oled.clear(PAGE);  
  oled.setFontType(0);  
  
  oled.setCursor(0,0); 
  oled.print("F:");
  oled.print(pres_front,0);
  
  oled.setCursor(0,32);
  oled.print("R:");
  oled.print(pres_rear,0);
  
  oled.display();       
  
 Blynk.virtualWrite(V1, pres_front);
 Blynk.virtualWrite(V2, pres_rear);
 
 Blynk.run();

 
 delay(250);

}

Photon 1 Sensors

Arduino
This code controls the particle photon 1 which writes the data from sensors to the cloud
// This #include statement was automatically added by the Particle IDE.
#include <SparkFunMicroOLED.h>
#include "math.h"
// This #include statement was automatically added by the Particle IDE.
#include <blynk.h>
#define BLYNK_PRINT Serial
char auth[] = "15c926f8f8f44628a4eba44b61a64431";

MicroOLED oled;
void setup() {
    oled.begin();    // Initialize the OLED
  oled.clear(ALL); 
Serial.begin(9600); 
}

void loop() 
{
float Front_Pressure = (0.146 *analogRead(A0))-60 ;
float Rear_Pressure  = (0.146 *analogRead(A1))-60 ;
Particle.publish("FrontPSI", String(Front_Pressure));
delay(1000);
Particle.publish("RearPSI", String(Rear_Pressure));

Blynk.virtualWrite(V0, Front_Pressure);
Blynk.virtualWrite(V1, Rear_Pressure);
delay(1000);
Blynk.run();
}

Credits

Muayad Alhilal

Muayad Alhilal

1 project • 0 followers
ME at UNC Charlotte
Daniel Garver

Daniel Garver

1 project • 0 followers

Comments

Add projectSign up / Login