@charlieman22 avatar
UTC

Nedminder
62 VBB1T Round Tail W/ leaner sidecar
Joined: UTC
Posts: 4834
Location: california
 
Nedminder
@charlieman22 avatar
62 VBB1T Round Tail W/ leaner sidecar
Joined: UTC
Posts: 4834
Location: california
UTC quote
Quote:
A layer of red ink from a Sharpie marker will make that bolt look like a $30 sensor.
ROFL emoticon ROFL emoticon ROFL emoticon
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
I solved my tach problem. Switching the input power from 3.3 to 5v sorted it right out.

I also need to re-crimp a couple of my cable ends, but that's just an annoyance.

I mostly just need to get this sucker mounted so I can take it for a spin.

Sadly, it's supposed to rain non-stop for the rest of the year, so I may have to just get wet for the initial test ride, but I've done dumber things for worse reasons.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
So close...

All the hardware is behaving.

I wrote a little dashboard app that updates with the telemetry in real time.

I built a little foam mount.

And for some reason, it doesn't want to boot when I plug it into the USB adapter I connected to the battery and onboard electrical. To make matters even more frustrating, it was running off the onboard USB over the weekend, which is a quality part and rated for 2.5A, same as the wall wart I've been running it off.

So I'm tied to a plug until I can figure out what's up. Soooooooo frustrating.
Telemetry console app.  Curses FTW.  real app to come, plus an LCD display.
Telemetry console app. Curses FTW. real app to come, plus an LCD display.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
As I consider how I'm going to sort out my power (or lack thereof) problem, I'm starting to think about instrumentation. I considered just getting a really long extension cord, but I don't think that's going to scale to my needs, so I'm back to considering other options.

In the meantime, I added Delta (rate of change) for the CHT and EGT to the dashboard and I have a 20x4 character display ordered that I'll be able to display it on. I already have some RGB LED's (Adafruit NeoPixels in various form factors), so I played around and built a temperature indicator light with them.

It cycles from blue to green to red as the temp rises from 100f up to 325f.

Below 100f and above 325, it also blinks to indicate that it's still warming up (under 100f), and when it's getting into the danger zone (325). Once it hits 350, I crank up the brightness of the LED and it starts fast blinking.

All the thresholds are configurable, so I may play with the numbers a little, but I think I like the fundamental behavior.

The LED is at 10% brightness in the video.

@charlieman22 avatar
UTC

Nedminder
62 VBB1T Round Tail W/ leaner sidecar
Joined: UTC
Posts: 4834
Location: california
 
Nedminder
@charlieman22 avatar
62 VBB1T Round Tail W/ leaner sidecar
Joined: UTC
Posts: 4834
Location: california
UTC quote
Chandlerman - that is pretty cool.
I had a Polini iron cylinder that would seize at 310 CHT - to the damn degree.
309 was fine...
Very nice to have an O-shit light blinking - though I would think a screaming sound - before the screeching sound - would be good too. 🙂
Like the indicator colors a lot.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
I'm already considering adding a warning buzzer. It's not hard, I just don't happen to have one on hand.
@christopher_55934 avatar
UTC

Ossessionato
2007 Stella 225
Joined: UTC
Posts: 3547
Location: Rochester, Minnesota
 
Ossessionato
@christopher_55934 avatar
2007 Stella 225
Joined: UTC
Posts: 3547
Location: Rochester, Minnesota
UTC quote
chandlerman wrote:
I'm already considering adding a warning buzzer. It's not hard, I just don't happen to have one on hand.
How about a turn signal buzzer from a Stella?

Can you make the entire display background color flash and change colors? Might do a better job of getting your attention, especially in daylight.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
Christopher_55934 wrote:
How about a turn signal buzzer from a Stella?
That's going to be 12v. I'll get something thats 1) more of a buzzer than a beeper; and 2) runs on 3.3v or 5v DC so it'll match my board.

And if that doesn't work out, I can always drive a 12v relay with the buzzer on it, but that's extra complexity I'd like to avoid, especially up in the headset which is already an electrical nightmare.

