Electronics > Electronics

50$ robot rc signal processing

(1/2) > >>

redloff:
Hello everybody,

I've made 50$ robot and even managed to implement a push button interrupt handling to switch between different modes.
Additionally I scrapped a RC receiver from a toy car and soldered connectors where appropriate, so I could hook up receiver to any port on uC.

I have also tested that while playing with knobs on the transmitter I get either -4 or +4 Volts on the receiver (receiver has of course two output lines - forward/backward and left/right).

Now I would like to do something more than just hook up RC receiver directly to servos, as they are already nicely handled with PWM outputs.
What I would like to achieve is to detect this +/- 4V signal on two different input ports of the uC and handle those events with software.
Unfortunately I don't know where to connect and how to handle them. Should it be a standard input port or rather a2d?
Do I need to build any additional IC?

I will greatly appreciate any support  8)

Soeren:
Hi,



--- Quote from: redloff on October 04, 2012, 04:17:23 PM ---I have also tested that while playing with knobs on the transmitter I get either -4 or +4 Volts on the receiver (receiver has of course two output lines - forward/backward and left/right).
[...] What I would like to achieve is to detect this +/- 4V signal on two different input ports of the uC and handle those events with software.

--- End quote ---
With 3 resistors you could turn each of the +/-4V signal into eg. 1.5V (-4Vin), 2.5V (0Vin) and 3.5V (+4Vin) to feed into an A/D-C line (2 in total of course).

             o +5V
             |
            |R| 10k
             |
In o--[20k]--+--o Out
             |
            |R| 20k
             |
             / (gnd/0V)


With more external hardware, you could turn each channel into two digital signals (01, 00 and 10), which the controller can read faster and with a bit less programming, but at the cost of two I/O lines.

waltr:
Detect or measure the voltage?
Comparator input to detect, ADC input to measure analog voltage.

Warning: most digital devices (AtMega) do not like negative voltages. -4 volt to your processor can kill it. You need to have a circuit to prevents the negative voltage. Depending on exactly what you want to use this signal for will determine the circuit.
The circuit could be a diode and a resistor or a few Op-amps.

Lets us know what you want.

Edit: Soeren posted as I typed. His circuit is simple and safe.

redloff:
Thank you very much for the IC and a tip about negative voltages (I already experimeted with it but fortunately didn't burn anything).
The approach Soeren suggested is exactly what I would like to achieve.

Soeren: i understand +5V, GND and Out have to be plugged to the uC as +5V, GND and signal pins respectively, but what is "In" exactly? From the receiver I have two wires commig out, where should I connect the other one?
I'm sorry, I know this is an extremely lame question but IC schematics simply scare me (especially the open ones :))
I would also greatly appreciate any good and complete noob tutorial on understanding schematics, to be able to read things like you've posted and in future maybe even understand how they work  :D

One more question: isn't the receiver sending pwm signal to the uC?
If so, then I can imagine that handling the uC pin's high state interrupt wouldn't be enough to have a fluent speed control.
If the receiver is sending pulse signals, then servo movement would be rather jumpy, am I right?

Soeren:
Hi,


--- Quote from: redloff on October 05, 2012, 11:50:22 AM ---Soeren: i understand +5V, GND and Out have to be plugged to the uC as +5V, GND and signal pins respectively, but what is "In" exactly? From the receiver I have two wires commig out, where should I connect the other one?

--- End quote ---
Yes, it's the "hot" wire from the receiver, the other wire from the receiver is connected to ground (make sure that it IS the ground wire that you ground, especially if you power the receiver from the same power source as the logic.



--- Quote from: redloff on October 05, 2012, 11:50:22 AM ---I'm sorry, I know this is an extremely lame question but IC schematics simply scare me (especially the open ones :))

--- End quote ---
There's not an IC in sight!?
(IC is an acronym for Integrated Circuit).



--- Quote from: redloff on October 05, 2012, 11:50:22 AM ---I would also greatly appreciate any good and complete noob tutorial on understanding schematics, to be able to read things like you've posted and in future maybe even understand how they work  :D

--- End quote ---
I doubt that you can find anything really complete, but Google is your friend :)

Understanding a schematic sorta takes an understanding of how they work ;)



--- Quote from: redloff on October 05, 2012, 11:50:22 AM ---One more question: isn't the receiver sending pwm signal to the uC?
If so, then I can imagine that handling the uC pin's high state interrupt wouldn't be enough to have a fluent speed control.
If the receiver is sending pulse signals, then servo movement would be rather jumpy, am I right?

--- End quote ---
A standard receiver is sending PDM (Pulse Duration Modulation) signals, with a pulse duration of between 1ms and 2ms (some may overstep this standard though and duration may be as short as ~0.3ms to as high as ~2.8ms).
These pulses are repeated roughly at 50Hz (each 20ms).
Your task in software is to measure the durstion of this pulse

When you write about +/-4V, you have something besides the receiver added and only you can measure what signals it send.

Are you able to get eg. 1..2V out of the receiver, or is it only -4V, 0V and +4V?

Navigation

[0] Message Index

[#] Next page

Go to full version