![]() |
Forum Index : Microcontroller and PC projects : controlling 433MHz remotes
Author | Message | ||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
The following code allows a micromite to control the wireless 240vac mains outlet remotes sold by Jaycar, part MS-6147. output is from a COM port, and needs to be inverted. I am using an armmite, so I had to do a hardware inversion of the COM TX line, which is used to drive a TX module like here: https://lastminuteengineers.com/433mhz-rf-wireless-arduino-tutorial/ Each byte of the serial at 11250 baud is one bit of the remote code. I have listed the codes for four channels. I have just bought a second lot which appear to have a separate set of codes so if anyone wants I can decode those too, which will give 8 channels to control. I am using them to control a set of traffic lights dim integer a,i,j,k Open "com4:11250" As #4 Const alloff=&H1720083f Const aon=&H17200f3b Const bon=&H17200d39 Const con=&H17200b3d Const don=&H17200733 Const aoff=&H17200e3a Const boff=&H17200c38 Const coff=&H17200a3c Const doff=&H17200632 a=remote_tx(alloff) Do a=remote_tx(con) 'green light Pause 3000 a=remote_tx(alloff) a=remote_tx(bon) 'orange light Pause 5000 a=remote_tx(alloff) a=remote_tx(aon) 'red light Input h$ a=remote_tx(alloff) Loop Function remote_tx(y) For k=1 To 2 i=2^32 For j=1 To 32 i=i>>1 'shift 1 bit right If (i AND y) = 0 Then Print #4,Chr$(&b11111100); Else Print #4,Chr$(&b10000000); EndIf Next j Print #4,Chr$(&b11111100); Print #4,Chr$(&b11111100); Print #4,Chr$(&b11111111); Pause 40 Next k End Function |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5090 |
hi crez, are you sing the 8 bit UART to generate a specific pattern that is used by the 6147 module ? Including the "fixed level" start and stop bits ? (hence the odd baudrate of 11250). Nice, I have done this before in a commercial product where I used an ST UART in 9 bit mode with 2 top bits to generate DiseqC signals (DiseqC is used for communication between a satellite dish and a satellite receiver for home entertainment systems). Volhout PicomiteVGA PETSCII ROBOTS |
||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
Hi Volhout A high bit on the remote code is a long high pulse, and a low bit is a short one. I create the long high pulse by sending (inverted) &b10000000 and the short one by sending &b11111100. The start bit is low, which is sent next to the least significant bit. The baud rate worked over a range, but was falling apart at 8500 and 14000. |
||||
Andrew_G Guru ![]() Joined: 18/10/2016 Location: AustraliaPosts: 871 |
Hi Crez, Very interesting! I'm in . . . 1) Were did you get your transmitter? (I'd get a receiver too just to play) 2) Would an HC-12 work as a transmitter - do you know the exact frequency? 3) The Jaycar site shows here (about 2/3rds in) how to capture the code for each receiver - is that how you did it - any tricks? 4) If the 30m range were a problem one could use a pair of HC-12s to rebroadcast messages? 5) (I'm an ex Traffic Signals person - tell me about your interest) Cheers, Andrew |
||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
I bought a few on ebay a while back. Other options: element 14 : 2500107 altronics: z6900 jaycar: zw3100 Hc12 is not suitable, it has its own encoder built in. I think 433.92 is the transmitter I used. I was not aware of that arduino project. I opened the remote as they say and captured the pulse train on a digital oscilloscope. You can buy the receivers separately(ms-6149), so they are not tied to a particular control. This means the codes I listed above should work with any of the receivers. I tested the original remote in open air and it was still working at 80m. I only stopped walking because I couldn't see the red light on the receiver further than that ![]() I am working in the vehicle testing area. We will soon need to test a vehicle's ability to recognise the state of traffic lights. David |
||||
Volhout Guru ![]() Joined: 05/03/2018 Location: NetherlandsPosts: 5090 |
This is my personal fear...... Autonomous driving cars. I am aware successes are booked, and development is progressing constantly towards a consumer product that is safe...But... It can only work if the road is suitable. Lines, Trafic lights, other people obeying the rules, cars communicating. If any of these fail, autonomous cars (but also human driven cars) fail. This implies autonomous cars will only be possible in carefully maintained road sections. Probably even prepared for this sole purpose. And (local) governments need to be supplied with sufficient funds to keep the road in condition. Or these will be commercial roads specific for this purpose, where you pay for use... Funds and governments will fall short within the life cycle of a purchased car. Car manufacturers will not supply funding. So who does... In my opinion it is far better to stop this "do it because you can" effort and put an extra railways there. Of coarse electrical to be CO2 safe. That is something we know how to maintain. Nothing against people trying, but in the end money (not technology) will make it fail. Volhout PicomiteVGA PETSCII ROBOTS |
||||
crez![]() Senior Member ![]() Joined: 24/10/2012 Location: AustraliaPosts: 152 |
autonomous electric cars on rail lines... sounds like a good idea. |
||||
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |