Voiture RC Wi‑Fi à recharge Qi : Kit voiture télécommandée sans fil
Composants et fournitures
- Kit émetteur Qi 5 W IDT (P9038-R-EVK) × 1
- Kit récepteur Qi 5 W IDT (P9025AC-R-EVK) × 1
- Arduino MKR1000 × 1
- Châssis robot 2 roues pour Arduino × 1
- Pilote moteur L293DNE × 1
- Module convertisseur élévateur CN6009 (step-up) × 1
- Batterie Li-Po 3,7 V (≥700 mAh) × 1
- Diodes 1N4007 × 8
- LED générique × 1
- Résistance 221 Ω × 1
- Colliers de serrage (tie wraps) × 5
- Plaque d'essai (optionnel) × 1
Outils nécessaires
- Fer à souder
- Pistolet à colle chaude
- Tournevis
- Voltmètre
Applications et services en ligne
- Arduino IDE
À propos de ce projet
Ce que vous allez construire
Une voiture RC commandée par Wi-Fi qui se recharge automatiquement par induction (standard Qi) lorsqu'elle est garée sur sa base.
Principe de fonctionnement
- Cerveau : Arduino MKR1000 (Wi-Fi intégré), alimenté par batterie Li-Po 3,7 V.
- Commande moteurs : L293DNE (nécessite ≥4,5 V) → élévation 3,7 V → 5 V via module CN6009.
- Recharge : le MKR1000 gère nativement la charge Li-Po quand une source 5 V est présente sur VIN. Le récepteur Qi (5 V) y est connecté. Quand la voiture stationne sur l'émetteur Qi (base), la batterie se recharge.
- Deux modes vitesse : Rapide et Lent.
Construction hardware
- Soudure : fils sur bornes moteurs ; fils rouge/noir sur sorties OUT/GND du récepteur Qi.
- Circuit électronique : sur breadboard ou soudé selon schéma (voir image). Attention : batterie Li-Po ≥700 mAh impératif (risque surchauffe/explosion).
- Réglage CN6009 : ajuster la vis pour obtenir 5 V en sortie (vérifier au voltmètre sur OUT+/OUT-).
- Fixation récepteur Qi : base en plastique (ex. carte) collée sous le châssis ; récepteur collé dessus (silicone). Fil rouge → VIN Arduino, fil noir → GND.
- Stabilisation : attacher batterie et breadboard au châssis avec colliers.
Partie logicielle – Connexion Wi-Fi
Dans le code, renseigner SSID et mot de passe (lignes 12–13). Prévu pour WPA/WPA2 ; instructions en commentaires pour WEP/réseau ouvert (lignes 34–37).
Utilisation
- Connexion au MKR1000 : deux options — (a) hotspot mobile (recommandé, pas de routeur nécessaire) ou (b) même routeur Wi-Fi que le téléphone. Renseigner SSID/mot de passe dans le code.
- Récupérer l'IP : si hotspot, visible dans les paramètres du hotspot (ex. 192.168.1.1) ; si routeur, dans l'interface d'administration.
- Accéder au serveur web : navigateur →
https://<IP_ARDUINO>. - Base de charge : brancher l'émetteur Qi sur secteur via adaptateur 5 V DC.
- Piloter ! : interface web avec gros boutons (AVANT, ARRIÈRE, GAUCHE, DROITE, STOP) et choix vitesse (RAPIDE/LENT).
Code
Arduino_IDT_Wi-Fi_Car.ino
#include
#include
const int motor1Control = 2; // Moteur droit
const int motor2Control = 3; // Moteur gauche
const int motor1Input1 = 4;
const int motor1Input2 = 5;
const int motor2Input1 = 8;
const int motor2Input2 = 9;
const int wifiLed = 10;
char ssid[] = "example"; // ← VOTRE SSID
char pass[] = "password"; // ← VOTRE MOT DE PASSE
int keyIndex = 0;
int status = WL_IDLE_STATUS;
String readString;
WiFiServer server(80);
String speedMode = "fast";
void setup() {
pinMode(motor1Control, OUTPUT); pinMode(motor2Control, OUTPUT);
pinMode(motor1Input1, OUTPUT); pinMode(motor1Input2, OUTPUT);
pinMode(motor2Input1, OUTPUT); pinMode(motor2Input2, OUTPUT);
pinMode(wifiLed, OUTPUT);
while (status != WL_CONNECTED) {
status = WiFi.begin(ssid, pass); // WPA/WPA2
// status = WiFi.begin(ssid, keyIndex, pass); // WEP
// status = WiFi.begin(ssid); // Open
delay(10000);
}
server.begin();
digitalWrite(wifiLed, HIGH); // LED = connecté
}
void loop() {
WiFiClient client = server.available();
if (client) {
boolean currentLineIsBlank = true;
while (client.connected()) {
if (client.available()) {
char c = client.read();
if (readString.length() < 100) readString += c;
if (c == '\n') {
// Réponse HTTP + page HTML
client.println("HTTP/1.1 200 OK");
client.println("Content-Type: text/html");
client.println();
client.println("");
client.println("FORWARDS
");
client.println("LEFT");
client.println("STOP");
client.println("RIGHT
");
client.println("BACKWARDS
");
client.println("SPEED MODES
");
client.println("FAST");
client.println("SLOW");
client.println("");
break;
}
// Traitement commandes
if (readString.indexOf("?fast") > 0) { speedMode = "fast"; readString = ""; }
if (readString.indexOf("?slow") > 0) { speedMode = "slow"; readString = ""; }
if (speedMode == "fast") {
if (readString.indexOf("?moveForwards") > 0) { moveForwards(); readString = ""; }
if (readString.indexOf("?moveBackwards") > 0) { moveBackwards(); readString = ""; }
} else {
if (readString.indexOf("?moveForwards") > 0) { moveForwardsSlow(); readString = ""; }
if (readString.indexOf("?moveBackwards") > 0) { moveBackwardsSlow(); readString = ""; }
}
if (readString.indexOf("?turnLeft") > 0) { turnLeft(); readString = ""; }
if (readString.indexOf("?turnRight") > 0) { turnRight(); readString = ""; }
if (readString.indexOf("?stopMoving") > 0) { stopMoving(); readString = ""; }
}
}
delay(1);
client.stop();
}
}
// --- Fonctions mouvement ---
void moveForwards() {
digitalWrite(motor1Control, HIGH); digitalWrite(motor2Control, HIGH);
digitalWrite(motor1Input1, LOW); digitalWrite(motor1Input2, HIGH);
digitalWrite(motor2Input1, LOW); digitalWrite(motor2Input2, HIGH);
}
void moveBackwards() {
digitalWrite(motor1Control, HIGH); digitalWrite(motor2Control, HIGH);
digitalWrite(motor1Input1, HIGH); digitalWrite(motor1Input2, LOW);
digitalWrite(motor2Input1, HIGH); digitalWrite(motor2Input2, LOW);
}
void turnRight() {
analogWrite(motor1Control, 0); analogWrite(motor2Control, 200);
digitalWrite(motor1Input1, HIGH); digitalWrite(motor1Input2, LOW);
digitalWrite(motor2Input1, LOW); digitalWrite(motor2Input2, HIGH);
}
void turnLeft() {
analogWrite(motor1Control, 200); analogWrite(motor2Control, 0);
digitalWrite(motor1Input1, LOW); digitalWrite(motor1Input2, HIGH);
digitalWrite(motor2Input1, HIGH); digitalWrite(motor2Input2, LOW);
}
void stopMoving() {
digitalWrite(motor1Control, LOW); digitalWrite(motor2Control, LOW);
digitalWrite(motor1Input1, LOW); digitalWrite(motor1Input2, LOW);
digitalWrite(motor2Input1, LOW); digitalWrite(motor2Input2, LOW);
}
void moveForwardsSlow() {
analogWrite(motor1Control, 200); analogWrite(motor2Control, 200);
digitalWrite(motor1Input1, LOW); digitalWrite(motor1Input2, HIGH);
digitalWrite(motor2Input1, LOW); digitalWrite(motor2Input2, HIGH);
}
void moveBackwardsSlow() {
analogWrite(motor1Control, 200); analogWrite(motor2Control, 200);
digitalWrite(motor1Input1, HIGH); digitalWrite(motor1Input2, LOW);
digitalWrite(motor2Input1, HIGH); digitalWrite(motor2Input2, LOW);
}
Pièces personnalisées / Boîtiers
Fichier CAO : Arduino IDT Wireless charging wifi car.cad
Schéma
Schéma de câblage complet (image fournie).
Processus de fabrication
- Constructeurs C# : Types, exemples et patterns avancés
- Comprendre les classes imbriquées C# : Définition, utilisation et héritage
- Maîtriser la surcharge de constructeurs en C#
- Pourquoi les appareils IoT Wi-Fi posent une menace de sécurité croissante
- Fabrication de pièces moteurs de précision premium avec tours CNC et fraisage
- Maîtriser le cric automobile : types, usages et conseils de sécurité
- Comment le nombre de cylindres façonne la performance des moteurs modernes
- Comment fonctionne un moteur de voiture : à l'intérieur de la puissance au volant
- Comment réparer une fuite d'essence sur sa voiture rapidement et en sécurité