General IOWizard Issues
Navigates to RoboticsConnection.com Home RoboticsConnection.com HomePage
RoboticsConnection User Forum
Home       Members    Calendar    Who's On
Welcome Guest ( Login | Register )
        


««123»»

General IOWizard Issues Expand / Collapse
Author
Message
Posted Tuesday, January 19, 2010 8:28 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Danny,

Nowhere does it say that the IOWizard supports servos...Only the Serializer supports servos. So, you'll never get those to work w/ the IOWizard. LoL

Best Regards,

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1561
Posted Tuesday, January 19, 2010 8:36 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Danny,

One more note, you will want to ignore ADC values returned from the IOWizard for the pins which do not have anything plugged into them.  Those values will 'float' based on adjacent ADC readings, and is a function of the microcontroller.  You will know which pins have sensors plugged into them, so you will know which readings to pay attention to.

NOTE: Each 10bit analog value is returned in two bytes. So, you will have to shift the first (upper) byte by 8, and then add the subsequent (lower) byte to that shifted value to arrive at a 10bit integer value. See the pseudo code below for an example:

Pseudo code:

Int adc;

int value;

adc = i2c_read(1) ;

value = adc << 8;

value += i2c_read(1);

Best Regards,



Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com
Post #1562
Posted Tuesday, January 19, 2010 8:38 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Danny,

When querying the Ambient temp sensor, make sure you convert the values using the formula found on the product page for the Ambient Temp sensor, under the 'Pinout' tab.

     http://www.roboticsconnection.com/p-68-ambient-temperature-sensor-board.aspx

Best Regards,

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1563
Posted Tuesday, January 19, 2010 9:13 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55, Visits: 139
This is the part that is confusing.. you say there are two bytes returning but there are 10 bits..

8 bits per byte - please clarify this...


-Danny

Animusoft
RUG Community
Post #1568
Posted Tuesday, January 19, 2010 9:39 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55, Visits: 139
OK so I think I understand what you are saying. Been playing around with the math to derive this its consistent with the ambient temperature sensor.

Now my question to you is the following - if I have additional sensors - say a PING))) ultrasonic range finder - I am assuming i need to understand how the sensor works and sends commands to it as it expects via I2C.

If this is the case - what do you recommend? Either for the PING))) or the Max EZ Sonars you have on the RC.com site? I have tried finding out more information in regards to these sensors but have no luck finding the information I require.

When I plug in the PING))) sensors I can at least get the LED to turn on and off but I cannot get an accurate reading. or better said I do not understand how to get a reading from it.



-Danny

Animusoft
RUG Community
Post #1569
Posted Tuesday, January 19, 2010 11:12 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55, Visits: 139
Jason,

So I have been trying to get a reading from the PING))) sensor on GPIO 0 of the IOWizard with little resolve. Here is a code snippet I was doing to test this functionality after reading some things from society of robots website about the ping sensor.


using System;
using System.Threading;

namespace ConsoleApplication10
{
class Program
{
static void Main(string[] args)
{
RoboticsConnection.Serializer.Serializer serializer = new RoboticsConnection.Serializer.Serializer();
serializer.BaudRate = 19200;
serializer.PortName = "COM5";
serializer.Units = RoboticsConnection.Serializer.Ids.Units.Metric;

serializer.StartCommunication();

//Make the I/O pin an Output
//Bring LOW the pin that the PING rangefinder is connected
//Bring the pin HIGH for 5 microseconds
//Bring the pin LOW
//Make the I/O pin an Input
//Wait until the pin goes HIGH
//Use a timer to see how much longer it takes for the pin to become LOW
//The time it took to become low is now our raw distance ( in microseconds)
//Divide Raw Distance by two since it includes the time for a return trip of the sonar
//Raw distance * 2257 is our distance in cm
//Raw distance * 889 is our distance in inches

// 0 = output low
// 1 = output high
// 2 = input

RoboticsConnection.Serializer.Sensors.I2CDevice iowizard = new RoboticsConnection.Serializer.Sensors.I2CDevice(serializer);
string result = string.Empty;

result = iowizard.Write(0x64, "1 0 0");
Console.WriteLine(result);

result = iowizard.Write(0x64, "1 0 1");
Console.WriteLine(result);

result = iowizard.Write(0x64, "1 0 0");
Console.WriteLine(result);

result = iowizard.Write(0x64, "1 0 2");
Console.WriteLine(result);

for (int i = 0; i < 100; i++)
{
result = iowizard.Read(0x64, "20");
Console.WriteLine(result);
Thread.Sleep(100);
}

serializer.StopCommunication();
}
}
}



