Converting Arduino Nano Chinese Clone to 3.3V

Go To Last Post
16 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With all the rage (https://www.avrfreaks.net/forum/a...) and epic farts (https://www.avrfreaks.net/forum/m...) about the Arduino Nano clones, here is what I have been upto this weekend.

 

I had a few of these clones (http://www.minikits.com.au/nano-... but from aliexpress) lying around and I wanted to convert them to 3.3V, as I had the ones with the CH340g USB to Serial IC, whose schematics etc are scarce, but from hackaday I found the proper diagrams (http://hackaday.com/2014/12/02/f...) - but no schematic of the arduino nano, I had to play with the multimeter a bit and find out where the power traces were going, this is what I got

Arduino Nano power rail - crudely drawn and simplified schematic

 

yes I forgot to draw the GND connection on the LM1117 5

 

So I replaced the LM1117 5.0 with the same pinout LM1117 3.3, and removing the diode from the PCB, I added a little jumper wire and ended up something like this

Arduino Nano HACKED to 3.3V power rail - crudely drawn and simplified schematic

Again forgot the GNd connection, also i had to connect the pin 4 and pin 19 of the CH340G Ic

 

I also tried then to follow this tutorial here: http://www.ba0sh1.com/tutorial-3... to change the bootloader so that it divides the 16MHz clock by 2 and I get a clock of 8MHz as the datasheet mentions cant run at 16MHz at 3.3v supply BUT, i was unable to program the bootloader, something about no response from the Nano, but then i tried it with the IDE and it is still working..>! i thought okay, the specs in the datasheet must be light about the limits, but I really do need to make it work at 8MHz as I cannot rely on this, though I tested the serial, it is still working...

 

 

Also, what will happen if I connect a Li-ion battery, the small mobile ones, (rated at 3.7V but can go to 4 something volts on full charge) tot he VIN pin - I am assuming the Regulator will work, but the problem case I need to ask about is what will happen if I have the USB port connected also and also the battery (dont want any explosions..)

so the battery and USB issue and also why cant I program the bootloader..?? any ideas..?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Shirley,   you just put a diode in the Vin line.    Then the Lithium battery cannot back feed into the USB and vice-versa.    Use a low-voltage-drop diode.

 

The bootloader will be the same for 3.3V and 5V.    i.e. it will assume a 16MHz crystal.

 

Yes,    I know that you should run at 8MHz.    Believe me,   it will work fine at 16MHz and 3.3V

 

If you do want to change the bootloader,    just connect in the usual way.    (obviously with a 3.3V capable programmer e.g. Chinese USBASP set to 3.3V)

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:

Shirley,   you just put a diode in the Vin line.    Then the Lithium battery cannot back feed into the USB and vice-versa.    Use a low-voltage-drop diode.

yes, the diode is a low-voltage-drop one, I used the same one which was there in the actual Nano board.

 

david.prentice wrote:

Yes,    I know that you should run at 8MHz.    Believe me,   it will work fine at 16MHz and 3.3V

Okay then.... believing you...!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I am planning on using ESP8266 wifi module and other modules most of which are 3.3v compliant and I was tired of always needing to use level converters and etc in between... burned a few modules too this way.. :)

Am glad so much that ATMega328p works at 16MHz even at 3.3V

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It is not official.    The data sheet limits you to about 12MHz @ 3.3V

 

So I would not go producing 10000 units that rely on unsupported clock speed.    But it is fine for hobbyist use.

 

Yes,   life is much easier with everything running at 3.3V.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what about 100 to 500 units...?

I have some plans for making a couple 100 modules with such 3.3V nanos on them.

As any solution I design which has an AVR and USb-to-Serial chip etc is more expensive then when i design a small board and put a Nano on top of it.

 

So I am going with a 5x5cm PCB from Seeed with headers to put a Nano on top of it and add headers for battery chargers, h-bridge and a few more things.. all these are modules on top or bottom of a PCB, buying the individual ICs and then making a special PCB is more expensive for me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

so i was planning to use the same approach as this guy: http://www.ba0sh1.com/tutorial-3...

Assuming I dont change the crystal and keep it at 16MHz

 

So the other way is modify the Arduino bootloader, configure CLKPR register to divide the clock by 2. To do this, follow the steps below:

  1. Go to “c:\arduino-1.0.3\hardware\arduino\bootloaders\”, make a copy of “atmega” folder, I name my new folder “atmegad2″
  2. Inside “atmegad2″, edit “ATmegaBOOT_168.c”, look for the main() function and add the following
uint16_t w;
 
#ifdef CLKDIV2
// Disable interrupts
ch = SREG;
cli();
// Enable clock change
CLKPR = _BV(CLKPCE);
// Change clock division
CLKPR = 0x1;
// Enough time for new clock to be stable?
asm volatile(
  "nop \n\t"
  "nop \n\t"
  "nop \n\t"
  "nop \n\t"
);
SREG = ch;
#endif
 
#ifdef WATCHDOG_MODS
...

then re-compile it with a new target in makefile

atmega328_pro16div2: TARGET = atmega328_pro_16MHz_Div2
atmega328_pro16div2: MCU_TARGET = atmega328p
atmega328_pro16div2: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 -DDOUBLE_SPEED -DCLKDIV2
atmega328_pro16div2: AVR_FREQ = 8000000L
atmega328_pro16div2: LDSECTION  = --section-start=.text=0x7800
atmega328_pro16div2: $(PROGRAM)_atmega328_pro_16MHzDiv2.hex

Since I dont have windows, I tried to simply compile it but was having problems with the AVR-GCC on my linux machine not being the same as that used to compile arduino bootloaders. Then after replacing a couple of lines regarding the EEPROM related register name I was able to compile it.

 

Now I have the hex file, I used another Nano, not modified, uploaded the Arduino ISP on it and was trying to use it to program the bootloader but it didn't... I even tried it both ways, powering the target at 3.3v and at 5V but was getting no reply errors from Arduino IDE.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You take your own risk.    If all the AVRs in a batch are exactly at the limit of the spec,   you could have to replace 500 units in the field.

 

OTOH,   if you test the modules before you sell them,   you should be fairly safe.    If you find a batch that is only capable of 12MHz,   you will have to use them elsewhere.     The cost of quality control in your factory is a lot cheaper than having to replace an item in the field.    Especially if it is only a $5 item and you have to pay $1000 for the field engineer's travel expenses.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

here, where I am, Pakistan, the exchange rate is a simple multiplication of USD by 100 to get our currency and 1000$ for even a months salary is a dream many still dream... and since am a recently graduated engineer, getting <500$/month and trying to design something, the main cost is time and cost and for now, my costs are at max 15$ or 20$ / board with battery, charger, h-bridges, Nano, cable, some sensors and a couple other things.

 

I will be testing before selling, but best if I can program the bootloader to divide the clock and run everything at 8MHz - I will try to reprogram my Nano again later tonight...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ebay and "Nano-compatible" is a minefield.

 

Some have no USB->TTL chip

Some use counterfeit FTDI

Some use CH340

Some use PL2303

Some use Silabs

...

 

As a silly question.    How easy is it for you to buy small quantities on "Nano" from China?

Or just to buy a single USBASP ?

 

As far as I can see,   you have the same currency conversion.

You have a postal service.

You may have to pay import duties on small packets.

 

In the UK,   packets with small value do not incur any tax or duty.

 

It looks as if 5V Nanos are cheaper than 3.3V Nanos on Ebay.

And Pro-Minis are ridiculously cheap.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

well, I can easily get like 10 Nanos from China, all having the same CH340 IC and cable in about 32$

As for other things, the seller has been sending me stuff which works and it is tried and tested, I will be importing in small quantities at start so no duties here either, shipping is free if I wait for like a month to receive my stuff, which I why I usually order stuff a month in advance.

 

The Pro Minis dont have the USB-Serial IC and hence I cannot readily use them and a ProMini and a Serial Adapter cost more than a Nano with cable - after much thaough and experimentation I have selected the sellers and stuff from aliexpress and now I need to change the stuff to work at 3.3V

 

Hence this post... :)

Thanks for the interest and the answers though... (Y)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Ah-ha.    So you have no real problems with buying stuff on AliExpress or Ebay.     Yes,   it takes 9-45 days for stuff to arrive in the UK too.

 

I know that Pakistan is a completely different country to India.

Do Indians have difficulty buying on Aliexpress or Ebay?

 

There seems to be a very big commercial / hobbyist market in India.    e.g. load of shops,   small manufacturers,  big manufacturers, ...

 

We get asked questions about these products.    But from outside India, we don't know anything about them.

I presume that you could buy products and components from Pakistan, India, China, Thailand, ...

So you have a pretty good idea of the pros and cons.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

buying stuff from online vendors is still not a norm here and until about a year or 2 back the Arduino etc were not very common here, we even made a USBaspLoader board locally, called it Ejaaduino (http://ejaad.com.pk/ejaaduino/) and sold about 100 of those...

 

India, I think has a completely different scenario of hackers... we even buy stuff from there, the Numato shop has some quite good boards of PIC and FPGA and cheap rates

 

As for buying from aliexpress, once you have tested a vendor a few times and the ones who have great stores and feedback, their stuff is good and works, not once have I had problems with the stuff, but they do try to MARKET in a way which is a play on words... like they would say Arduino Uno + cable, price 3 per item, but then you will see that they count the Uno as 1 item and the cable ass the other item... some buy it thinking they would get 2 Unos...

 

Now even locally some shops have started stocking stuff from aliexpress and other vendors so now we can get stuff locally too, just at a higher price.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes,   Aliexpress has lots of tricks like that.    It gets a vendor to the top of a list.

There are similar tricks on Ebay.     You just have to read carefully.

 

Yes,   there are hobbyist UK mail-order companies that buy their stock cheap from China and deliver next day in the UK.

If you want it immediately,   you have to pay a higher price.

 

As far as I can see,   this would be a good business model for any shop in any country.

 

The price of Arduino-related clone boards and shields has fallen dramatically in the last few years.    I would be happier if they did not use counterfeit components.

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Go ahead and replace the AMS1117 5.0V IC with an  AMS1117 3.3V IC.   Don't remove any diodes or change any other circuitry on the Nano.   When the Nano is powered by USB the +5V on VUSB will cross the Schottky diode barrier and still be high enough for the AMS1117 3.3V low-dropout regulator.  If you power the Nano using V-in, the Schottky diode will keep the V-in voltage (greater than +5V) from going into VUSB.  The USB serial connection will still work fine.

 

Test each Nano for running at 16MHz at 3.3V for several hours.  If any fail, then don't ship them.  Offer a longer guarantee than Apple does (more than 90 days).  The crystal on the Arduino is too small to fool around with.   It's better to simply replace units that fail (with a smile and free shipping) than it is to ship units that have ugly rework wires on the board fixing something that isn't broken, but is out of spec and MIGHT go wrong. 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

that would work too, just replacing the LM1117 5 with LM1117 3.3 but I am attaching circuitry with the nano which will blow up at 5V, the ESP8266 and other stuff... so I cannot afford to JUST change the regulator, cause when the USB port is plugged in, everything will go back to to 5V...

But yeah, I will see if I can manage that, cause that is easier and better and yes, no one likes wires on a board.