Photocell with Proffie V3?

Hello there. I’m working on a blaster build that was originally designed for arduino prop maker feather. My friend and I are making them and would like to repurpose it for proffie. Part of the design has a “clip out” and “clip in” sound that are triggered based on a photocell sensor. Is something like this possible?

Thanks in advancs.

Almost certainly.
It will probably require some coding and/or extra hardware though.

When you say “photo cell”, what actually is it? Options include:

  • solar panel / photo diode, these actually generate voltage based on light
  • photo resistor, resistance changes based on brightness
  • photo transistor, more of an on-off thing, transistor is activated by light
  • some active circuit thing which does all the work for you, like an IR receiver

Its fit for a CdS photoresistor, as well as a hall effect sensor with one of the small neodymium magnets in the kit. Both using 10k resistors. If we can get away with using it that would be cool, but we could fit tactile switches in it’s place if needed to create the same effect.

The hall effect resistor might be easier.
With the photo resistor you need an analog input, and a bit of coding to decide if it’s high or low. The hall effect sensor has hardware that does that for you, so you can just pretend that it’s a latching button, and the blaster prop already has support for a latching clip button, so it should just work.

Okay great. That’s the more important part to it.

The basic idea is,

Cap comes off via magnet and plays a sound,

Power cell is exposed and when removed and replaced it plays a sound. I’m assuming the photo resistor was used to detect if it was there or not. Or the change in light from it.

Magnet cap put back and plays the final sound to complete the reload.

Appreciate the help!

Are you sure it’s a photoreceptor or is it a transmit/rec circuit that bounces the beam on the battery? Those behave pretty much as a switch (albeit a very noisy one).
IIRC, the blaster prop only has a clip empty/out state. But I did have programmed one. You might need to tweak the prop a bit to add the two states (batt door open/close and battery in/out) and add a specific sound (the events definitions and sounds I think go straight in saber_base).

The prop is a Ray Gun from the zombies mode in call of duty. So there tube where the batteries go in has a hole on each side where the photo resistor would go on one side, and an LED on the other. As each battery would pass it would play a sound, and then one for removal. I found a 3mm IR break beam sensor that may work similar. If all else fails we are going to mod the battery prop to have a contact and act as blade detection.

The barrel is on a hinge and is latched with a magnet. There’s a separate magnet that was placed to interact with a hall effect sensor on the other side in the fuse of the blaster.

So a typical reload is

Barrel opens - plays a sound

Battery cells come out - plays a sound (add a silence file for the second)

Batteries go in - play a sound for each (2) as they pass

Close barrel - plays final sound

Its difficult but it’s a fun project I’d like to take the time and get right.

hall effect sensors, IR break beam sensors and latching buttons all work the same way (the proffieboard can’t tell the difference), so you can use whatever works best for your prop.

Having a couple of different sounds like this is not currently supported by the blaster prop, but I don’t think it would be overly hard to add either.

I have questions about your description though:

  1. Are these actual batteries? If so, how do you plan to play a sound when both are removed? Or are the batteries just props and the actual power comes from somewhere else?
  2. As batteries go in, you say to play a sound “as they pass”. Which I assume to mean that batteries are passing the sensor, and it activates for a short while while that is happening. However, if that is how your sensor works, how do you tell the difference between “batteries going in” and “batteries going out”? Seems like it would be better to have a separate sensors for “battery 1 in place” and “battery 2 in place”.

The batteries are just fake prop batteries. We’ll have the real power elsewhere. Probably an 18350.

As for telling if they’re inserted or removed, that’s a good question and one of the main things I’ve thinking about.

I can edit the font to have the battery removing sound added to the barrel opening sound since they do happen relatively fast in succession.

The location of the break beam sensor would be at the front of the tube, and when the batteries are fully inserted, the beam would be completely blocked. Then when they’re removed that connection would happen again. The other part with that is, if the first battery falls out faster than the second and there’s that fast moment where the IR beam would detect again, the insert sound would then play if I’m thinking this through correctly.

I think I found what it looks like on youtube.
It’s interesting, because each battery makes a sound when inserted, which is kind of nonsensical really.

If I was doing this, I would still add two sensors. One for the location of the first battery, and one for the location of the second. Then I would write some code that checks how many batteries are inserted. (And ignores the front sensor if there is no battery in the “bottom” slot.) Then, every time the number of batteries changes, I would play a sound.

I can help write some code for that if you like, it’s not particularly difficult.

You will have to count how many “buttons” you will need. I think Proffie 2.2 can have 6 and ProffieOS limits to 8. Might be wrong. If you are designing it and have control, I would put the break beam/hall sensor as close to the back of batteries as I can. Thus, for the back battery, you can play sound on CLOSE and OPEN. And for the forward, you can play the sound only when you have a certain time out of oupen (look at the short/middle/long push timings on the butttons for props).
You can get if the batteries are being inserted or removed by using a combo on the back and middle sensors. forward sensor + bottom release is a release. forward sensor plus long push is an insert.

I might need to rethink my setup anyways. The adafruit 3mm breakbeam sensor I was looking at is probably big for the location. I’m only working with a little over 3mm of space for a housing. Unless I can try and make something with a small IR LED and receiver myself. The prop is already designed, however I’ve already made some minor adjustments in Fusion, but it’s a pain working with meshes on the free version.

I’m waiting on my installer friend to get them in hand, but we may go the blade detection route and modify the first battery to make a contact. Then only have 1 sound for them removed and inserted. Which I am happy with if all else fails.

I do appreciate all the help and advice given in the thread.

To me, and this is different than what you were going for, but perhaps simpler, it seems like it’d be easiest to just put a resistor inside your prop batteries and hook up the contacts. If you wire up blade detect with the battery props in parallel, you could get different readings depending on 1 or 2 batteries inserted, and you could setup your preset arrays with sounds that fit what you’re looking for.

For example, you wire up blade detect to each battery in parallel. if I recall correctly you can enable a pull-up resistor internally.

Then, let’s say you use 300kOhm resistors in each “battery” the first one would register as 300, but when both are in you’d get a resistance of 150, which should definitely register different ID values.

And of course you can finagle things around with that idea to achieve different effects, but that’s what came to my mind.

I really like this alternative. The batteries are super easy to remake and add the changes to make this work. This is definitely something to look into. Appreciate the suggestion.

1 Like

Digi-key has a whole section of photo-transistors that could be used (paired up with an IR diode).

They even have a how-to-use-it-with-arduino, which directly applies here:

https://www.digikey.com/en/maker/blogs/2022/how-to-use-a-phototransistor-with-an-arduino

PS: IR-LED + Phototransistor seems to be what my pinball machine uses to detect balls passing through in various places.

When I played paintball break been IR was the standard way to know when the ball was in the chamber. And you could use it to estimate the bolt’s speed if you put the beam high in the right place.
But for your application, may be you could use something like the IQ antennas and detect the induction? That’s as thin as you can get and the batteries prop would just need an antenna or something like that.

You’d need a way to measure the inductance though, which might be tricky. There are several ways to do it, but I don’t know enough to say how easy or hard it is.

Just wanted to update and say I found a good match for the phototransistor idea on Digikey. Low profile and were made for each other. So we’ll fit 2 in there for each battery.

IR - OP140B TT Electronics/Optek Technology | Optoelectronics | DigiKey

Receiver - OP550A TT Electronics/Optek Technology | Sensors, Transducers | DigiKey

Plan is to get everything test fit and work out how to wire this all up this week/weekend.