gregh
electronics, computers and scratchbuilding
I built a small railcar for my grandson Nick, a few years ago. Because he was young I just provided a for/off/rev switch on the roof. (the little black ‘stalk’). It had a simple Picaxe sound system.
But now he wants radio control.
So I used a 433 MHz keyfob type control. This is the transmitter
The A button causes it to accelerate, B for brake and D to toggle direction. (C is not used).
The Receiver is the green board in this pic, mounted below my veroboard circuit.
Previously I have always used two, 8-pin picaxes – one for motor speed/direction and one for sound. But the new 08M2 version can run a 32 MHz, so I decided to try and do it all with one 8-pin picaxe.
I also tried to write a program to simulate gear changes. I’m not very happy with the sounds, but it will have to do! Still it’s pretty good to get motor speed, direction, sound and volume control all from one small chip with 6 IO pins!
And here is everything crammed in. I used eight, low discharge NiMH batteries.
After writing and testing many different programs for the Picaxe, I decided on a control method that uses just 4 presses of the A button to get to top speed. Pressing it once, runs the speed up to 25%, and motor RPM sound up to max, then changes into 2nd gear with reduced revs – ie just loping along in 2nd. Pressing A again, increases the motor speed to 50% and RPM sounds to max and then changes into 3rd gear, with low RPM sound. Repeat to get into 4th gear at 75% speed and low RPM then the 4th press takes speed up to 100% and RPM to max. Braking is just a continuous hold of B button for about 4 secs with no gears, just a gradual reduction of RPM sound. Volume is reduced when slowing and stopped. Pressing D button toggles the direction.
I also added directional LED headlights and a cabin light for the passengers.
Now Nick is getting ready to travel around the world and hopefully get a run in the UK and USA.
Here’s a short video to demonstrate the sound.
[size=12pt]http://youtu.be/r9fd7v-OQ7M[/size]
But now he wants radio control.
So I used a 433 MHz keyfob type control. This is the transmitter
The A button causes it to accelerate, B for brake and D to toggle direction. (C is not used).
The Receiver is the green board in this pic, mounted below my veroboard circuit.
Previously I have always used two, 8-pin picaxes – one for motor speed/direction and one for sound. But the new 08M2 version can run a 32 MHz, so I decided to try and do it all with one 8-pin picaxe.
I also tried to write a program to simulate gear changes. I’m not very happy with the sounds, but it will have to do! Still it’s pretty good to get motor speed, direction, sound and volume control all from one small chip with 6 IO pins!
And here is everything crammed in. I used eight, low discharge NiMH batteries.
After writing and testing many different programs for the Picaxe, I decided on a control method that uses just 4 presses of the A button to get to top speed. Pressing it once, runs the speed up to 25%, and motor RPM sound up to max, then changes into 2nd gear with reduced revs – ie just loping along in 2nd. Pressing A again, increases the motor speed to 50% and RPM sounds to max and then changes into 3rd gear, with low RPM sound. Repeat to get into 4th gear at 75% speed and low RPM then the 4th press takes speed up to 100% and RPM to max. Braking is just a continuous hold of B button for about 4 secs with no gears, just a gradual reduction of RPM sound. Volume is reduced when slowing and stopped. Pressing D button toggles the direction.
I also added directional LED headlights and a cabin light for the passengers.
Now Nick is getting ready to travel around the world and hopefully get a run in the UK and USA.
Here’s a short video to demonstrate the sound.
[size=12pt]http://youtu.be/r9fd7v-OQ7M[/size]