TrexJr control methods

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Post Reply
Mr.Nordheim
Posts: 14
Joined: Wed May 07, 2014 7:32 pm
Location: Norway

TrexJr control methods

Post by Mr.Nordheim » Sat Jun 21, 2014 10:04 am

Hi.

I'm very new to this world of micro controllers, embedded communication protocols and programming. I'm going head first, in deep water (if that's a saying) and started with buying the pyb and some stuff from pololu.

One of the items is the TrexJr http://www.pololu.com/docs/0J5/all, this can from my understanding be controlled with either servo (pwm), analog, rs232 (-12v - 12v) and logic level serial(?).

Can I use the logic level serial on the pyb? been looking for some documentation regarding this on the pyb, but now I'm just taking turn round myself... :oops:

Edit: Its typical, right after I posted this I found out about UART https://www.sparkfun.com/tutorials/215 and as far as I can see, it's the way to go (I want to keep servo connections on pyb and Trex free for rc and servos later on)

Feel free to come with tips and confirmations, I'll really appreciate it.

User avatar
dhylands
Posts: 3066
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: TrexJr control methods

Post by dhylands » Mon Jun 23, 2014 1:22 am

Using the logic-level interface seems like it should work fine.

Use the bottom hookup from here: http://www.pololu.com/picture/view/0J346.

The green wire will be at 5v, but the Rx pin on the micropython board is 5v tolerant, so that should be fine.
The orange wire will be the Tx line from the micropython board and will be at 3.3v. Many 5V devices will treat 3.3v as a logic high, so you may be able to connect it directly. If you see lots of errors, then you'll want to consider putting a voltage converter in place.

Mr.Nordheim
Posts: 14
Joined: Wed May 07, 2014 7:32 pm
Location: Norway

Re: TrexJr control methods

Post by Mr.Nordheim » Tue Jul 01, 2014 9:16 pm

dhylands wrote:Using the logic-level interface seems like it should work fine.

Use the bottom hookup from here: http://www.pololu.com/picture/view/0J346.

The green wire will be at 5v, but the Rx pin on the micropython board is 5v tolerant, so that should be fine.
The orange wire will be the Tx line from the micropython board and will be at 3.3v. Many 5V devices will treat 3.3v as a logic high, so you may be able to connect it directly. If you see lots of errors, then you'll want to consider putting a voltage converter in place.
Thanx for clearing up the 5V tolerance. It has been lurking on the back of my mind for quite some time.

Regarding the trex seeing 3.3v as high, a single npn mosfet might do the job, or some 74xx buffer. Sorry I'm a bit rusty on electronics.

And I really appreciate the reply!

User avatar
dhylands
Posts: 3066
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: TrexJr control methods

Post by dhylands » Tue Jul 01, 2014 9:45 pm

There are lots of voltage conversion solutions available these days.

https://www.sparkfun.com/products/11771
https://www.sparkfun.com/products/12009
https://www.sparkfun.com/products/11955 (designed for I2C)

http://www.adafruit.com/products/395
http://www.adafruit.com/products/757
http://www.adafruit.com/products/1875
http://www.adafruit.com/products/395

http://www.pololu.com/product/2595

These are some of the popular ones. Using a transistor like you suggest will also work (although its unidirectional)

Mr.Nordheim
Posts: 14
Joined: Wed May 07, 2014 7:32 pm
Location: Norway

Re: TrexJr control methods

Post by Mr.Nordheim » Tue Jul 01, 2014 10:17 pm

And again. Thank you Dave.

nobody told me bout these back on school... guess I have some module browsing to do =)

Post Reply