connecting pyboard to CAN BUS

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.
User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: connecting pyboard to CAN BUS

Post by kamikaze » Mon Oct 31, 2016 9:39 am

Roberthh wrote:The CAN bus uses a diffferential signal. Given that, connecting the GND of PyBoard to the GND of the car is not mandatory, but it might help in case of noise & spikes. If you power PyBoard from the car's power network, then a common GND can be assumed anyhow. Us proper twisted & shielded cables, unless tehse are very short.
but wouldn't it there be a problem in that PyBoard has 3.3V and OBD2(car) has 12V ?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: connecting pyboard to CAN BUS

Post by Roberthh » Mon Oct 31, 2016 9:45 am

You're just connecting the GND lines, to avoid high potential differences between the data lines and GND due to floating potentials. Of yourse you cannot supply PyBoard directly from the car's supply, which is something between <10V and 14.4V, depending on the state of the car (starting engine, running, etc..). You would always need a proper supply circuit. I would ne even connect Vin on Pyboard directly to the car's supply w/o a LC filter.

Lysenko
Posts: 62
Joined: Wed Aug 17, 2016 1:21 pm

Re: connecting pyboard to CAN BUS

Post by Lysenko » Mon Oct 31, 2016 9:55 am

kamikaze wrote: but wouldn't it there be a problem in that PyBoard has 3.3V and OBD2(car) has 12V ?
If you don't want to mess around with "electrics" directly you might find something like this:

https://www.olimex.com/Products/Power/DCDC6-16-TO5/

... easier. It's MP14820S based. Similar to the TI part you mentioned but generic in a Anadin vs. Aspirin sense.

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: connecting pyboard to CAN BUS

Post by kamikaze » Mon Oct 31, 2016 10:52 am

Lysenko wrote:
kamikaze wrote: but wouldn't it there be a problem in that PyBoard has 3.3V and OBD2(car) has 12V ?
If you don't want to mess around with "electrics" directly you might find something like this:

https://www.olimex.com/Products/Power/DCDC6-16-TO5/

... easier. It's MP14820S based. Similar to the TI part you mentioned but generic in a Anadin vs. Aspirin sense.
Thanks, but the main idea is to minimize CAN "shield", so it looks like I will make such regulator on-board. Also MP14820S is not capable to output 3.3V as I see it. I'm going to output 3.3V which will be sent directly to PyBoard`s V+ (or VBAT? which one?)

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: connecting pyboard to CAN BUS

Post by Roberthh » Mon Oct 31, 2016 11:10 am

You must not connect any external power supply to Pyboard 3.3V pins. These are outputs. The input is Vin/V+.
PyBoard's V+ (called Vin at Pyboard 1.0) can deal with 3.6 .. 16V, unless you draw too much (>80 mA) current, at which point it overheats at 14V. So in principle you can connect it to the car's Power, assuming a 12V net. The problem are spikes and noise on the card power supply. So you should add some passive filters, something like this:

Image

Only that I would put the Zener diode behind the FR102 and add a fuse. You can buy this ready made. Just look for power filter car audio. What helps for car audion, helps here too.

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

Re: connecting pyboard to CAN BUS

Post by dhylands » Mon Oct 31, 2016 2:56 pm

Using a switching regulator to get the 12V down to 5V would reduce the wasted heat. Something like:
https://www.pololu.com/product/2843
or an adjustable version:
https://www.pololu.com/product/2103

You probably also want the filtering circuitry in @roberthh's post

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: connecting pyboard to CAN BUS

Post by kamikaze » Tue Nov 01, 2016 2:51 pm

Roberthh wrote:FR102
is SBYV27-100 part will be simillar/better than FR102?

User avatar
Roberthh
Posts: 3667
Joined: Sat May 09, 2015 4:13 pm
Location: Rhineland, Europe

Re: connecting pyboard to CAN BUS

Post by Roberthh » Tue Nov 01, 2016 3:02 pm

You can use that part. It's major purpose is to protect against reverse polarity.

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: connecting pyboard to CAN BUS

Post by kamikaze » Thu Nov 03, 2016 1:06 am

Created my third version (actually second) of CAN bus transceiver PCB. Soldered it with a solder paste in owen... let's hope I haven't burn the TCAN337GDR chip :roll: will test it soon. If it works fine then I'll try to create a real shield for PyBoard that will actually contain a voltage regulation stuff and 2 CAN bus transceivers. So it will be possible to connect it to car`s OBD2 port directly. What do you think - is it a better idea to create 2 separate halves (so they could be used together or as a separate parts) - one for CAN and one for 12V to 5V regulation ?

Image

User avatar
kamikaze
Posts: 154
Joined: Tue Aug 16, 2016 10:10 am
Location: Latvia
Contact:

Re: connecting pyboard to CAN BUS

Post by kamikaze » Mon Nov 07, 2016 1:31 am

ok. It didn't work for some time... thought that I've burned ICs in owen... but the real reason was one wire that wasn't completely connected, doh )

DEMO

My tiny test suite

Post Reply