raspberrypi expansion module

Request new hardware or ideas for the controller
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

If you are trying to have a Pi module that replicates the wifi attachment, you need to make it as the Pi is a Serial to TCP converter.
Roberto.
rufessor
Posts: 293
Joined: Tue Oct 25, 2011 7:39 am

Re: raspberrypi expansion module

Post by rufessor »

I too have been looking at the Pi... in terms of replacing the RA processor with the Pi- big issue is PWM output ... Pi has only 1 channel although there are some work arounds for this in software https://projects.drogon.net/software-pw ... pberry-pi/ but it eats clock cycles and of course uses up the other output pins... I believe I found a hardware (USB maybe) board that can interface for multi channel PWM ouput on the Pi but now its two pieces of hardware.. Would be nice to have something with enough PWM channels and outputs for everything else in 1 box... with internet!
Gotta love the memory though.
cypho
Posts: 13
Joined: Fri Oct 05, 2012 11:01 am

Re: raspberrypi expansion module

Post by cypho »

rufessor wrote:I too have been looking at the Pi... in terms of replacing the RA processor with the Pi- big issue is PWM output ... Pi has only 1 channel although there are some work arounds for this in software https://projects.drogon.net/software-pw ... pberry-pi/ but it eats clock cycles and of course uses up the other output pins... I believe I found a hardware (USB maybe) board that can interface for multi channel PWM ouput on the Pi but now its two pieces of hardware.. Would be nice to have something with enough PWM channels and outputs for everything else in 1 box... with internet!
Gotta love the memory though.
How about this add-on chip. Adds 16 PWM channels should be more than enough.

http://www.adafruit.com/products/815
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

Take a look at these:
http://www.youtube.com/watch?v=F-te4qkbh28
http://www.doctormonk.com/2012/04/raspb ... duino.html
The first one show the Arduino IDE running on the Pi and the 2nd one shows how we can leverage the wifi framework we already have and use Pi as a internet bridge.
We just need a python script, I guess... :)
Who know python really well?
Roberto.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

Ok, so I got my PI a couple days ago and here is what I got so far :)
http://i761.photobucket.com/albums/xx25 ... cb4643.jpg
Roberto.
dcartier
Posts: 33
Joined: Thu Sep 20, 2012 2:34 am

Re: raspberrypi expansion module

Post by dcartier »

cypho wrote:
How about this add-on chip. Adds 16 PWM channels should be more than enough.

http://www.adafruit.com/products/815
Yep, those do work fine with the Pi. I have 2 of those hooked up to mine along with 2 x 16 bit GPIO, 1 x 12 bit 4 Channel ADC and 2 x 12 bit DAC for my 2 (soon to be controlled) WP40s. At some point the Pi will be hooked to the RA.

Which brings me to the reason I stopped by. I built an ATO/AWC with 4 water level sensors using the MPXV5004G chip. I noticed that the sensor in the sump seems to drift higher by 4% over a couple of days. If I lift the sensor from the water exposing it to the air, once submerged, the reading becomes accurate again. At first I though I had a leak that was allowing the water level to rise in my tube, but after thinking about it, that would cause the reading to be high, not low.

I am now leaning toward changes in barometeric pressure between when the sensor is lifted, and reset to ambient pressure, and when the ambient pressure changes over the course of a few days.

Is anyone using the RA version of the water level sensor seeing anything similar, and does the RA version take into account the ambient pressure at the time of calibration?

I am probably over thinking this. :?

Dennis
thekameleon
Posts: 137
Joined: Sat Feb 16, 2013 7:44 am

Re: raspberrypi expansion module

Post by thekameleon »

Actually I think it could be an air leak. If you sensor is reading a higher water level, I think that means the air pressure exerted on the sensor by the water pressure would lower which should result in a higher water level. If you can use a clear plastic tube and see if water is climbing into the tube... It really shouldn't happen very much.
dcartier
Posts: 33
Joined: Thu Sep 20, 2012 2:34 am

Re: raspberrypi expansion module

Post by dcartier »

That was my first thought as well. But the sensor is reading a lower reading after a few days when the water level is at the target. Unfortunately the sensor tube is CPVC, so it is opaque. I re-cut the end of the PVC hose that connects through a Watts connector to the sensor tube this morning, so we will see if it has any effect in a few days.

I am concerned as I don't want my AWC to increase the salinity over time.

