I want to do a project on the spark core, that is a smart carpets (Four Carpet). I have 16 pressure sensors,which are embedded in four smart carpets, which produce voltage when someone step over them. Each smart carpet has 4 sensors.
Each carpet’s data will be received by the Pic18 microcontroller board. Each Pic18 will convert the analog voltage to digital by using ADC, and convert it to ascii codes after that. This is the first part of my project which was done by one of my friends.
Now the part that I want to do is sending these Ascii codes through the I2C connection to the Spark Core1 (Master), and forward the data by using the wireless to the cloud. The other three carpets will also have their system (PIC18+Spark Core) and act as slaves.They will take control from the Master spark core to send their data to the cloud or to the Master Spark core.
For example, if segment 3 has data, it will wait until receive the permission signal from the master to send his data to the cloud, or send it to the Master and the master will forward the final data to the cloud at the end. Overall, my system will have four smart carpet, and each carpet’s system consists of PIC18+Spark core.
If it is easier to send the data directly to the cloud without taking the permission from the Master, I’ll go with this solution to achieve my project. A sample of my data will be like this form (SA0001E), were S for start, A for carpet A, E for the end of the data, and finally 0001 is for the location of the active sensors in the carpet, and here it means that only one sensor is active in this carpet.
Any idea or sample code that help me to start?
I appreciated your help. I hope if you can understand my whole project’s idea.
Here is a picture that demonstrates the idea.