Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Fanged Lawn Wormy
Jan 4, 2008

SQUEAK! SQUEAK! SQUEAK!
That actually sounds really cool. Looking into that.

Adbot
ADBOT LOVES YOU

Skunkduster
Jul 15, 2005




Doggles posted:

Earlier this week I got my first Arduino and made an LED blink. Today, I have a Family Feud face-off buzzer:
https://www.youtube.com/watch?v=Az4jBE55_Aw

:3:

That looks pretty cool. I'd like to see some pictures of the guts and a description of how you did the lighting if you don't mind.

Wibla
Feb 16, 2011

shame on an IGA posted:

Has anyone else played with the siemens logo series? They sell them as "Programmable Relays" but they're little micro PLCs with 8 inputs (8 digital, 2 do double duty as 0-10v analog), 4 relay outputs, and are programmable in FBD through the integrated display and softbuttons. I use a ton of them at work.

They're nice, but the limitations are annoying when coming from actual PLCs.

Have you looked at S7-1200s?

shame on an IGA
Apr 8, 2005

Wibla posted:

They're nice, but the limitations are annoying when coming from actual PLCs.

Have you looked at S7-1200s?

Maybe in another decade, most of our serious equipment runs on -300 with an uncomfortably large amount of S5 still hanging around.

Doggles
Apr 22, 2007

SkunkDuster posted:

That looks pretty cool. I'd like to see some pictures of the guts and a description of how you did the lighting if you don't mind.

I didn't think much about taking progress pics other than uploading a few Instagram stories. My original plan was to use tissue paper to diffuse the lights, but it looked like crap. This is the story I posted when I bought a sheet of corrugated plastic and discovered it was exactly what I needed!



There you can see I have the lights mounted in a sheet of styrofoam. Used scissors to poke holes 2" apart and I have the lights wedged in there. I used these WS2811 LEDs. One strand cut in half for a 5 x 5 grid of lights in each indicator. The box is made out of 12x12 wood panels I got from a craft store, all duct taped together. I didn't nail or glue anything because, with this being my first project, I wanted everything to be as reusable as possible in case I either screwed up or wanted to come up with a more permanent solution down the line.

All the wires are connected to breadboards behind the indicators for now. They're all sort of free-floating along with the Arduino. The back panel of each box is only taped at the top so I can flip that panel up to access the LEDs wires and such.

For the buttons, they're 100mm dome push buttons. I already burned out the LEDs inside them because I didn't even think about resistors when I started. Whoops. At least I'm finally getting some delivered today. I bought 5x5x5 floral styrofoam blocks to house the buttons. Hated working with them because they're difficult to cut into and they leave flakes of styrofoam EVERYWHERE, but I managed to cut a slot into each to slide the button on top. They can at least take a beating. Doing this project highlighted to me how much I need to learn woodworking.

Here's a link to the version of the code I was running close to when I took the video in my previous post:
https://create.arduino.cc/editor/thekog/8e29999e-631c-4373-867b-e5fb699eafd1/preview

The buzzIn() animation was one of the first things I coded upon receiving the Arduino and finding out about the FastLED library so it's a little sloppy as I was coding it on the fly and I haven't gone back to touch it up. Basically, it takes the first column of lights and blinks it yellow twice, then blinks it orange twice, and then finally leaves it red. As that column moves to orange, the next column starts blinking yellow, and the same pattern moves on down the line. It's inspired by the buzz in lights from the Ray Combs era of Family Feud.

The idle animation is one of the last things I coded in and I'm blown away by how well it turned out. It wasn't necessary at all for this project, but it's a result of me experimenting with controlling individual LEDs with an algorithm. The idle animation is controlled by faceOff(). I assign each LED a twinkle direction (it's supposed to be random, but there's a typo in the old code there. Should be random8(2) to seed the direction instead of random8(1)). With each loop it either brightens or dims based on that direction. If it gets to a bright or dim limit that I specify, then the direction for that pixel flips.

If it was just that you get a cool little pulsing pattern. Where it really shines is that each time a pixel moves, I added a 1/1000 chance of it changing direction regardless of how bright or dim it is. With that, it goes from pulsing to now sort of looking like the surface of water. In the corrugated plastic gif, you can sort of see the beginnings of the faceOff() algorithm. At that point each pixel changed by a larger amount at once, but then waited a longer time to change another pixel.

And before I gave myself a break from programming this weekend, I started work on a victory animation Friday afternoon:


Won't post the code for that until I get it finalized, but what it's doing currently is constantly dimming the blue channel of each LED, and then randomly choosing one LED to increase blue to maximum. This makes the whole block yellow, with white bursts going off all over inside it.

Doggles fucked around with this message at 18:29 on Oct 22, 2018

