Espruino Scalextric Cars

Posted on
  • I'm planning to custom build a scalextric car controlled by an espruino. I have the track, but it's not delivering power correctly. As such, I'm hoping to use an espruino to control power to the onboard motor and potentially host the power supply on the vehicle. Initially I'm hoping to control this remotely, but later maybe have the vehicle automated.

    All input gratefully received.

  • Looking forward to this. I used to have plans to digitise SCX cars in some way but I always talked myself out of it saying that I might as well just do it as a computer game rather than interacting with the real world.

    You could do awesome things like simulating engine wear which causes the cars to drive slower, track the cars as they move around the track and do lap counting this way. If you're putting the Pixl on board the car then you could display what place in the race the cars are on the roof.

  • Sounds great! One of the Espruino MDBT42 breakouts and an FET would be a reasonably compact way to drive the car - I guess you just need to be careful that the power to the car wasn't so uneven that the board kept resetting (but a diode+capacitor would fix that).

    Depending how much space you have I guess there might be the option of actually putting a battery on board the car, which would fix your power delivery issues?

  • Definitely like the idea of having the race position on the roof. I know digitised railways simulate acceleration curves rather than a more boolean on and off, that's definitely something that could be brought in.

  • The Espruino MDBT42 breakouts is a good shout, but my Pixl.js turned up this morning. I opted for it specifically for the Bluetooth integration, but couldn't say no to the screen as well. Longer term I'm hoping to add an accelerometer and Gyro to see if I can get it to be completely autonomous.

    I would definitely be looking to on-board the power supply for the espruino and the motor, quite happy for these to be separate. The challenge I'm currently investigating is the power draw of the motors and the battery supply that would be needed to power it. It appears that traditionally the motors run on 12 volts for 18,000 rpm (they do require a gearbox). The flip side of this of course is going to be weight. I know that the newer cars have magnets to improve down-force, I'm hoping that the weight of the batteries may somehow be mitigated by removing this magnet.

  • You could use 3x LiPo batteries - you can get some quite small ones, but I guess you'd be looking at 50-100mAh of capacity for each to get anything that'd go in one of the cars. I wonder if it'd be enough...

    For a source of them, I did see some reasonably small ones in disposable e-cigarettes, but they're still not exactly tiny!­UCk

    Maybe a supercapacitor would be good enough to at least smooth out very uneven voltage from the rails?

  • Sorry for the delay have been busy doing the day job.

    Quick update:
    github page has been created here:­spruino-scalextric

    And: victim car has been purchased, although will require a bit of a refit to contain a whole pixl board. See images.

    5 Attachments

    • 664591168999266182.jpg
    • 1675592802142643647.jpg
    • 2114882776466987051.jpg
    • 5731078160212712789.jpg
    • 7466974344359411619.jpg
  • Wow, nice. There's more space in there than I remember!

    I guess you could try and 3d print a new body for it... It it were a Pickup truck you could have the Pixl in the back :)

  • HI @AdamSmith, any further updates on this project ?

    I was thinking about doing something similar a while back but like most of my ideas they never make it into the psychical world.

  • Hi there,
    Nothing too exciting at the moment. There's a couple of active tasks at the moment with identifying an appropriately sized motor and power supply. The innards of the Scalextric cars provide a good insight as to what is required. But it's built to run off high voltage AC power. Rather than the DC that a battery solution would provide. So it's finding the balance of motor and power that will provide the correct levels of thrust vs weight for the vehicle size.
    From the code perspective, some very basic code now exists that looks to handle the acceleration and braking by applying a percentage of maximum acceleration/braking to a current speed. This should be a little more in line with how actual cars behave.

  • Cheers for the update.

    I got stuck in the 3v to 4v dc motor google search, then trying to find the right gears and pinions!
    Minefield. I did manage to build a track timer using a puck, a few ir sensors and a poorly code html page to record history and best. Ideally the track timer could be built into a car.

  • Are the motors really AC-only? I'd have thought they would handle DC - and by using DC and not AC you might actually get a little more power for a given voltage.

    It may still not be quite enough though.

  • I assume the tracks are AC, there's a rectifier in the car (#4 you see the 4 diodes) and the motors are DC.
    I'd use a standard rc car ESC with BEC for 3S or 4S, depending on the DC voltage available after the rectifier. (There are ESCs for DC motors without aluminum cooling block and fan). These ESCs have the PWM already build in, so no need to build your own PWM software and hardware.
    Then just modify your board to work with the CR2031 as backup to avoid resets, and power it from the 5V BEC.
    To control the ESC:

    const servoPin = <pin>
    let servoPosition = 1.5; //1500ms == centered; 1000ms == min; 2000ms==max;
    //at 1000 you'll go backwards at max speed, at 2000 forward at max speed
    pinMode(servoPin , "output");
    setInterval(function() { digitalPulse(servoPin , 1, servoPosition ); }, 20);
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

Espruino Scalextric Cars

Posted by Avatar for AdamSmith @AdamSmith