HomeGenie Forum

General Category => Troubleshooting and Support => Topic started by: petediscrete on December 11, 2015, 05:40:40 PM

Title: Raspberry PI B and Arduino UNO using analogue sensors
Post by: petediscrete on December 11, 2015, 05:40:40 PM
I've managed to connect the Arduino UNO to the Raspberry via USB and successfully ran the blinking light serial test. Now that's working I've got an Arduino smoke sensor and light sensor which I'd like to use. Basically I need to send the readings from both from the Arduino to the Raspberry PI using HG to read the results.

Should I go the Arduino IDE route with a sketch or can I bypass the Arduino sketch and send the raw output to the Raspberry PI/HG for processing
Title: Re: Raspberry PI B and Arduino UNO using analogue sensors
Post by: kevin1 on December 11, 2015, 06:51:26 PM

You'll definitely need to edit the arduino code to read the analog inputs and send them over to Pi/HG.  Since you are on Pi you can use the HG arduino sketch editor/loader and skip the Arduino IDE.  Then you'll need to parse the data in HG... read this other conversation in process... http://www.homegenie.it/forum/index.php?topic=1265.0 (http://www.homegenie.it/forum/index.php?topic=1265.0)
Title: Re: Raspberry PI B and Arduino UNO using analogue sensors
Post by: petediscrete on December 12, 2015, 12:12:57 AM
I'll try that and report back.

Is there anyone doing much with a Raspberry PI and an Arduino. I'd like to see how good they work together with HG
Title: Re: Raspberry PI B and Arduino UNO using analogue sensors
Post by: petediscrete on December 12, 2015, 04:50:52 PM
I've now connected an Arduini Smoke Sensor shield to the Arduino and ran the Serial I/O program.I'm getting back serial output from the smoke sensor so thats all working.I'd like to incorporate this output into the alarm system to add a fire aspect to it now. Could anyone point me in the right direction on how to achieve this.
Title: Re: Raspberry PI B and Arduino UNO using analogue sensors
Post by: kevin1 on December 13, 2015, 01:53:17 AM
In the security system program code there is a check for these parameter names:

                || parameter.Name == "Sensor.Smoke"
                || parameter.Name == "Sensor.Heat"
                || parameter.Name == "Sensor.CarbonMonoxide"
                || parameter.Name == "Sensor.CarbonDioxide" )

So if you RaiseEvent like this, I think HG will recognize it as such...
    Program.RaiseEvent(module4, "Sensor.Smoke", ArduinoData, "Smoke"); 

Title: Re: Raspberry PI B and Arduino UNO using analogue sensors
Post by: petediscrete on December 13, 2015, 03:54:56 AM
Thanks for that.

May have hit a problem with adding the smoke sensor shield. I now have an Arduino Uno and a smoke sensor shield piggy backed connected directly to the Raspberry Pi. As a result I've noticed that's the Raspberry PI Camera module CSI is acting a little strange. When I disconnect the Arduino everything is fine. I'm thinking it may be a power supply issue.