Doggles
Apr 22, 2007

I rewired my Family Feud buzzers last night. I can now add extensions to each of the wires connecting the devices to spread them out a bit when its time to put them in action. This time I remembered to take a photo of the guts when I finished up. The closed indicator on the left has a breadboard setup inside that's mirrored from the open indicator.



Got my LED and resistor kits delivered that day so I got LEDs back inside the buttons, plus I also added two LEDs to the main breadboard so the host (me) can determine who buzzed in when the back panels to the indicators are closed. For the LEDs in the buttons, while one side is ringing in, the other button's LED turns off. The LEDs on the breadboard typically remain off, and the left or right one comes on based on which player rung in. In this photo, the right side is in the process of ringing in, so the right breadboard LED is lit.

Here's the current code I've got running for the buzzers:
https://create.arduino.cc/editor/thekog/c42b4605-91b7-4c0d-b20e-74ea9c0e90a0/preview

Got some Halloween party planning to do this week. Won't have much time to program so this code should be stable for the most part for the next few days.

Already I'm seeing the need for a bigger Arduino for more game show projects. I think I'm down to three available digital pins, plus I believe the Uno can only handle interrupts on the two pins already occupied by the buttons. Will definitely need more interrupt and output pins for a 3+ player lockout system. :getin:

Beve Stuscemi
Jun 6, 2001




Sort of an arduino adjacent question, does anyone know where I can buy a project box with a grid for drilling stamped in the back of the lid?

TheresaJayne
Jul 1, 2011
I just got some Digispark attiny devices to play with, They have a USB device demonstrated in a page that can read the key presses from a normal kb and do some generation work when it detects that key sequence, I cannot find much in the way of information on how to access the usb port on these devices like that.

The example provided uses a button on the device to perform the reset, although when i wired it up on a breadboard it didnt work as intended so I am not sure why this isnt working or how to fix it, Also I found that the device will not boot on a USB2 and only a USB3 port so that suggests that for some reason its trying to draw too much current on the 2 and thus cannot boot, any suggestion on this ?

The link i am talking about https://www.hackster.io/mushux95/password-usb-key-d10b11

ReelBigLizard
Feb 27, 2003

Fallen Rib
I bent the pins. I also published my first Arduino library. I'm not new to it, just never had the need before.

https://twitter.com/boudloForge/status/1072641328880730112

Planning on using these things in a bunch of my IoT / LoRa projects because of the low power consumption and useful custom segments. Much less thirsty than the OLEDs i've used before.

Doggles
Apr 22, 2007

Hardly had any time to work on it over the past couple of months because of the holidays, but my face-off buzzer has been prettied up and should be sturdy enough for use now! :dance:



Video of the buzzer:
https://www.reddit.com/r/arduino/comments/abvrtf/finally_found_the_time_to_finish_up_my_faceoff/

Ambrose Burnside
Aug 30, 2007

pensive
I play paintball with an old school stock-class marker, the kind that uses 10-round paint tubes fed into an internal tube magazine on top of the gun instead of standard bigass bulk-feed hoppers. I'd like to make some sort of ammunition counter for it, but I'm not sure the best way to go about it. The problem is that the paintballs aren't 'indexed' in the tube- there's no spring to keep them in a predictable position, they roll back and forth in the tube except when it's pointed downwards. I'm thinking about two different approaches to getting a paint count:

1) stud the side of the tube with 10 (cheap, paintball-sensing) proximity sensors and calibrate them to be triggered when the sensed range approaches zero (so it will only trip when the widest point of a ball is adjacent and not an edge or the far side of the tube or whatever. Sum the number of triggered sensors at any given time and illuminate the appropriate number of LEDs, probably with some pausing or taking of averages to address probable ammo count 'flickering' with ball movement.

2) install a single rangefinder at the rear of the magazine, ranging down its length. The sensed range will correspond to a specific number of paintballs in the magazine. I'd address paintball rolling count issues with the programming, tell it to hold the count whenever the sensed distance changes too quickly for more than a brief moment or something to that effect.

I'd be building a new paint tube for this, so I'd probably help things along by giving the tube more of a downward slope and would also design it around housing the sensors in a robust and well-protected way. IRT #1, I'm really not sure what sensors I would use- those little inductive proximity sensors would be perfect (like $2 each, contactless/non-optical so ideal for the rough n dirty use environment) but I'm pretty sure they're useless for paintballs, unless they could detect the interference between the sensor and the metal tube wall on the far side or something like that (I've never worked with em). Similarly for #2, rangefinding in such a dirty environment is probably a nightmare, but at least there I only need the one sensor so I can spend more than a couple bucks for it.



(if I really go buck-wild with the daydreaming the counter doesn't output to LEDs on the tube body, but instead is sent wirelessly to a board built into the paintball mask which puts the ammo count right in front of my eyes at all times (a pseudo-HUD/projection or tiny LEDs outside the mask lens or something) but one step at a time)

Ambrose Burnside fucked around with this message at 21:24 on Jan 2, 2019

shame on an IGA
Apr 8, 2005

I'd use a counter that increments -1 per trigger actuation and resets to 10 when the mag is removed, then you only need 2 sensors and cheap limit switches will probably do the job. If you want to detect the balls directly you're looking at either ultrasonic or optical and it's gonna get mad expensive and have a lot (A LOT) of complications with debouncing the signals.

shame on an IGA fucked around with this message at 22:05 on Jan 2, 2019

Ambrose Burnside
Aug 30, 2007

pensive

shame on an IGA posted:

I'd use a counter that increments -1 per trigger actuation and resets to 10 when the mag is removed, then you only need 2 sensors and cheap limit switches will probably do the job

i thought about that but there isn't a 1:1 correlation to trigger pulls:shots fired, misfeeds where you just shoot air are very common. i already count shots in my head and it's the misfeeds that are already loving that up, hence wanting a direct ammo count. it also doesn't use retained magazines, per se- you basically keep paint in glorified cigar tubes and pop them through a little finned aperture at the back of the permanent tube mag and remove them as soon as the paint is out of the cigar tube dealie. you also 'handload' paintballs into the magazine fairly often for various reasons. basically i want to avoid anything that makes assumptions about trigger pulls or mag loading because it may end up giving a deceptive/unreliable output

shame on an IGA posted:

I'd use a counter that increments -1 per trigger actuation and resets to 10 when the mag is removed, then you only need 2 sensors and cheap limit switches will probably do the job. If you want to detect the balls directly you're looking at either ultrasonic or optical and it's gonna get mad expensive and have a lot (A LOT) of complications with debouncing the signals.

what about those wee little laser ToF sensors? haven't worked with em yet but they're supposedly much better for cutting noise and false readings and they're only a couple bucks each to boot. I don't think draconian debouncing approaches would be much of a problem, and I can reasonably supplement it with User Debouncing In The Field because "just tilt the gun downwards to get an ammo count" isn't too onerous and just telling it to not tell me poo poo until the readings hold steady within X margins for at least 0.5 seconds or whatever would probably be acceptable for real use during play. Might get too pricey to roll with 10 of them, but just one ranging down the magazine is lunch money.

Ambrose Burnside fucked around with this message at 22:34 on Jan 2, 2019

Ambrose Burnside
Aug 30, 2007

pensive
comedy option #3: 10 laser diode + laser receiver pairs crossing the tube magazine, an interrupted beam = 1 LED illuminated

e: i was mostly joking about the lasers specifically, but i didnt realize IR break-beam sensors are cheap as poo poo until now, hmmm. no idea if they'd get fucky with light reflected off the glossy paintball shells rollin around but that sort of sensing would also be good and fine if it works for $2/sensor or what-have-you

i'm also open to weirder/less conventional approaches if the sensors are a good fit. like. i don't even know, touch/pressure sensors that can tell when a paintball is sitting on them? a conductive approach with the contact pad on the bottom and some sort of conductive brush material along the top? an improbably-accurate load cell that determines count based on weight?

Ambrose Burnside fucked around with this message at 00:09 on Jan 3, 2019

Splode
Jun 18, 2013

put some clothes on you little freak
Can you make the tube sprung like a magazine for bullets, or would that gently caress up the feeding? Even if it's a very weak spring it could really help reduce the impact of you running around messing up the ammo count.
It also gives you a handy platform to track the position of rather than having to detect the balls themselves.

Ambrose Burnside
Aug 30, 2007

pensive

Splode posted:

Can you make the tube sprung like a magazine for bullets, or would that gently caress up the feeding? Even if it's a very weak spring it could really help reduce the impact of you running around messing up the ammo count.
It also gives you a handy platform to track the position of rather than having to detect the balls themselves.

Yeah, it fucks up the feeding if the gun isn't designed with it in mind. I don't think spring-feed is really possible with an old-school pump-action gun like mine at all, it would force multiple paintballs down into the breech during the long interval it's open (compared to a semiauto pneumatically-actuated bolt), which will always break in the barrel and puts you out of action for a while. Double-feeding is already a problem with just gravity if you're not careful.

Aurium
Oct 10, 2010
Ir beam break is almost certainly the easiest and most reliable solution.

Don't mount it at the end of the barrel, drill some holes around half way down and mount the diodes there. Use some kind of opaque glue (Black epoxy, silicone, regular glue and then paint it, etc) to seal light out.

There are lots of examples of using modulated light out there to further noise proof it. They're usually in the 38khz region. It helps a bunch, and you can even find pretty cheap modules that can do it automatically.

Ambrose Burnside
Aug 30, 2007

pensive
I'm pretty sure it'd be way too delicate a setup to be practical, but I'm tickled by the idea of cannibalizing a consumer-grade jeweller's scale and using the wee load cell to support the freefloating bottom section of the magazine's tube (with the rest of the tube mag body being a separately-anchored part serving to protect the scale assembly from knocks and being leaned on or w/e). A .68 cal paintball should weigh about 3g, give or take no more than ~0.2g, and you can get +/- 0.05g tolerances from a $25 scale. The read would get skewed by the gun being held at weird angles and would be useless while running/doing exciting kinetic things, but a cannibalized scale would already come stock with smoothing for the output that could be improved/supplemented as needed
In the whimsical land of pure theory they seem to offer all the accuracy I'd need while simultaneously being very forgiving of the paintball's position in the tube mag, and if im lucky, in a package that's already done most of the work for me. Just, yeah, not holding my breath on the durability side of things


...IR beam break def sounds much less stupid but i'm having fun with this as a problem solving exercise ok

Ambrose Burnside fucked around with this message at 01:07 on Jan 3, 2019

Ambrose Burnside
Aug 30, 2007

pensive

Aurium posted:

Ir beam break is almost certainly the easiest and most reliable solution.

Don't mount it at the end of the barrel, drill some holes around half way down and mount the diodes there. Use some kind of opaque glue (Black epoxy, silicone, regular glue and then paint it, etc) to seal light out.

There are lots of examples of using modulated light out there to further noise proof it. They're usually in the 38khz region. It helps a bunch, and you can even find pretty cheap modules that can do it automatically.

each beam-break sensor would only be able to pick up a single paintball or lack thereof, so I'd need 10 sets if I wanted a full ammo count and not just a You're Empty indicator, right? the "mounted at the end pointing down the tube mag" thing assumed a rangefinder measuring how many paintballs have gone missing.
(i should just post the part im talking about b/c why would any of you be familiar with this different flavour of nerd poo poo)

the tube mag is on top pointed towards the back w the flared cone at the end, it screws into an l-joint coupler that feeds paintballs into the breech. i'd ostensibly be fabricating a replacement for one or both parts

i was thinking of staggering the beam-break diodes along the sides of the full length of the tube mag at a paintball width interval, which would put some right at the end near the aperture and daylight. that's p much unavoidable. that said I could compensate w the mag design, the sensors could be installed opening into sheltered holes/slots to exclude as much non-sensor-originating light as possible, kinda like how those cheap dust sensors use boring ol IR LEDs + photodiodes in a light-blocking enclosure to get surprisingly accurate air particulate readings. and if environmental light were an issue at the open end of the tube mag, it's always possible to modify the aperture to have Enhanced Sunshade Properties, or even replace it with an opaque plug to be removed/reinserted for every reload

tbh a rudimentary beam-break approach seems simple enough to do without an arduino in the mix at all, but it'd def make elegant signal smoothing + summing and general operational tweaking far, far easier. the sensor side of things i have most of the parts for on hand already, tho...

e: supposed to be an edit, whatevs

Ambrose Burnside fucked around with this message at 01:39 on Jan 3, 2019

Sagebrush
Feb 26, 2012

I bet you could do it with an accelerometer and some clever software. The jolt from a paintball discharge is probably quite consistent and easily distinguished from normal footsteps, dropping, etc. You could look at direction, magnitude, and event time as a start.

it would depend on the mechanics of your specific gun, but I'll bet there's also a noticeable, consistent difference between a dry fire and a successful discharge. Bigger jolt with more recoil.

The solutions using break-beam sensors and the like are probably more robust, but I like the elegance of a solid-state device that can just be strapped onto the gun with no other modifications.

One Legged Ninja
Sep 19, 2007
Feared by shoe salesmen. Defeated by chest-high walls.
Fun Shoe
Edit: IRT Ambrose

I think they were referring to putting one sensor on the barrel for an accurate shot counter, from which you could calculate rounds left. Which still doesn't solve your reloading stipulation, but it's good approach from a different angle. I mostly replied just so I could say I can't believe someone is still playing with a Phantom. :corsair:

Ambrose Burnside
Aug 30, 2007

pensive

Sagebrush posted:

I bet you could do it with an accelerometer and some clever software. The jolt from a paintball discharge is probably quite consistent and easily distinguished from normal footsteps, dropping, etc. You could look at direction, magnitude, and event time as a start.

it would depend on the mechanics of your specific gun, but I'll bet there's also a noticeable, consistent difference between a dry fire and a successful discharge. Bigger jolt with more recoil.

The solutions using break-beam sensors and the like are probably more robust, but I like the elegance of a solid-state device that can just be strapped onto the gun with no other modifications.

That does indeed sound hella elegant (and a good fit for a commercial product, installation's universally a breeze) but the code side of things is absolutely my weak point, I'm still mostly kludging together chunks of other people's sample programs to make anything work. Hardware solutions are accessible to me, and the simpler they are the less likely i'll get stuck and stall out with a half-done Shame Project taunting me from the bench. Tallying up a bunch of sensor states once per 200ms and turning some LEDs on, though? That I can manage.
(Accelerometer could also supplement a detection sensor-based system in a much cruder way, tho- whenever there's enough motion to make an accurate ammo count impossible, pause the timed checks until things are quiet.)


springboarding off that question- given my requirements: powering/handling signals from 10 sets ofpaired LED/phototransistors, powering a small LED bargraph, li-ion power source friendly, and ideally compact size- which board is the best fit? Doesn't seem too daunting beyond all those sensors and their pins. I've only used an Uno and haven't tackled anything that pushed the basic board's capabilities, but I'd imagine a sensor shield would be helpful no matter what. for compactness a nano would be ideal but idk if there are any relevant quirks or caveats there (i e i know where to get an uno shield that's a good fit but i dunno about a nano equivalent)

Ambrose Burnside fucked around with this message at 02:05 on Jan 3, 2019

Ambrose Burnside
Aug 30, 2007

pensive

One Legged Ninja posted:

Edit: IRT Ambrose

I think they were referring to putting one sensor on the barrel for an accurate shot counter, from which you could calculate rounds left. Which still doesn't solve your reloading stipulation, but it's good approach from a different angle. I mostly replied just so I could say I can't believe someone is still playing with a Phantom. :corsair:

Oh ok, I dig. That would work in theory but 1) it'd be incredibly awkward/impractical to locate the sensor on the "downstream" part of the gun anywhere other than just after the breech, and a random bigass port in that critical section of the gun could gently caress performance up to the point of having to replace parts, totally unpredictable risk of impairing performance, and
2) i'm not brave enough to gently caress up the barrel itself, that's the one thing I can't really go and make a quality duplicate of myself (i work in a machine shop but the stock barrel is solid as hell and beyond my ability to duplicate to the same standard)
phantoms have very good ballistics from the factory, i do not understand ballistics, ergo i wanna keep any substantial modifications limited to the parts upstream of the bolt going pop pop pop


and yeah i dont think there are many of us left, i havent run into another phantom player in years and years. mostly its just the oldest dude working in the pro shop who'll make a point of coming over to check it out and give me props for not buying something extremely fast with a garish paintjob like the drat kids do nowadays

Sagebrush
Feb 26, 2012

One Legged Ninja posted:

Edit: IRT Ambrose

I think they were referring to putting one sensor on the barrel for an accurate shot counter, from which you could calculate rounds left. Which still doesn't solve your reloading stipulation, but it's good approach from a different angle. I mostly replied just so I could say I can't believe someone is still playing with a Phantom. :corsair:

This is also a very good idea. If the paintball is travelling at 250fps and it's .68" in diameter, it will be occluding any given part of the barrel for up to 225 microseconds. That's quite a short time, but totally detectable using interrupts on an 8-bit AVR. A infrared LED and photodiode pair drilled into the end of the barrel and run straight into a digital pin would work just fine. The 38KHz transceivers would give you more noise immunity, but realistically I don't think it would be required.


Ambrose Burnside posted:

springboarding off that question- given my requirements: powering/handling signals from 10 sets ofpaired LED/phototransistors, powering a small LED bargraph, li-ion power source friendly, and ideally compact size- which board is the best fit? Doesn't seem too daunting beyond all those sensors and their pins. I've only used an Uno and haven't tackled anything that pushed the basic board's capabilities, but I'd imagine a sensor shield would be helpful no matter what. for compactness a nano would be ideal but idk if there are any relevant quirks or caveats there (i e i know where to get an uno shield that's a good fit but i dunno about a nano equivalent)

The Nano is fine for what you're doing -- it's basically just an UNO in a smaller form factor. You don't need a shield. There are other options (the Pro Micro, the Teensy, etc) but I'd just pick up a 3-pack of nanos for :10bux: on eBay and call it a day.


e:

Ambrose Burnside posted:

Oh ok, I dig. That would work in theory but 1) it'd be incredibly awkward/impractical to locate the sensor on the "downstream" part of the gun anywhere other than just after the breech, and a random bigass port in that critical section of the gun could gently caress performance up to the point of having to replace parts, totally unpredictable risk of impairing performance, and
2) i'm not brave enough to gently caress up the barrel itself, that's the one thing I can't really go and make a quality duplicate of myself (i work in a machine shop but the stock barrel is solid as hell and beyond my ability to duplicate to the same standard)

Technically you don't even have to modify the barrel. You could make a ring that goes around the end like a flash hider that contains the transmitter and receiver, but which has a bore a few millimeters larger than the barrel so the ball's flight is unaffected. Also it's only four wires to the end -- three if you share the grounds.

Sagebrush fucked around with this message at 02:11 on Jan 3, 2019

Aurium
Oct 10, 2010
I was referring to counting shots. Watching the barrel like this won't have a problem with air shots, and should be able to detect double shots. I'd expect it to be fast enough to respond the the distance between 2, and if it can't, it could definitely respond to seeing an extra long pulse as 2 went by.

