Is there any way to configure a sound indicating that the battery is fully charge on proffieboard v2.2

Hi @profezzorn

Is there any way to configure a sound indicating that the battery is fully charge on proffieboard v2.2

?

It’s possible to check the voltage and play a sound if it’s over some value. Not sure if that is what you want though.
Also, it will require some coding to do.

Doesn’t @jedimaster have some config shenanigans to detect charging status in his special proffie toolbox? or is that only v3?

This looks like it might be what you’re looking for

1 Like

That is right but will it sound if the saber is off would be my question. Or maybe I can be less lazy and read the document… :face_with_bags_under_eyes:

Yes, it works on V2. And if by off you don’t mean kill switch then yes, it will work still. Doesn’t have to be ignited.

1 Like

My jmt studio doesn’t have the addon button am I missing something?

On the OS Versions tab there’s a button for Add JMT features. That will add the files for you. Then you will see a button show up on the config page for adjusting your prop to use them. You’ll just need to use the options explained in the documentation from there.

awesome, thanks man, I’m getting an error that the pin needs to be defined, what am I supposed to put there? is it just 01 pin3 or something else?

I got it to compile and I placed the file in the common folder but no sound was played, I think it’s cause the recharge port is using a daughter board or I used the wrong pin, i typed BladePowerPin3 in the define is that the correct pin?

I need to improve my documentation on the hardware side of this, and I have a post coming soon as recently promised on my charge detect post from a while back…

Quick answer on the pin: bladePowerPin3 won’t work even though it compiles and it won’t hurt anything on the hardware as you flashed it. You want an open I/O pin. On my V2 test case I use Data2 (pin = 1), and on a V3 I use Free1 (pin = 7).

#define CHARGE_DETECT_PIN 1           // Pin used for charge mode detection (Data2)
#define JMT_CHARGE_LOCKOUT            // Locks out controls while charging
#define JMT_CHARGE_COMPLETE_ANNOUNCE  // Announces charge complete

The bigger thing though: CHARGE_DETECT_PIN is a hardware requirement, not just a define. The pin is an active low input with the internal pullup on, so something has to physically pull it to ground when charge voltage appears. Without that circuit no pin choice will ever fire, so that’s most likely what you’re hitting rather than anything to do with how your charge port is wired.

If you don’t already have it, the circuit is simple. I use a 2N2222 (MMBT2222A in SMD, marked 1P, or a TO-92 through hole one with 1/4w resistors if you have the room):

  • 150k from your charge voltage to the base
  • 1M from the base to ground
  • emitter to ground
  • collector to the detect pin

Tap the charge voltage (5v) wherever your charge port brings it in. When it shows up the transistor turns on and pulls the pin to ground. Unplug and the 1M bleeds the base off so it turns fully back off. The reason for the transistor instead of a voltage divider is that the board pin never sees 5v this way, it only ever gets shorted to ground or left alone.

Note that charge complete waits for a stable full reading before it announces. Battery voltage reads 100% before the cell is really there, so this gets it as close as it can to what will be full after you remove the charge cable instead of firing the second the number hits the top. It has to hold above the threshold for the dwell time before it counts. There are tuning defines if you want to adjust that, but the defaults should be good to go (did a bunch of bench testing to get it where I was happy).

If you’re testing right now, chargebegin.wav is the one to try first since it plays the moment charging is detected. chargecomplete.wav won’t fire until the level has held at the top for the dwell.

I have downloaded both and they’re in the common folder already, though I changed it to 1 as per above and it still didn’t play so if I’m understanding this correctly you would need to install that board you have in your post?

Yes that’s right. You need some way to detect the voltage presence. You don’t need the SMD version. You can also use through hole parts if that’s what you have or easier to get…

So 1m and the smaller resistor on this end?

Yes, that’s the 5v source where it says DC+. Do you have a 2N2222 transistor?

  • Connect DC+ to 150k to the base of the transistor.
  • Then connect the emitter of the transistor to DC-.
  • Put the 1M between the base and emitter.
  • And then your collector will be your low signal wire for charge detect (pull-up handled by proffie).

Just make sure you check the data sheet on your transistor so you get the base and emitter right.

1 Like