Shop OBEX P1 Docs P2 Docs Learn Events
Can I do this with a homework board? — Parallax Forums

Can I do this with a homework board?

thomasfamilythomasfamily Posts: 17
edited 2013-09-03 11:01 in BASIC Stamp
OK, I'm still very new to this but I'm having fun and the kids and I have created a jack-o-lantern that sprays silly string by using the homework board and a PING sensor.
I took the basic idea from instructables and then wrote the code essentially from scratch since the original was for the arduino.

it works great and we can't wait to use it but now I'm thinking what ELSE can I do with this? The homework board is running off a 9V and it is powering the PING and a single servo that with some added hardware pushes the spray nozzle on a can of silly string.
simple program, looks for anything less than 3 feet away then activates the servo. waits 30 secs then looks again.

**********
my wishlist:
1. add LEDs to the eyes (pretty simple, just haven't done it yet)
2. also would love to have a car horn beep as it sprays the kids when the approach the door. or even better about 20 secs after the string hits them so they get a second jolt.
horn pulls 12V. so can I power the whole board with 12V? that might make things easier than trying to add in a transistor (no clue how to do that)

how does the increased voltage affect my PING sensor/servo/LEDs ?
if I cannot run the board off 12v how do I power the horn separate from the PING, servo and LEDs? transistor? if so how?
************

looking at maybe switching the PING to this sensor simply because it is black and easier to hide? (also PING actually belongs on my BOE-BOT and needs to go back) issues using this sensor on a HW board?

also for the price hard to beat this set of horns. I'd only need 1 for the project but they state 12V and pull 8A current.

thanks for the insight.

Shawn

Comments

  • thomasfamilythomasfamily Posts: 17
    edited 2013-09-02 18:02
    Still reading a bunch.
    something like this seems like it would work.
    then I can have the 12V supply just to the horn and controlled with the Mosfet.
    so it's isolated from the homework board by the Mosfet and when I send a signal to the gate (control) pin it would honk?

    also found the sensor from above on parallax site too (YaY!)

    seems like that would work?
    Would I need a diode across the horn to prevent any current running back into the homework board?
  • NWCCTVNWCCTV Posts: 3,629
    edited 2013-09-02 18:21
    To answer your question about "Will this work" it is kind of a yes and no answer. Yes, The HW board should be able to do all of this. However, keep in mind that the Basic Stamp can only do one thing at a time. Also, I would replace the 9V batery with a 9V wall wart as it is going to drain VERY quickly. You may want to look at a Propeller as it could easily handle all of this and do it at the same time instead of having to wait for one action to complete before another one starts.
  • thomasfamilythomasfamily Posts: 17
    edited 2013-09-02 18:27
    OK thank you. I'll keep that in mind. At the moment though sequential actions might actually be best. I'm hoping for a triggered event, then a short interval then a blast from the horn.
    the silly string is fun and unexpected but a 20 second later horn blast will be hilarious. but even then the whole sequence is over rather quickly and I could get a horn blast in a half second if not less after the initial sense.

    so now I need to order a new sensor and a MOSFET. Oh! and good call on the wall wart. gotta go see if I have one in the scrap box.
  • ercoerco Posts: 20,257
    edited 2013-09-02 20:19
    Sure you can do all that stuff with a HW board! You'll need a big 12V battery to drive a car horn, which could also power your HW board, but your servo needs a 6V battery. Easiest solution IMO is to use two 6V batteries (gel cells would last a long time) in series to power the horn and use the center battery connection (6V) to power your servo and HW board (use Vin). The HW board has inline 220 ohm resistors, fine for switching a small transistor (2N2222A) to drive a relay (5, 6, or 12V) for your car horn.

    Since you're mechanical enough to use a servo to shoot silly string out of an aerosol can, you could really scare the kiddies with one of my favorite aerosol devices: :)

    http://www.youtube.com/watch?v=p3wq6I8KkAo
  • Mike GreenMike Green Posts: 23,101
    edited 2013-09-02 20:19
    It doesn't have to be a 9V "wall wart". It can be anything from 6V to 9V or higher. Because of heat dissipation reasons, I'd normally use the lower end of that range. If you power the servo as erco suggested from a 6V tap on a 12V gel cell battery pack and power the horn directly off the 12V, you could power the Homework Board from the 12V battery since the overall current through the regulator will be fairly low.
  • thomasfamilythomasfamily Posts: 17
    edited 2013-09-03 03:58
    OK.
    I think, I've got it. that's very helpful and I love the flamethrower!
    The mechanical side I get, it comes pretty easy and I can usually muddle through programming with enough time. I really struggle with the electronic side.
    I can usually get pointed in the right direction if I read enough but my solutions may not be the most elegant.

    Thank you
  • thomasfamilythomasfamily Posts: 17
    edited 2013-09-03 11:01
    Ok the.current draw on that horn was killing me. I am trying to keep this small and light so
    I switched to a home security alarm that pulls 500mA at 12v.
    Planning on running it off a AA battery brick I have already.since it is momentary on, I figure the batteries will last a good while.

    So I assume I can still power the board/PING off 9v then AA brick to power the alarm. Still need a transistor and a relay or can I just use the transistor? Like the MOSFET above?

    Edit: so i went with this http://parallax.com/product/27115 likely overkill but will solve my issues.
    Likely a cheaper way but i can use it later on other projects.
Sign In or Register to comment.