Friday, October 23, 2015

Particle/Spark WiFi photon intro and first project

I recently picked up a Particle 'Photon' WiFi Device.  It's a pretty cool platform and idea.  I missed out on the Kickstarter but they are shipping the development kits and modules of the P0.

The P0 SOM is based around the BCM43362 WiFi chipset and uses a STM32F205 as the brain.  The STM32F205 firmware is open source and on github.

I set the device up through my iPhone.  The setup process with Tinker app was seamless in setup.  I ran into issue when I tried flashing through the build.particle.io with the LED blink example the device would go into an infinite flash cycle (flashing magenta LED).  I would then have to soft-reset the device to push it back into WiFi Host-mode so I could pair it again.

I also ran into some issues with my unit out-of-the-box.  Generally, the serial operation was flaky with frequent 'Serial Error' messages.

I ended up having to flash to the latest firmware (0.4.5) using dfu-util.  This resolved the issue with poor serial operation and inability to flash from the cloud-based IDE.

The code syntax interface is 'Wiring' similar syntax so easy to pickup if you've used the Arduino.  Now onto the fun stuff, the demo....

I threw together a project when I got back this evening.  My girlfriend has been leaving her hair straightener on in the mornings and will text me to check and turn it off before I go to work.  So, I thought I'd whip up an AC relay example to showcase how rapid and easy the development is.  The whole thing took me about 1 hour to put together.  I could probably condense this all into a single PCB and replace the mini-USB breakout used for power by an integrated AC-DC +5V module recommended on this electronics.stackexchange post.  A block diagram of the setup is shown below.  I used the Tinker iPhone app to control the device.  The D7 GPIO pin on the Photon is connected to the Powertail Switch 2 AC relay + input.


Required Parts:
1. Sparkfun mini USB breakout. - $2
2. Apple AC-to-DC 5V USB wall plug. - $10
3. Spark Photon Eval Board. - $20
4. Powerswitch Tail 2. - $26.00

Some pictures of the prototype: