help understanding I2C line follower from robotics connection...?

i am 16 and have to use this I2C line follower board purchased from roboticsconnection.com for a school project... i know it was bought from a completely different company, but i thought you could help me...


i am using the 28X1 chip circut on my robot and im not sure how to connect the sensor bar and to which input... i have connections SDA and SCL but no idea where to attach them on my robot...

help would be greatly appreciated, thanks :)
 

Technical

Technical Support
Staff member
Hi, welcome to the forum.

You need to connect 0V, 5V, SDA and SCL on the sensor bar to the correct pins on the 28X1 (see pinout diagram in the PICAXE manuals where all 4 are labelled).
Then you also need to connect a 4k7 resistor between SDA and 5V and another one between SCL and 5V.

The data on their website is very sparce, but with a good wind behind you you should then be able to read data using this code:

hi2csetup hi2cmaster, $50, i2cbyte, i2cslow

main:
hi2cin (b1)
debug
pause 1000
goto main
 

westaust55

Moderator
Concur with Technical that the website has the most dismal specs and information for that device - it is their own product from what I can gather.
The website does indicate how each sensor acts on one bit of the byte transmitted, so 5 bits change with the base unit.
If you and the two extra 1 sensor modules at each side then 7 bits will be changing.

BUT . . . also spotted this snippet elsewhere:
"according to the website it is written:
The two blue columns on the right represent the two optional GPIO inputs on the side of the Line Follower. If nothing is connected, then their readings will be '0'.
actually when I put the sensor on the white ground it gives me 96 instead of 0, so that means the two optional GPIO inputs on the side of the Line Follower give 1 if they are not connected (unless you connect them to the ground)."
 
Last edited:

westaust55

Moderator
Line Follower connections

Attached are two diagrams which should help you.

As there is no datasheet for the line follower module I do not have the details of the order of the four pins for wires connecting to the line followers. The photos indicate there is text there so cross check the sketch attached with the actual board.

On the PIACXE project board you will need to
1. remove two of the 10 kOhm resistors which pull those two lines to ground (0V line)
2. for the i2c comms bus and instead connect in two 4.7 kOhm resistors from the two i2c signal lines to v1+ (the +5V supply).

You will need a multimeter to identify the two 10k Ohm resistors and un-solder the connections as they are part of the SIL resistor package.
Alternatively , cut the tracks leading up to those leads and bypass with some wire – this will avoid the loose resistor terminals touching the connections again later.
Another option might be to remove the entire SIL resistor pack and install a few discrete/single resistors for inputs that still need pull-down resistors.




while noting that your are 16, a few questions:
- what is your level of electronics experience in general
- which subject is your project for (science, electronics, other)
- how much experience have you had with the PICAXE before
- who chose the PICAXE (nice choice by the way) and
- who chose the line followers (eg you, teacher, other)

Some idea on you experience, etc, can help us better pitch our information at the right level.
 

Attachments

Thanks heaps westaust55, that info is perfect

and to answer your questions,
i have been into electronics for a while now (3/4 years) and have constructed multiple DIY kits from dicksmith and other places,
This project is for my Engineering class which is by far my strongest subject,
as far as my experience with picaxe goes, i havent had much, but i do understand how it works very well...
for engineering class, i had the choice to use either vex, lego or picaxe
i chose picaxe due to its size and its ease of programming (flowcharts).
But my teacher chose to use this specific 28x chip and the line follower bar.


cheers :)
 

westaust55

Moderator
While there are quite a few who come onto this forum and use the flow charting method, ultimately, the vast majority here use BASIC program code due to its greater flexibility and greater set of available commands.

You can still hand / CAD draw in flowcharts and code in BASIC.

Just something to be aware of when you do come to questions on this forum is that fewer here seem to use the flow chart method of programming so answers may take longer to receive.
 
well what i meant was that i like the flowchart method because i understand it and its easier for me, but i also understand fairly well how to use BASIC programming.
cheers. :)
 

freddy2

New Member
Has anyone got this going? I have a Line Wizard V2.0 and have hooked up as per westaus55 diagram on 28X1 project board. Used 5K1 pull up resistors as couldn't find any 4K7

Lights come on and all looks good. I have downloaded the following program.

Code:
#picaxe 28x1
#no_table
' PICAXE-28X1 sample program for Robotics connection Line Wizard 2.0

' Install 2 X i2c pullup resistors - between SCL, SDA and VCC 4.7K each
 
 
 symbol line_pos=b0
 
init:
 'Slave address of line wizard is $50 in standard settings
 'Selectable by software
 hi2csetup i2cmaster, $50, i2cslow, i2cbyte
 
 pause 100
 

 
main:
 ; read values from Line Wizard (address $50)
 hi2cin [$50], $0,(line_pos) 
 
 
 

 ; debug display
 debug b0
 ; wait 1 second then loop
 pause 1000
 goto main
Seems to work fine for around 7-10 polls and then debug stops. I disconnect the power from the line wizard and polling starts again. Power up and works fine for 7-10 polls or so.

LED indicator on wizard shows object being detected but PICaxe not happy.

Any ideas?

p.s. I am in Perth too !!!!
 
Last edited:
Top