Coder Social home page Coder Social logo

algafix / pico-tesla-charging-port-opener Goto Github PK

View Code? Open in Web Editor NEW
14.0 3.0 2.0 6.56 MB

Open Tesla's charging port using a Raspberry Pico, a cheap 433MHz transmitter and micropython.

License: GNU General Public License v3.0

Python 100.00%
raspberry-pi-pico tesla hacking micropython rf-signal 433mhz raspberry-pico

pico-tesla-charging-port-opener's Introduction

Raspberry pico - Tesla charging port opener

Tesla's charging port signal has been known for years. There are several projects about how to retransmit it, how to sample it for HackRF or other SDR's and how to retransmit it. However, I couldn't find a micropython implementation so I decided to have some fun.

The signal has simple ASK/OOK modulation with 2.5 kHz of sample rate, easy enough to attempt a microcontroller micropython implementation.

For more information about the Tesla's charging port signal and how to reverse engineer it:

How to use

Components

  • Raspberry Pico
  • 433.92 MHz transmitter for Europe (315 MHz for USA)
    • FS1000A - Meh, it may work or it may not, pray
    • STX882 - Much better option
  • Antenna or 17 cm of wire [Optional]
  • A way to connect everything

Assembly

  1. Connect/solder the pins from the transmitter to the pico

    • VCC -> VBUS
    • GND -> GND
    • DATA -> GP0 (change the code if you prefer another pin)
  2. Flash the pico with micropython: official documentation.

  3. Load the appropiate file:

    • main_pico.py file for the raspbery pico.
    • main_tiny2040.py file for the tiny2040.
  4. Rename to main.py for automatic execution.

Use

You may connect the pico to your phone or get a battery for power on the go :)

Here an example of a portable implementation using a Tiny2040.

Note

The script blinks the led of the pico automatically. If you are using a Raspberry pico W change the Pin defnition accordignly (link).

Results

I've added a recorded signal generated with the pico to the docs folder, sampled at 1MHz with an RTL-SDR.

The raw signal looks like this in Inspectrum.

Raw signal image

Once we adjust the min and max power values, we can add an amplitude plot and check that it can really be decoded to the original signal.

Signal with amplitude thresholds image

101010101010101010101010100010101100101100110010110011001100110011001011010011010010110101001010110100110100110010101011010010110001010110010110011001011001100110011001100101101001101001011010100101011010011010011001010101101001011000101011001011001100101100110011001100110010110100110100101101010010101101001101001100101010110100101

Adjustments

The transmitted signal should have a symbol period of 400us. This is indicated with micropython's call sleep_us(400). However, thats the time the sleep call will wait, we need to account too for the time it takes to execute the rest of the code. I was getting pulses of 416us so I just compensated for them. Seems little but it's a huge difference after the 333 symbols of the signal, and it was not able to open the charging ports.

Samples too long

Therefore, I changed the call to sleep_us(384) and it fixed the issue.

Samples too long

You may need to play a bit with this parameter to make it work if you change the code ¯\_(ツ)_/¯.

Better solutions could be implemented, like using the PIO framework. Maybe I'll do it in the future.

pico-tesla-charging-port-opener's People

Contributors

algafix avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

1-tong markusdd

pico-tesla-charging-port-opener's Issues

Badge board type/name

What's the name of that small cicuitboard it's mounted on I can't seem to find it anywhere? I looked for a pimoroni badgelite but couldn't find it anywhere.,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.