opto sensor, microcontroller, led display

Thread Starter

akramer08

Joined Jan 23, 2013
113
Ill go with the picaxe. I dont know exactly which one to get. Im not sure what the difference is between all of them. What do you guys think?

Sensors I will do the IR and I will place it just below the hopper on the feedneck. Putting it inside the "chamber" or the barrel I think will be extremely tricky, as that involves a lot of work inside the gun itself.

I decided to abandon the fps at this time. I could see maybe adding it as a cool feature down the road. One of you mentioned it would require two pairs of IRs, so one at the beginning of the barrel just after the ball is released from the bolt, and one further down the barrel or just outside of the end of it.

For the display...it might fully depend on how the 16x2 lcd looks. All the pictures Ive seen on google have a background color and a text color. Wouldnt that be hard to see during the day? If the pictures just exaggerate the background color and its not really hard to see, Ill go with the lcd. If the only lcds available are hard to see during the day, Ill go with the oled.
 

thatoneguy

Joined Feb 19, 2009
6,359
Without using a backlight, the transflective backing of the LCD makes it very legible in well lit areas.

If you plan to use it in dim/dark, then you'd need the backlight on. For daylight only, LCD w/o backlight would be fine.
 

tshuck

Joined Oct 18, 2012
3,534
Ill go with the picaxe. I dont know exactly which one to get. Im not sure what the difference is between all of them. What do you guys think?
This is thatoneguy's area, I've never used PICAXE, but I'll do some reasearch tonight if I get the chance, unless we come to a consensus on the part...
Sensors I will do the IR and I will place it just below the hopper on the feedneck. Putting it inside the "chamber" or the barrel I think will be extremely tricky, as that involves a lot of work inside the gun itself.
...doesn't sound too hard...
I decided to abandon the fps at this time. I could see maybe adding it as a cool feature down the road. One of you mentioned it would require two pairs of IRs, so one at the beginning of the barrel just after the ball is released from the bolt, and one further down the barrel or just outside of the end of it.
they don't need to be spaced that far apart. Really, we would need to know how big the paintball is(diameter, unless they aren't mounted in the middle) and the separation of the two sensors. They don't need to be separated by much at all, in fact, they could reside in the same enclosure...
For the display...it might fully depend on how the 16x2 lcd looks. All the pictures Ive seen on google have a background color and a text color. Wouldnt that be hard to see during the day? If the pictures just exaggerate the background color and its not really hard to see, Ill go with the lcd. If the only lcds available are hard to see during the day, Ill go with the oled.
The OLED display will, undoubtedly be easier to see in the daytime, but that isn't to say the LCD is illegible...
 

Thread Starter

akramer08

Joined Jan 23, 2013
113
I will just go with the ammo count and battery level. The fps sounds pretty cool, but its in no way necessary.

My big thing that Im not sure about is the display. The OLED is easier to see in daytime, and I believe one of you mentioned it was easier to hook up. On the OLED, can you have two lines, the one on top being a larger font and the bottom line a smaller font? That way the ammo count would stand out and the battery level would be secondary?
 

thatoneguy

Joined Feb 19, 2009
6,359
I'd suggest the arduino if you are looking at using the 1" Graphic OLED display.

Text can be printed in 7 different sized fonts at any location on the display, the arduino library also has functions to draw boxes/circles/lines/etc. These can be used to fill in or clear an area or draw a picture of a battery with a certain amount "full" based on ADC reading.

check out the ebay link for that 1" OLED UART/SPI/I²C, and look at the manual to see if the library functions make sense (quite a bit easier than communicating with the raw commands).
 

thatoneguy

Joined Feb 19, 2009
6,359
Is it a lot harder using the picaxe with the oled? I don't need any circles, lines, etc. Just text will do.
I'm guessing you'll want to add features once you get started, so I'd suggest the arduino for this. I'm a PIC fan, but there are certain cases where Arduino libraries/system are a better choice, especially when just starting out.
 

thatoneguy

Joined Feb 19, 2009
6,359
Is the arduino a lot bigger? I really want to keep this as small as possible
The board is 2" x 3", but there are several tutorials on "Mini-fying" an arduino project by using just the IC from the UNO board and moving it to a proto board.

The native C runs faster than the interpreted picaxe, and I just noticed the extra fonts for that graphical OLED display are only uploaded with the Arduino libraries.

This would leave you the option of menus, shot count, battery level (if you got an external 1.25 or 2.5V precision reference), as well as leaving the option for velocity available on top of what you initially build.

Any time I look at what is needed for a project, I try to go with the lowest cost, and with enough Flash and RAM for expanding the application in the future. Since you are just getting started, the choice was mostly between PICAXE and Arduino. Most only suggest Arduino, while ignoring the much cheaper PICAXE solutions.
 

Thread Starter

akramer08

Joined Jan 23, 2013
113
Which is easier to program? A flowchart was mentioned for the picaxe. Is the arduino just programmed with codes? Whichever is easier for a beginner is the way I want to go.
 

thatoneguy

Joined Feb 19, 2009
6,359
Most simple PICAXE programs can be done with flowchart programming, BASIC for more complex programs.

Arduino is programmed in C, which does have a bit of a learning curve to it, both syntax and in how functions pass variables (pointers).

The PICAXE Software is a free download and will show you the results in a simulation. Try that out to see if you can do what you want in flowchart mode.

PICAXE Software The top two are the commonly used ones, I don't have a ton of experience with the flowchart mode, however.
 

tshuck

Joined Oct 18, 2012
3,534
Which is easier to program? A flowchart was mentioned for the picaxe. Is the arduino just programmed with codes? Whichever is easier for a beginner is the way I want to go.
Technically speaking, they are both programmed with code, the difference is in how that code is generated.

I've seen a few programs that will allow you to program an Arduino through a VPL(visual programming language), which would allow the code to be laid out in blocks that have certain functions, though I can't say anything about their usability, nor efficiency, but I thought I should mention it.
MiniBloq

Wiring, the language Arduino uses, isn't too bad, and there are quite a bit of examples and tutorials out there to learn from, so the learning portion of it should be minimal.
 

thatoneguy

Joined Feb 19, 2009
6,359
The biggest downfall of Arduino is that there isn't a simulator as part of the package, and debugging is only possible by printing to the serial terminal, rather than examining memory/port states, etc.
 

Thread Starter

akramer08

Joined Jan 23, 2013
113
I'm leaning toward the picaxe. It sounds like it kit be a little easier to use for this project. I might get an arduino in the future to learn a little more. What exactly should I look into getting? Is there a certain amount of pins or does it go by size? I want to have 3 buttons(power button and setting buttons) as we'll as the sensor and display. I'll go with the 16x2 LCD, as thatoneguy mentioned the different text types were used with the arduino.
 

thatoneguy

Joined Feb 19, 2009
6,359
I'm leaning toward the picaxe. It sounds like it kit be a little easier to use for this project. I might get an arduino in the future to learn a little more. What exactly should I look into getting? Is there a certain amount of pins or does it go by size? I want to have 3 buttons(power button and setting buttons) as we'll as the sensor and display. I'll go with the 16x2 LCD, as thatoneguy mentioned the different text types were used with the arduino.
The M2 parts all have about the same memory and functions, unless there aren't enough pins.

If you plan on adding anything, such as trying to see if you can capture velocity, adding another button, etc, I'd suggest going with the 20M2. Once you have a project that uses more I/O than the 08M2 has, there's not much size difference between the 14 pin, 18 pin, and 20 pin (≈0.3" length difference between 20pin and 14pin). All options will be smaller than the display itself.

With the 20M2, all of the PICAXE functions are available, and only a couple pins short of what a standard Arduino provides. The cost difference is minimal once you get larger than the 08M2, and the platform offers simulation without chip, as well as in circuit debugging. ICD means that while uC is running your program, you can view the state of all variables, I/O, etc. Running in Debug mode does slow the uC down, but it's sometimes the only way to locate odd behavior.

I help a lot of students get started in programming, and BASIC on PICAXE is the fastest way for them to be grinning, and essentially, addicted. Microcontrollers are one of the most fun ICs in electronics. From random number generation to a DIY odd logic chip, a lot can be done with a few lines of code.

The downsides are the named RAM limit (which you shouldn't have an issue bumping into with the character LCD) and the lack of user-base in the US, though it is increasing. The last one is obviously speed, though they function (run BASIC) faster than home PCs did when first on the market when set to run at 32Mhz, even with the interpreter/BASIC slowing it down. Phil Anderson was the only distributor for the US for a long time, he is deceased, but Aztec MCU has filled the void.

Comparison Table and info on PICAXE chips
 
Last edited:

Thread Starter

akramer08

Joined Jan 23, 2013
113
I guess since the program for the picaxe is free and can run a simulator ill go ahead and start on that soon. When I finally get the programming tested and running, what's the next step? What does I need to transfer the program to the controller?
 

thatoneguy

Joined Feb 19, 2009
6,359
I guess since the program for the picaxe is free and can run a simulator ill go ahead and start on that soon. When I finally get the programming tested and running, what's the next step? What does I need to transfer the program to the controller?
Yes, you'll probably need the display and controller + breadboard before then. Aztec sells a breadboard with Picaxe M2 and programming adapter so you would be set, only add the Serial Link to the LCD (Make sure it is a UART/TTL Serial Display, character only, not graphic). Then choose your LED/PhotoTransistor from mouser or digikey, or any other shop you find convenient. It's best to get them as a pair, so the wavelengths are matched for best performance. If you can't get a matched pair, just make sure the wavelengths are the same for emitter and detector. LEDs are very narrow in their light, one wavelength only, similar to a laser, but LED light isn't coherent like a laser is (unless you get a laser emitting LED).

But you can start now to get the gist of it. You'd use the serial/uart send command to put text on the display in the flowchart software. There isn't a receive needed.
 

tshuck

Joined Oct 18, 2012
3,534
Also, if you are going to want the battery level monitor, you'll need to get a PICAXE M2, according to the link thatoneguy provided a couple posts above, as the M2 class has the fixed-voltage reference on board the PICAXE. Otherwise, you'll need an external voltage reference.

only add the Serial Link to the LCD (Make sure it is a UART/TTL Serial Display, character only, not graphic)
I'm sure I2C is also supported, no?
 

Thread Starter

akramer08

Joined Jan 23, 2013
113
Also, if you are going to want the battery level monitor, you'll need to get a PICAXE M2, according to the link thatoneguy provided a couple posts above, as the M2 class has the fixed-voltage reference on board the PICAXE. Otherwise, you'll need an external voltage reference.
Yea I planned on getting the 20M2. So if I wanted to add features in the future I wouldnt need a whole new chip. I downloaded the flowchart program and I have to say, I have no idea what Im looking at.
 
Top