It would not help a magazine with the wrong number loaded, I suppose. I missed that this could be a concern.

Some, or even a lot, of light leakage isn't a problem. It's the same technique as tv remotes use, and they can work in full sun, and are, and by nature can't be shielded. But, it would help reliability.

To talk about other sensors, most Laser TOF sensors have a pretty large minimum distance. (Though I just saw the VL6180, which I bet you could use if you were clever with your mechanical design)

Inductive won't work, though the very similar to use capacitive ones could sense a paintball.

I think I'd still recommend beam breaking, they are plenty cheap enough to just use 10 sets in the mag. I just found a 10 pair pack on eBay for 2.95.

Aurium fucked around with this message at 02:14 on Jan 3, 2019

Ambrose Burnside
Aug 30, 2007

pensive
At the end of the barrel is a really good idea- my barrel came stock with a threaded 'suppressor' tip (doesnt suppress poo poo but does protect the thin barrel edge from impact) so fabricating a replacement tip with an IR eye in it would be pretty painless, I don't have to modify the gun proper at all and the finicky electric tip would just screw on and off.
No way I could locate more than the sensor bits at the tip, though, so I'd need some slick-looking and easy-to-disconnect way to run the wires down the barrel and to the battery + board parts (location TBD if it ain't in a bespoke tube mag body). Maybe give the barrel its own run of wire hidden under a conduit with connectors at both ends so everything's easy to uncouple when i have to unscrew the barrel off.
A direct magazine check approach would be preferable, sure, but this takes a magnitude fewer parts and less fiddly bespoke work at the expense of being precise instead of accurate, so to speak.
If it were coupled with some other sensor, maybe a simple limit switch tripped by the pump being cocked or trigger being pulled or by the bolt's position, it could even include one or two alert functions- a trigger pull followed by a beam trip lowers the ammo counter by one, but a trigger pull with no beam trip lights a dry-fire indicator instead, something to that effect. That would go a big way towards offsetting the magazine capacity assumption thing.


The only definite downside I see to putting the sensor in the tip is that the barrel tip is probably the most foul-prone part of the gun. if a paintball breaks, every hole in the existing suppressor tip fills with paint 100% of the time. it gets sand and grit in it, it bangs into walls and touches the ground when my dumb clumsy rear end falls down, etc. I'd probably need to find some way to seal the sensor components up watertight and have some sort of seamless transparent lens/cover over the diode working bits so they can be wiped clean with a barrel squeegee quickly and with a minimum of fuss. Maybe I could turn the suppressor tip from transparent acrylic or polycarb and then paint all exterior parts with a couple coats of black paint so a transparent 'barrel lining' is a given.
even considering that its a v good approach to this tho, so thanks to all of youse



Aurium posted:

I think I'd still recommend beam breaking, they are plenty cheap enough to just use 10 sets in the mag. I just found a 10 pair pack on eBay for 2.95.

i'm not usin the right search terms, can you link me

Ambrose Burnside fucked around with this message at 02:52 on Jan 3, 2019

poeticoddity
Jan 14, 2007
"How nice - to feel nothing and still get full credit for being alive." - Kurt Vonnegut Jr. - Slaughterhouse Five
I've worked with one of those TOF sensors and they're pretty decent for some applications but they're really not meant for super short distances. I got whatever the shorter range one Adafruit sells is, and it spits out garbage nearer than about 10cm.

This is where I'll admit my complete ignorance about the mechanics of paintball guns and I'll ask if you could just drill witness holes into the tubes?

Barring that, I'd recommend an infrared distance sensor that's not a TOF device.

babyeatingpsychopath
Oct 28, 2000
Forum Veteran


Comedy option is to use a raspi and openCV with a linear camera from an old flatbed scanner. 100% accuracy at all times by directly imaging the entire length of the magazine.

Probably not real amenable to battery power, though.

