This project is undergoing a huge change and will be updated with new information and code. The project is now being prepared for ScaniaHack 2025 and use the progress we made in 2024 as a starting point.
The old branches are still available and can be used for reference but the main branch will be uppdated and restructured.
The main branch is now protected and the only way to get changes in to it, is to make a pull-request from your own fork. I also removed the old access-rights to the repo but will add them again if needed.
The goal here is to make an 'autonomous' toy-monster-truck, using my own electronic design and software for the control system. To get a head-start I used a cheap radio-controlled toy-truck as a start and replaced the radio-control-pcb with my own designed control-system-pcb.
The 'brain' of the truck is an ESP32 and the sensors used are ultrasonic distance-sensors and acc/gyro/compass. This design was made to be simple and easy to both understand and replicate. I hope it will be a source of inspiration and give ideas for improvements.
(More details for the git-magic in the wiki)
-
Fork this repo from main and do your thing in a feature-branch from this fork on your own github-account
-
When done, make a pull-request back to main and describe your changes in the pull-request
-
Try to keep one feature or bug-fix per pull-request to make the merging easier
-
If you have any questions or need help, just ask me by pm, email, IRL or in the pull-request and I will try to help you out.
Note: when working in vscode with platformio you need to open the \sw subfolder from where you have cloned the repo, and then you can work, build and download to esp from there.
All sections are undergoing change and will be updated with new information and code.
-
doc: documentation and images,
-
A workdescription for the conversion
-
A proposal for how to setup the work at ScaniaHack
-
-
hw: electronics hardware including:
-
PCB layout and all the schematics in KiCAD format.
-
References to used components etc.
-
-
toy-truck
-
CAD models and 3d printables for some add-ons to the toy-truck chassi.
-
-
sw: this is the 'real' software and the VsCode project you should open in order to work with the code. To test different parts of the software we use 'environments' in the platformio.ini file.
-
hw-test-sw: software for testing the hardware, like hello world.
-
www: software for the backend web-server, like
-
post log script
-
view log script
-
It is possible to use my PCB-design for an other type of vehicle or use the schematics and build any other sort of control-board. The ESP32 is a very versatile microcontroller and can be used for many different applications.
Connecting and downloading to the ESP might be a nightmare some times. Usually it goes well but when it starts to bug it can go on forever. However, you are not alone, google will help out when you search for your error message.
Sometimes it works better if you power the pcb from the usb-port using a 3.3V type of FTD like FTDI1232 set to 3.3V. In this case the power from the batteries needs to be off or you might destroy the circuit. Allways leave battery-power off when using power from the programming interface.
-
Some connections where missing in the first version of the schematics, like the connection between the B+ and the diode in the voltage-regulator. This is now fixed in the schematics and the pcb-layout for version 3.1
-
To keep the ESP safe on the io-side I am using rechargable batteries summing up to 3.6 volts which works just fine, but with alkalines you will probably get like 4.6 or 4.7 volts with fresh batteries which might damage the ESP32 io. Don’t use those…
-
In the schematics I used a 1N4148 diode for reversed polarity protection but this was NOT a good choice. This can be left out completely or replaced by a schottky type of diode with a low voltage-drop.
Unfurthunatly this specific model is not sold anymore at Biltema but there are many other models at Biltema or elsewhere that can be used for this project. The most important thing is that the chassi is big enough to fit the new electronics and that the wheels are big enough to handle the terrain you want to drive on.
You can of course also design a new PCB formfactor from the schematics provided. The KiCAD files in the hw
directory include all the necessary components and connections. Feel free to modify the layout to better fit your specific needs or to improve the design. If you come up with a better design, please share it with the community by making a pull-request.