-
-
-
-
-
-
-
Hi @Gordon.
CODE:I2C1.setup({scl:b6, sda:b7}); I2C1.writeTo(0x63, "R,25.3"); setTimeout(function (e) { getphValue(); }, 1000); function getphValue() { var d = I2C1.readFrom(0x63,7); var toChar=""; var i; for(i=0; i<d.length; i++) { toChar += String.fromCharCode(d[i]); //console.log(toChar); //console.log("i.length: " + i + " " + "d.length: " + (d.length - 1)); if(i==(d.length-1)) { console.log(toChar); toChar=""; //console.log("toCharVal: " + " " + toChar); } } }
Circuit:
I removed the 4.7k resisters.
I have 5.0v wall adapter vcc and gnd hooked up to the IN vcc and gnd on the pwr-iso. OUT from the pwr-iso I have 5v going to the VCC of the ph sensor and GND to the GND of the ph sensor. The power light on the module is on so I know VCC and GND are properly hooked up.
I have USB from my laptop powering the Espruino board. From B6 of the Espruino to the SCL of the ph sensor and B7 of the Espruino to SDA of the ph sensor.
This current circuit design produces error:
>echo(0); =undefined Uncaught InternalError: Timeout on I2C Write Transmit Mode 2 at line 8 col 30 I2C1.writeTo(0x63, "R,25.3"); ^ in function "onInit" called from line 1 col 8 onInit(); ^
To test if my PH sensor is working properly, I removed the pwr-iso from the circuit.
Without pwr-iso circuit design:
USB from laptop to Espruino USB
3.3v and GND from Espruino to VCC and GND of ph sensor.
SDA and SCL from Espruino to SDA and SCL of ph sensor.Power light is lit and I can read and write from the ph sensor to the Espruino.
I have no idea why I get the timeout error when using the pwr-iso. Any ideas?
-
@Gordon, thank you!
-
I purchased: http://www.atlas-scientific.com/_files/_datasheets/_circuit/pwr-iso.pdf? That power isolator seemed a bit expensive, however, I wanted to experiment with an already made power isolate; sinse I already purchased: http://www.atlas-scientific.com/_files/_datasheets/_circuit/pH_EZO_datasheet.pdf? I figured I would purchase the Power Isolator from the same company.
Anyways, I'm not that technical when it comes to reading datasheets and I would like advice/help on how to properly connect everything up to the Espruino, power iso and the PH sensor(http://www.atlas-scientific.com/_files/_datasheets/_circuit/pH_EZO_datasheet.pdf?)
I already asked a question about what size pull-up resisters to use which are 4.7k. I contacted the manufacturer and asked if there are pull up resisters on the power isolator board and if the 4.7k would interfere with the power isolator. The manufacturer explained to me that there are pullup resisters on the board and the 4.7k might be too high.
The power isolator requires 5v in and will output 5v. I know the Espruino is 3.3v so I was planning to use a seperate 5v power adapter and a L7805 voltage regulator to provide a cleaner 5v to the power isolator. Will I be required to use a logic converter between the Espruino i2c and the power isolator i2c since the Espruino is 3.3v and power isolator is 5v? I was planning to use: https://www.adafruit.com/products/757 if a logic converter is necessary.
I need help designing my circuit because I am confused about the pullup resisters. The power isolator and logic converter have 10k pullups and the ph datasheet asks for a 4.7k pullup value for i2c communication. What values of pullups are required and where do I place them in the circuit?
-
@DrAzzy @Gordon I purchased one of these:https://www.adafruit.com/products/881 without doing research on the ht16k33 chip because I thought it would be relatively easy for me to port the arduino and python code to javascript, however I was wrong. After some more research I stumbled across:https://github.com/mdobson/tessel-ht16k33?files=1
I haven't received the 7-segment from Adafruit yet so I wasn't able to attempt to port the code to the Espruino yet. Is the ht16k33 relatively easy to port over to the Espruino? -
-
@Gordon I will most likely go the max7219 route. Just out of curiousity, how hard(code wise) would it be to implement:http://www.maximintegrated.com/en/products/power/display-power-control/MAX6955.html ?
-
-
I would like to control 3 rows of 4-digit(with the decimal) 7-segment displays using i2c.
The display that I would like to use can be found here: https://www.sparkfun.com/products/11408Is there a IC that exists to drive 3 rows of 7-segment display mentioned above using i2c?
-
@DrAzzy Thank you! i2c isn't difficult after all. One more question, I will eventually have multiple modules hooked up to the same i2c bus. Will each module require its own pullup resister?
-
Module info:
All I2C mode responses are in ASCII format however, they do not terminate with a
rather, they terminate with a NULL. The Null termination makes data
manipulation easier once it has been received.default address: 0x63
I am looking for a generic i2c example. I didn't see a generic i2c example in the Tutorials and Examples. All I saw were examples under the Using I2C section. I then had a look in the I2C Class in the Reference. The i2c reference page sort of makes sense, but I am so used to serial that all this i2c bits and bytes confuses me.
What confuses me is this: address 0x63 represents the ASCII decimal of 99. Besides 0x63 as an address what is that format also called? The reason why I ask is, I can change the address from 1 to 127. So, for an example, I send the ASCII decimal 25 to the module to change the address, what does 25 represent? Is there a ASCII decimal to whatever that format is converter? Another thing that I am unsure about is when I receive data in ASCII format from the module, how do I convert that to readable output?
I basically need an i2c example of setup, read and write.
so far I have:
function onInit() { I2C1.setup({scl:b6, sda:b7}); } onInit();
-
I've always had issues when I attempt to connect to serialports on Ubuntu. I can temporary get by when I execute: sudo chown :rich /dev/ttyACM0
However, that gets annoying when I have to resubmit that command in the terminal. I tried to add the user rich to the dialout group, logout and log back into my account; however, I still get the Connection error when I attempt to connect to /dev/ttyACM0 How can I get the Espruino chrome app to gain access to /dev/ttyACM0 without having to execute the chown command?
-
A couple weeks ago I stumbled across the Intel Edison, purchased the mini breakout kit and in a few days the kit arrived. I've been playing around with the Intel Edison and its quite nice, but I haven't hooked anything electronic wise to it such as sensors and etc....
I've been using the Espruino for sensor readings and a 4d 4.3" touch screen for the sensor read outs. I've gotten so far into my project I rather NOT get rid of the Espruino so I though maybe I can utilize the Espruino and the Intel Edison together by communicating between the Espruino and the Intel Edison using UART. My idea is to use the Espruino for the lcd and sensors; use the Intel Edison for the wifi, encryption and server.
The one thing I dislike about the Intel Edison is that it only accepts 1.8v. So, I will need a logic level converter between the Espruino serial port and Intel Edison serial port which I have absolutely no idea which logic level converter to purchase. Can anyone please recommend a logic level converter to purchase that will work with serial port logic?
Thanks!
-
@DrAzzy, unfortunetly the module that I purchased didn't come with a 4.7k resister. I also forgot to ask how do I properly attach a pullup resister?
UPDATE
Nevermind the how to attach a pullup resister question, I found the answer at: http://www.espruino.com/MCP4xxx -
I would like to interface with the atlas-scientific ezo pH sensor using the i2c bus. The data sheet(http://www.atlas-scientific.com/_files/_datasheets/_circuit/pH_EZO_datasheet.pdf?) for the pH sensor recommends the usage of a 4.7k resister for the pullup resisters. Does the microcontroller dictate the resister value or does the device you want to connect to dictate the resister value? Also, what is the functionality of pull up resisters and how do you calculate a value of a pull up resister?
-
@Gordon, I'm anxiously awaiting for the "new" designed Espruino to be released on kick starter ;-)
-
@Gordon You mentioned something about BLE? How secure is BLE? I'm afraid to use BLE because, I have been reading and watching youtube videos about how to crack/hack BLE; surprisingly its rather simple to do.
-
@Gordon, I really like the new design. If the new design is cheap enough I can permintly leave the board in a project :)
What I am attempting to do is write a function to handle the "i2c read request" for all of the sensor modules; I would also like to repeat the "all the sensor readings" every 5 seconds or possibly longer than 5 seconds.
Depending on what command I send to the module indicates how long I should wait in milliseconds. For example if I send the "R" command, I am required to wait 1second or 1000milliseconds to invoke the I2C1.readFrom function. Most of the other commands that I send only require that I wait a total of 300milliseconds before I invoke the I2C1.readFrom function. This just insures that I give the sensor modules enough time to calculate the results before I readFrom the sensor module.
I am not sure If i should write multiple functions for the different sensors(ph, ec, temp) or just write one function to read from them all? So far I started to write a function before I asked this question to read from them all, but only started with the ph sensor as I would like to get something working and then branch off from there.
Code:
I remed out the geteci2cData(eci2c) function because I wasn't sure if that would execute before the getphi2cData(phi2c) finished processing the data. However, I think I should be ok because as Gordon mentioned, "other tasks cannot execute until the current task has finished."?