Hank Fletcher
New Member
Alright, so I'm trying to get my head around the best way to interface a cheap, hacked R/C receiver to a 16F88. The receiver is powered by a 1.5V battery, and I've got the 16F88 running from a separate, 5V regulated, plug-in power supply. I suppose the 16F88 will eventually be running from a 7805 from a battery pack, but that's where I am right now.
Anyway, the receiver has six leads:
- 1.5V+
- common
- the lead originally intended for forward
- the lead originally intended for reverse
- the lead originally intended for left
- the lead originally intended for right
The "left" and "right" leads have their own problem sorting out, but I haven't quite gotten to that point yet. I'm anticipating that once I sort out things a little better with the "forward" and "reverse" leads, sorting out the second two might become more obvious.
The trick is, the forward and reverse leads constituted essentially an h-bridge for the original motor, each lead attached to an opposite pole on the motor. With the original controller stick at centre, there's no potential difference between the two leads, but both are +1.5V with respect to common. So a voltmeter connecting the two leads reads:
My original idea was to connect the receiver's and battery's common to the power supply's common, and to connect the forward and reverse leads each to their own A/D pin on the 16F88 (with pulldown resistors to common). That way I could use the A/D pins kind of like they were digital inputs, and just check when they change to somewhere closer to 1.5V than 0V. Obviously the problem is that that works when the stick is pressed forward, but doesn't work for when the stick is pressed back.
What can I do for the -1.5V reverse lead? For a long time I was fussing over the best way to do this without frying something and with the least amount of parts. If I use a pullup resistor on the reverse leads A/D pin instead, should I expect it to sink the voltage a bit, and be able to read when the A/D pin drops a bit below the supply voltage? Looking at the breadboard and the aforemention description of what's going on, I couldn't figure out if that would risk shorting something somehow.
Am I going about this the wrong way with the battery and power supply? I know this makes my noobness obvious, but I couldn't figure out either what I need to do to drop the regulated 5V for the 16F88 so that I could have the 1.5V for the receiver on the same circuit, hence the battery. I mean, does a voltage divider work on a regulated circuit? I've fried some pots in the past, I think because I didn't take into account the "regulated" characteristic of the circuit, but that's always been a bit of a mystery - I don't fry components if I can help it!
Sorry for the wordy description. I'd post a schematic of it if someone tipped me to some freeware schematic drawing software!
Anyway, the receiver has six leads:
- 1.5V+
- common
- the lead originally intended for forward
- the lead originally intended for reverse
- the lead originally intended for left
- the lead originally intended for right
The "left" and "right" leads have their own problem sorting out, but I haven't quite gotten to that point yet. I'm anticipating that once I sort out things a little better with the "forward" and "reverse" leads, sorting out the second two might become more obvious.
The trick is, the forward and reverse leads constituted essentially an h-bridge for the original motor, each lead attached to an opposite pole on the motor. With the original controller stick at centre, there's no potential difference between the two leads, but both are +1.5V with respect to common. So a voltmeter connecting the two leads reads:
0V when the controller's stick is centred
1.5V when the stick's pressed forward
-1.5V when the stick's pressed backward.
My original idea was to connect the receiver's and battery's common to the power supply's common, and to connect the forward and reverse leads each to their own A/D pin on the 16F88 (with pulldown resistors to common). That way I could use the A/D pins kind of like they were digital inputs, and just check when they change to somewhere closer to 1.5V than 0V. Obviously the problem is that that works when the stick is pressed forward, but doesn't work for when the stick is pressed back.
What can I do for the -1.5V reverse lead? For a long time I was fussing over the best way to do this without frying something and with the least amount of parts. If I use a pullup resistor on the reverse leads A/D pin instead, should I expect it to sink the voltage a bit, and be able to read when the A/D pin drops a bit below the supply voltage? Looking at the breadboard and the aforemention description of what's going on, I couldn't figure out if that would risk shorting something somehow.
Am I going about this the wrong way with the battery and power supply? I know this makes my noobness obvious, but I couldn't figure out either what I need to do to drop the regulated 5V for the 16F88 so that I could have the 1.5V for the receiver on the same circuit, hence the battery. I mean, does a voltage divider work on a regulated circuit? I've fried some pots in the past, I think because I didn't take into account the "regulated" characteristic of the circuit, but that's always been a bit of a mystery - I don't fry components if I can help it!
Sorry for the wordy description. I'd post a schematic of it if someone tipped me to some freeware schematic drawing software!
Last edited: