Sending a text


#21

A picture is going to be harder. A photo is a lot of data. Hopefully someone else here knows more about doing that, or if it’s even possible.


#22

A while back we played with the JPEG UART/SPI cameras; these would take pictures and JPEG code them internally so the imp only had to deal with the compressed data. Worked fine and back on an imp001 (when it had much less memory available) you could do a couple of frames per second of VGA.

Things have moved on a bit since, looks like the Arducam is a pretty good one to try: http://www.arducam.com/tag/spi-camera/

…up to 5MP, onboard compression, I2C & SPI interface.


#23

Thanks for the responses. I probably was not clear, or don’t know what questions to ask. If I go to the Yo dashboard, I can upload a picture and it will be included with the Yo. Or I can also type in a URL, and it will be included with the Yo. I do not want to take a picture, just have a previously uploaded picture or URL included with the Yo. I don’t if this can be done at the Yo end or in the Agent code. Maybe it’s not possible, and that would be ok.


#24

I’m guessing, looking at the minimal yo api ( http://docs.justyo.co/v1.0/docs/yo ) that you may just have to throw a URL in there (maybe a URL to a jpeg?) and it may just work. They don’t show examples of the optional link being used.


#25

Hugo, I was able to add a URL to the Agent code, and it worked! I uploaded my graphic to Flickr, and put that URL in the code. I now get an alert and a “Bird in Trap #1” graphic. This rocks!


#26

Yay for vaguely guessing correct api usage :slight_smile:


#27

Sanity check please. I close a switch (a relay) to start a 5V motor, and at the same time I want the IMP to function, as if I closed a switch, which will send me a Yo. Will this circuit work, or will I fry something. Right now, if I connect (touch) the IMP USB Ground and pin 1, a Yo is sent. Any help is appreciated.


#28

You don’t want 5v on an IO pin, also a motor put a lot of spikes and noise on-top of the 5v.

For this I’d use: Imp 3.3v -> resistor -> optocoupler -> imp gnd with pin1 connected between the resistor and opto.

DC motors often have a flyback diode in parallel for protection of anything else connected to the same supply such as the optocoupler. A capacitor will also help absorb some noise too.


#29

See diagram below.
An advantage to controlling motor or relay with Imp is that you can turn on the motor when pin 1 closes AND/OR you can turn it on some other way, like through the internet, regardless of the pin 1 switch.

Better description of what @rocketfire is talking about with flyback diode … here is a similar thing with the Arduino:


#30

@mlseim’s circuit diagram is definitely the right way to go, though add the diode across the motor (pointing “up” as in the arduino link).

Depending on how big the motor is you may need a bigger transistor or a slightly smaller R1 (eg 470 ohms). The reason here is that a bipolar transitor like this essentially just amplifies current - the amount of amplification is referred to as hFE and typically it’s 50-100x.

We can easily work out what current is flowing from the imp through the transistor, as we know the imp’s GPIO, when on, is 3.3v, and the base of the transistor, when on, will be 0.7v (this is a diode drop due to the P-N junction).

So, (3.3-0.7) / 1k = 2.6mA. With an hFE of 50, that’d give you a max current of 130mA through the motor, which may be a little small - I’ve no idea how big this motor is :slight_smile:


#31

@Fritz,
I’m wondering now what the motor has to do with the bird trap.
If the imp switched a relay (dry contact or SSR) instead of a motor, any motor could be used.


#32

Thanks for the suggestions. The motor is a regular 5V RC servo, which actuates the trap. A relay is wired directly to the servo motor, bypassing the normal control electronics. The IMP is only used to send the Yo.


#33

Another thought, change the relay so that it has a 2nd set of contacts (double-pole). Use the 2nd set of dry contacts for Imp pin 1. That way, it is still totally isolated from motor.


#34

If the motor is a servo, then you can just use an imp pwm to control it (and set any position you want - not just open/close)…


#35

Hugo et al, you have to remember that a month ago I was unaware of the Imp, and I am still IMP ignorant. I am starting to see that it could do a lot more than I’m using it for, but since I didn’t know that and can’t code, I’m really pleased in what its doing. Couldn’t have done it without the support of people on the forum.


#36

Hii Fritz! Thank you for your help I got the solution here.
Bulk SMS


#37

I wanted to express my gratitude towards this forum. I really enjoyed to having me here as I can get any kind of solution and knowledge here. Thank you so much for starting this topic I wonder if I can get more stuff related to Bulk SMS Services


#38

Whatever SMS service you are looking at, you will seek the part about “API” (Application Program Interface). That is where you use an outside, or remote script to send text messages. Example:http://api.msg91.com/apidoc/samplecode/php-sample-code-send-sms.php

They don’t specifically have a script sample for Imp Agent, but any of the existing Imp examples (like Twilio) would be similar.

As far as pricing, I have a feeling that msg91 is expensive … hard for me to do all of the currency conversions without studying it. I think it is expensive for me, because I’m in the U.S. If you’re in India (the home of msg91), it would be OK.


#39

The msg91 thing appears to be spam; not only spam in this forum, but they appear to be people who specialize in bulk SMS (= SMS spam).

To send a text, I’d use Twilio. Clear pricing and it just works.


#40

I see more spamming on the site. Too bad we have to deal with that stuff. I’ve use Twilio, and also looked into Nexmo.