Wireless Projects with microchips

Post here to let others know of a project you're working on.

Moderators: Chuckt, Garth, bitfogav

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Wireless Projects with microchips

Post by bitfogav » Fri May 14, 2010 10:50 am

Thought I would start this Project post as ive been working on a wireless project over the last week or so and just wanted to share all the info I have learned from it and hopefully help someone build there own wireless project :)

At the moment the project sounds simple, I have used two 16F648A microchips and connected two switches to one and two LEDs to the other, I wanted to use the USART - universal synchronous asynchronous receiver transmitter which is a peripheral of the microchip but half way through programming and testing I found that using USART, I couldnt get the correct signals, or the signals wouldnt match what was beng transmitted.

So I found some information called Manchester encoding, In the Manchester encoding a logic 0 is indicated by a 0 to 1 transition at the centre of the bit and a logic 1 is indicated by a 1 to 0 transition at the centre of the bit, one of the problems with wireless is the amount of noise that is picked up by the receiver but I found using this method the noise wasnt a problem.

ill update this more when I got more time :)

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Mattigasz » Fri May 14, 2010 9:14 pm

Hmm sounds very interesting...A friend of mine wants to build a wireless video tranceiver for his robot project(!) it is quite complicated I guess. Currently he is trying to device a way to use the internet as the transceiver but that would require building an internet compatible computer on his robot and that means more weight. Seemingly, from what I just read, this wireless function is integrated in the microchip? How does it (very very roughly) work?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Sat May 15, 2010 4:50 am

Hi Mattigasz

Well with my project I only wanted to send 8bits or 1byte of data from one microchip to another microchip, so I started off by connecting the microchips together using one wire and could easily send logic 0s and 1s in 8 bits and programme the one microchip to read the data and then carry out the certain functions of the program code.. But the hard bit is in the programming, you have to program your code so the one chip receiving the data could define your 8bits of data, But if you use the USART peripheral of the microchip, what you send out on one microchip is basically what you get received at the other, its just easier to program in your souce code.. but I dont advise using it for wireless.

So now I connected a Transmitter module to one microchip and a Receiver module to another chip and tried to send my 8bits of data but I found that with a scope what was being received was different to what was being transmitted, so I found something called manchester encoding, you can find it all over the internet? basically with manchester encoding it uses a logic High to Low or Low to High so for every 1bit of data there would be something like a logic 0 to 1 then a logic 1 to 0 and then a logic 0 to 1 again and this would be only 1bit of data, so to send 8bits of data I had to send about 40bits of data to the receiver just to send my 8bits of data, it sounds like alot of work but its good when you see your finished project working :)

theres alsorts of possible projects for using wireless like =
Car security systems
Robotics
Sending a outside temperature to an indoor receiver
the list goes on!

here are the Transmitters and receivers that I have been using

Image

Image

the transmitter is a TM1000-1 and the receiver is a RM1SGS
both of these you can get from Ebay :)
Attachments
trnas.jpg
trnas.jpg (9.97 KiB) Viewed 18906 times
rec.jpg
rec.jpg (3.63 KiB) Viewed 18906 times

Mattigasz
semi-newbie
semi-newbie
Posts: 15
Joined: Sun Mar 28, 2010 2:05 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by Mattigasz » Sat May 15, 2010 7:39 am

Thanks for the swift response. I'll make sure I check out Manchester encoding! Once I have my homebrew computer project done I'll definetely make my own wireless security system!

btw: Cool project! Is it done all ready? Happy with it?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Sat May 15, 2010 7:52 am

Good luck with your Homebrew computer project! :)

Yeah Im happy with it and how it all works thank you, its still on the breadboard stage at the moment though but ive been trying to see how far it will transmit and I reckon about 10 meters through walls, I am yet to try it in open space and also if I increase the transmitter power supply I should hopefully get more distance :D

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Sat May 15, 2010 8:13 am

I was speaking to a friend at work about the problems with these wireless devices and the answer (or the reason) is so simple!

He specializes in radar and communications systems and I basically said that when no signal is being transmitted (and therefor received) I actually get loads and loads of noise on the receiver (by looking at it on a scope)

He said "of course you would!"

The reason being is that all these sorts of devices utilize AGC (automatic gain control)

If you think about it - if you have the transmitter and receiver within centimetres away from each other and you were transmitting data to the receiver, then the received signal would be through the roof - it would be very large indeed. So the AGC of the receiver would reduce the gain to bring it down to the required level.

If you were to move a few metres away from the receiver and transmit again, the received signal would not be nearly as big in amplitude as the previous (because we are further away) So the AGC would automatically adjust the gain to get it to the required level.

So if we are not transmitting anything - the AGC puts its gain upto maximum to try and get some signal - with gain up that high basically any tiny little signal will get amplified and thats why we see so much noise!

So while that does explain the problem, it does not fix it :cry:

Now as for the distance that you can transmit there are two key things you need to do. The first is that these require 50 ohm coax to be used as the antenna. If you dont use 50 ohm coax you will get HUGE losses and therefor your transmitting distance is greatly reduced (to just a few metres)

Furthermore, the length of the antenna needs to be spot on to further reduce the loss. I think 24cm is what is recommended for these.

Now as for manchester encoing, that is a great way to overcome the AGC problem of the receiver. As far as I understand, manchester encoding always transmits clock pulses even if we are always sending logic 0's - is that correct?

So this means the receiver is always receiving something, therefor it sets the gain for that particular signal, and doesn't amp it up to allow noise to interfere.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Sat May 15, 2010 8:52 am

Yeah Brad you are so right about the noise and the coax needs to be 50 ohms.. i think this transmitter would go upto 1000meters but range or distant isnt really what i am tryin to achieve :) but would be nice to see how far they would go hehe :)

And your also right about manchester encoding always transmits clock pulses, thats what ive used in my project, to help the receiver set the AGC I send a pulse of 1s and 0s about 20 or so and then send the 8 data bits, but when there is nothing being transmitted you do get some noise from the receiver

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Wed May 19, 2010 5:59 am

How fast is your data rate?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Wed May 19, 2010 7:09 am

Here is the transmitter code, I have spent hours and hours on it..

I will post the receiver code soon.

:)

Copy the link below to download code

http://www.bradsprojects.com/phpBB2/upl ... v2_341.asm
Attachments
Wireless Transmitter V2.asm
(13.96 KiB) Downloaded 562 times
Last edited by bitfogav on Sun May 23, 2010 8:40 am, edited 2 times in total.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Wed May 19, 2010 7:34 am

This is a picture of the prototype transmitter and receiver boards that ive made and been using to get the code working correctly..


Image
Attachments
transandrec.jpg
transandrec.jpg (45.78 KiB) Viewed 18869 times
trans&rec.jpg
trans&rec.jpg (40.12 KiB) Viewed 18872 times

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Post by brad » Wed May 19, 2010 10:12 pm

Looking very professional indeed!

I had a quick look through your code and like the way you're going about it - It's great to see how people work around a problem in very different ways to others :D

I would like to have this project on the site on a seperate page - would you be interested in having it all uploaded?

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Thu May 20, 2010 2:59 am

Hey Brad, thanks for the comments and yeah I would appreciate that alot if you could upload my project on your site as a seperate page that would be great, Im still working on the receiver code at the moment, trying to get the comments sorted out so people can understand my code, as you probably can see that from my transmitter code I tried to leave comments so people could see what was going on?, abit like some of your project codes? I dont know where my evenings have gone this week hehe!!

I would like to also do some schematics aswell for the project but Im still learning on how to use Eagle software... :)

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Fri May 21, 2010 4:58 am

still working on the receiver code but I just wanted to upload my schematics of the transmitter and receiver modules.. :)


http://www.bradsprojects.com/phpBB2/upl ... ss_207.jpg
Attachments
Wireless.jpg
Wireless.jpg (52.13 KiB) Viewed 18844 times
Last edited by bitfogav on Fri May 21, 2010 5:13 am, edited 1 time in total.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Fri May 21, 2010 5:04 am

you can download the schematics from this link :)

http://uploading.com/files/618cc4ff/Wireless.sch/

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Sat May 22, 2010 6:50 pm

Heres the Receiver code :)

http://www.bradsprojects.com/phpBB2/upl ... v2_134.asm

I would appreciate it if the code was not used for any profit!
Attachments
Wireless Receiver V2.asm
(17.01 KiB) Downloaded 569 times

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 5 guests