Self-shielded beam-break sensors (the kind that have the emitter and receiver right next to each other on the chip) and retroreflective tape on the bottom of the mag means only one set of holes to drill.

True comedy option: hall effect sensors and use ball bearings for ammo.

Ambrose Burnside
Aug 30, 2007

pensive

poeticoddity posted:

I've worked with one of those TOF sensors and they're pretty decent for some applications but they're really not meant for super short distances. I got whatever the shorter range one Adafruit sells is, and it spits out garbage nearer than about 10cm.

This is where I'll admit my complete ignorance about the mechanics of paintball guns and I'll ask if you could just drill witness holes into the tubes?

Barring that, I'd recommend an infrared distance sensor that's not a TOF device.

There's already slot cutouts in the stock magazine for good old-fashioned "using your eyes" but they're pretty hard to use in play- fields are usually dim-lit and your visibility tends to be poor through a fogged-up mask with a scratched lens. Practically speaking you end up relying on counted shots 90% of the time. The real seed for this idea was the appeal of having a bright, unambiguous and ergonomically-located visual counter that reflects the actual number of paintballs in the tube.

Good to know ToF sensors aren't a good fit, though. I figure it's gonna be either IR photointerruptor switching like we've been talking about, or maybe capacitive proximity sensors, which I was certain were expensive as hell and out of the running until i stumbled upon a bunch of ~$2/switch offerings. None of the datasheets bother mentioning the short-range performance vs. maximum detection range so I've got no idea if they'd be a reliable substitute, but in principle switching via capacitance changes vs illumination changes would be highly preferable given the operating conditions.

babyeatingpsychopath posted:


True comedy option: hall effect sensors and use ball bearings for ammo.

and on the output end of things, jam one of those 1.25" square LED flip phone screens inside your mask, snake a wire under your clothes to the magazine, and display ammo count through varying quantities of wicked sick Halo guy helmets superimposed over a blown-out jpeg of Cool Flames

alternately: use a dekatron counting nixie tube jammed inside a red dot scope body to indicate ammo count like a cool steampunk guy from the indeterminate past, power it directly with mains current via an extension cable, fall weird onto something and it shorts, and you die doing waht you loved, trying and failing to impress gangly teenagers with your obscure vaccum tubes

Ambrose Burnside fucked around with this message at 05:52 on Jan 3, 2019

Aurium
Oct 10, 2010

Ambrose Burnside posted:


i'm not usin the right search terms, can you link me

This is what I was talking about at the time.
https://www.ebay.com/itm/Infrared-IR-LED-Sender-Receiver-Pairs-You-choose-Quantity-3MM-or-5MM-USA/382632330774

The circuit is trivial. http://startrobotics.blogspot.com/2013/05/how-to-use-ir-led-and-photodiode-with-arduino.html

Have them point at each other, with the paintball get in the way. That example has it using an analog input, and just being low enough, but you'll probably want to use a digital input instead, to make it reliably go to 0, you'll probably need a larger resister than the 3k it's recommending. This will introduce a bit more noise.

I highly recommend using the 38khz modulation technique. It's easy to do, is literally orders of magnatude of noise rejection, and requires no additional hardware. It can be the difference between being swamped by sunlight, and having no issues at all.

With that in mind what I'd actually recommend is

https://www.ebay.com/itm/5-Sets-Infrared-Diode-LED-IR-Emission-and-Receiver-38Khz-VS1838B-for-Arduino/132880227375

They're even more trivial to use. They take care of the demodulation for you, so all you have to have the arduino do is flash at the 38khz, and look at the output of the various sensors. In addition, they have all of the output signal conditioning built into them, so you don't even need to find the ideal output pull up resistor.

At $3 for 5 pairs, and taking care of all of the hard parts for you, I think it's the best choice.

Also, a thread on generating the 38khz output. https://forum.arduino.cc/index.php?topic=102430.0

Ambrose Burnside
Aug 30, 2007

pensive

this is extremely useful, thank you~

BedBuglet
Jan 13, 2016

Snippet of poetry or some shit
Does anyone have any recommendations for driving brushless DC motors with a pwm signal from an arduino? I'm trying to drive a 105 watt, 24v BLDC aquarium pump that has no Hall feedback. I've found two options so far. There's this one but I've read the signal is sloppy(bad parts) and won't get the performance the stock controller turns out. I'm also not 100% sure it'll work without a Hall sensor though I've read things indicating it will. Alternatively, I'm looking that this one which would require a pwm to analog 0-10 volt circuit to control it. If someone with more electronics chops than me could point me in a good direction, that would be really helpful.

evil_bunnY
Apr 2, 2003

