IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
By using the project, you confirm that you have permission to broadcast the relevant radio signals
This is a project of a remote key fob for controlling gates / barriers from AN-Motors (or others if they do not have encryption and use OOK modulation at a frequency of ~ 433MHz). AN-Motors uses similar packets to keeloq but without encryption
For build you'll need:
- Atmega328P or arduino nano / mini / micro etc...
- Cheap 433MHz transmitter module (popular green PCBs. Often solds with a receiver)
- TP4056 charger module with build-in protection
- Any small LiPo or LiIon battery (for example from disposable vapes)
- 16MHz crystal oscillator, 2x22pF capacitors and 1M resistor for it (if using Atmega328)
- BC547 NPN transistor or any other small NPN transistor, 1K and 10K resistors for charger detection circuit
- Button + 10K resistor
- 3 LEDs + 3x470 resistors
- Some other capacitors and resistors (see schematic)
- Plastic case (For example, from tic tac, as in the photo)
-
Using the rtl-433 project (Keeloq packets) or any other method, get a packet from your gate / barrier
- Example of demodulated AN-Motors packet for ID 0x12345AB (0x0DA2C48): https://triq.org/pdv/#AAB0160401019803381010271880808080808080808080808255+AAB04C0401019803381010271890908190909090909090819090819090818181908181908181818190818190819090908190908190909081819081909090819081819081908190818190819090818355
- Packet consists of 4 same packets:
- 12-bit preamble (ON -> wait 413us -> OFF wait 413us)
- 4130 us pause
- 66-bit payload (64bit + battery and repeat flags)
- ~16100 us pause
- Payload structure:
- 12-bit
0x202
header (probably a constant)0010 0000 0010
- 4-bit button code (ex.
0100
) - 8-bit + 8-bit random number (you can use constant) (ex.
0xEDED
or0xABAB
or0x9797
etc.) - 28-bit ID (ex
0001001000110100010110101011
) NOTE: rtl433 shows ID in little-endian. If you use the ID from rtl_433, you need to flip it - 4-bit button code again (ex.
0100
) - Two bits of ones (
11
) (battery and repeat flags)
-
Exctract ID from the packet in big-endian format. NOTE: rtl433 shows ID in little-endian. If you use the ID from rtl_433, you need to flip it
- Example of packet: 001000000010010011101101111011010001001000110100010110101011010011. So, ID is
0001001000110100010110101011
in BIN or12345AB
in HEX
- Example of packet: 001000000010010011101101111011010001001000110100010110101011010011. So, ID is
-
Using Platformio or Arduino IDE (convert
ANMAK/blob/main/src/main.cpp
to.ino
format) open the code -
Put this ID (28-bit) to the code
-
Put button code to the code
- Example of packet: 001000000010010011101101111011010001001000110100010110101011010011. So, 1st button is pressed with code
0100
in BIN
- Example of packet: 001000000010010011101101111011010001001000110100010110101011010011. So, 1st button is pressed with code
-
Assemble device with whatever you find
-
Uncomment
REF_CALIBRATION
, measure AREF voltage in mV and put into the VREF_ACTUAL_MVvariable
-
Comment
REF_CALIBRATION
, upload code, connect battery. Done!