Would a Propeller Activity Board be good for a one-off children's toy?
gwtthr
Posts: 30
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.
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.
Comments
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.
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.
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.
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.
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.
Each 74HC165 chip can read 8 inputs. I used two chips so I set the "BITS_IN" constant to 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).
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.
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?
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.
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)
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:
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.
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.
Ive been very busy with the Holidays and Ive 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 havent 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. Ive found a plethora of buttons and switches available on eBay. I tried to get a variety of items since it is a childrens 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 wasnt 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 cant get .wav files of those sound effects online without a lawsuit. Ive finally decided on a PS2 steering wheel off eBay. Im going to dismantle it and put it on an enclosure that I build. Once a majority off the parts are in Ill 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 wont 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 childrens toy? I keep finding powered ones when I search online. Of the couple of spare computer speakers sets Ive had laying around one went into my Ghostbusters protonpack, and the other got thrown away.
For a permanent project Im 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? Id save me quite a lot of effort. Losing the prototyping board wont bother me.
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?
If anyone wants to give chime in about SPIN and the pros and cons of using it, I'd appreciate it.
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.
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.
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?
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, 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.
Considering it says not to charge it for more than four hours, I may take the battery out.
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.