Of course, if this all works out well, I may ditch the GPS speedo, which would get me back both space and get a bunch of wires out of there.

Also...I should add some decent turn signal indicators to my dash. That's not part of the Ves-Pi, just something it occurred to me I should do because I'm the worst at forgetting to turn mine off.
@christopher_55934 avatar
UTC

Ossessionato
2007 Stella 225
Joined: UTC
Posts: 3547
Location: Rochester, Minnesota
 
Ossessionato
@christopher_55934 avatar
2007 Stella 225
Joined: UTC
Posts: 3547
Location: Rochester, Minnesota
UTC quote
chandlerman wrote:
That's going to be 12v. I'll get something thats 1) more of a buzzer than a beeper; and 2) runs on 3.3v or 5v DC so it'll match my board.

And if that doesn't work out, I can always drive a 12v relay with the buzzer on it, but that's extra complexity I'd like to avoid, especially up in the headset which is already an electrical nightmare.

Of course, if this all works out well, I may ditch the GPS speedo, which would get me back both space and get a bunch of wires out of there.

Also...I should add some decent turn signal indicators to my dash. That's not part of the Ves-Pi, just something it occurred to me I should do because I'm the worst at forgetting to turn mine off.
LOL, how about the horn? It could just start honking at you before before the back tire locks up.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
Christopher_55934 wrote:
LOL, how about the horn? It could just start honking at you before before the back tire locks up.
I was going to tie the horn to the speedo so it can start honking at people to get out of my way if I'm going too fast. Cheaper and easier than installing decent brakes.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
Okay...so the power problem seems to be specific to the battery I have in the bike, which is good because I can work around that with a battery swap. Why it was still failing to work with a charger hooked up, I cannot say, but when I tried running it off the other battery I have, it worked, so I just need to do the swap.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
So after messing around with batteries and a few other things, I finally got sick of it and just strapped a 100AH LiFePO4 battery that's a spare from my boat onto the tunnel and got after it.

I need to look at why some of my telemetry wasn't there, but I think that's a bug in my code, because my dashboard looked good.

The other thing I need to look at is fixing my telemetry processor to auto-reconnect when it switches wireless networks from my house to my hotspot.

But, fundamentally, it's working!

Now it's time to go celebrate.
Not subtle, but it worked.
Not subtle, but it worked.
Some of the very first telemetry.
Some of the very first telemetry.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
I'm still fighting with my power supply issues. I've ordered another 12v to 5v step down regulator that people on Amazon say they're using successfully with with Pi's, so hopefully that will finally sort me out and I can get on with getting some telemetry and getting back to the software and instruments.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
The 20x4 LCD showed up today, so I ported my basic dashboard over to it, albeit with dummy/no data for now.

I re-used to code that calculates the blue-green-red scale for the CHT range, plus blinking in the Danger Zone, onto the backlight, which I think is pretty good, but I'm still not sure how I feel about it overall. I may replace the accelerometer data with something else (add delta's for the CHT & EGT, plus maybe turn signal indicators).

Next, though, I need to figure out what pins I have available to wire it up (it needs NINE, plus power).

I don't love the refresh on it, but it'll be nice to have the info visible.

@swiss1939 avatar
UTC

Ossessionato
P208, Stella VMC Stelvio 187, Stella 150, VNX1T, V9A1T, V9B1T, 02 Sportster XLH1208
Joined: UTC
Posts: 4110
Location: Staten Island, NY
 
Ossessionato
@swiss1939 avatar
P208, Stella VMC Stelvio 187, Stella 150, VNX1T, V9A1T, V9B1T, 02 Sportster XLH1208
Joined: UTC
Posts: 4110
Location: Staten Island, NY
UTC quote
chandlerman wrote:
The 20x4 LCD showed up today, so I ported my basic dashboard over to it, albeit with dummy/no data for now.

I re-used to code that calculates the blue-green-red scale for the CHT range, plus blinking in the Danger Zone, onto the backlight, which I think is pretty good, but I'm still not sure how I feel about it overall. I may replace the accelerometer data with something else (add delta's for the CHT & EGT, plus maybe turn signal indicators).

