1976 Puch Maxi - APuchalypse Now

I also picked up a bit more hardware and finished up the pannier.

Tie downs added to the top to hold bungies and padlocks added to the side for a little bit of security.
 

Attachments

  • 2015-10-22 006.JPG
    2015-10-22 006.JPG
    875 KB · Views: 346
  • 2015-10-22 007.JPG
    2015-10-22 007.JPG
    849.3 KB · Views: 345
Made a few quick changes. Decided to swap batteries and go with a 12V system instead of 6V.

Also started gutting an old CB350 speedometer.
 

Attachments

  • 2015-10-26 001.JPG
    2015-10-26 001.JPG
    890.7 KB · Views: 327
  • 2015-10-26 002.JPG
    2015-10-26 002.JPG
    913.2 KB · Views: 334
  • 2015-10-26 003.JPG
    2015-10-26 003.JPG
    952.7 KB · Views: 328
  • 2015-10-26 004.JPG
    2015-10-26 004.JPG
    968.6 KB · Views: 341
Just ordered this. Time for shit to get real. :D
 

Attachments

  • 2012-05-07_068-900x600.jpg
    2012-05-07_068-900x600.jpg
    121.4 KB · Views: 342
Gonna find out.

I'm hoping the 50cc of raw power doesn't end up vibrating things too much, but we can also look at potting the whole thing.
 
Had to google what a nixie tube is... I'm assuming this is going to be mashed up with that speedometer bucket somehow?
 
maxDTM said:
Had to google what a nixie tube is... I'm assuming this is going to be mashed up with that speedometer bucket somehow?

That's the plan. Let's hope the execution work out. :p
 
OK... here's some entirely untested code which should be pretty close to what's needed. It's definitely not efficient as it could be. I could simplify out a lot of the math, but I kept everything simple and (hopefully) easy to follow in case anyone else wanted to try something similar. The code calculates everything in Metric and then converts to Imperial so that our friends outside the USA, Britain, Liberia, and Myanmar can also use it. ;)

Code:
#include "NixieTube.h"
#include "math.h"

const int COUNT = 2;
const float TIRE_DIAMETER_IN_INCHES = 21.89;
const int HALL_SENSOR = 2;
const float PI_APPROX = 3.1415;
const float MM_PER_INCH = 25.4;
const unsigned int MS_PER_HOUR = 3600000;
const unsigned int MM_PER_KM = 1000000;
const float KM_PER_MILE = 1.60934;

bool triggered = false;
unsigned long elapsed = 0;
float tireCircInMm = 0;
unsigned int MAX_SPEEDO_VAL = pow(10, COUNT);

NixieTube tube(11, 12, 13, 10, COUNT);
// pin_ds, pin_st. pin_sh, pin_oe(pwm pin is preferred), COUNT

void speedoTrigger()
{
	triggered = true;
}

void setup()
{
	pinMode(HALL_SENSOR, INPUT); //setup the pin to accept input from the hall sensor
	attachInterrupt(0, speedoTrigger, RISING); //speedometer sensor interrupt
	
	tireCircInMm = TIRE_DIAMETER_IN_INCHES * PI_APPROX * MM_PER_INCH; //get the diameter in mm
	
	for(byte i=0; i < COUNT; i++)
	{
		tube.setBackgroundColor(i, Blue);	// set background LED light to blue	for all of the nixies
	}
	
	tube.setBrightness(0xff);	// brightness control, 0x00(off)-0xff
	tube.display(); //turn it on
}

void loop()
{
	 if(triggered)
	 {
		 unsigned int pulsesPerHour = 0;
		 float kmPerHour = 0;
		 float mph = 0;
		 
		 triggered = false; //reset interrupt value so we can come back to this code the next time the wheel goes around
		 
		 elapsed = millis() - elapsed; //get the number of milliseconds that have elapsed since the last trigger event
		 pulsesPerHour = MS_PER_HOUR / elapsed; //number of pulses per hour at the current rate
		 kmPerHour = pulsesPerHour * tireCircInMm / MM_PER_KM; //1000000 is the number of mm in a km
		 mph = kmPerHour / KM_PER_MILE; //convert from km per hour to miles per hour
		 
		 while(mph > MAX_SPEEDO_VAL) //reduce to the correct number of significant digits so we don't overflow the display (e.g. two nixies mean 99 max, three nixies 999 max)
		 {
			 mph = mph - MAX_SPEEDO_VAL;
		 }
		 
		 tube.printf("%i", (int)mph); //output the value to the nixie(s) in serial mode
		 tube.display(); //show it
	 }
}
 
Sonreir said:
Code:
		 while(mph > (COUNT * 10)) //reduce to the correct number of significant digits so we don't overflow the display (e.g. two nixies mean 99 max, three nixies 999 max)
		 {
			 mph = mph - (COUNT * 10);
		 }

I think you want those "COUNT * 10" to be "10 to the power of COUNT". Though, personally I think it'd be cooler to peg it at "(10 to the power of COUNT) - 1", to retain more of the analog vibe.
 
Sonreir said:
Watch and learn.
HA!!... I kinda put that one on a tee for ya didn't I.

More of an out loud thought than a question but I am no doubt glued to the build and have already learned a few things. Proceed.
 
;D

Got a cheapo bicycle speedometer on the way from eBay.

http://www.ebay.com/itm/310958066647

The plan is to utilize the Hall sensor and ditch the unit.

The magnet is designed to clamp onto a spoke and the sensor should mount to the inside of the forks.

Hopefully this thing puts out a square wave, but we'll see.
 
Back
Top Bottom