VERSION EN FRANCAIS / FRENCH VERSION
This project contains hardware, software and documentation files for the "course en cours" educationnal competition in France. During a year, teams of 4 to 6 middle/high school students build their small electic car using the same tools as engineers. the contest consists of designing, creating, testing and running a small model car during the regional competitions, to acces the national final.
We are two university students in electrical engineering and industrial data processing, from IUT de Rennes, France. Our project is to integrate embedded telemetry, datalogging and manual control into the existings cars engines. We choosed to works with the Arduino environnement, to make it possible for everybody to program their car, modify it as they like, and to make programming accesible for the young people of the competition.
This project is realesed under the general public license and is strongly welcome to modifications.
In order to be able to program your board with the arduino IDE via usb, you will first need to install a bootloader on your board. Find insruction on how to do that in the software section.
When this step is done you should be able to programm your board like if it was an arduinon pro mini.
Just install the course-en-cours library (link in the software section) and import it to your arduino sketch. Here is a tutorial if you need help for this step.
You should now be able to program your board via USB, as described in the software section.
The hardware is based on 4 main components:
- ATmega328p microcontroller (the same as the arduino uno/nano/pro mini)
- MPU6050 accelerometer and gyro chip
- A FTDI chip (to program the microcontroller via USB)
- A micro SD card holder
This board is fully arduino compatible and should be selected in the arduino environnement as the arduino pro mini (ATmega328p, 3.3V 8MHz).
- Schematics (PDF)
- Bill of materials (PDF)
- Autodesk Eagle schematics file
- Autodesk Eagle board file
- Gerber files
BE CAREFULL: You need to provide 3.3V to the board, plugging directly the 11.1V LiPo battery will kill it. You can step down the battery voltage with a standard DC/DC converter (also known as buck-converter) set to output 3.3V (min 200mA), like in the wiring diagram above.
You can program your course en cours board in C/C++ directly with the arduino IDE via USB, assuming you already have a bootloader installed on your board. Instructions on how to flash a bootloader below.In the arduino IDE, select the "arduino pro mini" under Tools/Board, and the ATmega328p 3.3V 8MHz under Tools/Processor. Then select the COM port (under Tools/Port) on wich the board is plugged. To access all the course en cours related function, just import the "course_en_cours" library to your sketch. Here is a tutorial if you need help for this step.
You should now be able to program your board with the arduino software environement.
The delay() function from the Arduino IDE shouldn't be used in your program because it will block the process of our library.
- MPU6050 by jarzebski : Allows us to use the IMU.
- SDFat by greiman : Allows us to get a high speed SD card communication.
#include "Course_en_Cours.h"
Couse_en_Cours cec; // create Couse_en_Cours object
void setup() {
cec.initialiser(AUTO);
cec.palier_moteur(1000,0);
cec.palier_moteur(5000,50);
cec.palier_moteur(7500,75);
}
void loop() {
cec.executer();
}
Function | Description | Parameters |
---|---|---|
cec.executer(void); |
Mandatory function, needs to be run in the loop(). |
|
cec.initialiser(bool pilotage_mode); |
Function to set the driving mode. Needs to be run in the setup(). |
|
cec.palier_moteur(unsigned int ms, unsigned char pourcentage); |
The motor power step function. Use it in the setup() to set a fixed power/speed to the motor at a certain time. Can be called several times to create differents steps at different times. |
|
The actual software have some issues :
- If the .csv file is not already on the SD card, the logging would be slower than expected. Make sure that the file already exists on the card.
- The logging time may vary depending of how many steps (palier_moteur functions) you have added.
- The object Course_en_Cours must be called "cec" and declared as global variable (away from the loop() and setup(), or from any fonction).
In order to be able to program your board with the arduino IDE via usb, you will first need to install a bootloader on your board. Sparkfun have made an easy to understand tutorial on how to do that here : Installing an arduino bootloader
Here is the wiring diagram to install the bootloader with an arduino UNO (follow the sparkfun tutorial for step by step instructions).
When installing the bootloader, make sure your arduino target board is the arduino pro mini (ATmega328p 3.3V 8MHz), as this board is arduino pro mini compatible.
You should now be able to program your board via USB, as described in the software section.
Heol Fief
Dylan Gageot
heolfief/Course-en-Cours is licensed under the GNU General Public License v3.0.
See the LICENSE file for more informations.