Shop OBEX P1 Docs P2 Docs Learn Events
Would a Propeller Activity Board be good for a one-off children's toy? — Parallax Forums

Would a Propeller Activity Board be good for a one-off children's toy?

gwtthrgwtthr Posts: 30
edited 2014-04-26 18:53 in Propeller 1
I'm interested in making a one-off toy for my son. The toy will be a basic console with steering wheel and multiple push buttons for sound effects. I will use four toggle switches to set a mode (Airplane, Helicopter, Car, Space Ship, etc). The remaining buttons will play sound effects unique to each mode. The only experience I currently have is with a BS2 I used to make a working prototype. It doesn't have enough memory for the full program. I've got several questions regarding the Propeller Activity Board. I was interested in this set-up.

http://learn.parallax.com/propeller-c-simple-devices/play-wav-files

It has I/O ports for up to 16 pins. I would like to have buttons wired to all of those pins. Is that possible? I see only five 3.3V pins for power. Can I use multiple buttons on each voltage source(wired as pull-up, I think)? I also have the concern of my son getting ambitious and trying to push all the buttons at once. What would this do to the board?

I also see this same problem with the ground pins of the board. There are not as many pins for ground as those I would be monitoring for buttons. I've seen that you can use one ground for multiple buttons, but is there a limit?

Has anyone had any experience with the Veho speaker( Parallax #900-00018)? I would hate to start this and find that the sound quality was so poor that it wasn't worth my time. The sound files I would be using would be only 16-bit PCM, 32 kHz, mono WAV file recordings as recommend. Does anyone know the proper way to format an SD card for the PAB? The ones I have found for sale per-formatted for it are only 1gb. I'll like to play it safe and buy something much bigger for the money, and have plenty of room for longer sound effects. Is the Propeller Activity Board SDHC compatible?

I'm also looking for suggestions as to what other functions the PAB can perform while the 16 I/O pins are occupied. I know you can control servos, but those run on the same I/O pins that the buttons would be using? It would be neat to have some gauges that move by servo as the modes or sounds play. Any suggestions will be appreciated.

Thanks to you all in advance.
«1

Comments

  • jazzedjazzed Posts: 11,803
    edited 2013-12-31 13:04
    I don't think Parallax has any recommendations on ages, etc.... I assume that would be your discretion.

    I let my grandson play with my bots with my guidance of course. He loves the way they move and can do other things. It is a spark of imagination that I wouldn't miss for the world.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-31 13:18
    gwtthr wrote: »
    I'm interested in making a one-off toy for my son. The toy will be a basic console with steering wheel and multiple push buttons for sound effects. I will use four toggle switches to set a mode (Airplane, Helicopter, Car, Space Ship, etc). The remaining buttons will play sound effects unique to each mode. The only experience I currently have is with a BS2 I used to make a working prototype. It doesn't have enough memory for the full program. I've got several questions regarding the Propeller Activity Board. I was interested in this set-up.

    http://learn.parallax.com/propeller-c-simple-devices/play-wav-files

    It has I/O ports for up to 16 pins. I would like to have buttons wired to all of those pins. Is that possible? I see only five 3.3V pins for power. Can I use multiple buttons on each voltage source(wired as pull-up, I think)? I also have the concern of my son getting ambitious and trying to push all the buttons at once. What would this do to the board?

    I also see this same problem with the ground pins of the board. There are not as many pins for ground as those I would be monitoring for buttons. I've seen that you can use one ground for multiple buttons, but is there a limit?

    This is a limit of how much current the 3.3V pins can provide but you won't come close to using with pull-up resistors. All 16 I/O pins can be used as buttons without any problem. If you need more 3.3v sources use a wire to plug the 3.3V into the breadboard and then use the power from the breadboard. The same thing with the ground. Add as many ground connections as you need.

    There are chips that will let you read a bunch of buttons with just a few pins. There are also ways to wire buttons in a matrix so you don't need an I/O pin for each button.
    gwtthr wrote: »

    Has anyone had any experience with the Veho speaker( Parallax #900-00018)? I would hate to start this and find that the sound quality was so poor that it wasn't worth my time. The sound files I would be using would be only 16-bit PCM, 32 kHz, mono WAV file recordings as recommend. Does anyone know the proper way to format an SD card for the PAB? The ones I have found for sale per-formatted for it are only 1gb. I'll like to play it safe and buy something much bigger for the money, and have plenty of room for longer sound effects. Is the Propeller Activity Board SDHC compatible?
    The Veho sounds as one would expect from a speaker that size. IMO it sounds pretty good. I like them myself.

    I've use 16GB SD cards on the Prop. Yes, the PAB is SDHC compatible.

    I don't recall the best way to format the cards. I usually don't do anything special when using a uSD card with a Prop.
    gwtthr wrote: »

    I'm also looking for suggestions as to what other functions the PAB can perform while the 16 I/O pins are occupied. I know you can control servos, but those run on the same I/O pins that the buttons would be using? It would be neat to have some gauges that move by servo as the modes or sounds play. Any suggestions will be appreciated.

    Thanks to you all in advance.

    My main suggestion is don't use 16 I/O pins on switches. Three pins is all you need if you use a couple 74HC165 parallel to serial shift registers. I mention the chip I know how to use, I know there are lots of other options. The '165 chips can be daisy chained so you could easily have oodles of buttons without using up more than three I/O pins.

    I think the PAB is a good fit for this project. The built in SD card and audio circuit will make the project much easier to complete than if you were to use a bare bones board.
  • gwtthrgwtthr Posts: 30
    edited 2013-12-31 17:20
    Excellent reply Duane. I appreciate the help, because I'm going to need all I can get.

    It seems that all of my concerns of using the 16 I/O pins are moot. I guess I need to look into using multiple 74HC165 parallel to serial shift registers and that should give me the ability to add many switches. Would you be able to recommend a source I can use to learn to use this register? One that is clear and simple for a newbie to understand.

    Now that I have freed up some I/O pins, my new problem will be how many features do I want this toy to have. I just hope I can finish this in time.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2013-12-31 18:41
    I made a small demo on using the '165 chip here. It's pretty much just a translation of the Stamp Works Basic Stamp program into Spin.

    Each 74HC165 chip can read 8 inputs. I used two chips so I set the "BITS_IN" constant to 16.
    BITS_IN = 16
    

    I think the program would work on up to four chips (32 inputs) by modifying this constant. Additional chips beyond four wouldn't be hard to add but it would take more than just changing the one number.

    I also wrote a '165 object which makes it easier to use the code in another program. I'll try to find it and add a link to it from my '165 demo thread.

    I'm pretty sure there are other objects in the OBEX one could use with the chips. I just wanted to understand how they worked so I wrote my own driver (which is about as simple as drivers get).
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-01 23:46
    Welcome to the forums!

    Love your idea! I always wanted to add lights, blinkers, and more sound to my daughter's PowerWheels Mustang, but the little weed grew too fast, so now we have been talking of converting it to an oversize radio control car with all the effects.Though I am not certain how well it would work, you could use a matrix style setup for the buttons like the Parallax 16 button Keypad. I just used it for a remote (see this thread) and it gave me 16 inputs while only consuming 8 IO pins. I only added 4 pulldown resistors to the input lines. I don't see any reason why you couldn't do the same setup with plain old push buttons connected by wiring. Take a look at these switches at Sparkfun, they would work well for a toy and at $5 for a colorful set of 12, it's hard to beat. Since you mentioned a helicopter, you got to add one of these covered toggle switches. LOL

    Also, keep in mind that the Activity Board has 18 accessible IOs, not just 16. You have Ports 0-15 on the header, but Ports 16 and 17 are available on the last two servo headers. I just completed a project using my PropBOE, and ended up using all 20 of it's IOs, 4 of which were from servo headers. Had I not had those few extra on servo headers, I would have been short a few IOs for the project.

    Depending on how many IO Pins you truly need, you could also us the Propeller Project board and just add the Micro SD Breakout board (or regular SD BOB)and a DAC circuit for the audio output. I believe the Veho speaker will work with the line-out level from the Propeller /DAC setup, but not 100% sure. That Veho speaker is definitely loud enough for a child's toy. You can also adjust the WAV files to your liking with a free audio program called Audacity. It is really nice and easy to use. I used it to trim the audio and increase the volume of the sound effect files for the Time Machine project I just did a few weeks ago for a Christmas play.

    Good luck and please keep us up on your progress and if you have any questions. There are tons of people on these forums that will jump in to help with any issues.
  • gwtthrgwtthr Posts: 30
    edited 2014-01-06 17:36
    Thanks for the welcome Andrew. Trust me, my son has a PowerWheels Mustang which he is to young to drive now, but the mods will come. This project is first though.

    I've been researching my options on how to get numerous push buttons. I've read about using a matrix of buttons with diodes, and shift registers for multiple push buttons. Between the two for a beginner, what are the pro and cons of doing it each way?
  • electromanjelectromanj Posts: 270
    edited 2014-01-06 19:59
    First of all Whoot! Another Kansan! Welcome to the forums!

    Check out January's edition of Nuts and Volts Magazine. The Spin Zone by Jon McPhalen has an entire article about shift registers and the Propeller.
    http://www.nutsvolts.com/index.php?/magazine/article/January2014_SpinZone

    traVis.
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-06 22:28
    gwtthr wrote: »
    Thanks for the welcome Andrew. Trust me, my son has a PowerWheels Mustang which he is to young to drive now, but the mods will come. This project is first though.

    Very cool! My daughter got hers when she was 8 months old as well, so she had to wait a bit before she could reach the pedals (or have hair for the wind to blow through, LOL)
    IMG_4669.JPG



    gwtthr wrote: »
    Between the two for a beginner, what are the pro and cons of doing it each way?

    Tough one there for me to answer since I rarely have projects with a large number of inputs. But here are my thoughts:

    Matrix:
    Easy to wire/connect
    Easy to leave open for later additions
    Uses multiple IO pins (6 IO for 9, 8 IO for 16, etc)
    Usually needs debouncing or pulldowns to prevent false reads or multiple reads
    reasonably easy to code
    Can be scanned quickly, minimal timing impact on code
    Not a ton of examples on forums, (but maybe because there are very little differences between any style?)
    Not all input states can be read with a single read loop. In other words, if you use toggle switches with a matrix, you cannot have more than 2 on at any time or you will get phantom reads. See this snippet from one of Beau's posts:
    Multiple button presses are allowed with the understanding that “BOX entries can be confused. An example of a BOX entry... 1,2,4,5 or 1,4,3,6 or 4,6,*,# etc. where any 3 of the 4 buttons pressed will evaluate the non pressed button as being pressed, even when they are not. There is no danger of any physical or electrical damage, that's just the way this sensing method happens to work.

    Shift Registers:
    Minimal IO pin consumption
    Easy to add additional chips to expand
    Several objects in the OBEX and on the forums
    lots of examples on forums
    I believe they are fairly quick with reading inputs
    Easy to read each input's state individually in a single read loop. Each switch's state is independent from each other, so any number of combinations could be read and treated as additional options (IE: if 8 switches in a row are set in an on-off-on-off, etc pattern, a special sound plays)

    I guess I would say that for this reason:
    Easy to read each input's state individually in a single read loop.
    I would opt for shift registers. That gives you extra combinations of switch positions to have different triggers for.
    448 x 298 - 21K
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-07 08:30
    I would opt for shift registers. That gives you extra combinations of switch positions to have different triggers for.

    I second Andrew's suggestion. Particularly in this case where the ActivityBoard uses up a good portion of the pins to start with.

    The "box" issue Andrew refers to isn't an issue with normal keypads where only one button is being pressed at a time but I imagine you might want the ability to accurately monitor all the buttons no matter how many are pressed.

    I second the earlier suggestion to read JonnyMac's Spin Zone article. I haven't read this one yet but I learned a lot from his articles.
  • gwtthrgwtthr Posts: 30
    edited 2014-01-07 16:49
    I was leaning towards using the shift registers. Although I found the wiring diagram for the matrix straight forward enough to understand, yet complex to wire. I’m dreading the shift registers, but it is probably because I don’t have any experience with the Activity Board yet. Everything I’ve done with the BS2 has been dirt simple.


    I’ve been very busy with the Holidays and I’ve been meaning to update the forum with pictures of the build as it progresses. Between painting the kids bedroom and tiling a backsplash for the kitchen, I haven’t had time to work on this. As of now various parts are being ordered and starting to come in. The Activity Board has been ordered, so the option of sourcing the individual components as Andrew suggested is gone. I think it will save me some assembly work anyways. I’ve found a plethora of buttons and switches available on eBay. I tried to get a variety of items since it is a children’s toy and needs to keep his interest. I do have some aircraft style toggle switches. I was torn on what type of control would be used for my son to steer with. I wasn’t sure if I was going to use an old joystick or a steering wheel? I plan on this console being used as everything from a pretend car, to a helicopter, to even a couple of “space vehicles”. You can guess what those last two are, but you can’t get .wav files of those sound effects online without a lawsuit. I’ve finally decided on a PS2 steering wheel off eBay. I’m going to dismantle it and put it on an enclosure that I build. Once a majority off the parts are in I’ll put up some pictures.


    As far as the I/O ports, I could use ports 16 and 17 to run a couple of servos for “gauges” that could react to inputs. Sounds like fun, and more work…

    I was about to purchase the Veho speaker and noticed it was powered with a re-chargeable battery. This won’t suit my purpose since at the most I only want to have to plug the console into the wall for power. I would hate to have to keep re-charge the speakers. Can anyone recommend a pair of speakers that would plug in directly to the board and sound good enough for a children’s toy? I keep finding powered ones when I search online. Of the couple of spare computer speakers sets I’ve had laying around one went into my Ghostbusters protonpack, and the other got thrown away.


    For a permanent project I’m sure most of you have soldiered your components onto a perforated circuit board. Has anyone just used silicone or something similar to “glue” the components in place on a prototyping breadboard? I’d save me quite a lot of effort. Losing the prototyping board won’t bother me.
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-07 17:24
    I have seen projects built onto a breadboard and left as-is, but for a toddler, it may be wise to secure some things with hot-glue. Hot-glue will allow reasonably easy removal should adjustments need to be made. Here's a project I did that is still together today and is a mixture of solder, hot-glue, and zip ties.

    I can check later tonight if the Veho speaker works when the USB charging cord is plugged in and the switch is always on. If so, you could just use the Veho and power it from the 5 volts from the Activity Board. It's battery would slowly discharge when the device is off and the Veho runs on it's own battery playing dead-air, but it would still give you a simple amplified speaker solution. Otherwise, any battery powered amplified speakers with a standard headphone plug would work just fine. Just jump the battery terminals over to the Activity board to power them.

    Do you plan on using SPIN or C to program?
  • gwtthrgwtthr Posts: 30
    edited 2014-01-08 17:21
    I hate to say it, but SPIN or C? I didn't know I even had a choice. I've had a programming class in C in college. I was just going to use whatever language the example program I provided in the start of the thread had used. It looks like C to me. I haven't touched any C programming since 2003, just some MATLAB in last couple years.

    If anyone wants to give chime in about SPIN and the pros and cons of using it, I'd appreciate it.
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-09 00:13
    You have a few options with the Propeller: SPIN, C, PropBASIC, PASM, Forth, and maybe a few others I am probably forgetting. SPIN and PASM are considered native to the Prop, but with the Propeller GCC efforts, C will continue to gain a foothold with the Propeller. Someone else may correct me, but the fact that you are new to the Propeller makes me lean towards suggesting SPIN as this project is a slam dunk by using a few objects available on the forums or in the OBEX. However, since you have a C background, regardless of it's rustiness, venturing into Propeller GCC may prove easier on the learning curve.

    Anyhow, I can probably continue to help if you are using SPIN, but can't do anything for you with GCC (I haven't touched it yet). Of course, I am only one of many Propeller users on this forum, but I have done a few projects very similar to your idea.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-09 09:13
    I second Andrew's recommendation of Spin. You'll find a lot more code examples in Spin than in C.

    Like Andrew, I'm still using Spin. I believe C is targeted towards the educational market. Ken recently mentioned all the commercial users of the Propeller are using Spin/PASM.

    I'm one of the Spin only (for now) Propeller users. I agree with Andrew that you will more likely be able to find help with your project if you use Spin.

    I think your experience in C will help you with Spin. I had been using C a lot when I started learning Spin. I was very pleased with how easy it was to learn Spin. I was soon glad to be rid of the brackets and semicolons. :smile:
  • gwtthrgwtthr Posts: 30
    edited 2014-01-10 17:30
    My new Activity Board is in, speakers are ordered, and I've got a new micro SD card ready for some .wav files. I've transferred my BS2 test setup to the propeller. It took 20 min to remember how to check multiple push buttons using C (without looking it up)... urgh. Wish me luck. I hope the magic smoke stays in...
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-11 00:03
    Sorry for the delay. I tested the Veho speaker while constantly plugged in and it only worked like I had hoped 6 out of 10 times. I think the charge controller was getting confused and that was causing the inconsistencies.

    EDIT: Had a thought........ I was using a cheap, power-only, USB cable and kept getting weirder results, so I tried a different USB cable and it seems to work perfectly. The status LED on the speaker shows blue (meaning it is turned on) with a hint of redness (meaning charging). The only concern that I can think of would be that the speaker would always be on, so it would always be drawing power. Either from the USB cable when the device is powered or the battery when the device is turned off (the speaker/amplifier will still draw a little even without an audio input. Not sure how little though)
  • gwtthrgwtthr Posts: 30
    edited 2014-01-13 17:09
    EDIT: Had a thought........ I was using a cheap, power-only, USB cable and kept getting weirder results, so I tried a different USB cable and it seems to work perfectly. The status LED on the speaker shows blue (meaning it is turned on) with a hint of redness (meaning charging). The only concern that I can think of would be that the speaker would always be on, so it would always be drawing power. Either from the USB cable when the device is powered or the battery when the device is turned off (the speaker/amplifier will still draw a little even without an audio input. Not sure how little though)

    I plan on having the toy plugged in whenever it is being used. That being said, it sounds like the speakers will charge slowly as he plays and discharge as it sits without power. Probably not the best scenario for battery longevity, but not a problem as long was it will run with the a/c adapter to the board. Does this seem to be the case?
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-13 22:44
    Yes, exactly what I was attempting to explain. The only problem I could see would be whether or not the speaker functions when powered up with a completely dead battery. I just turned my veho on to let the battery die and will try it out tomorrow (or whenever the blue led turns black, lol.)
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-13 23:12
    Yes, exactly what I was attempting to explain. The only problem I could see would be whether or not the speaker functions when powered up with a completely dead battery. I just turned my veho on to let the battery die and will try it out tomorrow (or whenever the blue led turns black, lol.)

    You know that's really bad for the LiPo right?

    Low voltage alarms are commonly used with LiPo used with RC gear to prolong the life of the battery. One would normally not want the voltage to drop below 3.3V to 3.5V for a long lived battery. Draining a LiPo all the way has a very good chance of killing the cell. If it doesn't kill the cell out right, it will certainly severely reduce its capacity.

    My guess is you already know this. I just wanted to make sure you were willing to permanently damage the battery in order to perform the test.

    The Veho may have some sort of protection circuit to keep the battery from going too low but I wouldn't count on it.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-01-13 23:20
    FYI, Tracy Allen took a Veho 360 apart. Here's the post.
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-14 09:30
    The battery is finally dead (plugged it into my laptop at work with music playing to make it work a little harder.) Once it shutoff, I plugged it's USB cable into a charging port and it came right back on. So, it seems like the Veho should work very well in your scenario.

    Duane, Yes, understood. The Veho does not have a LiPo charging circuit that has undervoltage protection. As the Blue LED begins to DIM, it shuts off very abruptly. When you apply power for only a few seconds, it will run again for about 30 seconds before shutting down. I am sure if I continued this power cycling around it's hysteresis point, I could get the battery voltage lower, but probably still not below it's damage level since the amplifier IC seems to have a minimum functional voltage.
  • gwtthrgwtthr Posts: 30
    edited 2014-01-14 18:56
    I've considered that problem with the LiPo battery. Since I fly RC aircraft as well, I've heard enough stories about fires with misuse/handling to know what can go wrong. Too bad it isn't NiCd or NiMh, I wouldn't have to worry about the battery.

    Considering it says not to charge it for more than four hours, I may take the battery out.
  • gwtthrgwtthr Posts: 30
    edited 2014-01-21 18:13
    Update:

    I've been busy re-refreshing my memory on C code. At this point I've got my first version of code written for the project. It wasn't that bad to do. I have to hand it to the Learn Parallax webpage. They've made it easy for any beginner to get their feet wet and be successful. I hope creation of the sounds effects using the Audacity software goes just as smoothly.

    I've gathered most of the components I'll need for the toy. Shown are the gauges, steering wheel, dozens of buttons and switches, and many of other parts that will be included in the build. Once I've wired the board and tested it to make sure all the bugs are out, the console can be created.
    DSC_0155(2) resize.jpg
    1024 x 678 - 80K
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-21 21:10
    Awesome layout! Glad to hear you have code rolling out for the project. Please keep posting your progress.
  • gwtthrgwtthr Posts: 30
    edited 2014-01-22 17:49
    I found a problem with the Veho 360 speaker. I've just bought it and only used it a half-dozen times, and the jack is separating from the wire. Anybody else had this problem with theirs?

    IMG_7277.jpg
    1024 x 768 - 76K
  • WBA ConsultingWBA Consulting Posts: 2,934
    edited 2014-01-22 17:52
    Interesting, but I have not seen that. I have used my Veho quite a bit in the last year and not always in a friendly manner. If it still works fine, shove it back together and seal it up with a layer of heat shrink tubing or something to prevent it from pulling apart again.
  • JLockeJLocke Posts: 354
    edited 2014-01-22 19:44
    Mine has exhibited the same symptoms for some months now, but still works fine. Next time I have a packet of Sugru open, I'm going to put a little bit around the top of the jack as a little insurance.
  • gwtthrgwtthr Posts: 30
    edited 2014-01-23 06:37
    Well never mind about the speaker. Parallax is sending another one as a warranty replacement. Talk about great service!
  • gwtthrgwtthr Posts: 30
    edited 2014-03-29 17:58
    Okay, it's been a while. I've been busy with many other projects, but I finally have something worth updating you guys about. Here is the console.... about 50% complete. I've still got all the wiring to do, a couple more sounds modes to record, and paint. I'm leaning towards a Millennium Falcon type console paint job.

    DSC_0329(2).jpg


    DSC_0333(2).jpg


    DSC_0332(2).jpg
    1024 x 678 - 83K
    1024 x 678 - 85K
    1024 x 678 - 96K
  • mindrobotsmindrobots Posts: 6,506
    edited 2014-03-29 18:06
    That's too cool! Nice cabinetry! Can I have one??? :lol:
Sign In or Register to comment.