
Explanation of project
The previous iteration of this project was bound to distances of less than 1 KM because the HC-12, while extremely useful for sending simple, low bitrate serial data, was not going to allow me to know if someone bumped into my motorcycle while parked somewhere that wasn't within the range. This Lilygo T-Sim7000g module gives the functionality of an ESP32 with a SIM7000G chip, allowing you to make requests over mobile networks. More info about the pinouts and details can be found in articles like these. I used mine with an MPU6050 to allow for a notification to be sent to my phone from home assistant when my motorcycle is bumped while out and about.
Supply list
- Lilygo T-Sim7000g. Amazon also has them in America.
- SIM card. I got one from Hologram and it was super easy to set up.
- 18650 battery. You can get these from Amazon and many other places online, just make sure it's a decent one.
- 6v Solar panel. Amazon had these. DFRobot also has a semi flexible version that is a little more robust.
- Electrical enclosure box. There are plenty of these to choose from on Amazon and other online stores.
- DF Robot Solar Power Manager
- 3V channel relays
- Buzzer
- 12v A23 batteries
- A23 battery holder
- Electrical box for the alarm and relay
- Electrical box for the MPU
- Industrial velcro
Setting up SIM and testing code
My code can be found here: https://github.com/emackinnon1/lilygo-bump-GPS/blob/main/lilygo_bump_GPS.ino
This is largely based on the code found in this article under the section titled: LILYGO T-SIM7000G ESP32: Connect to the Internet, Send SMS, and Get GPS Data. I also used the relevants parts of this code that sends data to Traccar.
You will want to get your SIM card set up first and test this near a window or outside for good service. Uncomment these lines with test server and resources and comment out these lines in order to try out making http requests. You can comment out the other lines setting up the MPU while you are testing as well.
The other major part of the code that contains an http call is making a call to my Traccar server, which I set up to track GPS location. Traccar has an integration with Home Assistant that makes everything very easy.
Wiring

The wiring on this module is fairly simple since the only peripherals wired to the board are an MPU6050 and a relay. The relay should have a 12v A23 battery on it and the buzzer. I broke up the MPU and alarms into their own separate modules which made the form factor more manageable. You can use electrical glands to run the wires into the different boxes and velcro to attach everything to whatever it is you are using this system on.
For the MPU, the SCL and SDA to GPIO 22 and GPIO 21 respectively. After that you just need a wire for 3.3V and GND and one connected to GPIO 32 for an INT signal to wakeup the board. The relay is pretty straightforward, connect one end to the other ground pin, one to the other 3v3 pin and one to a GPIO (I used 33).
It's optional, but you can also use a solar panel to charge the battery. I did this and used the solar power manager. The nice part about the power manager is it tops ou your capacity to a quadruple factor with three more 18650 batteries and you can use whatever solar panel you want even if the voltage is higher than the recommended 6v. It does require a little more space inside the electrical box, so you may want to see if that will work for your uses.
Wrap Up


As mentioned in the beginning, this was the iteration I wanted to make after I made my first motion sensor. MPU6050 modules are extremely useful for motion or vibration detection and now that I can combine them with this Lilygo T-SIM7000g, I can send data untethered from a wifi connection or point-to-point communication protocol.
A few of the drawbacks of this iteration are the slow up time (the previous iteration with HC-12s pinged my phone in a matter of seconds that the motion sensor was bumped). It takes about a full minute to connect to the hologram network and send updates via http requests, not counting the the GPS calculation and upload, which could be upwards of 15 minutes. I ended up removing the GPS portion of the code because it took so long and I moved the battery logging to Home Assistant. I may redo this project yet again if there is an available 5G solution, but a board or module with this capability seems to be hard-to-find as of now. One other piece about boards is that there is an MCU based around Nordic Semi's nRF9160 with an accelerometer built in as well as a bunch of other features that are extendable with the FeatherWing line of products from Adafruit.
The last thing I wish I could change is the form factor. I was able to break things up into more three small electrical boxes, but... It is still a very DIY-looking project.