Wireless Reciever voltage drop

asagohan

New Member
Hi. I have been playing around with the RXB1 and TXC1 wireless receiver and transmitter from Jaycar. I have also made a program to send a signal to my picaxe to switch on the motors etc. The program definitely works because when I have the serial cable from my computer directly connected to the picaxe input it will do what it is supposed to. Normally if I just have the receiver connected to 5V (and not connected to the picaxe) it can receive signals and the voltage between the receiver ground and data goes up to about 4V (which should be a logic 1). However, as soon as I plug the data pin on the receiver into the picaxe input and the ground from the receiver into the picaxe ground the voltage level between ground and data on the receiver goes right down to 0.12V (which is nowhere near a logic 1).

Does anyone know what is causing this and how to fix it? I am not an expert at electronics or anything so it is probably something stupid that I have missed.
 

premelec

Senior Member
Note that some pins on PICAXEs can be used as outputs or inputs and when the pin is set as and output and LOW it will draw a bunch of current... Your program needs to set the pin being used as an input... if it is indeed a dual purpose pin... data not given in your post. Check the manual... good luck...
 

asagohan

New Member
Didnt work

Thanks for the advice.
But aren't all dual pins defaulted to inputs when the picaxe is reset? I haven't set them to outputs at any point. I tried what you suggested and went "let dirsc = %00000000 ' make all pins inputs" but it didn't change anything.

By the way I am using a 28X1 and digital in 1 (picaxe pin 12) as the input. I am doing "serin 1,T2400, command" (where command is just an integer between 1 and 6) to receive the signal.

There is also 5.1V between the ground and Vcc of the receiver (the ground and Vcc are connected to the picaxe).
 
Last edited:

westaust55

Moderator
voltage drop

With the 28X1, pins 21 to 28 are "normal" Outputs and set as such by the interpreter. These are portB.

PortC is the 28X1 normal inputs which the interpreter sets as inputs by default.

Can you upload your circuit so that we can better understand how you are connecting the various parts.

The program definitely works because when I have the serial cable from my computer directly connected to the picaxe input it will do what it is supposed to.
Are you suggesting that it only works when the serial cable is connected to the PICAXE?
If so, then could be you do not have the serial input pin pulled to ground with a 10kOhm resistor.
See the diagram at bottom of page 7 in latest (rev 6.6) of PICAXE manual part 1.
 
Last edited:

moxhamj

New Member
Like Westaust55 says, it does sound very much like two outputs joined together. Maybe put a 1k resistor between the picaxe and radio module. Then measure the voltage at the picaxe side and the radio module side. If you get a different reading that will be a clue that there are two outputs fighting with each other.

A schematic and photo will be very helpful. Sometimes the pins you think are connected are different pins.
 

asagohan

New Member
I am using the AXE020 project board which has all of the pull resistors etc. already there. I will try and put a resistor between the receiver and the input pin to see what I get.
 

westaust55

Moderator
I am using the AXE020 project board which has all of the pull resistors etc. already there. I will try and put a resistor between the receiver and the input pin to see what I get.
A thought:
Are you in error connecting the receiver ground to the PICAXE ground at the input header. Note that most of the pins down the left side are +5V - highlighted in red. Only the bottom 2 pins are 0V (Ground) - highlighted in green.
See attached AXE020 layout
 

Attachments

asagohan

New Member
I just unplugged all of my outputs and only have the one input from the receiver going into the board now. I also put a 300ohm resistor between the data out of the receiver. I still only get 0.14V between data and ground of the receiver when I should be getting about 4 and both sides of the resistor are the same.. What else on the AXE020 board could be doing that?
 

westaust55

Moderator
What results do you get when:

1. measure resistance from the PICAXE input to ground - pull down resistors are (should be 10k Ohm)

2. connect the input to VCC on the AXE board via say a 330 Ohm resistor, What voltage at the PICAXE input relative to GND.

Is the receiver getting its supply from the AXE020 board or where?
What type of supply if differnet to the PICAXE supply?
 

asagohan

New Member
The resistance is 10k from input to ground.

I have tried running the receiver from a separate power supply (ground was also connected to the picaxe ground) and right now I am using the picaxe power supply (a transformer that outputs 5V) to power the receiver using the V+ and ground connections on the input side of the board.

PICAXE to ground with 300ohm resistor between input and Vcc is 5.28V.

Going 2m away still gives the same results too.
 
Last edited:

tarzan

Senior Member
I think that you should ask yourself what is happening at the data pin on the receiver during normal radio noise events.

Can you post you code?

I recommend inverting your out put. (n2400)
Receiver gets the same treatment. Added: (I'll just clarify that match your input & output both n2400)
 
Last edited:

asagohan

New Member
I am sending a signal from my serial port using java (it is just sending a byte which represents a number from 0-7). I'm not sure if I can define how to send the byte from the computers serial cable (it is always high, and goes low when a signal is being is sent). I can post the code for the picaxe side, but I don't think it is a code issue. I am using T2400, because the voltage at the receiver always sits on 0 when the transmitter is idle and seems to be going from 0 to 4V normally when it is not connected to the picaxe and receiving a signal, which is T2400 right?

Code:
symbol servoPosition = b0
symbol command = b1
symbol parameter = b2
symbol distanceReading = b3

init: servoPosition = 150
	let dirsc = %00000000 ' make all pins inputs
	servo 0,servoPosition ' initialise servo
	
main:

'TODO put a qualifier that must be recieved before the next byte is processed
serin 1,T2400, command

if command = 1 then 'turn head command
	serin 1,T2400,parameter
	
	if parameter > 127 then
		parameter = 256 - parameter
		servoPosition = servoPosition - parameter
	else
		servoPosition = servoPosition + parameter
	endif

	servopos 0,servoPosition 'turn head to position	
	pause 100
	serout 2, T2400, (0)
elseif command = 2 then 'read distance
	distanceReading = 0
	high 1
	pause 200 'charge capacitor
	readadc 0, distanceReading	
	serout 2, T2400, (distanceReading)
	low 1
elseif command = 3 then ' forward
	high 4
	low 5
	high 6
	low 7
	serout 2, T2400, (0)
elseif command = 4 then 'backward
	high 5
	low 4
	high 7
	low 6	
	serout 2, T2400, (0)
elseif command = 5 then 'stop
	low 4
	low 5
	low 6
	low 7	
	serout 2, T2400, (0)
elseif command = 6 then 'right turn
	high 6
	low 7
	high 5
	low 4
	serout 2, T2400, (0)
elseif command = 7 then 'left turn
	high 7
	low 6
	high 4
	low 5
	serout 2, T2400, (0)
else
	serout 2, T2400, (1)
endif


goto main
 
Last edited:

tarzan

Senior Member
I am sending a signal from my serial port using java (it is just sending a byte which represents a number from 0-7). I'm not sure if I can define how to send the byte from the computers serial cable (it is always high, and goes low when a signal is being is sent).
Have you connected the Tx directly to the RS232 port or do you have a cable (axe027?) between them?
 

asagohan

New Member
The transmitter has a MAX232 circuit connected between it and the serial port. I have also added a 20k resistor to get it down to 3v. I have measured the voltage of the signal on the transmitters data out, it is 3V.
 

tarzan

Senior Member
What you have done is correct for True (T2400) signal.
That's a divider network for lowering the voltage right?
For True (T2400) on the receiver end you'll need a pull-up resistor. Not easy on the axe020.
 
Last edited:

hippy

Ex-Staff (retired)
SERIN Polarity

I can post the code for the picaxe side, but I don't think it is a code issue. I am using T2400, because the voltage at the receiver always sits on 0 when the transmitter is idle and seems to be going from 0 to 4V normally when it is not connected to the picaxe and receiving a signal, which is T2400 right?
No. For a PICAXE, idle low, active high input is N2400.

However, this is a secondary issue to the hardware problem. There should be no reason a PICAXE input pulls a 4V output down to anywhere near 0V unless there is a hardware fault or that input is actually set as an output low.

Have you tried with other input pins; do they also pull the output low ?

Have you got a breadboard so you can test with just the simplest PICAXE circuit without the AXE020 specific components ?

Are you measuring this pull-down to near 0V on the receiver output, the board input or PICAXE pin; are they all consistent ? It's not unheard of to look at an input pin, see 'nothing', and assume there's no ouput when that output actually connects to somewhere else.

When testing reception, simplify your code. You don't need all the clutter of trying to do two or more things at once, you just want to see what the PICAXE is receiving. Use something like -

- Do
- SerIn 1, N2400, b0
- SerTxd( b0 )
- Loop

Then use the Programming Editor Terminal to view what is being received. If that ( or with T2400 ) doesn't work then nothing else is going to. Test and prove the foundations before building upon them.

Also, disconnect all active hardware other than the receiver module. You don't want servos running which could be interfering with reception at this time.
 

tarzan

Senior Member
If you have an axe027 cable this hardware & software solution should work for you.
Put the max232 aside for now.
Send your Java output to USB port with axe027 cable connected to Tx unit.
Connect Rx to axe020 input. Change Picaxe code to n2400.
 
Last edited:

manuka

Senior Member
The golden rule with 433MHz wireless datacomms is to START SIMPLY. IMHO your present setup looks a fault finding overkill, & I'd STRONGLY recommend revamping it with a 08M or 18X to help iron out bugs.

Wireless data hassles can certainly develop, & supply voltages to those Jaycar units are just one of the issues -Rx must be 5V ±½V, but Tx can be as low as 3V. For some years their data sheets incorrectly listed this...

I've made & supervised hundreds of "reliable once tamed" Jaycar based 433MHz Tx/Rx circuits (mostly 08M & 18X), & when confusion arises recommend the likes of such approaches as => http://www.picaxe.orconhosting.net.nz/txrx433.jpg or => http://www.picaxe.orconhosting.net.nz/all3.jpg

If your application is more ambitious then consider 2nd generation 433 offerings, with the HopeRF HM-TR now well established. See =>http://picaxe.orconhosting.net.nz/hoperf.htm. HOWEVER these little darlings, which generally perform brilliantly, can also be a real teaser to tame...
-----------------------------------------------------------------------------------------
EXTRA: Update-in light of Tarzan's posting. I've never needed MAX232 with these Jaycar Tx/Rx units when PICAXE driven.
 
Last edited:

asagohan

New Member
Have you tried with other input pins; do they also pull the output low ?
I have just tried it on input 3 and had the same result (I have tried on input 2 before aswell).

I am now using this code :
Code:
Do
serout 2, N2400, ("hello")
SerIn 3, N2400, b0
serout 2, N2400, (b0)
Loop
The "hello" comes out fine. However anything that I type into the terminal of the PICAXE editor doesn't come out. I have also tried it using T2400 but nothing happens.

Are you measuring this pull-down to near 0V on the receiver output, the board input or PICAXE pin; are they all consistent ? It's not unheard of to look at an input pin, see 'nothing', and assume there's no ouput when that output actually connects to somewhere else.
I have measured it everywhere (mostly on the actual receiver). They are all the same when the receiver output is plugged into the picaxe input (around 0.14V). As soon as I unplug the recevier output from the PICAXE input, the voltage on the receiver data out goes up to 4V when I send commands.
 

tarzan

Senior Member
I am now using this code :
Code:
Do
serout 2, N2400, ("hello")
SerIn 3, N2400, b0
serout 2, N2400, (b0)
Loop
The "hello" comes out fine. However anything that I type into the terminal of the PICAXE editor doesn't come out. I have also tried it using T2400 but nothing happens.
I assume that the code that works is the Tx & Rx connected to the axe020 and when you try it with the serial terminal and it does not work you have the Tx connected to the max232. Is this correct. You have to say otherwise people will just be guessing as to what you have done.
 

moxhamj

New Member
As one of the people building wireless devices with picaxes, I'd like to contribute more here but I must confess I really don't understand the schematic nor the problem completely. I certainly second all of manuka's links - indeed I was going to add them myself!

Start with two 08s and a wireless Tx and Rx and copy manuka's breadboard setup exactly.

All this talk of driving things directly from RS232 though - I'm very concerned that a negative voltage might have zapped a pin somewhere - either on a picaxe or on a wireless module. It would explain the odd readings. An input can easily become an output/short if it has been zapped. I wouldn't try to drive anything from the PC for the moment - stick to programming two 08s for the moment and just prove that works. Have you got some 08s or 08Ms lying around?
 

tarzan

Senior Member
All this talk of driving things directly from RS232 though - I'm very concerned that a negative voltage might have zapped a pin somewhere - either on a picaxe or on a wireless module
Dr Acula

Please quote anyone who has said to drive “things” directly from the PC RS232 port other than a max232.

No schematic has been published yet probably the reason for much of the confusion.
 

moxhamj

New Member
Post #18 driving a max232. I presume this is on the same protoboard (unless our poster has two protoboards). It is very easy to get negative volts all through a circuit. Eg if you put -12V into a max232 and don't wire up any other pins. Now all the pins on that chip are going to be negative.

Plus I'm speaking from experience too.

A quick photo of the setup could help a lot here... Post #18 doesn't quite add up anyway - I'm trying to think how you could get 3V out of a max232 with a 20k resistor. Loading the pin with 20k won't drop the volts that much. And in series - well you might measure 3V in series with 20k if you used an old analog multimeter.

I built a perfect circuit once on a protoboard and still managed to zap something with -12V.

Another thing I've found helpful with wireless is to have a number of parts available eg 2 receivers and then you can compare the volts on each. It helps in narrowing down faults.
 
Last edited:

tarzan

Senior Member
Post #18 doesn't quite add up anyway - I'm trying to think how you could get 3V out of a max232 with a 20k resistor.
Post #19
I asked if it was a divider network. Because you are right it doesn’t add up.
Post #18 driving a max232. I presume this is on the same protoboard (unless our poster has two protoboards).
I imagine that he has:
PC – MAX232 – Tx
and separately
Rx – axe020 – PC.
 
Last edited:

asagohan

New Member
Tarzan is correct.
The RS232 cable goes from the computer to the max232 which reduces the voltage to 5v, which then goes through a 20k resistor into the transmitter (here is the cricuit for the transmitter: http://benybee.wordpress.com/2008/01/13/serial-level-converter-rs232-2-ttl-converter/ excluding the 20k resistor and the wireless transmitter). I have hooked the transmitter up to a CRO before (at someone elses house) and it showed 3v between the data and ground pins, which went down to 0 and up again multiple times when a byte was being sent. Next, I hooked up the receiver to the CRO. I'm not sure, but I thought it was at 5V and dropping to 0V when a signal was being sent, but I am not sure now, because it seems to go to 0V as soon as the transmitter is plugged in (on the DIGITAL multimeter) and goes up to 4V when I sent a byte. I didn't bother to check it while it was connected to the PICAXE because everything seemed fine.

On the circuit that I just tried before with the code, I had connected the ground of the picaxe to the ground of the transmitter circuit so I could receive what the picaxe is sending back directly from the serial cable (i.e the data from the picaxe is not going through the MAX232) because I don't have a transmitter/receiver from the PICAXE to the computer.

I don't have any other PICAXEs to try this with at the moment, and I don't have a breadboard either. I do have another receiver and it is doing the same thing.

It looks like this is not as simple as I thought to find the problem. I might hook it up to the CRO again with it connected to the PICAXE and see what happens. This might take a while. Sorry to trouble everyone with this.
 
Last edited:

moxhamj

New Member
Ah, ok. So what is the 20k resistor for? Was that part of a circuit somewhere?

The max232 should output 5V when resting and go to 0V when transmitting though you won't measure 0V - you might measure 1V or 4V depending on what sort of bytes are going through. You can try sending a string of binary 0's and then a string of binary 255s.

But most radio transmitters prefer to be resting at 0V and the signal is 5V. So you would need an inverter after the max232 if you are driving directly from the PC. Eg a spare gate from a 74HC04.

If you have a HC04 on hand then great. If not and you have to get one from the shop, maybe get the picaxe 08s as well or instead.

Or - you could go PC=>max232=>picaxe=>radio transmitter.

Then you can do the logic inversion on the picaxe - ie it comes in with True polarity (resting=5V) but goes out with N polarity (resting=0V).
 
Last edited:

asagohan

New Member
Yeah the MAX232 outputs 5V. I added the resistor because the datasheet for the transmitter says that the maximum modulation and supply voltage is 3.25V and typically is 3V. The 20k resistor is between the data out from the MAX232 and the transmitter data out.

If I just get a PIC chip, is it the same as getting a PICAXE? I will still be able to program it just like my current one right? And do I need to get an 08, or can I get another 28X1?

I just had an idea. I could just hook up the transmitter to the PICAXE output and the receiver to the PICAXE input and another PICAXE output to the computer serial cable input and get the PICAXE to transmit bytes and see if I can get a signal like that at least. What do you think?
 
Last edited:

moxhamj

New Member
Ah, if it is for voltage dropping then it does depend on the source impedence of the transmitter. Say the transmitter had an impedence of 20k, well then with your 20k the input would be 5V/2 or 2.5V. But if the impedence was 1meg, then if you put 5V through a 20k resistor then you are putting almost 5V still into the transmitter. If the data sheet said 20k then use that because they will have worked that out based on the source impedence.

You can play it really safe with a voltage divider - say max232=>2.2k=>3.3k=>gnd and pick off the volts between the 2k2 and 3k3 which will be ok for the transmitter.

A pic chip is not the same as a picaxe. A picaxe is pre-programmed with the clever little program that lets you download software. If you go for just a pic, be prepared to have to learn machine code!

Transmitter to picaxe output and receiver to input? That would work with different picaxes. But not with the same one, because you can't do a Serin during a Serout.
 

asagohan

New Member
Transmitter to picaxe output and receiver to input? That would work with different picaxes. But not with the same one, because you can't do a Serin during a Serout.
But I can do a serin then pause for a few seconds before doing a serout cant I?
 

moxhamj

New Member
Sure. Maybe I misunderstood, I thought you were trying to send a message from a picaxe to itself?

..."another PICAXE output" - does that mean another picaxe output on the same chip or another picaxe output on another chip?

I cut my teeth on radio comms with picaxes using manuka's excellent demos. Simple code and small (cheap) chips where it doesn't matter if you fry a few. And when things don't work, you can drop in another chip to help isolate the problem. I bought a batch of 10 08Ms and thought that was overkill, and then two weeks later I was buying a batch of 20.
 

manuka

Senior Member
Dr_A: Thanks for that kind feedback!

Just for the record,in my 6+ years spent personally working with PICAXEs (08-40) & also supervising 100s-1000s of students, I have not experienced a single dead PICAXE. A large part of this pleasing success is (I'm sure) due to careful initial breadboarding- problems with PCB versions are almost always due to soldering woes I find.
 

tarzan

Senior Member
I tried an experiment today.

08M =>Tx (Any Picaxe will do that will run off two AA batteries.)

Code:
            for b0 = "0" to "9"
            pause 500
            serout 0,n2400,(b0)
            next b0
and

Rx =>4009(inverter)=>MAX232=>PC

Receive the data on your PC running the Serial Terminal within the Programming Editor.

This works.
 

westaust55

Moderator
The golden rule with 433MHz wireless datacomms is to START SIMPLY. IMHO your present setup looks a fault finding overkill, & I'd STRONGLY recommend revamping it with a 08M or 18X to help iron out bugs.

Wireless data hassles can certainly develop, & supply voltages to those Jaycar units are just one of the issues -Rx must be 5V ±½V, but Tx can be as low as 3V. For some years their data sheets incorrectly listed this...
If the 5V +/-0.25V (from datasheet) for the Jaycar 433MHz receiver modules seems tight, then for the the Altronics 433MHz modules units the receiver voltage tolerance at 5V +/-0.1V is even tigher.

The transmitter modules can use a voltage in the range 3V to 12V.

http://www.altronics.com.au/index.asp?area=item&id=Z6900

http://www.altronics.com.au/index.asp?area=item&id=Z6905
 

asagohan

New Member
If I take out the picaxe from the socket, then measure if the signal is getting to the leg of the socket from the wireless receiver, I get a voltage. However once the picaxe is plugged back in, the voltage at the leg is 0.14V. So it seems that whatever is causing the voltage to drop is inside the picaxe. Does anybody know about this?
 

hippy

Ex-Staff (retired)
@ asagohan : Which PICAXE leg are you connecting to, on which PICAXE type ? Do you have a circuit diagram we can look at ?

Also, what voltage do you get before plugging the PICAE in ? Is the PICAXE powered when it pulls it to 0.14V ? It sounds to me like you have connected the receiver output to a PICAXE output pin.
 
Top