Let's Make Robots!

8 ADC inputs Need Slave Chip


It looks like I am going the brain/ multiplexer route here and will make the ultimate line-follow sensor of death. Led's will be off of PWM for brightness control, white/black threasholds will be adjustable and now I have decided that adjustable pull-up resistors would be handy too. I figure that a simple trimmer pot connected to the common of my resistor array would do the trick, but I would not mind some feedback on the issue. I have added a second video with an explaination. Thanks in advance.


**Original Post***

I have been plugging away at my line follow sensor and my related I/O expander issue and have hit a bit of an impasse. My original idea of using a digital I/O expander to keep an eye on all 8 sensors has fallen-through and in hindsight, was probably not the way to go in the first place. As it stands now, I have a simple problem of reading 8 IR sensors via ADC without using 8 pins on the main microcontroller. I simply need a support chip to sit on the line follow board itself and communicate with the main brain. Here are my requirements:

  • Must speak UART serial or preferably I2c
  • Must have a minimum of 6 ADC's preferably 8 --I really want 8
  • Must be smaller than a 28-pin dip (a full-size arduino will not fit --I can use a SMD atmega 328 though)

The main options in my mind are an Arduino 328 or a Picaxe 18m2 (or something else). The arduino, even in SMD form, is a little cheaper than the picaxe but only allows for 6 ADC inputs. There are 8 ADC pins on the SMD version, but I have yet to figure out if I can get a hold of them. Whether I can or I can't, I am still going to loose 2 of them if I want to use the I2C lines (my preference).

The next choice is the Picaxe 18m2 which has a ton of ADC's (more than I need) and is only about $.50 more than the Arduino. This so far, seems to be the option I want to use, but alas, the picaxe has no provisions to become a I2C slave. It can actually, but unfortunately  only to access it's memory functions (when in I2c slave mode, the picaxe becomes a fancy EEPROM really). This puts me back to using UART serial again which I would prefer not to do.

One more: I cannot use any of the MCP320x chips (which would solve all my problems) as they are SPI and the new Picaxe chips don't speak SPI. Arrggg.

At this point, I open the floor...

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

Previously on Junior I used a TLC1543 from Futurlec which gave me 11 channels each with 10bit resolution for $2.90. Admittedly the serial interface is an SPI type interface.

Gareth found a nifty ADC chip for his propeller but I can't remember the number.

If you are going to use the ATmega328 for more than just ADC then great, go for it!

I guess you'd better go with the PIC instead of a dedicated ADC chip, if the 7828/7830 isn't any good... Either way, I'm anxious to see how this board will look/work finished :)

A quick search led me to this: http://docs-europe.electrocomponents.com/webdocs/0c95/0900766b80c9530d.pdf

An 8 ADC to I2C chip... looks to me what you need... 2.5-3 euros, so about $4 ;)

Yup, that is the nightmare chip. I have it, I have tried it, it is just way too complicated to communicate with. I could not imagine the tutorial needed to get a picaxe person through this guy...

Mouser has this guy for $.51 in an SMT version. I think I like this. I tell ya, one of these 4051's, a SMD Atmega 328 and I got myself one fancy (and smart) line-follow board --Not to mention, I get the I2C I wanted.

Nice work, Cliick --Thanks

Hey Chris,

Someone in this site suggested an analogue multiplexer to me some time ago. I can´t remember who it was. Sorry (if you are reading). I pass on the suggestion to you. It was the CD4097B. It has 8 channels and comes in a 24 pin IC package. I can´t remember about I2C, however.

Hope this helps.

PS: Remember to read the datasheet before soldering... (sorry, I couldn´t resist the temptation! :P)


Yup, I have my tiny soldering tip and my flux pen all ready! Some of the SMD parts I ordered are actually starting to come in now. I am getting excited. And yes, I will follow the rules when soldering these guys...  :)


3 digital and one analog pin gives you up to 8 analog inputs. Easy to code, no need to waste a UART.




Maybe --that is a atmega 644 right? --Googling now...

Looks like somewhere around $7 minimum up to around 15 bucks for the chip. Plus, I have to bootload it. Not to mention, that is a TON of chip for such a simple task. Nope. Shucks.