Pretty much any hobby ESC will drive 100w all day every day. Get something meant for planes and it’ll even have a regulator for your arduino, just check the temperature for te first hour or so (they’re meant to sit in some airflow). Get something rated for 6s.

evil_bunnY fucked around with this message at 08:34 on Jan 10, 2019

Claeaus
Mar 29, 2010
I'm making a mini handheld "console" with a snake game for two players I've programmed myself and I've connected it like this:


The pins 12 and 4 are outputting continuously and pin 11,10 and 3,2 are the left/right controllers for each player.

So far I've been powering the Arduino with a USB-cable but I'm planning on getting an Arduino Nano and powering it using a 9V battery. Do I then let the battery go into VIN and GND on the POWER-part of the Arduino and then the 5V will go to the OLED like now?

Rexxed
May 1, 2010

Dis is amazing!
I gotta try dis!

Claeaus posted:

I'm making a mini handheld "console" with a snake game for two players I've programmed myself and I've connected it like this:


The pins 12 and 4 are outputting continuously and pin 11,10 and 3,2 are the left/right controllers for each player.

So far I've been powering the Arduino with a USB-cable but I'm planning on getting an Arduino Nano and powering it using a 9V battery. Do I then let the battery go into VIN and GND on the POWER-part of the Arduino and then the 5V will go to the OLED like now?

Yeah, it's got a voltage regulator on the Vin pin that drops the 7-12V input to that pin down to 5V internally. You can then use the 5V pin to power the OLED panel. As long as the 9V battery can handle the current you're drawing it should be fine (and OLEDs don't use much power so you're probably okay).

Sagebrush
Feb 26, 2012

It's worth noting that 9v batteries have absolutely terrible capacities for their size. In order to get 9 volts, they have (in one common design, at least) six AAAA cells welded in series inside the can. That means that the whole battery has the same capacity as a single AAAA -- about 300mAh -- albeit at 9 volts. If you run that into your Nano's linear regulator, though, the extra 4 volts just get cut off as heat so you're burning up half your energy for nothing, and 300mAh is not a lot once you start talking about things that make light or move.

If you plan on only running your device for a few hours, a 9v is fine. If you want better lifetime, a 4xAA pack is physically larger, yes, but will last 5-8 times as long and only about 15% of the power will disappear in the regulator (6/5v) instead of 45%. And AAs are cheaper than 9vs too.

Something to consider.

A LOVELY LAD
Feb 8, 2006

Hey man, wanna hear a secret?



College Slice
So I got the usual 1602 with i2c interface backpack and I'm using it with an ESP32; its working but just barely.



When its running i2c the letters are patchy and only readable at a very small viewing angle, and when I disconnect and reconnect it im guessing the i2c is no longer running and the display is much more readable but not correct. The ESP32 only gives out 3.3v as opposed to the 5v on arduino.

Is there any way to get the best of both worlds easily here? As a note I'm completely out of pins. I have a new screen that claims to be 3.3v on the way and a new backpack but I have that funny feeling it might just give me the same results.

taqueso
Mar 8, 2004


:911:
:wookie: :thermidor: :wookie:
:dehumanize:

:pirate::hf::tinfoil:

Is there a bias / contrast adjustment that is currently floating?

A LOVELY LAD
Feb 8, 2006

Hey man, wanna hear a secret?



College Slice

taqueso posted:

Is there a bias / contrast adjustment that is currently floating?

Sorry should have mentioned - the backpack has a contrast pot built onto the board thats cranked as far as it can go, I think if i were to get a better look at it id have to desolder the entire thing from the LCD to get to the underside?

Adbot
ADBOT LOVES YOU

Queen Combat
Dec 29, 2017

Lipstick Apathy
Huh, pleasant surprise. So I'm following this project, but I only have Nanos on hand instead of pro minis, because why gently caress with an RS232 - USB jobbie when you can have it all right there. However, I've never done anything like that before, but googling revealed to me that the SDA and SCL pins on the Pro Mini are basically pins A5 and A4 on the nano.

So, I wire it up like that, doesn't work. Weird.

Turns out, all I had to do was add "#include "wire.h"" in the "define.h" file of the project, and it worked perfectly!

Now, I do have one question, if anybody was willing to take a look at it. The project has a resistor and a fast-switching diode between the "RXI" and "TX0" pins on the pro mini. These pins don't exactly exist on the nano, so I put a similar thing across "RXD" and "TXD." Don't know exactly what it's for (high pass filter for noise on the data bus is my best guess?) but the project works all the same. Any ideas?




E: gently caress it, cloned the repository and made it use something not-depreciated, like the Pro Mini: https://github.com/geirskogul/m365_dashboard/

Queen Combat fucked around with this message at 06:01 on Feb 25, 2019

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply