Getting Started - What to Order

Posted on
  • I'm going to order the Espruino board soon and was wondering what else I should order - I'm just going to be experimenting with it initially but am interested in heating controls. Its really annoying ordering something then realising that additional items are required.

    It would be great if someone could have a quick look at what I'm thinking of ordering and suggest best options & any additional items I should think of:

    Espruino Board (from digitalmeans)
    Header Pins (2.54mm) - Male or Female???
    Breadboard - best size???
    Jumper Leads (M/M but also M/F if Male Header Pins???)

    Plus various other electrical components (obviously depends on what I intend to use it for!!):
    Nokia 5110 LCD,
    DS18B20 Temp Sensor,
    Relay Board

    I'm assuming most of the Boards (such as Relay Boards) advertised as being for the Arduino should be fine for use with Espruino???

    Anything obvious missing?

    It would be great if digitalmeans (and the other suppliers) could put together Espruino starter kits based on the various videos Gordon has uploaded).

    Any suggestions/ideas welcome!

  • Hi Dave,

    If you're going for protoboard I'd suggest getting female sockets for the Espruino. That way you can even just use solid core wire if you want a patch wire that's exactly the right length.

    I might get some M/F jumper leads too, as you might want to put things like the LCD (that would usually have pins) on a flying lead rather than directly in the breadboard.

    I used a (400 point breadboard)[http://www.ebay.co.uk/itm/251334922369] in the Espruino kits, but if you're not too worried about fitting everything into a box (at least initially) maybe just get a bigger one and then you can spread everything out.

    One other thing you'll need is a single 4.7k (or similar) resistor for the DS18B20 - and maybe you'll want to butcher 3 of your jumper wires so you can plug the DS18B20 into the breadboard easily.

    And yes, most things that mention Arduino will work great on an Espruino. Very occasionally there are issues with the voltage - most of Espruino's pins will take 5v inputs (check the reference for which ones) but they only ever output 3.3v which isn't enough for a small proportion of things (you can make them output 5v with a resistor, but it's a faff). Every relay module I've tried has been totally fine though.

    What are you planning on using as a heater? Something low voltage, or mains voltage?

    It's a good point about asking a distributor to provide a kit. I'll have a word with them about that.

  • Hi Gordon

    Thanks for your prompt reply. I'm looking forward to getting started and will place my order tonight with digitalmeans. They don't seem to have everything I need so I will also order some stuff from elsewhere.

    Away back in 2008 I developed a central heating control system in Delphi 7 which runs on a PC and uses an excellent little PIC board to control the boiler, pump & two 12v DC zone valves:

    http://www.phanderson.com/iom142/iom142.­html

    I stopped using it because it was too much having a big old pentium PC just to turn a few things on and off!! It would be great to have everything running on an Espruino.

    I could use my existing DS18B20's, two Relays for the Boiler/Pump and a L293D for the Zone Valves (I currently use relays for this but like the idea of using the L293D).

    My Delphi program currently sends ASCII characters to the PIC board to control things. As a first step I plan to replace the board with the Espruino (plus relay board) and modify the program to send Javascript to the Espruino.

    I will then gradually move the logic from the PC to Espruino until the PC is no-longer required.

    I would also like to get a second Espruino with a TFT screen to run a user interface which talks to the controller over bluetooth (or wifi) - I'm worried it may be difficult to render a nice GUI though.

    All just an idea at present but a nice project for the winter months.

    Thanks for all your hard work and I hope things continue to progress well.

  • Wow, sounds like a really neat project!

    The other thing you can do is use SSRs (look for SSR-25 on eBay) - they're nicer for switching mains voltages because you don't get small sparks when they open and close.

    It depends what you want for the UI - it'll do big numbers and custom fonts pretty easily, and even simple icons. The only issue is the speed of update on the big colour displays, as Espruino doesn't have enough RAM to store a copy of the screen contents. Black and white displays are generally pretty good.

    You could use something like the NRF24 or even 433Mhz modules and could then report back temperature from other rooms in the house too... Bluetooth is probably too short range for use in a house :(

    If you were going the WiFi route, you could have the actual control box as a web server and just use a cheap tablet/old phone/etc for the UI. Nice thing about that is you could control it from your phone if for some reason you couldn't reach the control box.

    These might be handy:

    http://www.espruino.com/WiFi+Enabled+The­rmometer
    http://www.espruino.com/Wireless+Tempera­ture+Sensor

  • I'll say a few things on general "stuff to order" for doing stuff with the Espruino..
    Ebay is a great source for cheap breakout boards and common sensors. Prices including shipping are much lower than adafruit et al. On the other hand, the best deals take the slow boat from china, and the ebay sellers are only good for the most common hobby electronics stuff.

    If you want general stuff to play with - the DHT22 is a cheap temperature sensor, though they're pretty flakey. Some of them have wonky calibration curves (someone recently posted about one that halves humidity readings above 25.5C, for example), and they're generally flaky. But they're cheap. BMP180's are cheap and easy to use temperature and barometric pressure sensors (because your heating system needs to detect upcoming changes in weather, and proactively adjust the climate control, right?). If you have any devices in your home with 433 mhz remote control, some 433mhz tx/rx sets might be fun (at barely over $1 per set, who can argue? Maybe turn on auxiliary fans/heaters connected to remote control outlets in adverse weather conditions?). And, of course you probably want network connectivity of some sort, either a WizNET or CC3k, or that new ESP8266 (though the state of current support is still poor).

    On the less-useful-for-your-project but still cool front, LDR's (light dependent resistors) for reacting to light, stuff with WS2812B LEDs for colorful lights, if the desire for such strikes you, are readily available.

    There are some proper full-color LCDs available that the Espruino supports, but they generally perform rather poorly at present. I'd consider one of the displays from Digole ( http://stores.ebay.com/digoledigitalsolu­tion/ ) for your remote control, as you can get great performance updating them, while the screen is still large enough to read.

    If you don't have a selection of common components, snag a resistor assortment pack, some 1N4001 or 1N5817 diodes, and some 0.1uf ceramic caps (or a capacitor assortment).

    I prefer to put male pin header on the Espruino, and everything else. That way I can use F-F jumpers for almost everything (the male dupont pins do not inspire much confidence, compared to the male pin header, though they seem to work okay), and it's easy to get a clip lead or probe onto a pin.
    If you can get the good stackable headers with the long pins, those are really nice, because you can solder a little wire to the bottom of the pin, and still put a connector on the top. Unfortunately, the bad stackable headers outnumber the good, and are very hard to tell apart in pictures. The best sign is if the seller disparages the ones sold by other vendors. The bad ones and have flat (stamped) pins that bend easily, and don't make a reliable contact.

    Regarding remote controls, if you use WiFi or Wired Ethernet for communication, you could use that for the remote control - have it serve a simple webpage permitting control, and then every web browser in the house is a remote control.

    For switching the zone valves, the L298D seems excessive, unless you actually need to reverse the polarity - there are much cheaper options (ULN2003, et al) if you just need to switch DC on and off.

  • Just a note about displays: The Nokia 5110 that you mentioned is a good honest display - and cheap. It's just a little on the small side.

    I haven't tried the Digole ones - they will probably be faster because the processing is done inside them, but you won't be able to use the Bitmaps/Custom fonts that you get if you use Espruino's internal graphics library.

  • Thanks for all the great responses!

    I will definitely investigate the web server approach.

    The main reason I was thinking about using the L298d is that the zone valves are reversible - to open & close. If using relays I need 4 of them for 2 valves - I thought the l298d may be more economical!

    Just one question - the ds18b20's can take 750ms to take a reading - will I need to wait for the response or does the event based approach allow me to do other things while waiting?

  • Oh, if they need to go both directions, the L298D is just what you want - I didn't realize there were zone valves that worked like that.

    I've never heard anyone complaining about the time it takes to get data from the DS18B20, though the module code does not let you provide a callback (ie, getTemp() will block until it returns). I may be missing something, as I haven't worked with oneWire bus before.

    In modules that expect to take a while waiting on some device, often they'll take a callback function as an argument when you call it, do stuff in the background with intervals/timeouts, and then call the supplied function, with the results as arguments, when done.

  • The reason my DS18B20's appeared slow is because I had them wired for parasitic power (ie power derived from the data line, no separate V+)

    I tried powering them directly and they returned the temperature very quickly so I should have no issues with blocking!

    I had no idea that the power mode has such an impact on response time.

  • @DaveNI - I wasn't aware there was an issue with parasitic power either. I'll have to try it and figure out what's taking the time. As far as I remember, OneWire itself doesn't really have any 'blocking' behaviour built into the protocol, so I'd imagine that any delay would be something to do with the DS18B20 module.

  • @Gordon - Some details I found regarding the 750ms delay:

    Parasite power mode:
    When operating in parasite power mode, only two wires are required: one data wire, and ground. At the master, a 4.7k pull-up resistor must be connected to the 1-wire bus. When the line is in a "high" state, the device pulls current to charge an internal capacitor.

    This current is usually very small, but may go as high as 1.5 mA when doing a temperature conversion or writing EEPROM. When a slave device is performing one these operations, the bus master must keep the bus pulled high to provide power until the operation completes; a delay of 750ms is required for a DS18S20 temperature conversion. The master can't do anything during this time, like issuing commands to other devices, or polling for the slave's operation to be completed. To support this, the OneWire library makes it possible to have the bus held high after the data is written.

    Normal (external supply) mode
    With an external supply, three wires are required: the bus wire, ground, and power. The 4.7k pull-up resistor is still required on the bus wire. As the bus is free for data transfer, the microcontroller can continually poll the state of a device doing a conversion. This way, a conversion request can finish as soon as the device reports being done, as opposed to having to wait 750ms in "parasite" power mode.

  • Ahh right - it's not an actual delay, just something you need to program in...

    In that case, a non-blocking delay is easy - you just need to use setTimeout to call some code 750ms later.

    I'm not 100% sure how the temperature conversion works with the current code, but I think it may be enough if you just make sure that you don't read other temperature sensors on the same OneWire bus within that 750ms.

  • ...that's why OneWire bus w/ parasitic power slaves has to be master-slave... master knows what the slave needs (power) to finish its job. In parasitic mode, the chip 'survives' on a (built-in) capacitor (with diode between the feeding resister) while stuff for other slaves goes on on the data line as well as when receiving commands for one self. Duty cycle can matter as well. Some devices then do one thing after another and in a much slower fashion to not too quickly deplete the capacitor and run out of power.

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Getting Started - What to Order

Posted by Avatar for DaveNI @DaveNI

Actions