The other long shot I was thinking of is micro bubbles that are traversing the baffle where the sensor is adding to the trapped air in the sensor tube. This seems like a very remote explanation though.

Dennis
dcartier
Posts: 33
Joined: Thu Sep 20, 2012 2:34 am

Re: raspberrypi expansion module

Post by dcartier »

Actually I think I described it wrong. The sensor is reading higher, but the actual water level at that point is lower. So it is reading more pressure in the sensor tube then the water level would normally exert.

Dennis
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

Wow... That was not easy... lol
But I finally got the Arduino IDE to compile our libraries.
I just didn't upload to test it yet...
The weird thing is that the compile size is very different...
Windows:
Binary sketch size: 42,588 bytes (of a 258,048 byte maximum)

Pi:
Binary sketch size: 40,464 bytes (of a 258,048 byte maximum)
Roberto.
dcartier
Posts: 33
Joined: Thu Sep 20, 2012 2:34 am

Re: raspberrypi expansion module

Post by dcartier »

Just to follow up to my earlier posts so anyone finding this thread in the future can get the solution if they are having a similar problem. It turns out that it was in fact changes to the atmospheric pressure that caused my offset error. It manifested as the sensor reading either too high or too low over a number of days and usually after a shift in the weather.

What I did to overcome this was to add a Bosch BMP085 barometric pressure sensor to my bus. This allowed me to implement a calibration process where the atmospheric pressure is measured and noted while the sensing tubes are lifted out and exposed to the atmosphere. Then upon each reading of the level sensors, the atmospheric pressure is again measured and compared to the stored calibration value. I convert the BMP085 readings into kPa (the water level sensor uses 1v per kPa). The water level sensor value is then adjusted by 10% of the difference between the current and stored pressure reading.

I believe this works by accounting for the difference in the atmospheric pressure at the time of reading as compared to the atmospheric pressure (in the trapped air) when the tube was submerged. This appears to correct the offset error to within a millimetre or two, which is good enough for my needs. More testing is required to determine if the amount of offset error remains linear or if there is a boundary where this becomes problematic. I expect the summer storm season will provide some good test case large swings in barometric pressure to see if this works over the possible range of conditions.

Dennis
Atari
Posts: 11
Joined: Tue May 14, 2013 3:07 pm

Re: raspberrypi expansion module

Post by Atari »

Are they any updates on this concept yet? I have many plains for my RA that would having a Raspberry pi as a middle man would really help with.
The Idea that I was looking to and landed me here is, setting up a a ping monitor on systems around the house. I would be able to use this info to things like a power failures, then turn my MHs off to save power of the UPS, and email me to fix it.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

I have a PI that has a wifi dongle, so the only thing it needs is power.
I can remote control it with VNC.
I was able to connect the USB-TTL cable to the other USB port and upload codes to RA just fine.
Nobody created any software for PI yet though.
So, you would not be able to use the smart phone apps, for example.
If you can code python, you can create a program to link the serial to the Ethernet/wifi port. Want to try?
You may be able to do Java too, but I'm not sure.
Roberto.
Atari
Posts: 11
Joined: Tue May 14, 2013 3:07 pm

Re: raspberrypi expansion module

Post by Atari »

I don't program very well yet but here is something I found that might help.
http://www.buttcrackbrewery.com/2012/11 ... er-part-2/
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

Cool.
Thanks for contributing.
This would solve the incoming portion of the puzzle.
We still need to push data to the Portal.
If you don't care about the Portal, this solution works fine :)
Roberto.
Atari
Posts: 11
Joined: Tue May 14, 2013 3:07 pm

Re: raspberrypi expansion module

Post by Atari »

With the RaspbarryPi running LAMP I was thinking that it would be the host for a private portal.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

Yes, it can.
And it would easily communicate with RA too with the zip files the author has provided :)
Want to try?
Roberto.
Atari
Posts: 11
Joined: Tue May 14, 2013 3:07 pm

Re: raspberrypi expansion module

Post by Atari »

I'm all about trying it. I just got to talk the wife into letting me get a Pi. It only took 2 years to get my RA :)
Atari
Posts: 11
Joined: Tue May 14, 2013 3:07 pm

Re: raspberrypi expansion module

Post by Atari »

I will get my Pi Friday!!! I'll be starting to play with it then.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

Roberto.
Atari
Posts: 11
Joined: Tue May 14, 2013 3:07 pm

Re: raspberrypi expansion module

Post by Atari »

I am able to upload sketch to an UNO over the RPi's GUIO UART. I am also able to send and receive serial information between the two over the same connection.

It would seam to me if I had the webpage that is running on the RA Wifi card I could setup up on the RPi's web server and have some PHP or Python to do the translating between the to. If this is the case then the RPi could be used as a Wifi card replacement with out loose of portal or phone use functions.

To program the UNO I have to hold down the reset till avrdude start to upload. This will not work for remote uploads to the RA. I have learned that the chip is reset before upload data generally by a DTR pin on arduinos. Is this what the CTR pin on the RA is for? If so we should be able to adapt one of the RPi GPIO pins to do the job, like is is shown herehttp://www.deanmao.com/2012/08/12/fixing-the-dtr-pin/ Would I need a logic level shifter for this pin too?

With this done one would be able to upload sketch from anywhere. The trouble I see with this is that the RA likes to be reset after a sketch. Best idea I got for this is to have the PRi controls a relay that sits on the communication cable. We could have a block with the relay sit between 2 communication cables, and use it to power the RPi. I think this solution could be used to do the programming reset too.

I have been doing most of my base work on an UNO because my RA is running my reef...

Please tell me your thoughts and what I am missing.
Last edited by Atari on Fri Oct 10, 2014 8:40 pm, edited 1 time in total.
User avatar
lnevo
Posts: 5430
Joined: Fri Jul 20, 2012 9:42 am

Re: raspberrypi expansion module

Post by lnevo »

The web page is not in the wifi card...the web server and stuff is all on the RA. If you setup a http proxy that will pass the get requests over serial you will get the responses back over the serial.
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

If you plug the USB-TTL cable to the PI, you can upload codes to RA without any modifications :)
All you need is a TCP to UART proxy to go straight to the RA webserver.
Or, you can create your own webpages and simply issue commands through the serial port. Either way would work :)
Are you good with python?
Roberto.
tommy2fast
Posts: 12
Joined: Sat Jun 29, 2013 3:54 am

Re: raspberrypi expansion module

Post by tommy2fast »

Hello,

any news?

Thomas
afelt
Posts: 1
Joined: Tue Jan 28, 2014 10:50 pm

Re: raspberrypi expansion module

Post by afelt »

When the Raspberry Pi came out I was really excited too but found it lacking in basic I/O capabilities (PWM) for a long time. Meanwhile at my work we discovered the BeagleBone (particularly the BeagleBone Black) and I have found them to be great. Either way a HTTP relay should be like twenty lines of code in Python on either so I will give it a shot with my gear (while doing my thesis....so bear with me :p )
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: raspberrypi expansion module

Post by thoughtiknew »

The tcp->UART bridge is too easy from Linux using socat I do this all the time for network serial ports on servers as far as the portal is concerned I just need to figure out what exactly gets sent to the portal and you can easily write a chrond script that will read the necessary data from the RA and push it to the portal going to dig my beaglebone black out tonight
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: raspberrypi expansion module

Post by thoughtiknew »

just got home and was doing some more thinking on this and on my beaglebone it is even more simple because i have 4 uart ports so i simply connect the wifi connector to one ttl port and RA to the second ttl port and bridge the two ttl ports using socat and then when i need to upload code or directly interface with the RA i can unbridge the connection which will cause ra to reset and receive commands

not sure how many ttl ports a PI has but you could always use usb to ttl cables and a usb hub

can i get the ra pinouts and the wifi connector pinouts going to breadboard this up tomorrow
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: raspberrypi expansion module

Post by thoughtiknew »

3.3 to 5v logic shift can be handled using a voltage divider on the arduino tx pin
rimai
Posts: 12881
Joined: Fri Mar 18, 2011 6:47 pm

Re: raspberrypi expansion module

Post by rimai »

I use the usb-ttl cable connected directly into the PI and works fine.
I'm able to upload codes and everything.
Roberto.
thoughtiknew
Posts: 28
Joined: Mon Jan 20, 2014 7:41 pm

Re: raspberrypi expansion module

Post by thoughtiknew »

Yes because the USB TTL cable is 5v tolerant but my beaglebone USB port is In Use for my WiFi adapter
Post Reply