2Wire (unidirectional I2C) coms from blocks of light on an LCD screen via (e.g.) HTML5.

"Here is a crazy idea for interfacing web pages to the real world. Imagine an old SmartPhone sitting in a cradle on a robot or other hardware device. On the phones browser, a web page is pulled up with a Javascript program running that is changing two blocks on the screen from black to white. One block is the clock line, the other is data, and they transmit 2wire (Unidirectional I2C) data. In the cradle, at the bottom of the phones screen, a pair of optical sensors convert the light level into voltages in two wires which then connect to any I2C device (e.g. a servo controller^, D2A, uC, whatever).

Now you have a Javascript controlled robot with wifi connection, maybe camera, screen space for faces or whatever, audio, etc... And optocoupled so there is no danger of frying the phone. No need to root the phone, no need for any apps, no development environment other than a text editor.

The ability to control a robot could then be combined with Javascript based object recognition to turn a cell phone into an object following device.

This is the prototype web page, which I think will work in very minimal browsers please let me know if it works on yours? Thanks!

Type in some data, and hit send. Watch der blinkenlights. Change delay to 10 and send. Change delay to 1 and send. Might be fast enough.

Text Data:
Hex Data:
Delay:
SCL: SDA:

Updated versions of this code are also available

Hardware

The following circuit was developed and tested by Conrad Salinas (THANK YOU!) at delays down to 5:

Bill Of Materials
Part Value Device Package Description
C3 0.1u CAPPTH1 CAP-PTH-5MM Capacitor
R1 PHOTOCELLPTH PHOTOCELLPTH PHOTOCELL CdS photoresistor. This is a low cost way to detect light levels. Resistance decreases with more incoming light. Mfgr Part: GL5528. SparkFun SKU: SEN-09088 (check eBay for better price)
R2 PHOTOCELLPTH PHOTOCELLPTH PHOTOCELL
R3 10K RESISTORPTH-1/2W AXIAL-0.5 Resistor
R4 10K RESISTORPTH-1/2W AXIAL-0.5 Resistor
R5 10K RESISTORPTH-1/2W AXIAL-0.5 Resistor
R6 10K RESISTORPTH-1/2W AXIAL-0.5 Resistor
RV1 10K POTTRIM TRIM_POT
U1 LM339 LM339 TSSOP-14 IC, Quad Comparator. Based on information from the SLCS006N datasheet from TI (www.ti.com).Digikey:296-6607-1-ND LM339PWR


A simpler circuit, which does not auto-balance the light, but seems to work quit well, was developed by Juergen G Pintaske (THANK YOU!)

Facebook video

Robots need brains. For hobby and edu, it's nice if the brains are cheap. But also powerful, with all sorts of sensors. What if you could have both? Use a cheap arduino for low level / high danger functions like motor control and if it frys just replace it.

Use a smart phone for high level, sensors, etc.. E.g. put the SmartPhone on top of the robot, and let it control the Arduino, using IMU, Compass, GPS, camera, etc... But... we can't risk damaging the SmartPhone. So we really don't want to electrically connect it. Some have used headphone jacks, USB OTG, but those have problems. Limited data transfer in one direction only, and OTG pulls power from the phone so it runs it flat quickly. And, you might fry your phone.

We could use WiFI, e.g. a robot based on the ESP or other WiFi enabled chips (they are cheap these days) but then we have another problem: The phone won't let you access the sensors in the phone if the web page is served via http. It needs secure access and that is difficult. Also, then you can't talk to the phone, because it's talking to the esp (if you use station mode) and figuring out IP addresses is a pain if you connect esp to home network. But being able to use a web page is nice because no app to install. The SDMG Bot does this.

But how about this: Use optical I2C from the phone screen to a pair of light sensors in the robot, which sends motor commands to the Arduino. It's one way, limited speed (like headphones) but it's isolated. The phone can hit a web page like a free one from github or google app engine, and the app engine can even allow world wide remote control from your PC or other phone. See Also: