Scott
Published © GPL3+

Truck Detector

Determine if a truck is backing up to a loading dock. and notify the building manager

IntermediateFull instructions provided15 hours15
Truck Detector

Things used in this project

Hardware components

Spresense boards (main & extension)
Sony Spresense boards (main & extension)
×1
USB Cable, USB Type C Plug
USB Cable, USB Type C Plug
×2
Adafruit power supply 5v 1 amp
×1
Adafruit Electret Microphone Amplifier MAX9814
×2
Jumper wires (generic)
Jumper wires (generic)
×1
ESP8266 ESP-12E
Espressif ESP8266 ESP-12E
For wifi unless you have a LTE Board
×1
Micro SD Card
In Fat Format. To store AI Model
×1

Software apps and online services

Edge Impulse Studio
Edge Impulse Studio
Maker service
IFTTT Maker service

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
if not using jumper wires during debug/setup

Story

Read more

Code

wifi

C/C++
Upload to the Esp82 wifi board
// be sure to include the ESP8266.h from the github page
#include "ESP8266.h"
#define SSID        ""
#define PASSWORD    "12345678"
#define HOST_NAME   "https://maker.ifttt.com/trigger/{Event_Truck_notifyer}//with/key/ << your key here>"
#define HOST_PORT   (80)

ESP8266 wifi;

void setup() {

//signal pin
pinMode(11, INPUT);

Serial.begin(115200);
Serial.print("setup begin\r\n");

//Wifi
wifi.begin(Serial2, 115200);
if (wifi.joinAP(SSID, PASSWORD)) {
Serial.print("Join AP success\r\n");
Serial.print("IP:");
Serial.println( wifi.getLocalIP().c_str());
} else {
Serial.print("Join AP failure\r\n");
}
if (wifi.releaseTCP()) {
Serial.print("release tcp ok\r\n");
} else {
Serial.print("release tcp err\r\n");
}
while(1);
}

void loop() {
uint8_t buffer[1024] = {0};
if (wifi.createTCP(HOST_NAME, HOST_PORT)) {
Serial.print("create tcp ok\r\n");
} else {
Serial.print("create tcp err\r\n");
}
char *hello = "GET / HTTP/1.1\r\nHost: https://maker.ifttt.com/trigger/{Event_Truck_notifyer}//with/key/ << your key here>";

if (digitalRead(11) == HIGH)
{
wifi.send((const uint8_t*)hello, strlen(hello));
}

}

Credits

Scott

Scott

1 project • 0 followers

Comments