Vehicle Application for UPiS

Post here your applications done based on UPiS
Share your ideas about new possible applications

Vehicle Application for UPiS

Postby Graham S » Thu Feb 06, 2014 11:34 pm

I’m considering using your Advanced UPiS Raspberry Pi power supply for a vehicle application.

Please consider this schematic:

Image

My plan is as follows:
1. The Raspberry Pi would be powered on and off by the UPiS to ensure safe shutdown and start-up when the 12V power is applied by the vehicle.
2. The UPiS would in turn be powered from a switched 12V circuit controlled by the cars ignition switch.
3. The NO relay on the UPiS would be used to control a more powerful NO relay board, fed from a permanent 12V source, which in turn would supply 5V from a voltage converter for the USB hub and any peripherals attached to it. I went this route because I don’t think the UPiS can supply enough power to run the USB hub and the devices attached to it directly.
4. As soon as the UPiS NO relay was closed the additional relay board would be energised and it’s NO relay also closed. In this way the Pi (or maybe the UPiS?) has control of power to the USB hub and hence the peripherals attached to it.
5. If the Pi was shutdown then the UPiS would go into low power state, the UPiS NO relay would open and power would be cut to the hub and its peripherals. This makes the setup fail safe so that the 5V supply and hub can’t exhaust the vehicles battery via the permanent 12V feed.
[/list]
Do you think this will work? If I control the UPiS NO relay from a GPIO pin on the Pi (via something like this: http://www.susa.net/wordpress/2012/06/raspberry-pi-relay-using-gpio/) then the USB peripherals/disk would not be powered until the Pi was booted and controlling the relay. Do you know if Raspian is OK with hot plugging USB peripherals?

Having read your UPiS manual, can I confirm that I’m right in thinking that when the appropriate jumper(s) are set on the UPiS that Pi GPIO0 can be used to control the UPiS NO relay? It looks like the I2C interface also runs over GPIO0/1 (SDA0/SLC0) to access the UPiS RTC, are these two options mutually exclusive? It’s not possible to do more with I2C is it, such as control the NO relay?

For the application I’m considering it would be good if the UPiS could be programmed to make the NO relay mirror the Pi’s power state e.g.

UPiS Power State Pi State NO State
============== ======= ========
USB Powered Closed
EPR Powered Closed
BAT Powered Closed
LPR Off Open
RPI Powered Closed

By doing this the UPiS could switch on/off an external battery to power non-essential devices, such as a USB hub and peripherals attached to it that use too much power to run directly from the UPiS battery. I guess I can achieve more-or-less the same thing with GPIO0 on the Pi, it’s just that I’d need to wait for Pi to boot before I could close the relay and turn on the extra peripherals.

Am I going about this the right way?
Graham S
 
Posts: 48
Joined: Thu Feb 06, 2014 11:07 pm

Re: Vehicle Application for UPiS

Postby Pimaster » Sat Feb 08, 2014 3:27 pm

Dear Graham,
Your application is very interesting!!
In order to simplify my answering I'm copying your text and include my answers in the text.


1. The Raspberry Pi would be powered on and off by the UPiS to ensure safe shutdown and start-up when the 12V power is applied by the vehicle.

We already added for application done in the "Univeristy of Alabama at Bimingham - USA" the above feature
- it is a part of the @sdwn command (not public released, yet)


2. The UPiS would in turn be powered from a switched 12V circuit controlled by the cars ignition switch.
OK
3. The NO relay on the UPiS would be used to control a more powerful NO relay board, fed from a permanent 12V source, which in turn would supply 5V from a voltage converter for the USB hub and any peripherals attached to it. I went this route because I don’t think the UPiS can supply enough power to run the USB hub and the devices attached to it directly.

A very good approach, yes the UPiS Relay is not so heavy, as also the step-up converter can not supply such big current (max is about 1.5 A I would say, but we have inside of the UPiS software and hardware cut-off system if it exceed much smaller values for safety reasons - LiPO batteries). In the new firmware this cut-off system will have user defined level


4. As soon as the UPiS NO relay was closed the additional relay board would be energised and it’s NO relay also closed. In this way the Pi (or maybe the UPiS?) has control of power to the USB hub and hence the peripherals attached to it.
Please clarify it

5. If the Pi was shutdown then the UPiS would go into low power state,
OK
the UPiS NO relay would open and power would be cut to the hub and its peripherals.
OK
This makes the setup fail safe so that the 5V supply and hub can’t exhaust the vehicles battery via the permanent 12V feed.
You are right
[/list]
Do you think this will work?
Seems that yes, but if you have some problems we can easy adapt the UPiS firmware for it

If I control the UPiS NO relay from a GPIO pin on the Pi (via something like this: http://www.susa.net
/wordpress/2012/06/raspberry-pi-relay-using-gpio/)
You do not need this circuit at all, we have it already with required transistor. You need just to select by jumper, control of the UPiS Relay by RPi, and that is all, check the manual.

then the USB peripherals/disk would not be powered until the Pi was booted and controlling the relay. Do you know if Raspian is OK with hot plugging USB peripherals?
I do not have this knowledge, about the Raspian

Having read your UPiS manual, can I confirm that I’m right in thinking that when the appropriate jumper(s) are set on the UPiS that Pi GPIO0 can be used to control the UPiS NO relay?
Look to pictures below

UPiS_1.JPG
P1 connector on the UPiS Board
UPiS_1.JPG (71.81 KiB) Viewed 6625 times

UPiS_3.JPG
RELAY control on the UPiS Board
UPiS_3.JPG (58.71 KiB) Viewed 6625 times

UPiS_2.JPG
RELAY jumper selector on the UPiS Board
UPiS_2.JPG (23.39 KiB) Viewed 6625 times



It looks like the I2C interface also runs over GPIO0/1 (SDA0/SLC0) to access the UPiS RTC, are these two options mutually exclusive? It’s not possible to do more with I2C is it, such as control the NO relay?

NO, different pins control the NO Relay, check above diagrams

For the application I’m considering it would be good if the UPiS could be programmed to make the NO relay mirror the Pi’s power state e.g.
Yes, we can add such @command
i.e @RMIR ON and @RMIR OFF


UPiS Power State Pi State NO State
============== ======= ========
USB Powered Closed
EPR Powered Closed
BAT Powered Closed
LPR Off Open
RPI Powered Closed

By doing this the UPiS could switch on/off an external battery to power non-essential devices, such as a USB hub and peripherals attached to it that use too much power to run directly from the UPiS battery. I guess I can achieve more-or-less the same thing with GPIO0 on the Pi, it’s just that I’d need to wait for Pi to boot before I could close the relay and turn on the extra peripherals.

Am I going about this the right way?


Yes, you are in the very good way, we will support you, because form this application some new @commands will born also for other users
Warmest Regards
PiMaster
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
Pimaster
Site Admin
 
Posts: 1593
Joined: Fri Sep 14, 2012 7:50 am

Re: Vehicle Application for UPiS

Postby Graham S » Sun Feb 09, 2014 3:43 pm

Starting to come together....

Image
Graham S
 
Posts: 48
Joined: Thu Feb 06, 2014 11:07 pm

Re: Vehicle Application for UPiS

Postby Graham S » Sun Feb 09, 2014 3:51 pm

OK, so I can't get the RTC working - not sure what I'm doing wrong. This is what I get from i2cdetect (I get the same from i2Cdetect -y 0 - although I have a model B so the command below should be correct):

pi@raspberrypi ~ $ sudo i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --


Here's what I've done:

1. Both jumpers are closed.
2. All the modules are loaded:

pi@raspberrypi ~ $ lsmod
Module Size Used by
rtc_ds1307 7735 0
i2c_dev 5557 0
snd_bcm2835 16165 0
snd_soc_bcm2708_i2s 5474 0
regmap_mmio 2806 1 snd_soc_bcm2708_i2s
snd_soc_core 131268 1 snd_soc_bcm2708_i2s
regmap_spi 1897 1 snd_soc_core
snd_pcm 81593 2 snd_bcm2835,snd_soc_core
snd_page_alloc 5156 1 snd_pcm
regmap_i2c 1645 1 snd_soc_core
snd_compress 8076 1 snd_soc_core
snd_seq 53769 0
snd_timer 20133 2 snd_pcm,snd_seq
snd_seq_device 6473 1 snd_seq
leds_gpio 2059 0
led_class 3688 1 leds_gpio
snd 61291 7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress
spi_bcm2708 4728 0
i2c_bcm2708 3997 0


Any suggestions what I'm doing wrong?

Graham
Last edited by Graham S on Sun Feb 09, 2014 4:35 pm, edited 1 time in total.
Graham S
 
Posts: 48
Joined: Thu Feb 06, 2014 11:07 pm

Re: Vehicle Application for UPiS

Postby Graham S » Sun Feb 09, 2014 4:02 pm

Pimaster wrote:For the application I’m considering it would be good if the UPiS could be programmed to make the NO relay mirror the Pi’s power state e.g.
Yes, we can add such @command
i.e @RMIR ON and @RMIR OFF


UPiS Power State Pi State NO State
============== ======= ========
USB Powered Closed
EPR Powered Closed
BAT Powered Closed
LPR Off Open
RPI Powered Closed
PiMaster


@RMIR ON and @RMIR OFF would be perfect. I've been experimenting with the NO relay and it doesn't function how I expected, the relay remains energised (@RON) even in low power state. I wasn't expecting this to happen as I assumed the relay would return to open in low power so that powering it doesn't consume ~50mA from the UPiS battery while in low power mode.

Is it a complex job to add @RMIR to the firmware? I'm looking to get this application finished in the next two weeks and will look at using the Pi to control the relay if it will take longer than this to add.

Thanks,
Graham
Graham S
 
Posts: 48
Joined: Thu Feb 06, 2014 11:07 pm

Re: Vehicle Application for UPiS

Postby Pimaster » Sun Feb 09, 2014 5:20 pm

Regarding RTC, follow exactly the manual, it must be working. In addition, you can load the minicom, to see if the rtc is working form another side that i2c, you will see the second chnging even if you do not have access to the i2c RTC port. So, form the minicom, just type @status 2-3 times and should see changing seconds, that will confirm working rtc, and if yes, follow exactly the manual step by step.
Keep me informed
BR PiMaster
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
Pimaster
Site Admin
 
Posts: 1593
Joined: Fri Sep 14, 2012 7:50 am

Re: Vehicle Application for UPiS

Postby sven » Thu Jul 17, 2014 1:03 pm

Hi there,

I´m planning to implement a small mediaserver (and later some more features) to my car based on the pi and the upis module and I´m wondering if it`s possible to start the raspberry when the 12V is available again (after ignition). Safe Shutdown on power loss is not the problem that`s well documented but I can not find anything about the new boot . Is the UPiS module able to do so? As far as I understood this feed also depends on that kind of feature so maybe some likes to share his experiences about this...

And something off topic: I´m interested in a easy and safe solution for mass storage devices attached to the pi, I´m testing around with USB sticks and SSDs but maybe someone got a brilliant idea about this...

Thanks and regards

Sven
sven
 
Posts: 2
Joined: Thu Jul 17, 2014 12:35 pm

Re: Vehicle Application for UPiS

Postby Pimaster » Thu Jul 17, 2014 1:05 pm

Hi,
The new firmware 1.091 is doing it, when we solve the small bug then, you are free ti use it as you like.



And something off topic: I´m interested in a easy and safe solution for mass storage devices attached to the pi, I´m testing around with USB sticks and SSDs but maybe someone got a brilliant idea about this...

we have to think little bit on it,

Warmest Regards
Pi Master/Ioannis
Warmest Regards
PiM
---
Designing with Mentor Graphics PADS - www.pads.com
Please read and follow the PiForum rules
http://www.forum.pimodules.com/viewtopic.php?f=13&t=196
---
Pimaster
Site Admin
 
Posts: 1593
Joined: Fri Sep 14, 2012 7:50 am

Re: Vehicle Application for UPiS

Postby maestro » Thu Jul 17, 2014 3:55 pm

Hi,

just to share on the storage part... Head start: forget it!:) Details: The USB chip in the Pi is of very low quality and many issues has been reported on the chip and the USB driver in the Pi. I've done boot from SSD (crash within 1-2dyas on storage issue, etx4 corrupted, etc..), lots of powering issues to solve (dont even try without powered usb hub), very risky in general. I've done and still use USB stick as a permanent storage. Similar issue as above but less frequent, depending on the I/O load. I'm getting USB error -71 in dmesg, at which point I've to reboot Pi to mount the USB stick again.

