Shop OBEX P1 Docs P2 Docs Learn Events
Sensors and motors — Parallax Forums

Sensors and motors

AImanAIman Posts: 531
edited 2006-10-01 12:53 in Propeller 1
Just ordered my first Propeller chip and was wondering some basic things.

First, how many HB-25 motor controllers can a propeller handle?

Second, how many sensors can an propeller handle?

My project will need three HB-25 motor controllers able to move both directions and I need to hook in roughly a dozen sensors with over half being sonar. Can one cog run all sonar? Can I use one cog to run the three motor controllers or do they need a cog a piece?

Lastly, I want to run a light/LED/Illuminated switch to show when a sensor or motor has power running to it. For example, a sonar is on all the time and the control board show it has power by being light - off means no power. Can this be done or is that an electircal nightmare? From the BS2 I know both can be done, but never tried doing them with light and then sonar after.

Any help would be appreciated
·

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-01 12:53
    Think of it this way ... The Propeller has 32 I/O pins of which 28 are completely free. You can put 2 HB-25 controllers on a pin, but it may be simpler to use one pin for each. There is a Servo object that can control up to 4 servos using just SPIN (and one cog) and another Servo object that can control up to 32 servos using assembly language (and one cog). Either one would work in this case. You just set the pulse width and forget it until you need to change the setting. The sonar sensors pretty much need one pin for each ... that's six to eight. You need to use a cog for each active sonar (while it's actually timing the pulse return time). You probably don't want to actually use all at the same time unless they're in separate rooms, so you'd pulse them serially and one cog can do that, just going around from one to another continuously. That leaves maybe 6 other sensors and their needs depend on what they are. We have assigned maybe 15 pins out of 28 at this point and maybe 4 cogs out of 8 (1 for servos, 1 for sonar, 1 for main program, and 1 for other sensors). If you really want to show power at a sensor or motor, just connect the LED (with an appropriate resistor) across the power connection at the device (it would be an extra wire to each device). If you want to show whether the device is in use, that's different. You'd want to control the LED from the program, maybe using a 74HC595 as an I/O expander.
Sign In or Register to comment.