Neural Network for my Robot Car

Hello, I recently built my first robot car from a starter kit and it comes with a ultrasonic sensor (the HC-SR04). Anyways I have been messing around with the code in the Arduino IDE and was trying to think if a way to integrate a neural network for predicting what the bots next move should be by using the distances measured by the ultrasonic sensor as the input values. Is this even possible?

It might be, You'll want to use a 32 bit MCU with either TensorFLow Lite or Linear Regression( LR). In the case of a near constantly changing model I'd use a LR.

If you got the game HollowKnight, you can see on the fly LR at work. LR is used to predict your next move based upon previous moves. so the bad guy, especially the Bosses, attacks the point where it thinks you'll be not where you are at.

So I can’t use an Arduino uno? Why does it have to be a 32 bit?

It is certainly possible to implement a small neural network on an Arduino Uno. Here is an example.

What did you have in mind?

Linear Regression and TensorFlow Lite requires a MCU that can handle double_t.

1 Like

I'm aware it's possible, however is it possible to run the neural network in the loop and constantly output values telling the car which direction to go. I guess "predict" it's next move. Meanwhile, the ultrasonic sensor is scanning for distances and inputting them into the neural network. Idk if that makes sense.

Of course it is possible. The example I linked shows you how, and it even includes a link to an obstacle avoidance example. Consider spending a few moments looking through it.

The main limitation is the small amount of memory, meaning small networks. But you don't need much for steering.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.