Wanted to start riding. The hardware was done and we couldn't wait to get the NRF2401 based remote control working. So we spent a day building and getting a these super cheap 433 Mhz radios to communicate a simple integer value signal (throttle position 0-180) from our remote control Arduino Nano to our broad's Nano which would then control the motor speed via a separate PWM signal. Again, the idea is the skateboard-based arduino will slowly spool up/dn based on throttle position so we don't fall off, even if the radio link is lost (which happens a lot), the board's micro will just slowly spool down the motor rather that cut off all at once. (Note: We want to try this ourselves using cheap off the shelf ESC. (A $150 VESC would take care of all this spool up/dn, breaking and more...waiting for ours on backorder)
OK so, the 433 RF works! Took a while and figured out a few things.
- The Arduino Wiring and Servo libraries are NOT compatible because the both want access to the same interrupt timer. So you have to use this ServoTimer2 library which was written to get around this issue. Works like a charm. As usual, put this in your Arduino/Libraries folder and follow the example. NOTE...the API is different from the built in Arduino Servo library. You don't send a 0-180 value to servo.write() as you would to the default Servo library. Instead you send a micro second value (the actual pulse width from 750-2250). So if you are porting code from library to the other, you will need to map the values.
- Antenna Matters. We added the recommended 17cm wire to the transmitter. No luck..it used stranded wire. We added 17cm single core wire...still no luck. We twisted and coiled the wire a bit....That worked! This is needed to give us about 6-8 feet of range. Did we mention these radios kind of suck?
Here is a working bench remote control setup.
Here is our first grand day out...That's rattling sound is the aluminum battery box cover..got to put a gasket on that thing. Now that we know how this behaves, we'll be increasing the accretion and top speed.