User avatar
Gomez
Posts: 40
Joined: Mon Dec 15, 2014 3:42 am
Location: Porto, Portugal

Analog Stick with MCP3002

Fri Jan 09, 2015 1:43 pm

Hello sirs,

Is there any other analog to digital converter that is cheaper on ebay?
I did some research but didn't find anything, MCP3002 is quite expensive for someone on a budget for a school project...

As I didn't found another microchip that does the same, is there any website where I can get a MCP3002 cheaper than ebay taking in account shipping? cheapest I found there was 5.37€ (4.09 + 1.28 shipping) ..

Any help would be greatly appreciated.
Thanks :)

User avatar
DougieLawson
Posts: 37069
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 1:49 pm

The MCP3008 is a cheaper ADC.
http://www.hobbytronics.co.uk/mcp3008-adc
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joan
Posts: 14652
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 1:50 pm

Have a look at a PCF8591 based module. It is only 8 bit but may be better suited to educational use.

Four input channels, one output channel. I2C based. http://www.ebay.co.uk/itm/391012308875

User avatar
Gomez
Posts: 40
Joined: Mon Dec 15, 2014 3:42 am
Location: Porto, Portugal

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 6:59 pm

DougieLawson wrote:The MCP3008 is a cheaper ADC.
http://www.hobbytronics.co.uk/mcp3008-adc
It might be cheaper in that website but its even more expensive on ebay and none of my local electronic stores that I went to sell the mcp3008 or the mcp3002 so I have to order it from outside ..
joan wrote:Have a look at a PCF8591 based module. It is only 8 bit but may be better suited to educational use.

Four input channels, one output channel. I2C based. http://www.ebay.co.uk/itm/391012308875
I am a little confused with how that one works, I am not very used to work with A/D Converters ..

I want to convert the analog signals of one joystick to digital for use with the raspberry pi as inputs for directions on retropie, I learnt how to do that with a MCP3002 but that is pretty expensive since i have to order it from outside my country and none are free shipping on ebay, the cheapest I found was at 4 euros in AliExpress ..

That PCF8591 is way cheaper and it might be a good alternative for me if I figure out how to use it ..
This is the map that I found from this website.

Image
And this is from the datasheet of the PCF8591.

Image Image

With the PCF8591, the 3V3 goes to VDD or VREF right?
GPIO 8 (SPI0 CE0) can go to the A0/A1/A2 ?
GPIO 9 (SPI0 MISO) can go to the SDA?
GPIO 10 (SPI0 MOSI) can go to the SDA too?
GPIO 11 (SPI0 SCLK) can go to the SCL ?
GND goes to VSS?

Joystick
3V3 to VDD or VREF
X Axis to Ain0?
GND to VSS
Y Axis to Ain1?

I probably messed something up with that but that's what I am trying to learn, I need to know how it works and if it does with a joystick before I order it so if someone can correct me that would be greatly appreciated :)

Thanks

User avatar
DougieLawson
Posts: 37069
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 7:34 pm

Gomez wrote:
DougieLawson wrote:The MCP3008 is a cheaper ADC.
http://www.hobbytronics.co.uk/mcp3008-adc
It might be cheaper in that website but its even more expensive on ebay and none of my local electronic stores that I went to sell the mcp3008 or the mcp3002 so I have to order it from outside ..
They appear to be willing to ship to foreign countries. Their website has an option for foreign languages like French & Spanish (not Portuguese).
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
joan
Posts: 14652
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 7:49 pm

Re: PCF8591

It's an I2C chip, not SPI like the MCP.

You connect ground, 3V3, SDA, and SCL.

It has three jumpers (P4, P5, P6) which link three of the analogue sensors to the analogue inputs. Remove the jumper if you need to use that analogue input for an external device.

It has four analogue inputs

AINO (if P5 is present reports the brightness of the photoresistor)
AIN1 (if P4 is present reports the temperature of the thermistor)
AIN2 ---
AIN3 (if P6 is present reports the voltage of the POT)