In summary: a lot of pain and uncertainty. What to do? Not sure, Pi is not intended to be 24/7 device. In case you are ok with reboot once in a time and loosing data is not that big a deal, no problem :)

Vit
maestro
 
Posts: 32
Joined: Tue Mar 11, 2014 7:07 pm

Re: Vehicle Application for UPiS

Postby sven » Thu Jul 31, 2014 10:55 pm

Hi all, sorry for the delay, disabled mail notification 8-)


Pimaster wrote:Hi,
The new firmware 1.091 is doing it, when we solve the small bug then, you are free ti use it as you like.
...
Pi Master/Ioannis


Great thanks :-)

maestro wrote:Hi,

just to share on the storage part... Head start: forget it!:) Details: The USB chip in the Pi is of very low quality and many issues has been reported on the chip and the USB driver in the Pi. I've done boot from SSD (crash within 1-2dyas on storage issue, etx4 corrupted, etc..), lots of powering issues to solve (dont even try without powered usb hub), very risky in general. I've done and still use USB stick as a permanent storage. Similar issue as above but less frequent, depending on the I/O load. I'm getting USB error -71 in dmesg, at which point I've to reboot Pi to mount the USB stick again.

In summary: a lot of pain and uncertainty. What to do? Not sure, Pi is not intended to be 24/7 device. In case you are ok with reboot once in a time and loosing data is not that big a deal, no problem :)

Vit



Hmmmm, okay, still thought about making the storage readonly with tempfiles in ramdisk or so... Any experiences with that, long time readonly usb storage (maybe ssd)? At least it`s a little bit more tuning but it shouldn´t be a problem to use rw access just in case of uploading files and rebuild databases *hmmmm*... Life could be so easy if SSD`s would have a LineOut 8-)

Thanks all
sven
 
Posts: 2
Joined: Thu Jul 17, 2014 12:35 pm


Return to UPiS Users Application

Who is online

Users browsing this forum: No registered users and 1 guest

cron