Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Working on Attiny85 and FS1000A cheap 433 Mhz transmitter #3

Open
benoitm974 opened this issue Feb 5, 2022 · 2 comments
Open

Working on Attiny85 and FS1000A cheap 433 Mhz transmitter #3

benoitm974 opened this issue Feb 5, 2022 · 2 comments
Labels
good first issue Good for newcomers

Comments

@benoitm974
Copy link

Just wanted to thanks you for your code !

I had an Attiny85 and FS1000A on the bench so decided to give it a try instead of buying new hardware... (I know other github on tesla door opener mention FS1000A can't be used but still wanted to give it a try) It took me some time to compare the tesla charger 433 signal output to the produced Attiny85/FS1000A one... Nor Attiny85 and FS1000A a super stable / calibrated devices... out of the box. The key element to this is the calibration of the Attiny85 internal clock to properly drive the FS1000A. There are several source for calibration of the Attiny85 on the internet (search for Attiny85 OSCCAL calibration). My option, since i wanted to calibrate the couple Attiny85+FS1000A was to use a logical analyser (cheap CY7C68013a mini board <$5) and record the 433 signal at different temperature and compare the time for one seri of pulse to the original tesla recording... (as reference a seri is 132ms on tesla charger EU and it send 5 of them).

Once calibrated I just set the OSCCAL value in the setup function, also I found it more "stable" to "warn" the FS1000A with a data HIGH before the sendsignal (at least it clearly helped the receiver to adapt the noise level for my analysis, but seems also to be more responsive on door opening...)

below the code (with the limited 2/3 changes mentioned above (attiny uses pin 0 for FS1000A, and pin 1 for LED)

`/*

  • TeslaChargeDoorOpener
  • This sketch will send a signal that will open the charge port door of a Tesla car.
  • It is similar to the button of a Tesla charge cable when not plugged into the car.
  • It will send the signal when powered on, then do nothing. Suited for battery-powered
  • operation using a push button.
  • Pin 11 must be connected to the signal pin of an ASK STX882 433.92MHz transmitter
  • that can be bought on eBay for a low price.
  • The message has been grabbed by using an SRX882 receiver to pick up the data sent
  • by a Tesla charging cable with built in push button.
  • The cable uses this signal to open the charge door when pushing the button not being plugged in.
  • When plugged in, the button on the cable can unlock the cable too. This is not done by RF, so
  • this sketch will not unlock the cable when plugged in.
  • The signal will be sent 5 times repeatedly, just like the charge cable button does.
  • Author: Fred Larsen
  • Github: www.github.com/fredilarsen
  • License: Apache
    */

// Pins
const uint8_t signalPin = 0; // The number of the pin with the output signal

// The signal to send
const uint16_t pulseWidth = 400; // Microseconds
const uint16_t messageDistance = 23; // Millis
const uint8_t transmissions = 5; // Number of repeated transmissions
const uint8_t messageLength = 43;
const uint8_t sequence[messageLength] = {
0x02,0xAA,0xAA,0xAA, // Preamble of 26 bits by repeating 1010
0x2B, // Sync byte
0x2C,0xCB,0x33,0x33,0x2D,0x34,0xB5,0x2B,0x4D,0x32,0xAD,0x2C,0x56,0x59,0x96,0x66,
0x66,0x5A,0x69,0x6A,0x56,0x9A,0x65,0x5A,0x58,0xAC,0xB3,0x2C,0xCC,0xCC,0xB4,0xD2,
0xD4,0xAD,0x34,0xCA,0xB4,0xA0};

//OSCCAL = 0x86;

void setup() {
OSCCAL = 0x91; //orig 86 //Best 91 Need to be calibrated per AtTiny
pinMode(LED_BUILTIN, OUTPUT);
pinMode(signalPin, OUTPUT);
digitalWrite(signalPin, HIGH); //HIGH to warm the FS1000A

}

void loop() {
sendSignals();
delay(1500);
}

void sendSignals() {
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(signalPin, LOW); //LOW before starting sendByte
for (uint8_t t=0; t<transmissions; t++) {
for (uint8_t i=0; i<messageLength; i++) sendByte(sequence[i]);
digitalWrite(signalPin, HIGH); //HIGH to keep FS1000A up between messages
delay(messageDistance);
}
digitalWrite(LED_BUILTIN, LOW);
}

void sendByte(uint8_t dataByte) {
for (int8_t bit=7; bit>=0; bit--) { // MSB
digitalWrite(signalPin, (dataByte & (1 << bit)) != 0 ? HIGH : LOW);
delayMicroseconds(pulseWidth);
}
}`

@benoitm974 benoitm974 changed the title Working on attiny85 and FS100A cheap 433 transmiter Working on Attiny85 and FS1000A cheap 433 Mhz transmitter Feb 6, 2022
@fredilarsen
Copy link
Owner

fredilarsen commented Feb 13, 2022

Thanks for the interest and contribution. I will leave this post here to help others with the same type of setup.

@fredilarsen fredilarsen added the wontfix This will not be worked on label Feb 13, 2022
@joelsernamoreno
Copy link

Hello @fredilarsen !

I adapted this for ESP32 + CC1101 + pushbuttons

You can find it here: https://github.com/joelsernamoreno/ECRF-TeslaCharge

Feel free to post this in this repository if you want

@fredilarsen fredilarsen added good first issue Good for newcomers and removed wontfix This will not be worked on labels Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

3 participants