Is there a way to use built in serializer commands such as pping to actually query a sensor on the iowizard or must they be coded by hand like above? I am a bit thrown back if I have to code these all up for each sensor.I imagined that the IOWizard combined with the serializer would have some kind of support for this already built in.

Either way please let me know.

-Danny


-Danny

Animusoft
RUG Community
Post #1570
Posted Thursday, January 21, 2010 10:12 AM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Moderators
Last Login: Wednesday, March 16, 2011 1:17 PM
Posts: 73, Visits: 96
I had to find an IOwizard that would fail when a sharp sensor was plugged into it. Mine works fine so I would say it is a borderline situation. What I believe is happening is that the sharps draw a lot of current when the led on them is pulsed. It averages out to not much, but the pulses must be enough to put noise on the power lines enough to confuse the pic.
However when I added a 1uf cap across power and ground on the iowiz it started acting normally. I tried it at the connector itself, as well as at the programming connector. So if you can solder, you can place a surface mount cap between the Power and ground pins on the bottom of the board, or use a through hole cap an put in in the power and ground holes on the programming header. Any cap 1uf or larger should be ok. Please note that the silkscreen is a little offset so that that labels for the programming holes are off a bit (on older Iowizards).It is the last 2 holes though near the analog port, Ground is the very last hole(nearest the analog port) and Vcc is next to it.
Jason will post a picture later.
I'll add some extra caps in future builds.
Ringo




Ringo Davis
Post #1575
Posted Thursday, January 21, 2010 4:09 PM
Forum Guru

Forum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum GuruForum Guru

Group: Forum Members
Last Login: Monday, December 27, 2010 5:21 PM
Posts: 55, Visits: 139
Have you used any sensors on the GPIO ports of the IOWizard? Can one use the built in functions in the serializer to span across to the IOWizard -or must one code to get the information from the sensor?

Please refer to my previous comment with the code example to understand what I am trying to say.


-Danny

Animusoft
RUG Community
Post #1579
Posted Thursday, January 21, 2010 9:40 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
Here are some closeups...Please note the capacitor lead polarity (anode/cathode) in 3rd image.



Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1584
Posted Thursday, January 21, 2010 9:43 PM


Supreme Being

Supreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme BeingSupreme Being

Group: Administrators
Last Login: Monday, October 31, 2011 9:18 PM
Posts: 640, Visits: 819
If you have a sensor connected to the Serializer, use the serializer protocol or .NET lib objects to talk to that sensor directly.  If you have a sensor connected to the IOWizard, and the IOWizard connected to the Serializer via I2C, then you must query that sensor thru the Serializer via I2C (using the Generic I2C Object that's used in the attached example app above).

The ONLY interface between the Serializer and the IOWizard is the 4 wire I2C interface.  You can't short circuit anything w/ jumpers if that's what you're asking.

Jason Summerour
President,
Summerour Robotics Corporation
www.roboticsconnection.com

Post #1585
« Prev Topic | Next Topic »

««123»»

Reading This Topic Expand / Collapse
Active Users: 0 (0 guests, 0 members, 0 anonymous members)
No members currently viewing this topic.
Forum Moderators: jsummerour, ringo

Permissions Expand / Collapse

All times are GMT -8:00, Time now is 3:19pm

Powered By InstantForum.NET v4.1.4 © 2012
Execution: 0.219. 9 queries. Compression Disabled.