Next, though, I need to figure out what pins I have available to wire it up (it needs NINE, plus power).

I don't love the refresh on it, but it'll be nice to have the info visible.

can you do the bg color for half the screen or is it all or nothing? If you can split the bg color half and half.. do the warning temp bg colors left side cht right side egt so you can know which temp is warning on quick glance.
@jkj-fz6 avatar
UTC

Ossessionato
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
 
Ossessionato
@jkj-fz6 avatar
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
UTC quote
chandlerman wrote:
Next, though, I need to figure out what pins I have available to wire it up (it needs NINE, plus power).
Could you use a display with I2C "backpack"? It uses only two pins (which can be shared with other I2C devices) plus power and ground. I believe you have to use a 3.3V to 5V level shifter (an additional tiny board) with a Raspberry Pi though.
Forum member supplied image with no explanatory text
@jkj-fz6 avatar
UTC

Ossessionato
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
 
Ossessionato
@jkj-fz6 avatar
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
UTC quote
swiss1939 wrote:
can you do the bg color for half the screen or is it all or nothing?
I think it's all or nothing. There may be something that can be done with blinking the characters.
@sdjohn avatar
UTC

Johnny Two Tone
'15 GTS300, '86 PX125EFL, '66 VBB, '01 ET4
Joined: UTC
Posts: 9063
Location: San Diego, CA
 
Johnny Two Tone
@sdjohn avatar
'15 GTS300, '86 PX125EFL, '66 VBB, '01 ET4
Joined: UTC
Posts: 9063
Location: San Diego, CA
UTC quote
what are the 3 channels x,y,z at the bottom?
@swiss1939 avatar
UTC

Ossessionato
P208, Stella VMC Stelvio 187, Stella 150, VNX1T, V9A1T, V9B1T, 02 Sportster XLH1208
Joined: UTC
Posts: 4110
Location: Staten Island, NY
 
Ossessionato
@swiss1939 avatar
P208, Stella VMC Stelvio 187, Stella 150, VNX1T, V9A1T, V9B1T, 02 Sportster XLH1208
Joined: UTC
Posts: 4110
Location: Staten Island, NY
UTC quote
You got gps on that thing? What else can we get on it?!
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
I'm waiting for my new power supply to arrive (it's supposed to be here today), but of course we're having a "cold snap" here, and are even going to get a couple inches of snow on Thursday, which is annoying when it comes to test rides or (and this is how thin my blood has gotten) walking out to the workshop.
JKJ-FZ6 wrote:
Could you use a display with I2C "backpack"? It uses only two pins (which can be shared with other I2C devices) plus power and ground. I believe you have to use a 3.3V to 5V level shifter (an additional tiny board) with a Raspberry Pi though.
I'm totally down to try an I2C backpack, I just hadn't seen one for a character LCD until now. I already have a couple 3.3->5v level shifters that I originally bought for the I2C controls for my LED's, but haven't needed them thus far.

I'm also wondering at what point I'm going to need to move the 5v power to an external source since my existing power problems are all before I start adding on LED's, displays, etc.
JKJ-FZ6 wrote:
I think it's all or nothing. There may be something that can be done with blinking the characters.
Yup, it's all or nothing. I already thought about how cool it would be to be able to display more data as background bar graphs, colors, etc., I just can't do it with this display. The next step up would be going to a full-on 320x200 display or the like, I'm just not quite ready to go there yet. I also worry about what the update latency on those might look like, even blitting to the screen like I'm doing for my updates in the current display.
sdjohn wrote:
what are the 3 channels x,y,z at the bottom?
Those are force vectors off an accelerometer. I'm still not sure how useful it's going to be, so I threw them onto Line 4 to see what they look like in realtime. My suspicion is that they're going to be too noisy to be useful, but you never know.

Best case is that I can distill them down to a single value, which would free up space on the display to include the deltas for the CHT & EGT, because *that* is something I'd love to know in realtime and being able to ditch two of those values would give me enough room to add them.
swiss1939 wrote:
You got gps on that thing? What else can we get on it?!
I've had GPS since the outset. That's where I get my speed from. Wheel sensors are soooo Last Century.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
Okay...this is just plain embarrassing...not only did AdaFruit (my preferred hardware source) have an i2c/SPI backpack, I had it on my wish list and forgot it existed. Facepalm emoticon

