SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By StaticDet5
#143118
OK, I think I'm getting that.
If I understand it correctly, I can save pin 2 and pin 3 for external interrupts. The two interrupts I'm thinking of, I'm not worried about conflicting: Interrupt on pin 2 being a trigger state change (for a high speed trigger option, not for an analog read trigger). Interrupt on pin 3 being the first photo-interrupter pin. When this is triggered it starts counting until the second photo-interrupter is triggered.

I'm getting ready to futz with the code on the prototype board to incorporate a local display as well. Every time I do a major change, I want to "gravitate" the pins to where they'll eventually be on the backpack.
By dkulinski
#143125
Hey guys, I am back from a few days of golfing with some buddies. The idea Mee_n_Mac has is right on. Pin 2 and Pin 3 are the INT0 and INT1 pins on the Arduino. You can set these to change on rising or falling edges. If your IR sensor puts out an active high then you want to set it to trigger on a falling edge, otherwise on the rising edge.

Putting the trigger on an interrupt probably isn't necessary as polling is going to be faster than any human interaction. In fact this is what I do on lasertag. So what I would do is put both interrupters on the INT0 and INT1 pins.

Dan
By Mee_n_Mac
#143130
dkulinski wrote:Putting the trigger on an interrupt probably isn't necessary as polling is going to be faster than any human interaction. In fact this is what I do on lasertag. So what I would do is put both interrupters on the INT0 and INT1 pins.
Why not put both on a single pin ? The ISR saves the time of the interrupt. Background code then computes the time difference and checks that it makes sense (to handle potential misses and false detections).

Golf ? I didn't know you were that old. :mrgreen:
By StaticDet5
#143134
Yikes... old jokes...

If I put both sensors on the same pin, it makes a fair amount of things easier.
BUT we lose some error checking. We'll double the rate of "false positives" on the photo-sensor system. Even if we limit the "look period" to the time immediately after the firing of the gearbox, we'll still get false hits.
If, on every hit, we have the system watch for 1/10th of a second, we have a decent range gate (down to 20fps).
If the gearbox fires, and we get a false hit before the round enters the detection chamber, then we're going to get three hits (false hit, actual entrance, actual exit). On full-auto, that will bring us in to the next shot. Possibly.
Hmmmm.... when I first thought about it, it wasn't a good thing. I thought I had a valid argument constructed in my head. Now it doesn't sound like a big issue.
Let me think about it. I REALLY like the idea of the photo-detector system being on one pin.
By dkulinski
#143145
You just lose discrimination when they are on the same pin. The sensors for lasertag work the same way.

What is the problem with putting the trigger on a polling loop? You don't have to have it timed, you could just have it in the main loop and then turn positive once the trigger is down for X amount of cycles.

As for the old comments, I am only 36. Besides, we were in Mesquite, NV for the 4 days of golf. There was golf, gambling and drinking involved. That isn't an old man's sport! Now what truly makes me feel old is that my oldest son is about to enter high school.

Dan
By StaticDet5
#143148
You're not going to hear "old" comments from me. We're the same age. Kids....that's another story. They'll make you older faster than anything I know.
I think you're right. I'm going to keep the trigger the way we've discussed.
By StaticDet5
#143524
Long overdue update:
I'm not dead. I'm actually returning to the land of the living, and finally going back to work. The last ten days to two weeks have been running around getting things ready for that.

I'm working on learning the 4DSystems programming language for their displays. The big thing is the serial commands and string slicing the serial messages to get the data to go to the right places. For now, I'm just going to worry about sending messages to the display. Later, I'll have the display send messages back to the Arduino to allow the user to configure certain things on the fly (burst amount being the biggest on the list). The project's not dead and definitely not abandoned.
By StaticDet5
#143789
Another fly in the ointment:
Something's happened to my system, and I need to send it in (thank you Asus warranty). It seems to be overheating. It's a laptop, so I can't mess around with it too much.

I'm taking the time to streamline my display prototyping. I found a four pole-double throw switch. Now I can just wire the display in and flip a switch between the USB programmer and the Arduino. It'll save time and lots of wear on the display.
By Mee_n_Mac
#143792
Sadly with notes getting smaller and smaller, cooling issues are getting more common. A little dust and lint can clog the airflow enough to cause a problem. I have an old HP dv9000 that suffered the Nvidia-GPU-unsolders-itself problem. In fact since my Acer died, I've been trying to resurrect the HP ... to no avail. :cry:
By StaticDet5
#143794
As a tech support guy (small business, on the side), I've had horrendous issues with HP's. At times it seems like they forgot basic thermodynamics.

I'm just hoping the little guy comes back OK. I backed up the files, but it's a great little computer.
By StaticDet5
#144182
I'm back at work. That's really eating into my time (I just did two 12 hour shifts, terminated by a 16 hour shift because I'm nice and I can't read).
My laptop is still being repaired (hopefully.... tech support has gotten awfully quiet...too quiet), so I'm working on some "admin tasks".

I finally sat down and rebuilt the display rig. In order to work with the display, I needed to plug the display into it's little programmer (I don't have the capability to bit-bash that interface, so I picked up the programmer at $25), write the program, flash it to the display, unplug the display and plug it into the Arduino that is going to run the code, and then run the code.

The plugging and unplugging were making me nervous. I wanted a way to switch interfaces at the flip of a switch (literally). The whole interface is run off of five wires (Vin, Gnd, Tx, Rx, Reset). I ran everything through a four-pole, double-throw switch, and kept the ground common throughout the system.

It was still a mess. I needed things a little more organized. I wanted to be able to move this thing around, safely/easily, once it was built.

Legos. I still have a ton of legos, and as a prototyping material, this is pretty easy to work with. It turns out the the switch fits almost precisely in a "holed" lego, with just a little bit of drill-shaving. It's keeping my wires organized, and I don't have to unplug anything. The only thing I didn't think of was a master power switch to the display. I may work on that later. As it stands, if either of the USB devices are sending power to the display, the display is on, showing information. You don't want to do this with OLED displays, as they can suffer burn-in.

Finally, I hit this little gem on Hackaday this morning.
http://www.vagrearg.org/?p=transline

It looks like they're talking about much longer transmission lines than I'm considering using. However, my "prior-art" research says that many of these projects get stuck with noise issues that they can't solve, so I'm going to read this article and see if there is anything else to incorporate into the sensor head (I'm pretty sure we already solved one of the big issues).

I'm also working on an Oscilloscope. Sparkfun's "new" scope from last Friday's "New Product Friday" release looks good (I wonder if I can get it to work on my tablet...)
By dkulinski
#144191
I like the idea with the display, very nice work there. I saw the long distance transmission article and thought the same thing. Hopefully it will help with your design, but I don't think you are seeing misreads from the wire. I think Mee_n_Mac's test of firing without the sensor harness proved that possibly the compressed air obscures enough light to cause a false reading.

You know that USB based o-scope caught my attention to. One reason is due to the fact that it also contains a logic analyzer. Because my workbench is next to my computer this may work well. Now to pay off my dental bill so I can start buying toys again.
By Mee_n_Mac
#144209
WRG to the MSO-28 ... I get to use the many K$ o-scopes available at work but yet it would be nice to have something handy at home, so I've looked into some basic hobbyist o-scopes thinking that w/o the display and computing functions a USB o-scope could be good for less $$s. Alas it seems not to be the case. Read the comments here ...
http://www.eevblog.com/forum/product-re ... lloscopes/
It appears you can get a "normal" o-scope for slightly more $$s. The killer for me (re: the MSO-28) is the 1000 sample depth. That's reallllly small as I find 8k is just enough. I think one of the posters above had it right ... buy an o-scope and then a separate logic analyzer if you need one.

WRG the transmission lines ... looked to be a good article ! I'll have to read it carefully later tonight. I'm sure some of the false detections were due to line reflections. These were the ones that happened bang-bang, one immediately after the other. The first detection would be the true one, the 2'nd the false one due to a reflection ... happening within 1 sample period (1 msec). I think by "detuning" the line (adding some capacitance) you were able to remove this type. There still remained some occasional false detections that happened randomly; too late to be reflections or gas detection. I can only guess these might be motor noise pickup or ??? Routing the wiring and/or shielding might be the answer to these but I'd have to go back the the test results to refresh my memory as to what was tried and didn't work.

And just a note for proto-typing mechanical thingees ... my friends showed me this stuff, called Sculpey Clay, a couple of years ago. It's like modeling clay and you can mold it into various odd shapes and then bake it into a plastic-like final product. I guess it's like a hard plastic version of SuGru. Good stuff if you want something molded ... say to fit your hand.
By Mee_n_Mac
#144222
dkulinski wrote:Alright, can you explain why the 1k sample depth is bad? In what situations does this rear its head?

Dan
An example I've run into is sampling a bitstream to decode what message was actually sent. My minimum rule of thumb is 5 samples/bit (others might say more) to get a good idea of the edge timing. Using a normal 8N1 setup that's 50 samples/byte and so 1000 samples limits you to 20 bytes max. Less when you factor in any dead time between bytes sent. For simple messages that might be enough but often it's not.
  • 1
  • 26
  • 27
  • 28
  • 29
  • 30
  • 32