Raspberry Pi anyone?

This is the place for posts that don't fit into any other category.

Moderator: RichardW

Post Reply
User avatar
CitroJim
A very naughty boy
Posts: 49526
Joined: 30 Apr 2005, 23:33
Location: Paggers
My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
x 6160
Contact:

Re: Raspberry Pi anyone?

Post by CitroJim »

Mandrake wrote:It would be, for someone who thinks overhauling an automatic gearbox is a bit of light weekend relaxation :-D
Good point well made Simon... :)
Xac wrote:
addo wrote:There is a mounting boss already for the air intake flap motor.
Really? Don't suppose you have any details of the motor needed?
Possibly the same as for the heater flap or you might look at linear actuators on the 'bay. they're stepper motors basically that drive a rack and pinion.
Jim

Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

CitroJim wrote: Possibly the same as for the heater flap or you might look at linear actuators on the 'bay. they're stepper motors basically that drive a rack and pinion.
Brilliant, thank's Jim



I can see I'm going to be volunteering to replace a heater matrix for someone just to get inside their dash :D
Although, we've not done Jenny's...
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

Next electronics question:

I need to make a timer that can hold a relay/mosfet closed for 30 seconds.

What I'll be doing is have a 5v permanent feed via Relay A to the Pi, with the relay controlled from the accessories feed and a timer.
Relay B is also controlled by the accessories feed and creates a circuit with one of the GPIO pins on the Pi when closed.

This way, when the key is set to accessories, the Pi powers on.
When the ingition is off, Relay B breaks the circuit and the Pi runs a script to wait 10 seconds and then if the circuit is still down, run the shutdown script. Once this is done, Relay A opens and power to the Pi is cut.

I remember wiring up a resistor and capacitor at school, t=RC rings a bell.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

Had a chat with a chap at work who restores pinball machines.
Came up with a circuit using a 555 timer, TIP120 tranny and a few resistors and capacitors thrown in for good measure.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
CitroJim
A very naughty boy
Posts: 49526
Joined: 30 Apr 2005, 23:33
Location: Paggers
My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
x 6160
Contact:

Re: Raspberry Pi anyone?

Post by CitroJim »

Xac wrote: Came up with a circuit using a 555 timer
The 555 is the answer to many questions and has been around since Noah was a lad... A real electronics survivor that one :-D

It forms the basis of many intermittent wipes and so on....
Jim

Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

The little test stepper motor and controller arrived yesterday but I was too exhausted from work to play around with it.
Hopefully this weekend I'll get time.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

To give you an idea how addled my brain has become, I only just remembered this evening that Cassy's steering wheel has a load of buttons doing nothing.
So I can connect them up to the RPi to change modes/volume/fan speed/temperature.
I need a holiday.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

Here's a rough drawing of the power circuit, with relays drawn where the timer and transistors will actually go.
A 12v feed activates the 555 board which provides 5v to power the RPi.
It also closes the shutdown signal circuit running off one of the GPIO pins.

When the ignition is turned off, the GPIO detects a low state and starts a script which waits 10 seconds in case the GPIO reads high again, and if not then tells the RPi to shut down.
The 555 board will keep power going to the RPi for 30 seconds which should be enough time to safely cut the power.

Image
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
CitroJim
A very naughty boy
Posts: 49526
Joined: 30 Apr 2005, 23:33
Location: Paggers
My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
x 6160
Contact:

Re: Raspberry Pi anyone?

Post by CitroJim »

Here's another project for the raspberry Pi...

Early XM diagnostics. Have a look at this on Club-XM :)

Simple S1 XM Diagnostic Reader

It might work on S1 Xantias too. The jury is out on if it'll work on an S2 car...
Jim

Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

CitroJim wrote:Here's another project for the raspberry Pi...

Early XM diagnostics. Have a look at this on Club-XM :)

Simple S1 XM Diagnostic Reader

It might work on S1 Xantias too. The jury is out on if it'll work on an S2 car...
We know what to get you for xmas then Jim :)
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

Code: Select all

    #!/bin/bash
    #################################
    # Speech Script by Dan Fountain #
    # TalkToDanF@gmail.com #
    #################################

    INPUT=$*
    STRINGNUM=0

    ary=($INPUT)
    echo "---------------------------"
    echo "Speech Script by Dan Fountain"
    echo "TalkToDanF@gmail.com"
    echo "---------------------------"
    for key in "${!ary[@]}"
    do
    SHORTTMP[$STRINGNUM]="${SHORTTMP[$STRINGNUM]} ${ary[$key]}"
    LENGTH=$(echo ${#SHORTTMP[$STRINGNUM]})
    #echo "word:$key, ${ary[$key]}"
    #echo "adding to: $STRINGNUM"
    if [[ "$LENGTH" -lt "100" ]]; then
    #echo starting new line
    SHORT[$STRINGNUM]=${SHORTTMP[$STRINGNUM]}
    else
    STRINGNUM=$(($STRINGNUM+1))
    SHORTTMP[$STRINGNUM]="${ary[$key]}"
    SHORT[$STRINGNUM]="${ary[$key]}"
    fi
    done

    for key in "${!SHORT[@]}"
    do
    #echo "line: $key is: ${SHORT[$key]}"

    echo "Playing line: $(($key+1)) of $(($STRINGNUM+1))"
    mpg123 -q "http://translate.google.com/translate_tts?tl=en&q=${SHORT[$key]}"
    done
By changing the URL used in the above for Google's translation services to have tl=us or tl=au, you can make it sound like a Valley girl, or a, I hate to say it, rather slow Australian woman.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

The temperature sensors arrived last week, and I managed to get a suitable resistor for them yesterday, so the temperature at home is currently a cool 19.5C :)
Next step for them is to wire/program buttons to adjust the desired temperature and LEDs to simulate the fan and air con switching on.

Hit a snag with the 555 and the keeping of power running for 30 seconds after the ignition is off.
So I'm wondering if using a 2F or 3F capacitor would do the trick.
According to my maths, C=(t*I)/V, which would be (30*0.5)/7=2.14 (7V being the drop from 12 to 5 that the regulator uses to convert to 5V.
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
Xaccers
Posts: 7654
Joined: 07 Feb 2007, 23:46
Location: Milling around Milton Keynes
My Cars:
x 184

Re: Raspberry Pi anyone?

Post by Xaccers »

12V capacitors of sufficient size are an obscene price and seem their target market is the Nova with a big speaker in the boot groups.
So that leaves capacitors in series which reduces the capacity.
To keep a constant discharge time and costs down I plan on using a 7810 voltage regulator to drop the 12-14V down to 10V and then have a line of 4 2.7V 25F capacitors giving a capacity of 6.25F. The drop from 10V to 7V (cut off voltage of the 7805) should be 34 seconds.

Image
1.9TD+ SX Xantia Estate (Cassy) running on 100% veg
1.9TD SX Xantia Hatchback (Jenny) running on 100% veg for sale
Laguna II 2.0dCi Privilege (Monty)

DIY sphere tool
User avatar
CitroJim
A very naughty boy
Posts: 49526
Joined: 30 Apr 2005, 23:33
Location: Paggers
My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
x 6160
Contact:

Re: Raspberry Pi anyone?

Post by CitroJim »

There's got to be a better way than mucking around with those big capacitors....

Let me have a think...

One way is another 555 time with the required time-constant set to keep the other one alive for long enough..
Jim

Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
User avatar
CitroJim
A very naughty boy
Posts: 49526
Joined: 30 Apr 2005, 23:33
Location: Paggers
My Cars: Bluebell the AX, Polly the C3 Picasso, Pix the Nissan Pixo, Propel the duathlon bike, TCR Pro the road bike and Fuji the TT bike...
x 6160
Contact:

Re: Raspberry Pi anyone?

Post by CitroJim »

Just been playing with Xac's Raspberry Pi. Very impressed indeed...

Just as a test we compiled up ClamAV from C source code and it did it flawlessly....

We put a virus test file on it and it found it...

I've got one on order...

Incredible bit of kit...
Jim

Runner, cyclist, time triallist, duathlete, Citroen AX fan and the CCC Citroenian 'From A to Z' Columnist...
Post Reply