I don't know that I'm going to spend $20 to get a $9 part, but it'll definitely go in the basket next time I order something, or sooner if I run out of pins.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
speaking of embarrassing...I forgot to see if things would actually...fit...in the dash.

and it ain't good. That's the corners of my 20x4 character LCD sticking out all four corners of the template for the headset opening.

The LED strip is annoying, but not the end of the world. I have individual LED's that I can drive with the same code that I could pack in more tightly or run along the edge or something, but I'll have to wire them up in sequence manually, which will be a bit of a PITA.

Time to see what else I can dig up in the way of smaller displays, or I need to find a spot that I can mount it other than the headset opening.
Forum member supplied image with no explanatory text
@jkj-fz6 avatar
UTC

Ossessionato
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
 
Ossessionato
@jkj-fz6 avatar
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
UTC quote
Could you use a TFT display?

Have you run into any performance problems, with all that going on in a Zero W? I have a Zero W project going that only displays the time of day and counts occurrences on some IO pins. It runs as intended for an hour or so, then crashes.

BTW, the 20 x 4 display I'm using measures 100 x 60 mm, probably about the same as yours but if it's smaller I'd be glad to get you some more info.
@jkj-fz6 avatar
UTC

Ossessionato
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
 
Ossessionato
@jkj-fz6 avatar
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
UTC quote
Just a thought... Does your headset open out some, behind the opening for the speedometer, like a jar or bottle? Could you set the display board back a little inside the headset?
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
My display is also 60x100mm, which seems to be the "standard" size for these things. It's also a good size for readability, but obviously not for the limitations of my build.

There's theoretically a lot of room in the headset--it's pretty cavernous for a pre-P headset--but I already have so much wiring in there that it doesn't do me much good. I also have cables routed back there for better bend radii, which doesn't help the problem, either.

As to reliability, I have both a Zero W and a Zero W 2 that I've used. I started with the W right as the W 2's were coming out and upgraded as soon as I could get my hands on one. It's about 5x faster CPU-wise, but the big benefit for me is that I can run the VSCode remote development tools on it, which the original lacked the memory for.

I'm using a Pi 3B for my LED dev and they have all been extremely stable.

I've had my monitors running for days at a stretch during testing without issues, and I'm a nightmare scenario of different bus'es. I'm collecting telemetry from:
- Tach: simple GPIO edge detection with both hardware & software de-bounce)
- Two SPI temp sensors for CHT & EGT
- GPS: completely takes over the serial port at 9600 bps
- An i2c A2D converter for the Throttle & gear position sensors
- An i2c accelerometer

I have a heat sink on it, and have two HAT's, one is an AdaFruit Ultimate GPS HAT and the other is a prototype board I built myself for mounting the various breakouts and cable connectors.

All my code is python 3.

What language, libraries, and bus are you using for your IO monitoring? And are you polling or registering an event callback? I use a callback for my tach, so I know that it can handle at least 10,000 events per second without falling over.
@jkj-fz6 avatar
UTC

Ossessionato
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
 
Ossessionato
@jkj-fz6 avatar
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
UTC quote
I'm doing this on a Zero W, first version, with python, I2C, and polling. I'm about to try to learn the intricacies of interrupts and callbacks.
I't supposed to be polling inputs at precise one-second intervals, but I'm not there yet.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
callbacks are easy . Here's the skeleton of my tach callback code. The hardest part was figuring out that I needed to call time_ns() (time in nanoseconds) to get adequate resolution for calculating the RPM's accurately.
import RPi.GPIO as GPIO

max_allowed_rpms = 9000
def spark_detected(self, channel):
   """
   spark detection callback function
   """
   self.this_time = time.time_ns()
   self._rpm = (1/(self.this_time - self.last_time)) * 60000000000
   self.last_time = self.this_time   

