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.
Responding to your update: If you are going full steam ahead with the line follower the take the advice of our fearless leader Frits with his Amander LDR. Make the most of your analog inputs by taking two readings. One with the LED on to get ambient light plus reflected light and then again with the LED off to get the ambient light. If you also want to measure the reflectiveness of the floor surface then you may also want to take a reading with the LED PWM at 50%. In this case I would use an RC filter to convert PWM to a true analog output which then drives a transistor so that the load of the LED does not affect the analog output. By looking at the difference between 100% and 50% brightness you can determine the reflectiveness of the floor which might change as you go from carpet to tiles etc. By using a combination of surface reflectiveness and ambient light readings your code should be able to track a line over different surfaces. I'm not saying, I'm just saying!

That is a great tutorial.

Oh, there is an update for you guys as well.

How many sensors should you use? Find out below:

Best Line Following Guide out there: http://www.wrighthobbies.net/guides/linefollower.htm


That is one cool guide!

While we are overkilling our sensor boards with dedicated brainlets, here's a suggestion.

Give it a specialized program that will give you more than one bit or one byte per sensor (whatever the number of sensors). Let it spit out actual information about relative position of the bot over the line. Make it a line navigator. It could spit out relative error values. Make it learn the width of the line. Make it go berserk when it detects multiple lines. Make it auto-detect contrast and black-on-white vs white-on-black lines. Make it versatile in accepting/detectng any number of attached QRD's (within reason).

But most of all: make it a continuous feedback machine. Make it spit out a voltage indicating off-centerness. Have the main brain read that voltage using its own ADC: the ultimate in universal data communications! And as a bonus: no waiting time. Read the error value as often as your super-brain is capable off.

You could even off-load your entire PID control to the brainlet. But now you're just bragging!

Chris Chris Chris... Why do you need 6 Sensors if this is a noobie beginner robot? Why not 3?

I re-read your post. I came into a similar situation recently with my own line follower. I started out using ADC for the output of 3 LDRs. The 256 shades of gray (literally) that I got were overkill for something as basic as high contrast line following. All you really need is a 1 bit digital response from each sensor. "Is there white (1) or black (0) beneath me?", the sensor should ask itself. I was about to redo my line following board to add some comparators in the circuit that would enable me to send the output of the LDRs straight to digital pins, thus freeing up the ADC ones. Then Ignoblegnome suggested that I keep the board as is and incorporate the comparating function into the code. And I did. As an example: if the value coming from a LDR is <185, I read it as zero. If it is =>186, I read it as one. I have kept that solution and it is working. I am not about to consider it done. There are other problems that I need to address. But I am happy with the processing of the sensors´ output.

Besides, if you have 8 sensors it´ll work even better. If I can get away with it, with only 3, you most certainly can.


Digital input from a QRD1114 is simple and still effective, I have opted not to use ADCs in the past with good results... http://letsmakerobots.com/node/22452

I would have to agree and would go with something like this.

After a quick search on the site it turned out several chips.
Amongst others there are the MAX11616 (12 bit, 12 channels and price $4.19) and the MAX11614 (12 bit, 8 channels and price $2.95).
Specs: http://www.maxim-ic.com/datasheet/index.mvp/id/6110