Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 10 of 10

Thread: Need help from Arduino MEGA to Teensy

  1. #1

    Need help from Arduino MEGA to Teensy

    Hi guys,
    I've implemented a board based on Arduino MEGA with a microSD car reader, a CAN bus module MCP2515, an analog input signal 0-5V, some LEDs a button etc...

    Now I'd like to re-engineer the board to make it smaller and more powerfull.... I've just seen the Teensy board and I'm thinking to use the v3.2 board with a microSD module (can you point me to a good/simple module?) will that solution cover all the requirements desribed befoer?
    The main requirement are:
    - more powerfull and more RAM than Arduino MEGA
    - simple to use connected to a CAN bus of motorbike (500Kbps) to ask and receive ODBII messages (i need RPM, TPS and ECT at least and as much real time as possible)
    - possibility to read and write from a microSD
    - acuire an analog signal 0-5V

    What about the v3.5 or v3.6?

    Can you help me choose the best Teensy board?

    What about the already implemented and tested Arduino SW? How can I port it to Teensy in th ebest way?
    I'm using sdFat library for the microSD module and coryjfowler MCP_CAN_lib for the CAN module


  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Teensy 3.5 might be simpler, since it's got the SD card socket built in.

    Most code and libs for Arduino "just work". The best way to check is to install Teensyduino, then just switch to Teensy 3.5 in Arduino's Tools > Boards menu, and click Verify.

    The one sticking point is going to be the analog input range. The ADC inputs are 0 to 3.3V. If you have 0 to 5V signals, you'll need to use resistor dividers or other ways to convert them to the 3.3V range.

    Teensy 3.x boards also have a higher performance CAN peripheral built in. But the libs aren't exactly the same, so you may need to do some programming work to switch. You'll still need to add the 8 pin transceiver chip, but the built-in CAN eliminates the need for an external CAN controller chip.

  3. #3
    Thanks for fast response!

    Looking to this specs page it seems to me that only the 3.6 has input signa 0-3.3V, the 3.2 and 3.5 support 0-5V or am I wrong?

    Auch! I was expected to do all the stuff with no external module but if I understood the CAN will need external component, correct?
    Now I'm using MCP2515 moduel for Arduino.... what would be the best and simple solution for the Teensy board?
    Is there any example project I can look?


  4. #4
    Senior Member+ defragster's Avatar
    Join Date
    Feb 2015
    Yes, T_3.6 I/O are all 3.3V max. T_3.5 is 3.3V on non-Digital Pins - analog only pins - and all signals - are still limited to 3.3V as MAX value.
    Yes, CAN takes an external transceiver for wire signals.
    I was just pointed to these modules: - they were some of the ones used in testing on other CAN threads for T_3.x library. Others may be linked on those CANBUS threads.

  5. #5
    Thank you so much guys!
    Well... it seems that the best and simple way could be to go for the v3.6 and if I've understood correct I'll just need the CAN transceiver posted by Defragster for all I have to do.
    Forgot the analog signal.... is there any smd module to adapt and acquire an analog signal of 0-5V? Or a simple resistors divider is all I need?

    What about the power supply of the v3.6 board? I'll use it on my motorbike so I'll have +12V (~14.2V while running!?)... If I read well the Teensy wants only +5V as power supply correct?

    I've just ionstalled the Teensyduino and select both Teensy v3.2 and v3.6 and doing "Verify" from the Arduino IDE everything seems ok! whooooo!!!! Gerat!

    What about this great module for the v3.2? Is there a place to buy it?

    Sorry for the many questions but I'm so exited and I definetly have to switch to Teensy!

  6. #6
    Senior Member
    Join Date
    Dec 2016
    Montreal, Canada
    6 volts max for power! If you really want 0-5V range you can get an external ADC (SPI/I2C variant) and allow teensy to read that chip. Teensy 3.6 is 3.3 volt on ALL pins ONLY. If you plan to run 5volt signals, get a Teensy 3.5, it outperforms the MEGA and has tolerance for GPIO at 5v except for the listed pins on the card.

  7. #7
    Hi guys,
    I've just ordered my first Teensy and I've choosed the v3.6 for my board! Can't wait to test it!
    I've also ordered that CAN transceiver:
    Which CAN library do you suggest me to use?

    Can you help me finding a good step down? I'd like to use the +12v (~14.2V) of my motorbike... may I have issue with noise?
    What about this step-down?

    As I'll have to acquire an analog 0-5V signal can you point me to an adapter if exist or is it better to just use couple of resistors?

    Thank you guys!

  8. #8
    Senior Member
    Join Date
    Dec 2016
    Montreal, Canada
    i wouldnt use crappy hobby regulators for vehicles/motorcycles, due to cranking can sometimes reset the mcu, or the fact that some regulators cant handle the fluctuations of vehicle charging system. I recommend the aluminum enclosed epoxy sealed switching psu you can get off ebay, they dont get warm and theyre watertight, voltage never seeps and it can be powered from 8-40 volts, outputs 5v 30 amps, and fits in palm of your hand.

    Click image for larger version. 

Name:	200170-1500x1500.jpg 
Views:	2 
Size:	77.9 KB 
ID:	16560

  9. #9
    Senior Member
    Join Date
    Apr 2017
    @tonton81. can you ellaborate on "cranking" can reset MCU? I have a data logger in an electric go kart and use a simple buck converter to power a Teensy 3.2 It works well, but every once in a while the MCU will restart. Maybe bucks are not the way to go? input voltage is 24 VDC. Here are the bucks i'm using.

    Note I have reverse polarity diodes before the buck on BOTH +24 and GND and 0.1 uf and 220 MFD caps before and after the buck.

  10. #10
    Senior Member
    Join Date
    Dec 2016
    Montreal, Canada
    cranking (starting vehicle) or voltage droops cause the reset. For this type of application you need a voltage stabilizer like the one i posted to you. i ran this with teensy3.5 in my civic for 3 years all seasons...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts