Answered: Problem turning pneumatic solenoids on

I have the pneumatics kit, and I cannot get the solenoids to be switched on using the I/O ports. I have a separate 5 volt supply, and the solenoids operate fine when hooked up directly to that via a switch (i.e. connecting +5 volts to center pin, and swichting the same +5 volts onto the signal pin).

I connected the solenoids to I/O 13 and 14. I can get these I/O ports to change with no trouble, but the swiched on voltage on both pins is about 4.76 volts (using a DMM). Is there a problem with my microcontroller (not supplying enough voltage), or do I have a different problem?

I am using the controller cables provided with the kit, which convert from 3 pins to 2. I would guess the controller uses a transistor to switch the 5 volt (center) power supply pin to power the solenoid with 5V.

I guess my question is, is the 4.76V at signal pin (output from I/O 13 or 14) not sufficient to switch on the controller cable, or do I have a separate issue?

**Not sure but I think you have a separate issue, the 4.76V should control the 3 to 2 wire interface.

Be sure you do not have the 3 wire connector plugged into the Vex Controller backwards. Also, can you see the I/O Output change from a High to a Low as you control it?**

I checked the voltages with a header inserted into the I/O slots for the solenoids before I plugged them in. The outside pin is ground, and the center is +4.96V (which is pretty close to 5.0, as far as I am concerned). However, without the solenoids plugged in, I still only get 4.76V. I tried it on both I/O ports 13 AND 14. I checked them again tonight, to be sure. I am controlling them with CH6 from the transmitter.

I am using the default code from MPLab, I commented out the lines for PWM6, and insterted the following, simple code (after switching IO13 to OUTPUT on line 184 in the code, where the OUTPUTS are specified):

solenoid1 = PWM_in6;
if (solenoid1 > BUTTON_FWD_THRESH)
{
IO13 = 1; //ADDED Turn on IO13
IO14 = 1; //ADDED Turn on IO14
}
if (solenoid1 < BUTTON_REV_TWZ
IO13 = 0; //ADDED Turn on IO13
IO14 = 0; //ADDED Turn on IO14
}
The code compiles fine, and when I press the CH6 up and down buttons, the voltage toggles between 4.76V and about 10mV - so the microcontroller is definitely switching on and off.

As for the solenoid cables, the 2-pin connector is connected to the solenoid, and the 3-pin into the I/O ports 13&14. The black wires are on the outside, to the pin I confirmed was ground, above.

As I mentioned, I have tested both solenoids and cables using an old computer power supply, which has an output of about 5.14V (i tested again tonight). The solenoids switch perfectly at the higher voltage.

I considered that maybe the system was pulsing the outputs for some reason, so I simply set IO16 = 1 in the code, and measured the voltage on that pin, again, 4.76V - and I could not get a solenoid to turn on.

Do you know what is the turn-on voltage for the solenoids, and do you know what is a typical output voltage at the I/O pins?

My best guess is that the diver chip is bad. I suggest you call our support line at 903-453-0802. Most of us will be traveling tomorrow until next week, so call early or wait until Monday.

**The problem was in the code. File ifi_aliases.h describes the bits used by the PIC18F8520 User Processor of the Vex MicroController. Bits IO13 and IO14 are the tristate enable bits, where a 1 is tri-stated (or input) and a 0 is driving (or output). So sample code to make them both an output is

IO13 = IO14 = OUTPUT;.

Now that the configuration is set, you must control the actual digital pins. Bits rc_dig_out13 and rc_dig_out14 are the output driver bits. So sample code to make them both a high are

rc_dig_out13 = rc_dig_out14 = 1;.**