Very short (5mm) wireless communication

Go To Last Post
41 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have a small AVR monted on a rotating fan.
I need serial communications between the AVR and a (non rotating ;) PC. Not necessarily both ways communication, the PC has to be able to send stuff to the AVR, the reverse is not important.

I've tried mounting a few IR LED's and phototransistors inside the motor of the fan, it's pretty dark in there, so I figured it might work w/o any modulation.
But I get some nasty noise problems... Most probably due to the rotation since there's not always a LED exactly straight above one of the phototransistors.

The application is cost sensitive... does anyone have a suggestion?

BTW debugging software on a rotating AVR is a pain in the a__!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You could try using RF Monolythics 900MHz RF transmitters. These are about $10 US in low quantities. The antenna could be part of the PCB. This brings in a new set of issues regarding encoding etc but we use it in low cost applications.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How fast is the fan, and how much data do you need to upload?

If the required rate is slow enough, you might be able to transmit one bit of information every time the fan goes round, synchronised to the position of the fan blades. This would ensure that the photodetector and IRED were in the correct relative position at each transmission.

Sean.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

tell me the stator of the fan is permant magnet? if not could inject a pulse or two during the off time if the supply is ac?

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would have thought the LED/photodiode is still your best bet but needs a bit more thought. Fire the transmitter at the right position. Use some sort of error detection/correction.

Another method would be a coil. Make the axis of the coil the same as that of rotation. But you will need to modulate.

Jon

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would use one of the Panasonic "QRBxxxxx" IR detectors and use a IR LED transmitter to send data to it. The IR detector is tuned to detect a certain frequency, such as 38,500 hertz (they have other freq's available too). So you hook up a IR LED emitter and send a 38,500hertz pulse train through a NAND gate (or something), then you use the other NAND gate input to feed the data bit by bit into the emitter. Thus you get on/off 38,500hertz pulses going out. The IR detector's output is high until it picks up the 38,500 hertz IR frequency, then the output goes low.
Now the output from the detector can be fed into, say the TTL serial input to the MCU. Program the UART for 300 baud, and you should be in business. Then the sending MCU would fire off the IR emitter and the receiving MCU would pick it up. You are limited to about 300 baud or so, as the detectors may not be able to react much faster, but it's hard to say.
You can program the timer on the MCU to generate the 38,500 hertz frequency and feed that to an input on a nand gate, then feed the other input to the nand gate from the output of the serial port. On the receiving end, you only need to feed the output from the detector into the serial port input on the MCU. The IR detectors have a open collector output, so don't forget a pullup resistor. You can drive the IR LED with a simple 220 ohm resisitor in series with it.
You can also use a 555 timer and set it up for 38,500 hertz or so too.
For object detection I had had good success simply using a LOOP with a simple PWM or Pulseout function (using the frequency harmonics to trigger the detector).
Some guys use a hex inverter IC and set it up to oscillate too.
Using only one gate out of a quad two input nand gate works, as you only need two inputs. Some guys have used the other three unused gates as an oscillator as well.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A few nand gates can pick up the net-frequency (50/60Hz), so maybe thats the trick...? filter the 50/60Hz, or those inducors parts (what a bat using, sonar??)

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's a 12V DC fan with permanent magnets. (The kind of fans used in computers).

I need at least 10-20kbps.. Preferably 50kbps.

Firing the transmitter at exactly the right moment is a problem since then I'd have to add one extra rpm sensor and problably a second AVR to manage the transmitter.

Standard RC5 modulation of 38kHz doesn't quite cut it since I need a little more bandwidth.
A ~500kHz carrier might work... But is has to be a fairly accurate oscillator. RC oscillator is kinda out of the question since I don't want to trim every single one by hand. ceramic resonator?

The nice thing about unmodulated IR is that it doesn't require a second PCB.. fewer PCB's = cost savings.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BTW, it's a small SMD board, so any bulky IR recievers is out of the question... besides... the fan rotates at 3000rpm, heavy stuff adds alot of stress to the board.

Pic of the board as it looks today.
http://www.hh.se/stud/d99tibr/sc...

The IR LED to the right is used for rpm sensing.
The transmitter LED's (three) are located inside the motor case.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why not do the same trick as a bike-counter, 2 magnets on the wheel (fan) and a reed relais..... dunno. bye.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This may seem like a dumb question, but what is it *for*? A fan RPM sensor would be more easily done other ways. The only thing I can think of is some kind of radar where the fan is just a convenient motorised base.

Of course, it's bound to be something completely different...

Sean.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about putting the LED in the center of the board, and using an arm that hangs the receiver out over it. Since it's in the center, the photons will have some "twist", which you'll have to account for in software, but you won't have to worry about the what position the blades are in.

--John (just kidding about the twist)

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Jerry Crane's suggestion of using an RF link is probably your best bet given the high data rates required and the size constraints. I think u would be hard pressed to get such rates from a basic IR link. There are several devices around that could prove useful but looking at your PCB photo they may become the most expensive component used. (even @ the $10 mark!)

If the data rate could be reduced (significantly) then u may still get away with IR. and I agree with the idea of putting the detector/transmitter in the center of the PCB (on the axis of rotation). This will iliminate any phisical alignment hurdles.

Another IR method could be to use reflected light instead of the direct path. I know I have played around heaps using the TV remote by bouncing it of the walls and ceiling. This will probably mean that your 5mm distance will now be much greater though.

A note on costing...
Your time spent on development should be considered alongside component costs. You may find a cheaper solution (component wise) using IR but your R&D costs may blow out due to the time taken to develop it, eg. compression or synchronisation algorithms. An overal cheaper solution could be found in simply usinging a complete "of-the-shelf" RF link as Jery suggests which is virtually "plug&play". Of course, if the final production volumes will be high, then the extra R&D costs can be absorbed and the greater saving lies in the component selection.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sean: Isn't that obvious from the picture?! :-)
It's a rotating LED matrix!
Just 8 LED's that rotate, and a CPU that turns them on/off to produce the image.
Works nicely, but I want to be able to update the image while the fan rotates. And animations at ~25fps would look quite spectacular, but that requires some bandwidth, 20-50kbps or so..

noname: Nah... I don't want a arm hanging over all the pretty LED's... :)

robski: I'am sorry, but I don't think you got the problem right. RPM sensing is no problem. data transmission to the rotating part is.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

RF might be the way to go... Have an antenna that goes circularly around the perimeter of the fan blades. Then in very close proximity run another circle of wire mounted on the fan base, but close (few mm) to the other loop of wire. The wire shouldn't throw everything off balance by too much. Although you would need some circuitry to read the antenna properly. However it might be possible!

-Colin

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A question: how are you powering this rotating device? Is there some way that you could modulate the power supply to tansfer your data?

Richard.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I agree with the coil mounted concentric with the fan. (except you don't need that high a frequency unless you are magnetically coupling a lot of LED drive power !)
Use two coils mounted in very close proximity, one rotating and one stationary.
You have to power the micro of course.... at the moment, you're probably using brushes which will be introducing their own noise.

An easy way would be to drive the coil at an an average of around 200 khz (for example), and to vary it up and down slightly, say pwm driving with 2 or 3 uS pulses for example.

The transmitter sends bursts of the above pulses coding them with most popular binary char as short pulse, the other as long.

While the frequencies could be a problem with generating excess RF, the modulation and random data element should help a lot by minimising any external tuned coupling effects.
Sequentially, the priorities would be:
respond to serial data input from PC (really ought to be synchronised to rotation)
send PWM
recieve PWM
update LEDs during comms intervals.

Obviously, 38kHz modulation on IR WOULD be sufficient... just use manchester or PWM encoding and reduce the LED drive until the reciever has minimal sustain.

By the way... IR modules are available quite small... even in 3 terminal surface mount.

25 hz x 8 LEDs x number of angular updates per frame is still a very small number..
circumference=radius x pi,
supposing you angularly update at the inter LED spacing on the outter LED circumference then updates per rotation = 8(radial LED spacings) x pi = approx 25 updates per second.

8 LEDs = one byte per update... I'm sure this is no coincidence !
25 bytes per rotation x 25 rotations per second = 625 bytes per second, or 5000 bits per second.

In close proximity, you could use many sorts of schemes to decode this sluggish comms rate.

If you want to update at smaller angles... fine, but the resolution improvement will be almost insignificant, and you can still save by using smaller angles at the outside, and bigger ones near the centre.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

updates per rotation = 8(radial LED spacings) x pi = approx 25 updates per second

This is a bit out, I think. Assume all 8 LEDs are taking up about 80% of one radius, so the inter-LED spacing is about 0.1R. There will be about 2pi/0.1 = 20pi = 63 (call it 64 for ease of use) angular segments per rotation. At 25 updates/second, this is 25x64=800 bytes. Assume UART-style comms (10 bits/byte) to give 8000 bits/sec.

This isn't too horrible, but it is challenging. Colin's concentric antennas seems like a good idea to me.

Sean.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about four or more infa red Tx Rx spaced around the pcb carrying the micro this enables a greater bandwidth of comms as a binary number can be sent in one go rather than just a bit waddle. When the TX RX line up the transmitter side squirts out data, depending on the length of time they are in alignment will depend the amount of data that can be transferred in any one time slot.
I know there is no RF so no (perceived) interesting bits.
Mike

Keep it simple it will not bite as hard

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I have what you need ... a little schematic for unmodulated IR - all parts are SMD.

http://www-und.ida.liu.se/~andro...

Basically it is just a photo-diode connected to ground via a 3.3k resistor and a comparator. The resistor 'converts' the diode light-current to a voltage and the comparator converts the low-level signal to logic levels.

The actual values of the resistors depend on how much light the photo diode sees. The threshold voltage should naturally be set to about half of the signal amplitude. Current values (22k & 150 ohms) give you a 30mV threshold, which may be too high or low for your particular setup. Check with a scope or voltmeter and adjust accordingly.

It easily handles 115kbps with a MAX987 (SOT23-5) comparator. A MAX985 (also SOT23) is slower but should work for lower speeds (I have only used MAX987 myself).

Andreas

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for all the suggestions.
Sending data only when the transmitters line up with the recievers would require quite some extra electronics, probably a extra AVR.

I know I really don't need that high resolution, but there is a few reasons to have 120 angles. Projecting a analog clock for one thing.. And the possibility to choose between solid lines or dots when drawing a image.

Sean: You calculations are off... it's 16000bps, not 8000bps. 64*25=1600. That's why I said I need 10-20kbps.

sleeperse: I can't see that pdf, but I agree that unmodulated IR probably deserves a second chance.

Colin: RF surely is one way, and I might try it... But large copper windings... I'd prefer something smaller if it's possible.

And yes, you guessed it, I get the power by a brush. (ground by the axis). I'am pretty sure the brush makes way too much noise to be useful for data modulation.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

64*25=1600

D'oh. Of course it is. This is a specific example of a general rule popular on Usenet: when correcting someone, it is usual to make one mistake of similar kind in your correction. This allows spelling flames to spawn whole threads by themselves.

But large copper windings

I've just had a thought about this. Near a motor is probably the worst place I can think of for this kind of coupling, especially with a large diameter and no modulation. Lots of stray flux to cause noise.

Sean.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why are you using it at 3000 RPM? For persistence of vision type displays, that's *far* higher than the human eye needs. And the fans typically do not have very good speed stability.

I started to build something like this a few years ago, but never got past the "acquire hardware" stage. I was planning on using a 5.25" floppy disc controller, which is phase lock looped to 360 RPM. If I remember correctly, I got part of the idea from a website where a fellow had done something similiar, and I was going to build on top of that idea. I even got around to cutting a precision cardboard disc that would hold the 16 LEDs.

As it was, I never got around to building the rest of it. Instead, I used a '2051 and 8 LEDs, and built a little board that did POV, but you had to turn your head quickly, or use something relfective and rock it back and forth quickly. While it only took a few hours to build and program, it provided hours of entertainment to people who walked by my cube and ask "What the heck is that?"

The other one that generated a lot of questions was a little board with 3 LEDs and 3 processors. I was playing around with multi-processor communications and the 9th bit address modes, and wanted to test an idea before I committed it to a larger design.

So I built this board. One processor was a master, the other two slaves. The master turned on it's LED, waited one second, sent a command to the 2nd processor who turned on his LED, then a command to the 3rd processor. Then it did the same thing turning them off, and repeated infinitely.

Nothing but 3 LEDs blinking on and off, and people *had* to know what it did, and why it was doing it. I've never seen so little circuitry generate so many questions, and all because some LEDs blink on and off in the same order, over and over and over...

Incidently, I have something I bought many years ago that does something similiar. It doesn't display words, but is a spinning bar of 50 or 60 different color LEDS. You plug it into an audio channel, and it displays different patterns based on the music. It was $30 USD or so at Sam's Club. Everything is black except the LEDs. The box is about 12" or so on a side, and the bar is about 9" in length. It uses a commutator ring to supply power, ground and audio to the bar (where all the electronics are). Obviously for something like that, speed stability, and the cleanliness of the audio signal into it are not very critical. But I always thought about hacking a micro on to it.

--John (master of the GUP, or Great Unfinished Project)

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

One last thought, Radio Control Model Airplane people use a simple optical Engine RPM indicator. It usually has a swtich on it for two blade, three blade or four blade propellors. In this case you hold the indicator up near the propellor while the engine is running and measure the RPM. The photocell, or phototransistor picks up the pulses coming from the ambient light through the propellor blades.
Why couldn't you do something like this as well? It works up to over 12,000 RPM easy. Then you only have a phototransistor or photocell up close to the fan blades, you can have a LED or something on the other side shine a light through as well. A photodetector might work too, but I don't know what the sensitivity would be when you spread them apart too far.
Using this method, you wouldn't have to have any logic on the fan at all. You could control the motor externally.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Earl: That's a nice way to measure RPM, but as stated above, that's not the problem. Data transmission is the problem.

John: 3000rpm (rpm=rotations per minute) gives 3000/60= 50 images per second, which is pretty much exactly what is needed to give a flickerfree image.
Besides, it's a DC fan, so I can't adjust the speed.

Sean: I agree.. Large copper windings probably picks up more noise than unmodulated IR.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Ampz,

You can adjust the speed using low speed PWM with a series pass transistor.

Have you tried switching the power to see if you could receive any signal on your board?

maccdave

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

By the way, small DC Brushless fans are not that electrically noisy............

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see Sean made corrections for my incorrectly remembered circumference formulae, it should of course be pi x d, NOT pi x r I think I must have been almost asleep....

Sean suggests using the inside 80% of the radius, the way he writes one LED is actually on or near the axis of rotation.

And as he later writes... corrections on a forum like this expose errors very easily- such as working off 100% of the diameter instead of 80% of the diameter to get inter LED angular spacing. The maximum *LED* radius should be used to calculate pi x 2r to find the circumference and the necessary divisions.

But then granularity is a flexible thing.... it's easy to use more LEDs, but 8 on a side will spin to give 8 concentric rings, ideally with a reduction in control points proportional to reduction in radii.
8.5 x pi x 2 ~=53
7.5 pi x 2 ~=47
6.5 pi x 2 ~=41
5.5 pi x 2 ~=35
4.5 pi x 2 ~=28
3.5 pi x 2 ~=22
2.5 pi x 2 ~=14
1.5 pi x 2 ~=10
.5 pi x 2 ~=pi
sum: 253 LED switch points(bits per frame) for an evenly controlled rotating matrix of 8 circumferences.
253 bits would make a nice long transmission as custom serial, at 25 frames per second that works out to 6325 bits per second + overhead of synchronisation pulses.
More work though, the PC has to sample points of the source image by reference to a 253 position x,y lookup table, then the fan uC could use a 53 byte table with redundancy on the inner radius bits and a smart serial unpacking system using a table with progressive step sizes for inner bit unpacking locations.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

EPE: Yes, I have considered using lower resolution for the inner rings, but that would make it impossible to draw a straight line from the center out.
Most applications for a device like this would require the ability to draw straight lines from the center out.
It might still be possible to save a few bytes of the innermost ring/rings w/o any detectable problems with straight lines, but the savings would not be that big, and I don't belive they are worth the hazle of rearranging all the bits in the data transmission.

maccdave: Yes, it is possible to adjust the speed of a DC fan by using PWM, but I really don't see any reason to do so. 3000rpm is perfectly fine, and small variations in fan speed are not a problem since I measure the rpm continuously and adjust each LED's timing accordingly.
Adjusting the speed of the fan would require a second non-rotating AVR, and I'd still need the rotating IR RPM sensor since there has to be something to trigger the rotating AVR. As I said previously, RPM sensing and timing works very well, my only problem is data transmission.

I have not tried switching the power as a means of data transmission, but I'am quite convinced that the noise generated by the brush would be quite a problem. In fact, Sometimes I have had some problems keeping the power stable enough. There is a 330uF electrolytic, and a few 1uF ceramic capacitors to help clean up the power.

A few pics of the fan in action:
http://www.hh.se/stud/d99tibr/sm...
http://www.hh.se/stud/d99tibr/8l...
http://www.hh.se/stud/d99tibr/bi...

As you can see it works great at displaying static preprogrammed images, but images transmitted from the PC in realtime is a problem.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This actually reminds me of another GUP that I came up with years ago.

Hubcaps with an array of LEDs, and a "pancake generator". This is a small low-profile generator that has a counterweight that hangs down. As the wheel turns, the counterweight gives the generator something to work against.

The hubcap would be covered in array of LEDS, and be programmable via IR or some other as yet never-bothered-to-define method. The generator also provides the wheel RPM to the controller. A small little message displayed as you drive down the road...

"Leroy's Lincoln"

scrolling nicely at 35 MPH.

--John

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice!
But there's no way that's legal...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

And why would that not be legal? No different from all the neon crap, and "helicopter" wheels and stuff that kids these days uglify cars with.

--John

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Might be different laws in your country. But here (sweden) the laws about extra lights on cars are very strict.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It's the same in the UK. For instance, I am told that the reason that the license plates on British cars are yellow on the rear of the car is because it is illegal to show a white light on a car except in the direction of travel.

Sean.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A very simple solution, yes, but hardly cheap, and they are pretty big... might be hard to fit them on the board.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice thread.

Long.

Ok, unmodulated IR for < $5. Gif image (hope it works better than the pdf I posted earlier. :-)

http://www-und.ida.liu.se/~andro...

/Andreas

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi

I can think several solution to this problem.But the one with less changes to your initial design is to put one IR receiver to the edge of of your rotating circle and an array of IR leds in the stator liting all together in a way that the receiver will be in the light always no matter its position.How much IR leds you need depend of the radius of the circle and the distance from receiver which depend of the power of light the leds emmit.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not an answer, but have you guys seen the Cart series (American Indy Cars?) as one of the teams had lights in their wheels to display sponsors names, Toyota etc. They can go up to 200+ mph which would need a pretty fast micro!

Josh.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

suggestion time over
production time now.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hmm, A friend of mine made something similiar.
He had no micro on the fan, but instead had 8 (eight) wires plus a return going to the LEDs and back via slip-rings. Hardly elegant, and totally not suitable for this application.

BUT I think I have an idea (lightbulb!!)

You could make a ring out of 5mm perspex that fits around your fan. Coat the entire ring on the outside with white paint, leaving only the side facing the blades exposed. (make sure this is a clean, smooth edge) You can fit an IR led on the side of the ring, and have the light reflect right around the ring, so that no matter where the detector is, it will be able to receive..
Basically a funny shaped optic fibre-type thingy..
This principle is sometimes used for backlit LCD displays..

Regards
Carel

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Sat in a bar and watched a fan displaying adverts for a well known Irish brewers!

admin's test signature