Shop OBEX P1 Docs P2 Docs Learn Events
Sensor Input Query — Parallax Forums

Sensor Input Query

BigbutsilentBigbutsilent Posts: 10
edited 2008-07-18 15:45 in Propeller 1
Help! No idea what Im doing.

Thats about it. First time here. I have got Demo Board & Proto Board - just don't seem to be able to find the answers on the site or forums.

I want to put two car oxygen/fuel cells onto the prop. I have made a circuit before with a pic. I used an AD822 op-amp. The two cells are calibrated to read and display on a LCD 21% (Air) they then work together - ie they check each other for drift. 10% if more they error message

The cells output between 11mv and 70mv

The question is do i need the op-amp?, can i interface direct to the chip or do i need to covert to digital.

Spin - Well i may as well look at my washing machine. Looks like hard work. It may just be me - old dog new tricks.

If anyone could help point me in the right direction that would be brilliant. otherwise I will just look at all you clever people with envey.

Cheers

Post Edited (Bigbutsilent) : 7/17/2008 2:54:32 PM GMT

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-17 14:42
    1) You should probably include the op-amp. The buffering and amplification will help since the cells' output voltage is so low. The Propeller can do its own analog to digital conversion, but it's not optimized for that. In particular, it uses its own supply voltage for its reference. You can always get better results using a cheap analog to digital converter chip with its own internal voltage reference, but the Propeller can do pretty well with just two resistors and two capacitors per channel mounted physically close to the Propeller chip. Download (from the Propeller downloads webpage) the application note on the cog counters (AN001) which describes the use of the Propeller for analog to digital conversions and includes code that you can incorporate into your program to do this.

    2) Spin is not difficult to learn. It shares a lot of concepts with C
  • hippyhippy Posts: 1,981
    edited 2008-07-17 14:47
    Spin looks daunting at first but soon turns out not to be and especially so if you've done some programming anyway. I've found it one of the better languages to use for rapid prototyping and even quite credible applications fall out in double-quick time.

    I'd recommend putting a day or so aside to just play with controlling LED's, detecting button pushes, driving the TV/VGA, trying the example code, and just generally getting a feel for the Propeller and Spin. I think you'll probably be surprised how quickly you get into a comfort zone.

    Develop incrementally and it should be fairly easy sailing, jump in too deep without enough experience and it could be a less satisfactory experience.

    I've no real experience with ADC on the Propeller so cannot help there.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-07-17 14:47
    For future reference...please do not repost your message when there is a problem. Edit the original using the pencil icon at the top right of the message window.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-17 14:50
    Thanks Eric - advice taken. I will change subject to sensor input query

    Mike, I agree the op-amp stays . I will also check out the AN001.
    I used a divider for ref. cheap low power reg 78L05
    My very limited programing skills was Clarion (millions of years ago) and more recent - oh dear - Picaxe basic. Well there you go the shame of in a real world application.

    Hanging my head in shame.

    C

    P.S. How do you edit a prior post?
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-17 14:55
    Thanks Hippy,

    I've been trying out the examples - I can flash LEDs with the best of them now. The two sensor problem is the little bit at first on will use one cog. The others are spoken for with the rest of the project.

    General Note:

    Sorry about the quality of submission - new here, and first time on a forum - don't know how these work either.

    C
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-17 14:57
    Point noted with thanks Steve. Will try harder. Getting the hang of it - I think

    C
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-07-17 15:02
    I see replies from Mike and Hippy, but who are Eric and Steve? Are these replies from another thread?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-17 15:14
    I think they must have slipped past on the first post before it got deleted. Thanks for the edit advice - easy when you know how.
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-07-17 16:05
    My post must have been deleted when the topic was renamed. I had suggested the use of a mcp3204/8 with a 2.048v or 4.096v reference for ease of use. A person will probably have problems trying to use these on a protoboard or demoboard, at least to get 12 bits resolution without a ground plane properly set up.
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-17 16:21
    Yeh sorry about that my fault, i sent the thread twice. I should have correct the first one, so you got deleted. Thanks for the tip. I really do need to keep this simple (I am, so it has to be - Electronics and software are not my strong points. I have brilliant ideas but lack the skills to make it happen. It took me a year to master the old circuit. labour of love!!) - I am not aware of the specs of mcp3204/8 I will look it up.

    C
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-17 16:26
    Erik

    Just noticed I spelled your name wrong. Sorry

    I see the mcp3204/8 has SPi - I have not got into that but maybe it would be worth doing it with the prop.

    C
  • hippyhippy Posts: 1,981
    edited 2008-07-17 17:48
    It's always a bit embarrassing when it all goes wrong on the first post isn't it, but people here don't bite ... not often, anyway smile.gif

    Don't be surprised if you you don't grasp "AN001" on a first or later read, I found and still find it quite complicated, but there's usually someone here who can give advice at the level you need.

    From your previous experience I presume you're well aware that it's often worthwhile writing short test programs to try out and understand a feature then use it rather than try to incorporate a feature into a much larger program without a good understanding. I definitely think that applies to the counters.

    and more recent - oh dear - Picaxe basic ... Hanging my head in shame

    No shame there, but I would say that using the PICAXE myself as well as the Propeller. Rather topically I used a PICAXE on my ProtoBoard as an easy way to get three channels of analogue into the Propeller using a serial link smile.gif

    labour of love

    Another Brit ? Or from Down Under ?

    Post Edited (hippy) : 7/17/2008 5:57:23 PM GMT
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-17 17:58
    Hippy,

    You may just have an idea - still use the picaxe stuff for the inputs and output to the prop. I need two or three sensor inputs into each cog - hence the small bits, it would be nice to run them on there own. The output ie results could then be sent to the display (LCD/OLED)

    Problem then is loads of electronics kicking around and more to go wrong.

    I think thats a pretty neat idea. Why cant i think like that. Played all afternoon with small bits of code. Ummmmmmmmm.

    That hill is steep.

    C

    PS. Sorry again - Brit
    PPS AN001 some of it - the bits that are written in English
  • Erik FriesenErik Friesen Posts: 1,071
    edited 2008-07-18 00:19
    There is an object written specifically for the 3208 that is included in the prop install and works well. I'd say a picaxe would work too. I have done something similar with a pic16f688. It can be a bit of a challenge at times to write your own communication protocols (using the serial engines of course).

    I jumped from the basic stamp to the propeller and in my opinion, getting a program to work has more to do with understanding logic flow than any particular syntax.(of course you have to get to understand the syntax). So what I'm trying to say is that the picaxe programming you have done should help get you up to speed soon.
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-18 08:01
    Thanks Erik,

    I'm looking at the 3208 but wonder if the path for me at the moment is with the Picaxe chip handling the sensor inputs. I already have that software and hardware sorted.

    You would think that there would be a general bit of code for a voltage input routine in the library. Oh well I will just have to bite the bullet and right one. I suppose that the problem if you want to interface to the real world - you need real I/O that you can use.
  • hippyhippy Posts: 1,981
    edited 2008-07-18 14:12
    If the sigma-delta ADC cannot be used one has to add external ADC anyway so that may as well be the PICAXE. The only issue is sampling rate and how to interface it to the Propeller. I was happy enough with 9600 baud serial and wrote my own receive routine which runs in its own Cog and uses the Boot Eeprom I2C SDA line so doesn't even need an extra I/O line.
  • BigbutsilentBigbutsilent Posts: 10
    edited 2008-07-18 15:45
    Typing to fast for the brain to catch up. Please read right as write. I don't know bad English as well!
Sign In or Register to comment.