SM0VPO Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

RC boat questions

4 posters
Post new topic   Reply to topic

Go down

RC boat questions Empty Re: RC boat questions

Post by Ivan Tue Apr 16, 2024 8:24 am

Hi John,

any programming is calling of library functions today (well - almost any, you can still write your machine code or assembler if you are a masochist). If you trace e.g. a Windows app into procedures and functions, you get deep inside the guts of system libraries and device drivers. It is nice to have a ready-made module together with a matching library, it saves lots of time.

IMHO those curly braces come from the C language. Just think that { means "begin" and } is "end".

VBR from Ivan

Ivan

Posts : 794
Join date : 2012-11-25
Age : 64
Location : Praha, Czechia

Back to top Go down

RC boat questions Empty Re: RC boat questions

Post by John_1981 Mon Apr 15, 2024 10:46 pm

All, 

I agree that for some applications, perhaps this one included, a simple hardware solution is the way to go. However, being able to write a few simple programs for a PIC, Arduino etc. opens up a whole world of inexpensive modules that could only be dreamed of a few years ago. 

I have been using PICs for over 10 years and have used Arduinos as well but still can't quite get used to all those curly brackets. I may be wrong here, but most of what I see for Arduinos involves using Libraries, and I don't like cutting and pasting bits of code written by someone else without properly understanding whats going on in the background. 

The Paul McWhorter videos on Arduino programming on YouTube are really good even if you don't drink iced coffee...

Regards,
John

John_1981

Posts : 32
Join date : 2021-11-07

Back to top Go down

RC boat questions Empty Re: RC boat questions

Post by Ivan Fri Apr 12, 2024 7:10 pm

Hi Harry,

take a look at ESP32. It can be programmed the same way and in the same IDE as Arduinos, but it contains a WiFi transceiver in the 2,4 GHz band. Libraries for a WiFi TCP/IP server and client are available, maybe for a PEER-TO-PEER connection too. Your whole remote control system could consist of two ESP32, several potentiometers, several servos and suitable batteries!

Enjoy! VBR from Ivan

Ivan

Posts : 794
Join date : 2012-11-25
Age : 64
Location : Praha, Czechia

Back to top Go down

RC boat questions Empty Re: RC boat questions

Post by sm0vpo Fri Apr 12, 2024 12:59 pm

John_1981 wrote:Harry, 

If you are struggling to write assembly code to get a PIC to produce a train of pulses have a look at PICBASIC PRO. I have been using it for over 10 years and find it easy to learn having used a Sinclair Spectrum back in the early 90s. Assembly language is ok if you want speed or are a masochist. That said, you can always use ASM routines within PICBASIC programs or interrupts for accurate timing. 

The PULSOUT instruction has a resolution of 10 microseconds with a 4MHz clock.

You can find the manual at http://ww1.microchip.com/downloads/en/devicedoc/pbp_reference_manual.pdf


Regards,
John
Hi John and Ivan,
Thank you very much for the comments. I am about to update the project with a microcontroller solution. I have solved the "1CH encoder". About 6 lines of text on an Arduino Nano. Working perfectly.

I like the Arduino more and more every time I have contact with it. I am now going to see if I can have an Arduino for the complete 6CH TX and RX. But to generate the servo tester, all I need is this script:

---------------------------------------------------------------
Components: Arduino Nano and a 10k pot.
---------------------------------------------------------------
Servo servpo;  // create servo object

int potpin = 0;  // connect the potentiometer
int val;    // pot value

void setup() {
  servpo.attach(9);  // connect servo to pin 9
}

void loop() {
  val = analogRead(potpin);            // reads potentiometer
  val = map(val, 0, 1023, 0, 180);     // scale down (0-1023 to 0-180)
  servpo.write(val);                  // send PWM to servo
  delay(15);                           // wait before doing it again
}
---------------------------------------------------------------

PICBASIC PRO. Hmmmm. I think I shall have to have a look at this. I have written several MPLABS assembly-language scripts and I find it really fun. Gets the grey-matter exercised.
But if it gets a bit complicated then PICBASIC PRO could be a good thing to look at. Thank you both for the suggestion.

Yes, Ivan, you are correct, I rather do like the discreet components methods. By single multivibrator on a breadboard is a really simple, easy and quick way of getting the required function. But to build a PCB takes a bit more time. With analogue circuits I can stuff an oscilloscope in at various points to see what is happening. AF, RF, analogue, digital, makes no difference. An Arduino or PIC is basically a black box. If it doesn't work it is not always so easy to investigate. To make changes also requires more programming.

Thank you both once again. My 72-year old eyes are opening more and more these days. A year ago I would not have had the time to play with an Arduino starting from zero knowledge. I just love the way it has machine-code programs already written for interfacing with just about anything. The above code, for example, define a potentiometer modukle, define a servo module, then the operation is simple: read the pot, write to servo, wait for a few ms, then do it again.

Ok, catch you guys later. BR Harry - sm0vpo

sm0vpo
Admin

Posts : 110
Join date : 2013-03-26
Age : 72
Location : Märsta, Sweden

Back to top Go down

RC boat questions Empty Re: RC boat questions

Post by Ivan Fri Apr 12, 2024 8:10 am

Hi John,

using a PICAXE is equally easy. A set of PULSOUT and PAUSE commands forms a sequence of pulses of different widths. A PICAXE can be programmed directly from a COM: port. But Harry usually prefers simple hardware solutions.

VBR from Ivan

Ivan

Posts : 794
Join date : 2012-11-25
Age : 64
Location : Praha, Czechia

sm0vpo likes this post

Back to top Go down

RC boat questions Empty RC BOAT QUESTIONS

Post by John_1981 Thu Apr 11, 2024 8:43 pm

Harry, 

If you are struggling to write assembly code to get a PIC to produce a train of pulses have a look at PICBASIC PRO. I have been using it for over 10 years and find it easy to learn having used a Sinclair Spectrum back in the early 90s. Assembly language is ok if you want speed or are a masochist. That said, you can always use ASM routines within PICBASIC programs or interrupts for accurate timing. 

The PULSOUT instruction has a resolution of 10 microseconds with a 4MHz clock.

You can find the manual at http://ww1.microchip.com/downloads/en/devicedoc/pbp_reference_manual.pdf


Regards,
John

John_1981

Posts : 32
Join date : 2021-11-07

sm0vpo likes this post

Back to top Go down

RC boat questions Empty Re: RC boat questions

Post by sm0vpo Tue Apr 02, 2024 3:43 pm

Hello Ivan and Densil,
Thank you for the comments. Densil, you brought up a really interesting subject. Yes, you are correct about the possibility if interference, but in practice this is not an issue, at least not in my case.

433MHz is a shared section of the amateur radio band and users are to accept interference form other users. This is also stated in the terms and conditions. That part of the band 433.800-434.250 MHz is allocated to "Digital communications & Experiments". In general, someone who pays to have a licence to use the spectrum has primary rights to that part of the spectrum.

Today many car manufacturers are migrating to 315MHz. The 70cm frequency band is getting too active to be 100% reliable.

A few years ago I looked into car remote keys. 25 years ago you could receive the modulation on a receiver, record it, then play the recording back through a 433MHz handheld radio to open or lock the car doors. Today this is not the case since the code is constantly changing. Crooks trying to use 5-Watt handheld radios to deliberately jam car locks do not always succeed. Even 5-Watts will only cover a small area.

The receiver sensitivity for car remote receivers is ridiculously poor. A car remote delivering 1mW will only give a range of perhaps 50 metres at best, often just 10 metres. Couple this with the unique variable code and you see that there is little or no chance of any two cars having the same code or being in close proximity sufficient to cause interference. They also use a wider bandwidth which means that a single NB transmission can be present, as long as it is not blocking the receiver. Under normal conditions the user rarely uses more than 5 metres, unless he is trying to find his car.

As Ivan pointed out, the terms and conditions of my licence allows me to use "home constructed" equipment within hamradio bands. It also allows me to use more than a few milliwatts. This would NOT be the case on the 35MHz, 40MHz and 2.4GHz bands. I have tested the transmitter while using my own car. The actual operating RF output power of the 3-Watt PA stage is about 100mW with the drive from the little TX module. I have also fitted a 20dB preamp and filter to my receiver module. Now I can get over 500 metres from my RC unit. I can run the transmitter continuously and have no problems opening my own car down on the street, about 50 metres away.

There is also one other relevant point, today you can go to E-Bay, Fruugo or Amazon and buy 433MHz walkie-talkies. I don't know if you can find a real toy-shop with them anymore. These walkie-talkies usually claim to deliver 5-Watts but the efficiency of the antenna has a lot to be desired. These units also have the potential to block 433-MHz remote receivers, even if they are not on exactly the same frequency.

The other point is that I will be using my boat a long way from any vehicle. I will be using it out in the coutryside beside lakes, where there are no cars. I do know that there are no cars in use on Swedish lakes Smile  But if anyone should have problems then yes, I will switch off the TX, which is the gentlemanly thing to do. I do not think this will be a problem.

FYI - There was an incident in the UK when a multi-storey garage was put into service beside a building supporting a 40-Watt hamradio UHF repeater. Every time the repeater was keyed up many car locks failed to work due to close frequency blocking receivers. The incident was taken to the UK telecom authority and it was stated that remote locks were using the band on a secondary basis. They did politely request the local hamradio club to move the repeater frequency as far away as possible from 433.92 MHz.

I saw that you posted this question a couple of days ago. For some reason I no-longer get e-mail alerts when new messages arrive. Sorry Densil for the delay responding. Thank you Ivan for your comments.

Very best regards from Harry - sm0vpo

sm0vpo
Admin

Posts : 110
Join date : 2013-03-26
Age : 72
Location : Märsta, Sweden

Back to top Go down

RC boat questions Empty Re: RC boat questions

Post by Ivan Mon Apr 01, 2024 7:15 am

Hi Densil,

you are right. There are ISM frequencies (Industry, Science, Medicine) and 8 PMR NBFM channels packed in a relatively narrow 433 MHz band. The risk of mutual interference is high and its solution lies upon the users. Usually no PAs are legal with remote control modules. Moreover these frequencies lie inside the 70 cm hamradio band - licensed hams may use tens or hundreds of watts radiated power there. Car locks should stay operational even under these circumstances. I suppose they employ some sort of safety encoding. Does anyone know more?

VBR and wishes of happy Easter from Ivan

Ivan

Posts : 794
Join date : 2012-11-25
Age : 64
Location : Praha, Czechia

sm0vpo likes this post

Back to top Go down

RC boat questions Empty RC boat questions

Post by Densil Mon Apr 01, 2024 2:39 am

hi Harry. I dont post much these days but i am folowing your recent projects. the articles seems to be getting longer with better explanations. just looking at ur rc boat project and i am interested to see the power controller and the sw. will u be posting the sw?

but i have questions. i understand that money is tight 4 u now u are not working and i thought the rc unit using 433mhz was cheap, quicj & clever. but i wonder about the frequency? i thought of using this same solution with a 433mhz tx module and a power amp. i saw you mods to make the pa more stable but i gave up the idea because the tx modules i got were 433.92 and that happens to be the same frequency as car locks. if you put a 5w pa on one of those you stand the risk of blocking car locks for probably 1km or something. have you considered that.

maybe you have a solution. if you have found out how to change the frequency then i 4 1 would be interested in more info.

/D

_________________
Ever noticed that old men use less money but they use more glue?

Densil

Posts : 47
Join date : 2017-01-06

sm0vpo likes this post

Back to top Go down

RC boat questions Empty Re: RC boat questions

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

Post new topic   Reply to topic
 
Permissions in this forum:
You can reply to topics in this forum