rps = self._max_allowed_rpms / 60
self._bounce_delay = 1 / rps
bouncetime = int(self._bounce_delay*1000)

# Set pin 16 to be an input pin and set initial value to be pulled low (off)
GPIO.setup(self.tach_pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
# bouncetime param is milliSec, but _bounce_delay is seconds
GPIO.add_event_detect(self.tach_pin, GPIO.FALLING, callback=self.spark_detected, bouncetime=bouncetime)

Why polling, btw? What are you monitoring that wants to be polled on the second if callbacks would work for it?
@jkj-fz6 avatar
UTC

Ossessionato
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
 
Ossessionato
@jkj-fz6 avatar
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
UTC quote
chandlerman wrote:
Why polling, btw? What are you monitoring that wants to be polled on the second if callbacks would work for it?
Exactly. I think it will work once I figure out how to do callbacks. Thanks for the help!

(The latest crash turned out to be a hardware error. Damn breadboards and jumper wires!)
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
JKJ-FZ6 wrote:
Exactly. I think it will work once I figure out how to do callbacks. Thanks for the help!

(The latest crash turned out to be a hardware error. Damn breadboards and jumper wires!)
Always glad to help!

And if you think that breadboards and jumpers can be frustrating, wait'll you start soldering prototype boards and the REAL troubleshooting fun begins...
@jkj-fz6 avatar
UTC

Ossessionato
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
 
Ossessionato
@jkj-fz6 avatar
BV400, Primavera 150, Yamaha Zuma 125
Joined: UTC
Posts: 4832
Location: Twin Cities, Minnesota
UTC quote
chandlerman wrote:
And if you think that breadboards and jumpers can be frustrating, wait'll you start soldering prototype boards and the REAL troubleshooting fun begins...
Are you planning to lay out boards for this?
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
I'm not sure yet.

Right now, it's just soldered wires on a prototype board, but I might go there once I have the back-end software matured and validate that it's actually useful.

If I were going to go that route, I might also see what would be involved to port it over to an Arduino, but my preliminary research was that getting the MQTT upload working on Arduino would be unduly challenging, plus I already know Python so it made the development a lot easier.
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
The new power supply arrived today and I just snuck out to the workshop and verified that it worked off the onboard battery, so I can unstrap the boat battery and...watch four inches of snow fall tomorrow...

No test rides for me for a few days, it looks like. As I sit around and wait for the snow and ice to melt, that gives me time to calibrate my accelerometer.
⬆️    About 1 year elapsed    ⬇️
OP
@chandlerman avatar
UTC

Innovator
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
 
Innovator
@chandlerman avatar
63 GL, 62 VBB, 05 Stella, 66 Smallstate, 66 Lammy S3, 63 Lammy S3 Riverside
Joined: UTC
Posts: 13094
Location: Nashville

331 Days Since Last Explosion
UTC quote
I've been resurrecting this project a little bit over the past few days.

Specifically, I finally got serious about building a functional dashboard, which was the missing link between what I built and actually getting useful data.

This was motivated by a combination of being out of town for a few days and having some downtime to work on it, combined with a strong desire to be able to identify and track clutch slippage on the Smallstate.

Next, I'm going to set up the sensor suite on the Smallstate, along with the 20x4 LCD.

Full-size image
Forum member supplied image with no explanatory text
Example of clutch slip detected
Example of clutch slip detected

Modern Vespa is the premier site for modern Vespa and Piaggio scooters. Vespa GTS300, GTS250, GTV, GT200, LX150, LXS, ET4, ET2, MP3, Fuoco, Elettrica and more.

Modern Vespa is made possible by our generous supporters.

Buy Me A Coffee
 

Shop on Amazon with Modern Vespa

Modern Vespa is a participant in the Amazon Services LLC Associates Program, an affiliate advertising program designed to provide a means for sites to earn advertising fees by advertising and linking to amazon.com


All Content Copyright 2005-2026 by Modern Vespa.
All Rights Reserved.


[ Time: 0.0141s ][ Queries: 4 (0.0056s) ][ live ][ 343 ][ ThingOne ]