I'm looking to use the GPIO pins to control a remote control car by activating the switches in the controller using a transistor as a switch.
The controller is powered by 2 AA batteries (3V) and the pins for the different controls are tied high normally. When the switch is activated the pin is tied to Zero (-)
I was considering the following attached circuit and before I wire it all up I thought it might be a good idea to make sure I have it right. I have basic-ish knowledge of electronics and don't want to damage my Raspberry Pi
In my head this ties the pin to 3V until a Base current is applied.
When the current is applied the circuit effectively become 3V - R1 - Pin - Q1 (0Ohm) - OV, so Pin is tied to 0V.
Also, any suggestions for R1 and R2
My Guess
R1 - 1KOhm
R2 - 10KOhm (Base)
I checked the current across the switches (so inline) and it was reading 0.1mA. With a 10KOhm resistor and 3.3V from the GPIO I would be providing 0.33mA (I think), so way more than enough to saturate the Base.
Any and all tips appreciated. You could save a Raspberrp Pi from being being fried...
Thanks,
Albert.
Help: Using GPIO to control a remote control car
Twitter:Winkleink
Google+: Winkleink
Google+: Winkleink
- Gert van Loo
- Posts: 2487
- Joined: Tue Aug 02, 2011 7:27 am
Re: Help: Using GPIO to control a remote control car
Yep, looks all good.
I have seen posted data much, much worse then this.
In fact if everybody put as much work in us 'experts' wouls have only a fraction of corrections to do.
One final point: you might want to add a 10K resistor between base and ground.
That way the circuit is in a defined state during booting when some GPIOs are set to input mode.
You have done all the right things, measured the correct currents and calculated all the values fine.I have basic-ish knowledge of electronics and don't want to damage my Raspberry Pi
I have seen posted data much, much worse then this.
In fact if everybody put as much work in us 'experts' wouls have only a fraction of corrections to do.
One final point: you might want to add a 10K resistor between base and ground.
That way the circuit is in a defined state during booting when some GPIOs are set to input mode.
Re: Help: Using GPIO to control a remote control car
Gert, thank you. My head is swelling getting a comment like that from the Gertboard man.Gert van Loo wrote:Yep, looks all good.
You have done all the right things, measured the correct currents and calculated all the values fine.I have basic-ish knowledge of electronics and don't want to damage my Raspberry Pi
I have seen posted data much, much worse then this.
In fact if everybody put as much work in us 'experts' wouls have only a fraction of corrections to do.
One final point: you might want to add a 10K resistor between base and ground.
That way the circuit is in a defined state during booting when some GPIOs are set to input mode.
Also, thanks for the pointer on the additional resistor.
The plan is to have this working for the Egham/Staines Raspberry Jam on Sunday so your extremely prompt reply id hugely appreciated.
Albert.
Twitter:Winkleink
Google+: Winkleink
Google+: Winkleink
Re: Help: Using GPIO to control a remote control car
Yeah.
I built the circuit and it worked. Not yet with a Raspberry Pi. As the Raspberry Pi is the newest piece for me I wanted to make sure all the other bits were sorted so that when I mess up on the Raspberry Pi piece I know it is only that bit I have to troubleshoot rather than thinking maybe the circuit was wrong.
I tested using an Arduino and successfully has the car going forward, backwards and turning left and right.
Tomorrow night is the Raspberry Pi bit...
I built the circuit and it worked. Not yet with a Raspberry Pi. As the Raspberry Pi is the newest piece for me I wanted to make sure all the other bits were sorted so that when I mess up on the Raspberry Pi piece I know it is only that bit I have to troubleshoot rather than thinking maybe the circuit was wrong.
I tested using an Arduino and successfully has the car going forward, backwards and turning left and right.
Tomorrow night is the Raspberry Pi bit...
Twitter:Winkleink
Google+: Winkleink
Google+: Winkleink
Re: Help: Using GPIO to control a remote control car
Looking forward to seeing it working, Sunday!
Re: Help: Using GPIO to control a remote control car
So, am I.Burngate wrote:Looking forward to seeing it working, Sunday!

Twitter:Winkleink
Google+: Winkleink
Google+: Winkleink