AINx reports a number between 0 and 255 in proportion to the voltage at its input. 0 for 0V and 255 for 3V3.

User avatar
Gomez
Posts: 40
Joined: Mon Dec 15, 2014 3:42 am
Location: Porto, Portugal

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 8:11 pm

DougieLawson wrote: They appear to be willing to ship to foreign countries. Their website has an option for foreign languages like French & Spanish (not Portuguese).
They appear to ship to every european country but the Airmail is the cheapest option so in the end it is 4.87 gbp which is around 6.21 euros, so its slighly more expensive than ebay
joan wrote:Re: PCF8591

It's an I2C chip, not SPI like the MCP.

You connect ground, 3V3, SDA, and SCL.

It has three jumpers (P4, P5, P6) which link three of the analogue sensors to the analogue inputs. Remove the jumper if you need to use that analogue input for an external device.

It has four analogue inputs

AINO (if P5 is present reports the brightness of the photoresistor)
AIN1 (if P4 is present reports the temperature of the thermistor)
AIN2 ---
AIN3 (if P6 is present reports the voltage of the POT)

AINx reports a number between 0 and 255 in proportion to the voltage at its input. 0 for 0V and 255 for 3V3.
so I can use the AIN3 since the joystick is a potentiometer .. but I have two axis so thats two analog inputs that I have to convert, do I connect one to AIN2 and the other to AIN3?

I might go with the MCP3002, even if it is pricier, I can understand the wiring and I know for sure that I can use it with the Keypad Driver that the website provides..

I am not understading completly the wiring of a analog joystick with PCF8591, or if it can be used with the driver...

User avatar
joan
Posts: 14652
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 8:17 pm

Gomez wrote: ...
so I can use the AIN3 since the joystick is a potentiometer .. but I have two axis so thats two analog inputs that I have to convert, do I connect one to AIN2 and the other to AIN3?
It doesn't matter which AINx you use, they all function the same. You just remove the jumper if it has an alternative function. Connect an input to AINx as you would have connected an input to the MCP3002.

User avatar
Gomez
Posts: 40
Joined: Mon Dec 15, 2014 3:42 am
Location: Porto, Portugal

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 8:48 pm

joan wrote: It doesn't matter which AINx you use, they all function the same. You just remove the jumper if it has an alternative function. Connect an input to AINx as you would have connected an input to the MCP3002.
Oh sorry, understood now ..
For compact purposes, can I use this chip instead?

Thanks for all the information :)

User avatar
joan
Posts: 14652
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 8:53 pm

Gomez wrote: ...
For compact purposes, can I use this chip instead?

Thanks for all the information :)
Probably, not my field. You'd need to check for sample circuits in the datasheet or on the www.

User avatar
Gomez
Posts: 40
Joined: Mon Dec 15, 2014 3:42 am
Location: Porto, Portugal

Re: Analog Stick with MCP3002

Fri Jan 09, 2015 10:38 pm

btw, can I use this PCF8591P the same way as the MCP3002, with this driver from this website?

I am not sure if it is supposed to work with an input from any ADC or the mcp3002 specifically.. cuz mcp3002 is SPI interface and pcf8591p is I²C interface, that driver may be specifically for the spi from mcp3002 ..

How can I make the raspberry pi use the digital signal of the PCF8591P as directions on retropie without that driver?

Thanks

User avatar
Gomez
Posts: 40
Joined: Mon Dec 15, 2014 3:42 am
Location: Porto, Portugal

Re: Analog Stick with MCP3002

Sat Jan 10, 2015 4:28 pm

ordered a PCF8591P since it was only 79 cents ..

I don't know if it will work with the driver but it's worth a try instead of paying straight 5 euros for a mcp3002 .. when it has been delivered I will post here if I it works or not..

Return to “Beginners”